blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
993c6e6058dc96b3c004b7a04f75e217452ac95e
73e6fb5cec81b605d23df294b889b45ac766f254
/springcloud/gateway/src/main/java/com/lynn/gateway/ZuulFallback.java
7bf92a57f3dee199bf357744eec932194b4c46cc
[]
no_license
R4Jay/springcloud
2c59ef204ef088dc5749001fb3b7cd8b13fdba39
eff51791f6f5e5a8580511e0971b361ace466297
refs/heads/master
2020-04-30T20:46:09.181056
2019-04-09T07:26:53
2019-04-09T07:26:53
177,077,127
1
0
null
null
null
null
UTF-8
Java
false
false
1,813
java
package com.lynn.gateway; import org.springframework.cloud.netflix.zuul.filters.route.FallbackProvider; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpResponse; import java.io.IOException; import java.io.InputStream; public class ZuulFallback implements FallbackProvider { @Override public String getRoute() { return null; } @Override public ClientHttpResponse fallbackResponse(String route, Throwable cause) { return new ClientHttpResponse() { @Override public HttpStatus getStatusCode() throws IOException { return HttpStatus.OK; } @Override public int getRawStatusCode() throws IOException { return HttpStatus.OK.value(); } @Override public String getStatusText() throws IOException { return HttpStatus.OK.getReasonPhrase(); } @Override public void close() { } @Override public InputStream getBody() throws IOException { // JSONObject json =new JSONObject(); // json.put("state","501"); // json.put("msg","后台接口错误"); // return new ByteArrayInputStream(json.toJSONString().getBytes("UTF-8")); ////返回前端的内容 return null; } @Override public HttpHeaders getHeaders() { // HttpHeaders httpHeaders = new HttpHeaders(); // httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8); //设置头 // return httpHeaders; return null; } }; } }
[ "sunxu_2004@163.com" ]
sunxu_2004@163.com
e4179e667941ca6b0f9970d521d04b697b796bc1
994f22b997998443eb1957088b42b4b2c3e1a073
/src/com/Employee_Management/models/Employe.java
7a9acff8bdc5b41709008fcc80a80f75000087f6
[]
no_license
taoufiqq/TangerLab
6664f5a72667f579f1e168ac8c80a9b10ef9b7a1
af32509fca2d457eae4618aaeec790497c716af2
refs/heads/main
2023-02-02T20:10:52.680201
2020-12-24T22:06:41
2020-12-24T22:06:41
324,243,379
2
0
null
null
null
null
ISO-8859-1
Java
false
false
1,456
java
package com.Employee_Management.models; public abstract class Employe { private String lastName; private String firstName; private int age; private String dateEntreeService; public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getDateEntreeService() { return dateEntreeService; } public void setDateEntreeService(String dateEntreeService) { this.dateEntreeService = dateEntreeService; } public Employe(String lastName, String firstName, int age, String dateEntreeService) { super(); this.lastName = lastName; this.firstName = firstName; this.age = age; this.dateEntreeService = dateEntreeService; } public Employe() { } public String getTitle() { return "L'employé " ; } public String getName() { return getTitle() + firstName + " " + lastName; } public abstract double calculerSalaire(); @Override public String toString() { return "lastName:" + lastName + "\nfirstName:" + firstName + "\nage:" + age + "\ndateEntreeService:" + dateEntreeService ; } }
[ "t.elhanchaoui@gmail.com" ]
t.elhanchaoui@gmail.com
e3d08bf63e8c5ba1d78175939b1eb352a3b90c97
6d2a9d8a934287f4b9a5f89733f5a3a02f82a42e
/src/main/java/com/vali/sma_back/web/rest/vm/KeyAndPasswordVM.java
0f7d580266aa16b59e8a8381cd0c2de15efd72b4
[]
no_license
BulkSecurityGeneratorProject/sma-back
6d20c5c3ab51cd4cb534892965966ddce713edbd
aaa283e47abfd4b5971c25e9dfd7c5b2d7f2a0bd
refs/heads/master
2022-12-10T05:38:55.708202
2019-03-18T19:45:50
2019-03-18T19:45:50
296,640,251
0
0
null
2020-09-18T14:13:00
2020-09-18T14:13:00
null
UTF-8
Java
false
false
498
java
package com.vali.sma_back.web.rest.vm; /** * View Model object for storing the user's key and password. */ public class KeyAndPasswordVM { private String key; private String newPassword; public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getNewPassword() { return newPassword; } public void setNewPassword(String newPassword) { this.newPassword = newPassword; } }
[ "marginean.vali@gmail.com" ]
marginean.vali@gmail.com
cc88a7b686ec1e38988deccebfe9472e257d861f
aedbead2ea4bffd3d0b53007910337c9e4ae5f3c
/JavaParadise/src/com/intiformation/app/dao/PlaceDAO.java
e4183291ff74a5082c25346cea497c8ba52aa125
[]
no_license
vaicThor/eclipse-workspace
fadb2005b6d71a16579c3b5e96a139074064e677
c842a3343e00a29e9b768a4874f92cfb707a18af
refs/heads/master
2022-04-15T06:14:15.548598
2020-04-15T09:54:47
2020-04-15T09:54:47
255,871,918
0
0
null
null
null
null
ISO-8859-1
Java
false
false
589
java
package com.intiformation.app.dao; import java.util.List; import com.intiformation.app.model.Place; import com.intiformation.app.model.Trip; public interface PlaceDAO { public abstract Long createPlace(Place place) ; public abstract Place findPlaceById(Long id) ;// retournera une Place public abstract Place findPlaceByName(String placeName) ; public abstract Boolean updatePlace(Place place) ;// retourne un booléen public abstract Boolean deletePlace(Place place) ;// retournera un booléen public abstract List<Place> findAll();// retournera une liste de Place }
[ "victor.louette.pro@gmail.com" ]
victor.louette.pro@gmail.com
6be4832d03bc52a34e94ed5982c00fe4803e90be
089b632ca32d70d178502c01eaaf5436f68718e0
/javaSE/src/homework/Cooker.java
b10adbf3155c448310412fddc8581ca4165901dc
[]
no_license
xiaocainiao07/homework
f04f93d78cd3408ecb1d1dfe26a25567def3d79f
fdf08736fab2b9471a918372887396233181df90
refs/heads/master
2021-09-04T05:40:34.845992
2018-01-16T10:51:31
2018-01-16T10:51:31
114,203,979
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package homework; public class Cooker extends Person{ public Cooker() { } public Cooker(String name, String username, String password, String worker) { super(name,username,password,worker); } }
[ "34093428+xiaocainiao07@users.noreply.github.com" ]
34093428+xiaocainiao07@users.noreply.github.com
ff38226c9bb85e4f0358a0c15a7b675968b5eb35
9e97f2c9948b7f14e3f402e174adee06faea0eec
/src/main/java/br/indie/fiscal4j/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN202.java
eeecf4dea14ea8f4d964602737600113a6aea4fd
[ "Apache-2.0" ]
permissive
andrauz/fiscal4j
1d16a4d56275c9fa50499fb9204fd60445ffd201
fe5558337a389f807040d92a6d140d4a2fa937d4
refs/heads/master
2020-04-25T01:13:47.253714
2019-02-15T19:29:18
2019-02-15T19:29:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,791
java
package br.indie.fiscal4j.nfe310.classes.nota; import br.indie.fiscal4j.DFBase; import br.indie.fiscal4j.nfe310.classes.NFNotaInfoItemModalidadeBCICMSST; import br.indie.fiscal4j.nfe310.classes.NFNotaSituacaoOperacionalSimplesNacional; import br.indie.fiscal4j.nfe310.classes.NFOrigem; import br.indie.fiscal4j.validadores.BigDecimalParser; import org.simpleframework.xml.Element; import java.math.BigDecimal; public class NFNotaInfoItemImpostoICMSSN202 extends DFBase { private static final long serialVersionUID = -7219850658794969064L; @Element(name = "orig", required = true) private NFOrigem origem; @Element(name = "CSOSN", required = true) private NFNotaSituacaoOperacionalSimplesNacional situacaoOperacaoSN; @Element(name = "modBCST", required = true) private NFNotaInfoItemModalidadeBCICMSST modalidadeBCICMSST; @Element(name = "pMVAST", required = false) private String percentualMargemValorAdicionadoICMSST; @Element(name = "pRedBCST", required = false) private String percentualReducaoBCICMSST; @Element(name = "vBCST", required = true) private String valorBCICMSST; @Element(name = "pICMSST", required = true) private String percentualAliquotaImpostoICMSST; @Element(name = "vICMSST", required = true) private String valorICMSST; public void setOrigem(final NFOrigem origem) { this.origem = origem; } public void setSituacaoOperacaoSN(final NFNotaSituacaoOperacionalSimplesNacional situacaoOperacaoSN) { this.situacaoOperacaoSN = situacaoOperacaoSN; } public void setModalidadeBCICMSST(final NFNotaInfoItemModalidadeBCICMSST modalidadeBCICMSST) { this.modalidadeBCICMSST = modalidadeBCICMSST; } public void setPercentualMargemValorAdicionadoICMSST(final BigDecimal percentualMargemValorAdicionadoICMSST) { this.percentualMargemValorAdicionadoICMSST = BigDecimalParser.tamanho7ComAte4CasasDecimais(percentualMargemValorAdicionadoICMSST, "Percentual Margem Valor Adicionado ICMS ST ICMSSN202"); } public void setPercentualReducaoBCICMSST(final BigDecimal percentualReducaoBCICMSST) { this.percentualReducaoBCICMSST = BigDecimalParser.tamanho7ComAte4CasasDecimais(percentualReducaoBCICMSST, "Percentual Reducao BC ICMSST ICMSSN202"); } public void setValorBCICMSST(final BigDecimal valorBCICMSST) { this.valorBCICMSST = BigDecimalParser.tamanho15Com2CasasDecimais(valorBCICMSST, "Valor BC ICMS ST ICMSSN202"); } public void setPercentualAliquotaImpostoICMSST(final BigDecimal percentualAliquotaImpostoICMSST) { this.percentualAliquotaImpostoICMSST = BigDecimalParser.tamanho7ComAte4CasasDecimais(percentualAliquotaImpostoICMSST, "Percentual Aliquota Imposto ICMSST ICMSSN202"); } public void setValorICMSST(final BigDecimal valorICMSST) { this.valorICMSST = BigDecimalParser.tamanho15Com2CasasDecimais(valorICMSST, "Valor ICMS ST ICMSSN202"); } public NFOrigem getOrigem() { return this.origem; } public NFNotaSituacaoOperacionalSimplesNacional getSituacaoOperacaoSN() { return this.situacaoOperacaoSN; } public NFNotaInfoItemModalidadeBCICMSST getModalidadeBCICMSST() { return this.modalidadeBCICMSST; } public String getPercentualMargemValorAdicionadoICMSST() { return this.percentualMargemValorAdicionadoICMSST; } public String getPercentualReducaoBCICMSST() { return this.percentualReducaoBCICMSST; } public String getValorBCICMSST() { return this.valorBCICMSST; } public String getPercentualAliquotaImpostoICMSST() { return this.percentualAliquotaImpostoICMSST; } public String getValorICMSST() { return this.valorICMSST; } }
[ "jeferson.hck@gmail.com" ]
jeferson.hck@gmail.com
8c97f6f8215122b5ea94f06d48a9351d585fccb8
9589c23fe5b8e69bfafec28e435e387622d44a74
/src/main/java/domain/Participant.java
d417bb67acbb35f18100f104949fd7a6888910a1
[]
no_license
parker1609/check-user-in-github-issue-comment
c067b1a8247c870bf38857ded5f1a3e1cbffdd2d
00c9c390a6d6045b278fe1ba9c82142f3e19db71
refs/heads/master
2023-01-27T18:01:20.035424
2020-12-11T19:02:20
2020-12-11T19:02:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,156
java
package domain; import java.util.Objects; public class Participant { private String userLoginId; private AttendanceStatus attendanceStatus; public Participant(String userLoginId) { this.userLoginId = userLoginId; this.attendanceStatus = new AttendanceStatus(); } public void attendStudy(int numberOfStudy) { attendanceStatus.attendStudy(numberOfStudy); } public double getAttendanceRate() { return attendanceStatus.calculateAttendanceRate(); } public String getUserLoginId() { return userLoginId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Participant that = (Participant) o; return userLoginId.equals(that.userLoginId); } @Override public int hashCode() { return Objects.hash(userLoginId); } @Override public String toString() { return "Participant{" + "userLoginId='" + userLoginId + '\'' + ", attendanceStatus=" + attendanceStatus + '}'; } }
[ "psbum1609@gmail.com" ]
psbum1609@gmail.com
7858d034430d86cd7d607a1b9d7f564a4744bfc8
85c40e679779d7df0ea09d6a74c9cca144ac39a1
/src/main/java/com/cglean/cloudnative/demo/client/ui/controller/ShowController.java
60368d3f0d3409671523c88e14c9843a6e192755
[]
no_license
cglean/cg-lean-ZDD
efc7cac955cf0975b0faccc84d5cf3c45f032574
4a490cb3ac2ca1a79edeffff52f067c40664df65
refs/heads/master
2021-01-18T06:34:39.732359
2016-11-11T21:50:27
2016-11-11T21:50:27
66,609,640
0
3
null
2016-11-11T04:14:15
2016-08-26T02:26:30
HTML
UTF-8
Java
false
false
4,703
java
package com.cglean.cloudnative.demo.client.ui.controller; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.cglean.cloudnative.demo.client.model.Show; /** * ShowController * * This is the MVC controller for the application. All UI HTTP requests get * here. We're using Thymeleaf as the template engine. * * * @author mborges * */ @Controller public class ShowController { private Log log = LogFactory.getLog(ShowController.class); @Autowired private ShowService showService; /** * INDEX * * @param model * @return * @throws Exception */ @RequestMapping("/") public String index(Model model) throws Exception { addAppEnv(model); return "index"; } /** * Core * * Action to initiate shutdown of the system. In CF, the application * <em>should</em> restart. In other environments, the application runtime * will be shut down. * * @throws Exception */ @RequestMapping(value = "/core", method = RequestMethod.GET) public String kill(@RequestParam(value = "doit", required = false) boolean doit, Model model) throws Exception { addAppEnv(model); if (doit) { model.addAttribute("killed", true); log.warn("*** The system is shutting down. ***"); Runnable killTask = () -> { try { String name = Thread.currentThread().getName(); log.warn("killing shortly " + name); TimeUnit.SECONDS.sleep(5); log.warn("killed " + name); System.exit(0); } catch (InterruptedException e) { e.printStackTrace(); } }; new Thread(killTask).start(); } return "core"; } @SuppressWarnings("resource") @RequestMapping(value = "/ssh-file", method = RequestMethod.GET) public String writeFile(Model model) throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy HH:mm:ss"); Date date = new Date(); File f = new File("ers-ssh-demo.log"); FileWriter fw = new FileWriter(f, true); Writer w = new BufferedWriter(fw); w.write(dateFormat.format(date) + "\n"); w.flush(); model.addAttribute("ssh_file", f.getAbsoluteFile()); addAppEnv(model); return "core"; } /** * SERVICES * * @param model * The model for this action. * @return The path to the view. */ @RequestMapping(value = "/services", method = RequestMethod.GET) public String shows(Model model) throws Exception { model.addAttribute("shows", showService.getShows()); addAppEnv(model); return "services"; } /** * SERVICES - clean DB * * @param model * @return * @throws Exception */ @RequestMapping(value = "/clean", method = RequestMethod.GET) public String clean(Model model) throws Exception { showService.deleteAll(); return shows(model); } /** * SERVICES - Add Show * * NOTE: this method chains (calls) the "shows" method so it returns the * services template with the updated show list. * * TODO: * - Turn this this into REST call * * @param firstName * @param lastName * @param emailAddress * @param model * * @return * @throws Exception */ @RequestMapping(value = "/add-show", method = RequestMethod.POST) public String addShow(@RequestParam("title") String title, @RequestParam("episodes") String episodes, @RequestParam("airDate") String airDate, Model model) throws Exception { Show show = new Show(); show.setTitle(title); show.setEpisodes(episodes); show.setAirDate(airDate); showService.add(show); model.addAttribute("shows", showService.getShows()); addAppEnv(model); return "services"; } /** * BLUEGREEN * * @param model * @return * @throws Exception */ @RequestMapping("/bluegreen") public String bluegreen(Model model) throws Exception { for (String key : System.getenv().keySet()) { System.out.println(key + ":" + System.getenv(key)); } addAppEnv(model); return "bluegreen"; } /////////////////////////////////////// // Helper Methods /////////////////////////////////////// private void addAppEnv(Model model) throws Exception { Map<String, Object> modelMap = showService.addAppEnv(); model.addAllAttributes(modelMap); } }
[ "vishal.laljeet@capgemini.com" ]
vishal.laljeet@capgemini.com
b226d729e0058d009ae3702f68de8bfefc6530c7
a048507c1807397329a558e84a5b0f69e66437d3
/boot/iot-master-webjars - 2.0/src/main/java/com/cimr/sysmanage/service/impl/UserDeviceServiceImpl.java
e86c6e965bbef965e16c3a3afcfc67eb18f94cf3
[]
no_license
jlf1997/learngit
0ffd6fec5c6e9ad10ff14ff838396e1ef53a06f3
d6d7eba1c0bf6c76f49608dd2537594af2cd4ee9
refs/heads/master
2021-01-17T07:10:30.004555
2018-11-08T09:15:13
2018-11-08T09:15:13
59,822,610
1
0
null
null
null
null
UTF-8
Java
false
false
1,682
java
package com.cimr.sysmanage.service.impl; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.cimr.comm.base.BaseDao; import com.cimr.comm.base.BaseServiceImpl; import com.cimr.sysmanage.dao.UserDeviceDao; import com.cimr.sysmanage.model.UserDevice; import com.cimr.sysmanage.service.UserDeviceService; import com.cimr.util.Assist; import com.cimr.util.StringUtil; /** * Created by suhuanzhao on 2018/5/18. */ @Service("userDeviceService") @Transactional public class UserDeviceServiceImpl extends BaseServiceImpl<UserDevice,String> implements UserDeviceService{ @Autowired private UserDeviceDao dao; @Override protected BaseDao<UserDevice, String> getEntityDao() { return dao; } @Override public void saveUserDevices(String userId, String deviceIds) { if (StringUtil.isEmpty(userId)){ return; } //先删除该用户的所有关联关系 Assist assist = new Assist(); assist.setRequires(Assist.andEq("user_id",userId)); this.deleteObj_common(assist); //再添加 List<UserDevice> userDevices = new ArrayList<>(); if(!StringUtil.isEmpty(deviceIds)){ String[] ids = deviceIds.split(","); UserDevice userDeviceTemp; for (String id : ids){ userDeviceTemp = new UserDevice(id,userId); userDevices.add(userDeviceTemp); } this.insertObjByBatch_common(userDevices); } } }
[ "675866753@qq.com" ]
675866753@qq.com
71a256b7f0877414b56e7306a7edd8649a804d38
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hazelcast/2015/4/AbstractClusterWideIterator.java
232c35684af0e4c83ee644716a16fda3181e0e27
[]
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
6,132
java
/* * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.cache.impl; import com.hazelcast.cache.ICache; import com.hazelcast.nio.serialization.Data; import javax.cache.Cache; import java.util.Iterator; import java.util.NoSuchElementException; /** * {@link AbstractClusterWideIterator} provides the core iterator functionality shared by its descendants. * *<p>Hazelcast cluster is made of partitions which holds a slice of all clusters data. Partition count * never increase or decrease in a cluster. In order to implement an iterator over a partitioned data, we use * the following parameters. *<ul> *<li>To iterate over partitioned data, we use partitionId as the first parameter of this iterator.</li> *<li>Each partition may have a lot of entries, so we use a second parameter to track the iteration of the * partition.</li> *</ul> *</p> * <p> *Iteration steps: * <ul> * <li>fetching fixed sized of keys from the current partition defined by partitionId.</li> * <li>iteration on fetched keys.</li> * <li>get value of each key with {@link #next()} when method is called.</li> * <li>when fetched keys are all used by calling {@link #next()}, more keys are fetched from the cluster.</li> * </ul> * This implementation iterates over partitions and for each partition it iterates over the internal map using the * internal table index of the map {@link com.hazelcast.util.CacheConcurrentHashMap}. * </p> * <p> * <h2>Fetching data from cluster:</h2> * Fetching is getting a fixed size of keys from the internal table of records of a partition defined by * partitionId. Table index is also provided as a table index locator. Fetch response is the keys and * last table index. The last table index is included in the result to be used in the next fetch. * </p> * <p> * <h2>Notes:</h2> * <ul> * <li>Iterator fetches keys in batch with a fixed size that is configurable.</li> * <li>Fetched keys are cached in the iterator to be used in each iteration step.</li> * <li>{@link #hasNext()} may return true for a key already removed.</li> * <li>{@link #hasNext()} only return false when all known keys are fetched and iterated.</li> * <li>{@link #next()} may return null although cache never has null value. This may happen when, for example, * someone removes the entry after the current thread has checked with {@link #hasNext()}.</li> * <li>This implementation does not affected by value updates as each value is got from the cluster * when {@link #next()} called.</li> * </ul> * </p> * * @param <K> the type of key. * @param <V> the type of value. * @see com.hazelcast.cache.impl.CacheRecordStore#iterator(int tableIndex, int size) * @see com.hazelcast.cache.impl.ClusterWideIterator * @see com.hazelcast.cache.impl.CacheKeyIteratorResult */ public abstract class AbstractClusterWideIterator<K, V> implements Iterator<Cache.Entry<K, V>> { private static final int FETCH_SIZE = 100; protected ICache<K, V> cache; protected CacheKeyIteratorResult result; protected final int partitionCount; protected int partitionIndex = -1; protected int lastTableIndex; protected final int fetchSize; protected int index; protected int currentIndex = -1; public AbstractClusterWideIterator(ICache<K, V> cache, int partitionCount) { this.cache = cache; this.partitionCount = partitionCount; //TODO can be made configurable this.fetchSize = FETCH_SIZE; } @Override public boolean hasNext() { ensureOpen(); if (result != null && index < result.getCount()) { return true; } return advance(); } @Override public Cache.Entry<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } currentIndex = index; index++; final Data keyData = result.getKey(currentIndex); final K key = toObject(keyData); final V value = cache.get(key); return new CacheEntry<K, V>(key, value); } @Override public void remove() { ensureOpen(); if (result == null || currentIndex < 0) { throw new IllegalStateException("Iterator.next() must be called before remove()!"); } Data keyData = result.getKey(currentIndex); final K key = toObject(keyData); cache.remove(key); currentIndex = -1; } protected boolean advance() { while (partitionIndex < getPartitionCount()) { if (result == null || result.getCount() < fetchSize || lastTableIndex < 0) { partitionIndex++; lastTableIndex = Integer.MAX_VALUE; result = null; if (partitionIndex == getPartitionCount()) { return false; } } result = fetch(); if (result != null && result.getCount() > 0) { index = 0; lastTableIndex = result.getTableIndex(); return true; } } return false; } protected void ensureOpen() { if (cache.isClosed()) { throw new IllegalStateException("Cache operations can not be performed. The cache closed"); } } protected int getPartitionCount() { return partitionCount; } protected abstract CacheKeyIteratorResult fetch(); protected abstract Data toData(Object obj); protected abstract <T> T toObject(Object data); }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
02f0e1e586f14433469887c61ddca3d1f309e9ed
e2745e833afada90a6fcce259896907f1ee095c7
/test-basic/test-jvm/src/main/java/com/dranawhite/jvm/stream/SpliteratorPro.java
bbdb6bf18624326b156f33437bffe056016dbba0
[ "MIT", "Apache-2.0" ]
permissive
dranawhite/test-java
5819777374728845b906254c08493f3811360f6e
b911e4afb1eaa40815333bd4aeb4209e21446068
refs/heads/master
2021-07-11T03:45:44.377754
2018-04-25T06:01:57
2018-04-25T06:01:57
96,076,631
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.dranawhite.jvm.stream; import java.util.Arrays; import java.util.List; import java.util.Spliterators; /** * @author liangyq 2018/3/14 */ public class SpliteratorPro { public static void main(String[] args) { List<Integer> list = Arrays.asList(8,3,2,6,9,0); Spliterators.spliterator(list, 0); } }
[ "1458755325@qq.com" ]
1458755325@qq.com
c595e0088c2d71a79a124e22db054a9094e72adf
0f9b55bd76a9dca62a720788ed43bbdc710a065e
/leetCode/src/leetCode20191018/TwoSum.java
7d9c8f470da4cd8190a76293f707ff0ade63045d
[]
no_license
Oceantears/IntelIDEAwork
9559da89b6d5769bbd8ef40468a7f31f8539138c
ab74382b4fb9e16e24ac635275d47902bae45e7c
refs/heads/master
2022-12-22T11:03:19.488413
2021-08-26T14:57:49
2021-08-26T14:57:49
208,036,056
0
0
null
2022-12-16T00:35:11
2019-09-12T11:32:58
JavaScript
GB18030
Java
false
false
648
java
/** * <一句话功能简述> * * <给定一个整数数组 nums和一个目标值 target,请你在该数组中找出和为目标值的那两个整数,并返回他们的数组下标。 * 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素 * * 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/two-sum > * * @author sunmeng * @create 2019/10/18 14:42 */ package leetCode20191018; public class TwoSum { public int[] twoSum(int[] nums, int target) { int[] twoNum=new int[2]; return twoNum; } public static void main(String[] args) { } }
[ "497209182@qq.com" ]
497209182@qq.com
416937e8f8ccae23d6801b7e9dad6124022f5231
742e9f34643a8dd823c6488e3e20ff476233a1d0
/5100 Final drug-manufacture-management/DrugManufactureAndManagementSystem/src/Interface/AdministrativeRole/Manufactory/ManufactoryManageEmployeeJPanel.java
5badc7ba43784fc0d899e9fc06b86a70aadaac5b
[]
no_license
Kaixin-Gao/NEU
90b8a9285e757e8b991b110d211e7471ac9287a9
82a62ebc4c664b6356fadcb2c4877c46acdab4be
refs/heads/master
2021-06-28T11:55:25.521258
2017-09-18T02:52:15
2017-09-18T02:52:15
103,878,902
0
0
null
null
null
null
UTF-8
Java
false
false
8,755
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Interface.AdministrativeRole.Manufactory; import Business.Employee.Employee; import Business.Organization.Organization; import Business.Organization.OrganizationDirectory; import java.awt.CardLayout; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.table.DefaultTableModel; /** * * @author zhang */ public class ManufactoryManageEmployeeJPanel extends javax.swing.JPanel { private OrganizationDirectory organizationDir; private JPanel userProcessContainer; /** * Creates new form manufactoryManageEmployeeJPanel */ public ManufactoryManageEmployeeJPanel(JPanel userProcessContainer, OrganizationDirectory organizationDir) { initComponents(); this.userProcessContainer = userProcessContainer; this.organizationDir = organizationDir; populateOrganizationComboBox(); populateOrganizationEmpComboBox(); } public void populateOrganizationComboBox() { organizationJComboBox.removeAllItems(); for (Organization organization : organizationDir.getOrganizationList()) { organizationJComboBox.addItem(organization); } } public void populateOrganizationEmpComboBox() { organizationEmpJComboBox.removeAllItems(); for (Organization organization : organizationDir.getOrganizationList()) { organizationEmpJComboBox.addItem(organization); } } private void populateTable(Organization organization) { DefaultTableModel model = (DefaultTableModel) organizationJTable.getModel(); model.setRowCount(0); for (Employee employee : organization.getEmployeeDirectory().getEmployeeList()) { Object[] row = new Object[1]; row[0] = employee.getName(); model.addRow(row); } } /** * 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() { jLabel1 = new javax.swing.JLabel(); organizationJComboBox = new javax.swing.JComboBox(); jScrollPane1 = new javax.swing.JScrollPane(); organizationJTable = new javax.swing.JTable(); jLabel2 = new javax.swing.JLabel(); organizationEmpJComboBox = new javax.swing.JComboBox(); jLabel3 = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); btnBack = new javax.swing.JButton(); btnCreate = new javax.swing.JButton(); setMaximumSize(new java.awt.Dimension(1600, 1200)); setMinimumSize(new java.awt.Dimension(1600, 1200)); setPreferredSize(new java.awt.Dimension(1600, 1200)); setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N jLabel1.setText("Organization"); add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(336, 172, -1, -1)); organizationJComboBox.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N organizationJComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); organizationJComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { organizationJComboBoxActionPerformed(evt); } }); add(organizationJComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(759, 169, -1, -1)); organizationJTable.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N organizationJTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Name" } )); organizationJTable.setRowHeight(30); jScrollPane1.setViewportView(organizationJTable); add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(235, 293, 1025, 177)); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N jLabel2.setText("Organization"); add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(386, 628, -1, -1)); organizationEmpJComboBox.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N organizationEmpJComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); add(organizationEmpJComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(778, 625, -1, -1)); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N jLabel3.setText("Name"); add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(386, 762, -1, -1)); nameJTextField.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); add(nameJTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(778, 759, 274, -1)); btnBack.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N btnBack.setText("<<Back"); btnBack.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnBackActionPerformed(evt); } }); add(btnBack, new org.netbeans.lib.awtextra.AbsoluteConstraints(235, 978, -1, -1)); btnCreate.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N btnCreate.setText("Create Employee"); btnCreate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCreateActionPerformed(evt); } }); add(btnCreate, new org.netbeans.lib.awtextra.AbsoluteConstraints(935, 978, -1, -1)); }// </editor-fold>//GEN-END:initComponents private void nameJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameJTextFieldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_nameJTextFieldActionPerformed private void btnCreateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateActionPerformed // TODO add your handling code here: Organization organization = (Organization) organizationEmpJComboBox.getSelectedItem(); String name = nameJTextField.getText(); if (name.isEmpty()) { JOptionPane.showMessageDialog(null, "An Employee must have a name"); } else { organization.getEmployeeDirectory().createEmployee(name); } populateTable(organization); nameJTextField.setText(" "); }//GEN-LAST:event_btnCreateActionPerformed private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackActionPerformed // TODO add your handling code here: userProcessContainer.remove(this); CardLayout layout = (CardLayout) userProcessContainer.getLayout(); layout.previous(userProcessContainer); }//GEN-LAST:event_btnBackActionPerformed private void organizationJComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_organizationJComboBoxActionPerformed // TODO add your handling code here: Organization organization = (Organization) organizationJComboBox.getSelectedItem(); if (organization != null) { populateTable(organization); } }//GEN-LAST:event_organizationJComboBoxActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnBack; private javax.swing.JButton btnCreate; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextField nameJTextField; private javax.swing.JComboBox organizationEmpJComboBox; private javax.swing.JComboBox organizationJComboBox; private javax.swing.JTable organizationJTable; // End of variables declaration//GEN-END:variables }
[ "32048100+Kaixin-Gao@users.noreply.github.com" ]
32048100+Kaixin-Gao@users.noreply.github.com
04e1c200f34ed9da767782a82cf5801cc01ab8a9
d675c0072db5ef49283d294c3908ff7630a7fcea
/app/src/main/java/data/model/CurrentWeatherObj.java
f010b7293e9bf51a6e77584d3864687df147e9b0
[]
no_license
SupremeCodeManufacture/WeatherApp
25100676ccac6599dbdebf1fd2a92b4a712dfcb7
43b933be5456aa08474bf954651f3849be00b727
refs/heads/master
2021-06-24T06:02:45.655973
2019-05-07T16:41:46
2019-05-07T16:41:46
171,173,246
0
0
null
2019-05-07T16:41:47
2019-02-17T21:14:34
Java
UTF-8
Java
false
false
3,314
java
package data.model; public class CurrentWeatherObj { private float temp_c; private float temp_f; private int is_day; private ConditionObj condition; private float wind_kph; private float wind_mph; private float wind_degree; private String wind_dir; private float pressure_mb; private float pressure_in; private float precip_mm; private int humidity; private int cloud; private float feelslike_c; private float feelslike_f; private float vis_km; private float vis_miles; private float uv; public float getTemp_c() { return temp_c; } public void setTemp_c(float temp_c) { this.temp_c = temp_c; } public int getIs_day() { return is_day; } public void setIs_day(int is_day) { this.is_day = is_day; } public ConditionObj getCondition() { return condition; } public void setCondition(ConditionObj condition) { this.condition = condition; } public float getWind_kph() { return wind_kph; } public void setWind_kph(float wind_kph) { this.wind_kph = wind_kph; } public float getWind_degree() { return wind_degree; } public void setWind_degree(float wind_degree) { this.wind_degree = wind_degree; } public String getWind_dir() { return wind_dir; } public void setWind_dir(String wind_dir) { this.wind_dir = wind_dir; } public float getPressure_mb() { return pressure_mb; } public void setPressure_mb(float pressure_mb) { this.pressure_mb = pressure_mb; } public float getPrecip_mm() { return precip_mm; } public void setPrecip_mm(float precip_mm) { this.precip_mm = precip_mm; } public int getHumidity() { return humidity; } public void setHumidity(int humidity) { this.humidity = humidity; } public int getCloud() { return cloud; } public void setCloud(int cloud) { this.cloud = cloud; } public float getFeelslike_c() { return feelslike_c; } public void setFeelslike_c(float feelslike_c) { this.feelslike_c = feelslike_c; } public float getVis_km() { return vis_km; } public void setVis_km(float vis_km) { this.vis_km = vis_km; } public float getUv() { return uv; } public void setUv(float uv) { this.uv = uv; } public float getTemp_f() { return temp_f; } public void setTemp_f(float temp_f) { this.temp_f = temp_f; } public float getWind_mph() { return wind_mph; } public void setWind_mph(float wind_mph) { this.wind_mph = wind_mph; } public float getPressure_in() { return pressure_in; } public void setPressure_in(float pressure_in) { this.pressure_in = pressure_in; } public float getFeelslike_f() { return feelslike_f; } public void setFeelslike_f(float feelslike_f) { this.feelslike_f = feelslike_f; } public float getVis_miles() { return vis_miles; } public void setVis_miles(float vis_miles) { this.vis_miles = vis_miles; } }
[ "lena.abarova@gmail.com" ]
lena.abarova@gmail.com
5a5b00b6247bff9df2ddf1db8678fd9c6131941b
3506099bb489835a19dc140cc6688c0f1ef6aff4
/api/src/main/java/org/openmrs/module/ugandaemrreports/reports/SetupInfantDueForAppointment.java
da6335f935dd8aded3372a264678e6797040c06d
[]
no_license
njoromodo/openmrs-module-ugandaemr-reports
79fe40282c4e5338773113bc7e5ab1f4ba067b3d
c02258b9d53f167d0d5ac79279f2c0c2c99b48c3
refs/heads/master
2020-03-30T20:11:17.188717
2018-09-25T06:47:26
2018-09-25T06:47:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,344
java
package org.openmrs.module.ugandaemrreports.reports; import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.openmrs.PatientIdentifierType; import org.openmrs.module.metadatadeploy.MetadataUtils; import org.openmrs.module.reporting.data.DataDefinition; import org.openmrs.module.reporting.data.converter.AgeConverter; import org.openmrs.module.reporting.data.converter.BirthdateConverter; import org.openmrs.module.reporting.data.converter.DataConverter; import org.openmrs.module.reporting.data.converter.ObjectFormatter; import org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition; import org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition; import org.openmrs.module.reporting.data.person.definition.AgeDataDefinition; import org.openmrs.module.reporting.data.person.definition.BirthdateDataDefinition; import org.openmrs.module.reporting.data.person.definition.GenderDataDefinition; import org.openmrs.module.reporting.data.person.definition.PreferredNameDataDefinition; import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; import org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition; import org.openmrs.module.reporting.evaluation.parameter.Mapped; import org.openmrs.module.reporting.evaluation.parameter.Parameter; import org.openmrs.module.reporting.report.ReportDesign; import org.openmrs.module.reporting.report.definition.ReportDefinition; import org.openmrs.module.ugandaemrreports.data.converter.CalculationResultDataConverter; import org.openmrs.module.ugandaemrreports.data.converter.ObsDataConverter; import org.openmrs.module.ugandaemrreports.definition.data.definition.CalculationDataDefinition; import org.openmrs.module.ugandaemrreports.library.DataFactory; import org.openmrs.module.ugandaemrreports.library.EIDCohortDefinitionLibrary; import org.openmrs.module.ugandaemrreports.metadata.HIVMetadata; import org.openmrs.module.ugandaemrreports.reporting.calculation.eid.DateFromBirthDateCalculation; import org.openmrs.module.ugandaemrreports.reporting.calculation.eid.ExposedInfantMotherCalculation; import org.openmrs.module.ugandaemrreports.reporting.calculation.eid.ExposedInfantMotherPhoneNumberCalculation; import org.openmrs.module.ugandaemrreports.reporting.dataset.definition.SharedDataDefintion; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * Infants due for appointment */ @Component public class SetupInfantDueForAppointment extends UgandaEMRDataExportManager { @Autowired private DataFactory df; @Autowired SharedDataDefintion sdd; @Autowired EIDCohortDefinitionLibrary eidCohortDefinitionLibrary; @Autowired HIVMetadata hivMetadata; @Override public String getExcelDesignUuid() { return "63dd99ad-db0d-4c15-b0da-f1f5676f3062"; } @Override public ReportDesign buildReportDesign(ReportDefinition reportDefinition) { ReportDesign rd = createExcelTemplateDesign(getExcelDesignUuid(), reportDefinition, "EIDDueForAppointment.xls"); Properties props = new Properties(); props.put("repeatingSections", "sheet:1,row:7,dataset:Appointments"); props.put("sortWeight", "5000"); rd.setProperties(props); return rd; } @Override public String getUuid() { return "4f2cd763-6737-4e82-93e0-515d0633c58b"; } @Override public String getName() { return "Infants Due Appointment"; } @Override public String getDescription() { return "Infants Due for Appointment"; } @Override public ReportDefinition constructReportDefinition() { ReportDefinition rd = new ReportDefinition(); rd.setUuid(getUuid()); rd.setName(getName()); rd.setDescription(getDescription()); rd.addParameters(getParameters()); rd.addDataSetDefinition("Appointments", Mapped.mapStraightThrough(constructDataSetDefinition())); return rd; } @Override public String getVersion() { return "0.1"; } @Override public List<Parameter> getParameters() { List<Parameter> l = new ArrayList<Parameter>(); l.add(df.getStartDateParameter()); l.add(df.getEndDateParameter()); return l; } @Override public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) { List<ReportDesign> l = new ArrayList<ReportDesign>(); l.add(buildReportDesign(reportDefinition)); return l; } private DataSetDefinition constructDataSetDefinition() { PatientDataSetDefinition dsd = new PatientDataSetDefinition(); dsd.setName("Appointments"); dsd.addParameters(getParameters()); dsd.addRowFilter(eidCohortDefinitionLibrary.getEIDInfantsDueForAppointment(), "onOrAfter=${startDate},onOrBefore=${endDate}"); //identifier // TODO: Standardize this as a external method that takes the UUID of the PatientIdentifier PatientIdentifierType exposedInfantNo = MetadataUtils.existing(PatientIdentifierType.class, "2c5b695d-4bf3-452f-8a7c-fe3ee3432ffe"); DataConverter identifierFormatter = new ObjectFormatter("{identifier}"); DataDefinition identifierDef = new ConvertedPatientDataDefinition("identifier", new PatientIdentifierDataDefinition(exposedInfantNo.getName(), exposedInfantNo), identifierFormatter); dsd.addColumn("EID No", identifierDef, (String) null); dsd.addColumn("Infant Name", new PreferredNameDataDefinition(), (String) null); dsd.addColumn("Birth Date", new BirthdateDataDefinition(), "", new BirthdateConverter("MMM d, yyyy")); dsd.addColumn("Age", new AgeDataDefinition(), "", new AgeConverter("{m}")); dsd.addColumn("Sex", new GenderDataDefinition(), (String) null); dsd.addColumn("Mother Name", new CalculationDataDefinition("Mother Name", new ExposedInfantMotherCalculation()), "", new CalculationResultDataConverter()); dsd.addColumn("Mother Phone", new CalculationDataDefinition("Mother Phone", new ExposedInfantMotherPhoneNumberCalculation()), "", new CalculationResultDataConverter()); dsd.addColumn("Mother ART No", sdd.definition("Mother ART No", hivMetadata.getExposedInfantMotherARTNumber()), "onOrAfter=${startDate},onOrBefore=${endDate}", new ObsDataConverter()); dsd.addColumn("NextAppointmentDate", sdd.definition("Next Appointment Date", hivMetadata.getReturnVisitDate()), "onOrAfter=${startDate},onOrBefore=${endDate}", new ObsDataConverter()); return dsd; } }
[ "ssmusoke@gmail.com" ]
ssmusoke@gmail.com
d5a595b5c585bb2ab77dde2e3b64b99b4d93a3b2
4d56c72564e204d46a4a8fa696a2ff44f394a8ec
/app/src/androidTest/java/com/busby/michael/easyartest/ExampleInstrumentedTest.java
071b9b548a8d75f918794ce46eeff723134c5ce1
[]
no_license
1busby/EastARTest
80188f9891b74fc6b8d9fdac3cf7a2c3c8ed8af9
7cb9b2e00c11c15245e23dd0a59bd1112428b432
refs/heads/master
2021-12-14T09:58:58.919875
2017-04-23T05:44:09
2017-04-23T05:44:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.busby.michael.easyartest; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.busby.michael.easyartest", appContext.getPackageName()); } }
[ "mbusbyIT@gmail.com" ]
mbusbyIT@gmail.com
c6f6e2adfbc62309dde4c4e3139436b09bea6218
e45da90582e7b7a4249723ac4aed62e497b74d2b
/src/main/java/com/xceder/ctp/trade/CThostFtdcParkedOrderActionField.java
5d35e3c5bcfb739d8502415bb6471f303bcc3c1b
[]
no_license
ssh352/myctp
3d3d3f1b04fc4b67d6debe60da2d135a2186bdef
564d3743e655c7aa3570640c5ad9c9bbe2435be4
refs/heads/master
2020-03-28T23:28:15.973557
2018-03-15T05:49:32
2018-03-15T05:49:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,726
java
package com.xceder.ctp.trade; import org.bridj.Pointer; import org.bridj.StructObject; import org.bridj.ann.Array; import org.bridj.ann.Field; import org.bridj.ann.Library; /** * \ufffd\ufffd\ufffd\ufffd\u0524\ufffd\ud996\udd72\ufffd\ufffd\ufffd<br> * <i>native declaration : ThostFtdcUserApiStruct.h:5798</i><br> * This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br> * a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br> * For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a href="http://bridj.googlecode.com/">BridJ</a> . */ @Library("Thosttraderapi") public class CThostFtdcParkedOrderActionField extends StructObject { /** * \ufffd\ufffd\ufffd\u0379\ufffd\u02fe\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcBrokerIDType */ @Array({11}) @Field(0) public Pointer<Byte > BrokerID() { return this.io.getPointerField(this, 0); } /** * \u0376\ufffd\ufffd\ufffd\u07f4\ufffd\ufffd\ufffd<br> * C type : TThostFtdcInvestorIDType */ @Array({13}) @Field(1) public Pointer<Byte > InvestorID() { return this.io.getPointerField(this, 1); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcOrderActionRefType */ @Field(2) public int OrderActionRef() { return this.io.getIntField(this, 2); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcOrderActionRefType */ @Field(2) public CThostFtdcParkedOrderActionField OrderActionRef(int OrderActionRef) { this.io.setIntField(this, 2, OrderActionRef); return this; } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcOrderRefType */ @Array({13}) @Field(3) public Pointer<Byte > OrderRef() { return this.io.getPointerField(this, 3); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcRequestIDType */ @Field(4) public int RequestID() { return this.io.getIntField(this, 4); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcRequestIDType */ @Field(4) public CThostFtdcParkedOrderActionField RequestID(int RequestID) { this.io.setIntField(this, 4, RequestID); return this; } /** * \u01f0\ufffd\u00f1\ufffd\ufffd<br> * C type : TThostFtdcFrontIDType */ @Field(5) public int FrontID() { return this.io.getIntField(this, 5); } /** * \u01f0\ufffd\u00f1\ufffd\ufffd<br> * C type : TThostFtdcFrontIDType */ @Field(5) public CThostFtdcParkedOrderActionField FrontID(int FrontID) { this.io.setIntField(this, 5, FrontID); return this; } /** * \ufffd\u1ef0\ufffd\ufffd\ufffd<br> * C type : TThostFtdcSessionIDType */ @Field(6) public int SessionID() { return this.io.getIntField(this, 6); } /** * \ufffd\u1ef0\ufffd\ufffd\ufffd<br> * C type : TThostFtdcSessionIDType */ @Field(6) public CThostFtdcParkedOrderActionField SessionID(int SessionID) { this.io.setIntField(this, 6, SessionID); return this; } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcExchangeIDType */ @Array({9}) @Field(7) public Pointer<Byte > ExchangeID() { return this.io.getPointerField(this, 7); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcOrderSysIDType */ @Array({21}) @Field(8) public Pointer<Byte > OrderSysID() { return this.io.getPointerField(this, 8); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05be<br> * C type : TThostFtdcActionFlagType */ @Field(9) public byte ActionFlag() { return this.io.getByteField(this, 9); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05be<br> * C type : TThostFtdcActionFlagType */ @Field(9) public CThostFtdcParkedOrderActionField ActionFlag(byte ActionFlag) { this.io.setByteField(this, 9, ActionFlag); return this; } /** * \ufffd\u06f8\ufffd<br> * C type : TThostFtdcPriceType */ @Field(10) public double LimitPrice() { return this.io.getDoubleField(this, 10); } /** * \ufffd\u06f8\ufffd<br> * C type : TThostFtdcPriceType */ @Field(10) public CThostFtdcParkedOrderActionField LimitPrice(double LimitPrice) { this.io.setDoubleField(this, 10, LimitPrice); return this; } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\u4eef<br> * C type : TThostFtdcVolumeType */ @Field(11) public int VolumeChange() { return this.io.getIntField(this, 11); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\u4eef<br> * C type : TThostFtdcVolumeType */ @Field(11) public CThostFtdcParkedOrderActionField VolumeChange(int VolumeChange) { this.io.setIntField(this, 11, VolumeChange); return this; } /** * \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcUserIDType */ @Array({16}) @Field(12) public Pointer<Byte > UserID() { return this.io.getPointerField(this, 12); } /** * \ufffd\ufffd\u053c\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcInstrumentIDType */ @Array({31}) @Field(13) public Pointer<Byte > InstrumentID() { return this.io.getPointerField(this, 13); } /** * \u0524\ufffd\ud98f\uddf5\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcParkedOrderActionIDType */ @Array({13}) @Field(14) public Pointer<Byte > ParkedOrderActionID() { return this.io.getPointerField(this, 14); } /** * \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcUserTypeType */ @Field(15) public byte UserType() { return this.io.getByteField(this, 15); } /** * \ufffd\u00fb\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcUserTypeType */ @Field(15) public CThostFtdcParkedOrderActionField UserType(byte UserType) { this.io.setByteField(this, 15, UserType); return this; } /** * \u0524\ufffd\ud98f\uddf5\ufffd\u05f4\u032c<br> * C type : TThostFtdcParkedOrderStatusType */ @Field(16) public byte Status() { return this.io.getByteField(this, 16); } /** * \u0524\ufffd\ud98f\uddf5\ufffd\u05f4\u032c<br> * C type : TThostFtdcParkedOrderStatusType */ @Field(16) public CThostFtdcParkedOrderActionField Status(byte Status) { this.io.setByteField(this, 16, Status); return this; } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcErrorIDType */ @Field(17) public int ErrorID() { return this.io.getIntField(this, 17); } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcErrorIDType */ @Field(17) public CThostFtdcParkedOrderActionField ErrorID(int ErrorID) { this.io.setIntField(this, 17, ErrorID); return this; } /** * \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03e2<br> * C type : TThostFtdcErrorMsgType */ @Array({81}) @Field(18) public Pointer<Byte > ErrorMsg() { return this.io.getPointerField(this, 18); } /** * \u0376\ufffd\u02b5\ufffd\u052a\ufffd\ufffd\ufffd\ufffd<br> * C type : TThostFtdcInvestUnitIDType */ @Array({17}) @Field(19) public Pointer<Byte > InvestUnitID() { return this.io.getPointerField(this, 19); } /** * IP\ufffd\ufffd\u05b7<br> * C type : TThostFtdcIPAddressType */ @Array({16}) @Field(20) public Pointer<Byte > IPAddress() { return this.io.getPointerField(this, 20); } /** * Mac\ufffd\ufffd\u05b7<br> * C type : TThostFtdcMacAddressType */ @Array({21}) @Field(21) public Pointer<Byte > MacAddress() { return this.io.getPointerField(this, 21); } public CThostFtdcParkedOrderActionField() { super(); } public CThostFtdcParkedOrderActionField(Pointer pointer) { super(pointer); } }
[ "790333234@qq.com" ]
790333234@qq.com
e075a233b51d54f3119b2786bc73b3772f520ade
07399d93a482f7565a97e69d8b9197ad25adf688
/com.astra.ses.spell.gui.language/src/com/astra/ses/spell/language/model/ast/stmtType.java
8c52c68a01d1885199fd59d801dd9000fc7a6921
[]
no_license
CalypsoCubesat/SPELL-GUI-4.0.2-SRC
1fda020fb3edc11f5ad2fd59ba1c5cea5b0c1074
a171a26ea9413c9787f0c7b4e98aeb8c2ab378ab
refs/heads/master
2020-08-29T07:26:22.789627
2019-10-28T04:34:16
2019-10-28T04:34:16
217,966,403
0
0
null
null
null
null
UTF-8
Java
false
false
209
java
// Autogenerated AST node package com.astra.ses.spell.language.model.ast; import com.astra.ses.spell.language.model.SimpleNode; import java.util.Arrays; public abstract class stmtType extends SimpleNode { }
[ "matthew.travis@aresinstitute.org" ]
matthew.travis@aresinstitute.org
ad273dc353f0c1ffe155a2412856c8568a15fa8b
58eb3f22086d76b5b8cf4a2553b90f39bb6c68f0
/src/main/java/ar/edu/uade/ia/escuela/datos/RepositorioPrivilegio.java
45372231bc76365992cf268eef765bbec0332384
[]
no_license
38074062/ia-escuela
9f2dc82adf686a0bd575c008f3de0d5d47c34c4d
af8fabe69a9b7bc9d8514829d6cc1b8bc8b553d3
refs/heads/master
2021-02-16T03:50:45.724365
2019-11-22T03:31:03
2019-11-22T03:31:03
244,963,686
0
0
null
null
null
null
UTF-8
Java
false
false
508
java
package ar.edu.uade.ia.escuela.datos; import java.util.Optional; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import ar.edu.uade.ia.escuela.dominio.modelo.empleados.Privilegio; @Repository public interface RepositorioPrivilegio extends RepositorioBase<Privilegio, Long> { @Query( "select e from #{#entityName} e where e.eliminado=false and e.nombre=?1" ) Optional<Privilegio> findByPrivilegio( String privilegio ); }
[ "anmartinez@uade.edu.ar" ]
anmartinez@uade.edu.ar
6448db16dc7fbe8d8c5277542414848a7c9abdab
b2562abdc1ee1524c3ef3b7496cdb502c31d40e7
/src/test/java/com/movie/demo/controller/MovieControllerTests.java
fe265e4da24d46c11ce087dd98a65b18fcf64a89
[]
no_license
Jassu123/movie-api
33fa681ab3aa83c4238d4d7de03c6c6e5724836a
78d5d86ea3c20c5ef7bf070cda1c741b6f1829a1
refs/heads/main
2023-03-22T20:24:19.829633
2021-03-19T15:04:49
2021-03-19T15:04:49
348,450,516
0
0
null
null
null
null
UTF-8
Java
false
false
1,342
java
package com.movie.demo.controller; import static org.mockito.Mockito.mock; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnitRunner; import com.movie.demo.controllers.MovieController; import com.movie.demo.entities.Movie; import com.movie.demo.service.MovieService; @RunWith(MockitoJUnitRunner.class) public class MovieControllerTests { @InjectMocks MovieController movieController; @Mock MovieService movieService; @Before public void init() { movieService=mock(MovieService.class); MockitoAnnotations.initMocks(this); } @Test public void testsaveMovie() { Movie movie= new Movie(); movie.setId((long) 1233); movie.setTittle("The Avengers"); movie.setWatched(true); movie.setMovieUrl("https://i.chzbgr.com/full/5569379584/hA96709E0/"); movie.setComment("New York blows up in this!"); movieController.saveMovie(movie); } @Test public void testdeleteMovie() { movieController.deleteMovie((long) 123); } @Test public void updateMovieAsWatchedTest() { movieController.updateMovieAsWatched((long) 865); } }
[ "siva.nadupuru@gmail.com" ]
siva.nadupuru@gmail.com
92260f533d59d19bc146fdecc2dfc571d9244b86
7af2f245f54136f31a4ee288c194d8f50ba8c2fe
/kodilla-testing/src/main/java/com/kodilla/testing/collection/OddNumbersExterminator.java
ea112d4431c0c5b21768e874095573ce873d8b2e
[]
no_license
Karolina-LK/kodilla_course_anew
468b844c556e18a782ed2dd7030d509a2029b40c
d46deaee5bb9f1e8eef53d7074935fa9d160f0d7
refs/heads/master
2020-04-11T21:20:23.883730
2019-05-01T13:16:34
2019-05-01T13:16:34
162,102,271
0
0
null
null
null
null
UTF-8
Java
false
false
1,261
java
package com.kodilla.testing.collection; import java.util.ArrayList; public class OddNumbersExterminator { static ArrayList<Integer> exterminate(ArrayList<Integer> allNumbers) { //czy dobrze rozumiem, ze metoda exterminate -wycina- z pierwszej listy, czyli allNumbers, listę tu nazwaną even, // czyli nazwa listy allNumbers powina pojawic sie i w main, i tutaj? //slowo static narzuca mi program ArrayList<Integer> even = new ArrayList<>(); for (Integer number : allNumbers) { if (number % 2 == 0) { even.add(number); } else { System.out.println("Entered number cannot be joined to the scope"); } } System.out.println("The chosen even numbers are as follows:" + even); return even; } } class Number { public static void main (String[] args) throws java.lang.Exception { ArrayList<Integer> allNumbers = new ArrayList<Integer>(); allNumbers.add(250); allNumbers.add(197); allNumbers.add(170); allNumbers.add(169); allNumbers.add(20); OddNumbersExterminator exterminator = new OddNumbersExterminator(); exterminator.exterminate(allNumbers); } }
[ "lubieniecka@interia.pl" ]
lubieniecka@interia.pl
1c6f8998554cc5a2d5c352a3501e86972e9718c4
ea301fcd925b00486aca83435f69db8a68f2c4da
/task-testrunner/src/com/rebtel/codetest/testrunner/annotations/TestRunner.java
c9b279c845185ad47c3fd6f6e0b85b4140958f90
[]
no_license
zffx/CodeExcercise
3ab87a7306709760ae6d8cfbef5c533883545d77
6b0ab9a6bad85569cd07bf8df3408b40b2094b72
refs/heads/master
2021-01-19T17:22:53.852749
2015-02-02T00:14:53
2015-02-02T00:14:53
29,943,013
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package com.rebtel.codetest.testrunner.annotations; import java.lang.annotation.Retention; @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface TestRunner { /** * Declares which method should be used as test-runner entry point. * The method must take a single parameter of type String, which will * be a package name, for which tests in that package shall be run. */ public String runMethodName() default "run"; }
[ "li.unicorn@gmail.com" ]
li.unicorn@gmail.com
524674862bdfeb4decc46064ebdf7021008c3126
a8dd6103be67ca14b4d35c6eada48fcca4f57206
/src/test/java/TestCases/ProjectDay.java
8d809620136ba7eb1258df58e61c57031d65209c
[]
no_license
bamboo1991/TechSchool
c54862b42b8ca881ea94e9efbde90344d541655d
c6d713eff38cde7b0b4ea9cea7aa5887466c162f
refs/heads/master
2023-05-12T21:55:09.636682
2020-02-21T00:23:14
2020-02-21T00:23:14
241,790,080
1
0
null
2023-05-09T18:23:40
2020-02-20T04:08:28
Java
UTF-8
Java
false
false
3,534
java
package TestCases; import io.github.bonigarcia.wdm.WebDriverManager; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class ProjectDay { @Test public void test1(){ WebDriverManager.chromedriver().setup(); WebDriver driver= new ChromeDriver(); driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); driver.get("https://s2.demo.opensourcecms.com/docebo/doceboCore/"); WebElement navigateToLogin = driver.findElement(By.id("login_userid")); navigateToLogin.sendKeys("opensourcecms"); WebElement navigateToPassword = driver.findElement(By.id("login_pwd")); navigateToPassword.sendKeys("opensourcecms"); WebElement clickButton = driver.findElement(By.id("login_button")); clickButton.click(); WebElement navigateToTheE_learner = driver.findElement(By.xpath("//a[@href='index.php?op=platform_sel&pl_sel=lms']")); navigateToTheE_learner.click(); WebElement E_learning = driver.findElement(By.xpath("(//a[@class='arrow_left'])[5]")); E_learning.click(); WebElement courseManagment = driver.findElement(By.xpath("//a[@href='index.php?modname=course&op=course_list&of_platform=lms&close_over=1']")); courseManagment.click(); WebElement add_Category = driver.findElement(By.xpath("//input[@name='treeview_opnewfolder_course_category']")); add_Category.click(); WebElement Category_name = driver.findElement(By.xpath("//input[@id='treeview_folder_name_course_category']")); Category_name.sendKeys("English"); WebElement Create = driver.findElement(By.xpath("//input[@id='treeview_create_folder_course_category']")); Create.click(); } @Test public void repeat2(){ WebDriverManager.chromedriver().setup(); WebDriver driver= new ChromeDriver(); driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); driver.get("https://s2.demo.opensourcecms.com/docebo/doceboCore/"); WebElement navigateToLogin = driver.findElement(By.id("login_userid")); navigateToLogin.sendKeys("opensourcecms"); WebElement navigateToPassword = driver.findElement(By.id("login_pwd")); navigateToPassword.sendKeys("opensourcecms"); WebElement clickButton = driver.findElement(By.id("login_button")); clickButton.click(); WebElement navigateToTheE_learner = driver.findElement(By.xpath("//a[@href='index.php?op=platform_sel&pl_sel=lms']")); navigateToTheE_learner.click(); WebElement E_learning = driver.findElement(By.xpath("(//a[@class='arrow_left'])[5]")); E_learning.click(); WebElement courseManagment = driver.findElement(By.xpath("//a[@href='index.php?modname=course&op=course_list&of_platform=lms&close_over=1']")); courseManagment.click(); WebElement new_course = driver.findElement(By.xpath("//input[@id='new_course']")); new_course.click(); WebElement codeButton = driver.findElement(By.xpath("//input[@id='course_code']")); codeButton.sendKeys("EL001"); WebElement courseName = driver.findElement(By.xpath("//input[@id='course_name']")); courseName.sendKeys("English"); WebElement createButton = driver.findElement(By.xpath("//input[@id='course_create']")); createButton.click(); } }
[ "stamovuber@gmail.com" ]
stamovuber@gmail.com
25d3af600aaf25e46761c8bbf5f10218149b0013
c6b300b3a4d9de54bd661d3b740aeaa6864e1ad6
/app/src/main/java/com/example/flightapplication/AddAdmin.java
c8cd3d96929d59aafdd74460776eb0b84682acb2
[]
no_license
Kanupriya-Jain/flightApplication
349333997846844d31d7910ba3864fea2e4d828d
e40106900701c2413ce02812b4ef7e7e8fd0bc87
refs/heads/main
2023-07-17T11:07:52.715239
2021-08-31T05:38:04
2021-08-31T05:38:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,942
java
package com.example.flightapplication; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.lang.reflect.Array; import java.util.ArrayList; public class AddAdmin extends AppCompatActivity { private Button back; private Button addAdmin; private DatabaseReference mUsers; private DatabaseReference mDatabase; private FirebaseAuth mAuth; private ArrayList<User> arrUser; private ArrayList<String> userNames; private Spinner spinner; private int choosenUser; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView((R.layout.addadminpage)); mAuth = FirebaseAuth.getInstance(); mUsers = FirebaseDatabase.getInstance().getReference("users"); mDatabase = FirebaseDatabase.getInstance().getReference(); back = (Button) findViewById(R.id.buttonBack); back.setOnClickListener(v -> startActivity(new Intent(AddAdmin.this, AdminPage.class))); arrUser = new ArrayList<>(); userNames = new ArrayList<>(); spinner = (Spinner) findViewById(R.id.spinner); mUsers.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { arrUser.clear(); if (snapshot.exists()) { for (DataSnapshot snapshot1 : snapshot.getChildren()) { arrUser.add((User) snapshot1.getValue(User.class)); } for (int i = 0; i < arrUser.size(); i++) { userNames.add(arrUser.get(i).getName() + " " + arrUser.get(i).getSurname()); } ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, userNames); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { choosenUser = i; } @Override public void onNothingSelected(AdapterView<?> adapterView) { Toast.makeText(AddAdmin.this, "Please choose a user", Toast.LENGTH_SHORT).show(); } }); } } @Override public void onCancelled(@NonNull DatabaseError error) { Toast.makeText(AddAdmin.this, "Something went wrong. Please try again", Toast.LENGTH_SHORT).show(); } }); addAdmin = (Button) findViewById(R.id.buttonAdd); addAdmin.setOnClickListener(v -> addsAdmin()); } public void addsAdmin() { mDatabase.child("admins").child(userNames.get(choosenUser)).setValue(arrUser.get(choosenUser).getMail()); System.out.println(arrUser.get(choosenUser).getMail()); } }
[ "sezer_ozaltin@hotmail.com" ]
sezer_ozaltin@hotmail.com
2a01a420e941a412b0952a6a18e233537782184e
2fd9d77d529e9b90fd077d0aa5ed2889525129e3
/DecompiledViberSrc/app/src/main/java/com/viber/voip/messages/conversation/chatinfo/a/f.java
569db77fa0359afe343ee9b4040027655864475e
[]
no_license
cga2351/code
703f5d49dc3be45eafc4521e931f8d9d270e8a92
4e35fb567d359c252c2feca1e21b3a2a386f2bdb
refs/heads/master
2021-07-08T15:11:06.299852
2021-05-06T13:22:21
2021-05-06T13:22:21
60,314,071
1
3
null
null
null
null
UTF-8
Java
false
false
4,526
java
package com.viber.voip.messages.conversation.chatinfo.a; import android.content.res.Resources; import com.viber.jni.PeerTrustState.PeerTrustEnum; import com.viber.voip.contacts.ui.list.as; import com.viber.voip.messages.controller.manager.an; import com.viber.voip.messages.conversation.ConversationItemLoaderEntity; import com.viber.voip.messages.conversation.ac; import com.viber.voip.messages.conversation.chatinfo.presentation.n; import com.viber.voip.messages.conversation.chatinfo.presentation.n.b; import com.viber.voip.messages.m; import com.viber.voip.phone.viber.conference.ConferenceCallsRepository; import com.viber.voip.settings.d.as; class f extends a { f(Resources paramResources, com.viber.voip.publicaccount.ui.holders.recentmedia.b paramb, ac paramac, ConferenceCallsRepository paramConferenceCallsRepository) { super(paramResources, paramb, paramac, paramConferenceCallsRepository); } private void c(ConversationItemLoaderEntity paramConversationItemLoaderEntity, n paramn) { int i = 1; n.b localb = paramn.g(); PeerTrustState.PeerTrustEnum localPeerTrustEnum1 = PeerTrustState.PeerTrustEnum.SECURE_UNTRUSTED; c.a locala1 = c.a.a; PeerTrustState.PeerTrustEnum localPeerTrustEnum3; int j; label91: c.a locala2; label105: PeerTrustState.PeerTrustEnum localPeerTrustEnum2; if ((localb != null) && (paramConversationItemLoaderEntity.getParticipantMemberId().equals(localb.a()))) { localPeerTrustEnum3 = localb.b(); if ((!paramConversationItemLoaderEntity.isSecure()) && (PeerTrustState.PeerTrustEnum.SECURE_UNTRUSTED != localPeerTrustEnum3)) { j = i; if ((!d.as.a.d()) || ((!paramConversationItemLoaderEntity.isSecure()) && (j == 0)) || (paramConversationItemLoaderEntity.isAnonymous())) break label140; if (i == 0) break label155; if (j == 0) break label145; locala2 = c.a.d; localPeerTrustEnum2 = localPeerTrustEnum3; } } while (true) { a(c.a(this.a, paramConversationItemLoaderEntity, locala2, localPeerTrustEnum2, paramn)); a(c.a()); return; j = 0; break; label140: i = 0; break label91; label145: locala2 = c.a.a(localPeerTrustEnum3); break label105; label155: locala2 = locala1; localPeerTrustEnum2 = localPeerTrustEnum3; continue; localPeerTrustEnum2 = localPeerTrustEnum1; locala2 = locala1; } } private void d(ConversationItemLoaderEntity paramConversationItemLoaderEntity, n paramn) { a.a locala = a(paramn, true, false, paramn.a(), false, paramConversationItemLoaderEntity.isGroupBehavior()); b(); a(c.a(this.a, locala.a())); if (as.c(paramConversationItemLoaderEntity)) a(c.s(this.a)); if (locala.a() > 0) c(locala.b()); } public void b(ConversationItemLoaderEntity paramConversationItemLoaderEntity, n paramn) { if ((!paramConversationItemLoaderEntity.isSecret()) && (this.b.getCount() > 0)) { a(c.a(this.b)); a(c.a()); } c(paramConversationItemLoaderEntity, paramn); d(paramConversationItemLoaderEntity, paramn); if (paramConversationItemLoaderEntity.isAnonymous()) a(c.l(this.a, paramConversationItemLoaderEntity)); a(c.a()); a(paramConversationItemLoaderEntity); a(c.g(this.a, paramConversationItemLoaderEntity)); a(c.d(this.a, paramConversationItemLoaderEntity)); if (!paramn.e()) a(c.h(this.a, paramConversationItemLoaderEntity)); int i; if ((an.a(paramn.d())) && (!paramConversationItemLoaderEntity.isSystemConversation()) && (!paramConversationItemLoaderEntity.isAnonymous())) { i = 1; if (i != 0) { if (!paramConversationItemLoaderEntity.isSecret()) break label230; a(c.g(this.a)); } } while (true) { if (!paramn.e()) a(c.i(this.a, paramConversationItemLoaderEntity)); if ((m.a(paramConversationItemLoaderEntity)) && (paramn.f() > 0L)) a(c.h(this.a)); c(); b(paramConversationItemLoaderEntity); return; i = 0; break; label230: a(c.f(this.a)); } } } /* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_3_dex2jar.jar * Qualified Name: com.viber.voip.messages.conversation.chatinfo.a.f * JD-Core Version: 0.6.2 */
[ "yu.liang@navercorp.com" ]
yu.liang@navercorp.com
3e07515f09ebf71808bdf9314251847846383257
523584d00978ce9398d0d4b5cf33a318110ddadb
/src-pos/uk/chromis/pos/inventory/RecipeEditor.java
cf7a2517639b222509f03b99f94adcc0ffbaefca
[]
no_license
zenonarg/Chromis
8bbd687d763f4bf258984e46825257486bc49265
8211d7e1f3aa0e5d858e105a392795bf05c39924
refs/heads/master
2023-04-26T09:31:06.394569
2021-01-12T15:26:15
2021-01-12T15:26:15
312,036,399
1
0
null
2021-01-12T14:57:42
2020-11-11T17:06:35
null
UTF-8
Java
false
false
13,667
java
/* ** Chromis POS - The New Face of Open Source POS ** Copyright (c)2015-2016 ** http://www.chromis.co.uk ** ** This file is part of Chromis POS Version V0.60.2 beta ** ** Chromis POS 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, either version 3 of the License, or ** (at your option) any later version. ** ** Chromis POS 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 Chromis POS. If not, see <http://www.gnu.org/licenses/> ** ** */ package uk.chromis.pos.inventory; import uk.chromis.basic.BasicException; import uk.chromis.data.gui.MessageInf; import uk.chromis.data.user.DirtyManager; import uk.chromis.data.user.EditorRecord; import uk.chromis.format.Formats; import uk.chromis.pos.forms.AppLocal; import uk.chromis.pos.forms.AppView; import uk.chromis.pos.forms.DataLogicSales; import uk.chromis.pos.panels.JProductFinder; import uk.chromis.pos.ticket.ProductInfoExt; import java.awt.Component; import java.awt.Toolkit; import java.util.UUID; public class RecipeEditor extends javax.swing.JPanel implements EditorRecord { private final DataLogicSales m_dlSales; private Object id; private Object product; private Object productKit; private Object name; private Object quantity; private String siteGuid; private Object insertproduct; public RecipeEditor(AppView app, DirtyManager dirty, String siteGuid) { this.siteGuid = siteGuid; m_dlSales = (DataLogicSales) app.getBean("uk.chromis.pos.forms.DataLogicSales"); initComponents(); m_jProduct.getDocument().addDocumentListener(dirty); m_jQuantity.getDocument().addDocumentListener(dirty); } public void setInsertProduct(ProductInfoExt prod) { if (prod == null) { insertproduct = null; } else { insertproduct = prod.getID(); } } @Override public void refresh() { } @Override public void writeValueEOF() { id = null; product = null; productKit = null; quantity = null; name = null; m_jReference.setText(null); m_jBarcode.setText(null); m_jProduct.setText(null); m_jQuantity.setText(null); m_jReference.setEnabled(false); m_jBarcode.setEnabled(false); m_jProduct.setEnabled(false); m_jQuantity.setEnabled(false); m_jEnter1.setEnabled(false); m_jEnter2.setEnabled(false); m_jSearch.setEnabled(false); } @Override public void writeValueInsert() { id = UUID.randomUUID().toString(); product = insertproduct; productKit = null; name = null; quantity = null; m_jReference.setText(null); m_jBarcode.setText(null); m_jProduct.setText(null); m_jQuantity.setText(null); m_jReference.setEnabled(true); m_jBarcode.setEnabled(true); m_jProduct.setEnabled(true); m_jQuantity.setEnabled(true); m_jEnter1.setEnabled(true); m_jEnter2.setEnabled(true); m_jSearch.setEnabled(true); } @Override public void writeValueEdit(Object value) { Object[] obj = (Object[]) value; id = obj[0]; product = obj[1]; productKit = obj[2]; quantity = obj[3]; name = obj[6]; m_jReference.setText(Formats.STRING.formatValue(obj[4])); m_jBarcode.setText(Formats.STRING.formatValue(obj[5])); m_jProduct.setText(Formats.STRING.formatValue(obj[4]) + " - " + Formats.STRING.formatValue(obj[6])); m_jQuantity.setText(Formats.DOUBLE.formatValue(obj[3])); siteGuid = obj[7].toString(); m_jReference.setEnabled(true); m_jBarcode.setEnabled(true); m_jProduct.setEnabled(true); m_jQuantity.setEnabled(true); m_jEnter1.setEnabled(true); m_jEnter2.setEnabled(true); m_jSearch.setEnabled(true); } @Override public void writeValueDelete(Object value) { Object[] obj = (Object[]) value; id = obj[0]; product = obj[1]; productKit = obj[2]; quantity = obj[3]; name = obj[6]; m_jReference.setText(Formats.STRING.formatValue(obj[4])); m_jBarcode.setText(Formats.STRING.formatValue(obj[5])); m_jProduct.setText(Formats.STRING.formatValue(obj[4]) + " - " + Formats.STRING.formatValue(obj[6])); m_jQuantity.setText(Formats.DOUBLE.formatValue(obj[3])); m_jReference.setEnabled(false); m_jBarcode.setEnabled(false); m_jProduct.setEnabled(false); m_jEnter1.setEnabled(false); m_jEnter2.setEnabled(false); m_jSearch.setEnabled(false); } @Override public Object createValue() throws BasicException { return new Object[] { id, product, productKit, Formats.DOUBLE.parseValue(m_jQuantity.getText()), m_jReference.getText(), m_jBarcode.getText(), name, siteGuid }; } @Override public Component getComponent() { return this; } private void assignProduct(ProductInfoExt prod) { if (m_jSearch.isEnabled()) { if (prod == null) { productKit = null; quantity = null; m_jReference.setText(null); m_jBarcode.setText(null); m_jProduct.setText(null); name = null; siteGuid = null; } else { productKit = prod.getID(); quantity = null; m_jReference.setText(prod.getReference()); m_jBarcode.setText(prod.getCode()); m_jProduct.setText(prod.getReference() + " - " + prod.getName()); name = prod.getName(); siteGuid = prod.getSiteguid(); } } } private void assignProductByCode() { try { ProductInfoExt prod = m_dlSales.getProductInfoByCode(m_jBarcode.getText(), siteGuid); assignProduct(prod); if (prod == null) { Toolkit.getDefaultToolkit().beep(); } } catch (BasicException eData) { assignProduct(null); MessageInf msg = new MessageInf(eData); msg.show(this); } } @Override public void refreshGuid(String siteGuid) { this.siteGuid = siteGuid; } private void assignProductByReference() { try { ProductInfoExt prod = m_dlSales.getProductInfoByReference(m_jReference.getText(), siteGuid); assignProduct(prod); if (prod == null) { Toolkit.getDefaultToolkit().beep(); } } catch (BasicException eData) { assignProduct(null); MessageInf msg = new MessageInf(eData); msg.show(this); } } /** 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() { jLabel3 = new javax.swing.JLabel(); m_jReference = new javax.swing.JTextField(); m_jEnter1 = new javax.swing.JButton(); m_jEnter2 = new javax.swing.JButton(); m_jSearch = new javax.swing.JButton(); m_jProduct = new javax.swing.JTextField(); m_jBarcode = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); m_jQuantity = new javax.swing.JTextField(); setPreferredSize(new java.awt.Dimension(700, 100)); setLayout(null); jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel3.setText(AppLocal.getIntString("label.prodref")); // NOI18N jLabel3.setPreferredSize(new java.awt.Dimension(70, 25)); add(jLabel3); jLabel3.setBounds(10, 11, 70, 25); m_jReference.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jReference.setPreferredSize(new java.awt.Dimension(150, 25)); m_jReference.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jReferenceActionPerformed(evt); } }); add(m_jReference); m_jReference.setBounds(90, 11, 150, 25); m_jEnter1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uk/chromis/images/ok.png"))); // NOI18N m_jEnter1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEnter1ActionPerformed(evt); } }); add(m_jEnter1); m_jEnter1.setBounds(250, 11, 57, 33); m_jEnter2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uk/chromis/images/barcode.png"))); // NOI18N m_jEnter2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEnter2ActionPerformed(evt); } }); add(m_jEnter2); m_jEnter2.setBounds(557, 11, 55, 31); m_jSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uk/chromis/images/search24.png"))); // NOI18N m_jSearch.setPreferredSize(new java.awt.Dimension(58, 34)); m_jSearch.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jSearchActionPerformed(evt); } }); add(m_jSearch); m_jSearch.setBounds(10, 50, 58, 34); m_jProduct.setEditable(false); m_jProduct.setPreferredSize(new java.awt.Dimension(200, 25)); add(m_jProduct); m_jProduct.setBounds(90, 50, 217, 25); m_jBarcode.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 25)); m_jBarcode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBarcodeActionPerformed(evt); } }); add(m_jBarcode); m_jBarcode.setBounds(397, 11, 150, 25); jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel4.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N jLabel4.setPreferredSize(new java.awt.Dimension(70, 25)); add(jLabel4); jLabel4.setBounds(317, 11, 70, 25); jLabel1.setText("Quantity"); add(jLabel1); jLabel1.setBounds(320, 50, 60, 14); add(m_jQuantity); m_jQuantity.setBounds(400, 50, 150, 20); }// </editor-fold>//GEN-END:initComponents private void m_jSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jSearchActionPerformed assignProduct(JProductFinder.showMessage(this, m_dlSales, JProductFinder.PRODUCT_NORMAL, siteGuid)); }//GEN-LAST:event_m_jSearchActionPerformed private void m_jReferenceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jReferenceActionPerformed this.assignProductByReference(); }//GEN-LAST:event_m_jReferenceActionPerformed private void m_jEnter2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter2ActionPerformed this.assignProductByCode(); }//GEN-LAST:event_m_jEnter2ActionPerformed private void m_jEnter1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter1ActionPerformed this.assignProductByReference(); }//GEN-LAST:event_m_jEnter1ActionPerformed private void m_jBarcodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jBarcodeActionPerformed this.assignProductByCode(); }//GEN-LAST:event_m_jBarcodeActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JTextField m_jBarcode; private javax.swing.JButton m_jEnter1; private javax.swing.JButton m_jEnter2; private javax.swing.JTextField m_jProduct; private javax.swing.JTextField m_jQuantity; private javax.swing.JTextField m_jReference; private javax.swing.JButton m_jSearch; // End of variables declaration//GEN-END:variables }
[ "john@chromis.co.uk" ]
john@chromis.co.uk
dfabcf7b4ace68990c5ca2494488ad3eed84aa6e
aac984de38b552f1adf7fd990400a29ee83f586a
/Day3/Solution.java
ca144bbf0b80d54bd63fed5169eb2380dff92b11
[]
no_license
sonamoo/30DaysofCode
15c98fb75654f97dc5ccc3b2ff22eb32b8deffc4
05194226f0e718801562caa6fddab7f8200c60b5
refs/heads/master
2021-04-29T02:19:17.100701
2017-02-03T03:44:40
2017-02-03T03:44:40
78,026,403
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); scan.close(); String ans=""; // if 'n' is NOT evenly divisible by 2 (i.e.: n is odd) if(n%2==1){ ans = "Weird"; } else { if( n >= 2 && n <=5) { ans = "Not Weird"; } else if ( n >= 6 && n <=20) { ans = "Weird"; } else if ( n >= 20) { ans = "Not Weird"; } } System.out.println(ans); } }
[ "limseho657424@gmail.com" ]
limseho657424@gmail.com
07aab4b90f15f31bfe4eb6158903f2567be5529a
5a891dd1cfcfcdc1fc6aeed2afe34a3acbf78448
/src/main/java/com/bravedroid/main/Main.java
582a147eaefe9128b4feec13838159e79ab21216
[ "Apache-2.0" ]
permissive
BraveDroid/Observers-Observables-Sync-Async-Programming-Fundamental
365449a1a65372bb153b0d376310ab8532e3b77e
2c744a11988f1c5191bdc2a3652f5522aec20383
refs/heads/master
2021-01-24T19:49:57.325436
2018-02-28T17:41:42
2018-03-02T08:24:18
123,242,625
0
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
package com.bravedroid.main; import com.bravedroid.work.WorkAsynchronouslyInManyThread; import com.bravedroid.work.WorkAsynchronouslyInOneThread; import com.bravedroid.work.WorkSynchronouslyInManyThread; import com.bravedroid.work.WorkSynchronouslyInOneThread; public class Main { public static void main(String[] args) { System.out.println("it's not because it is synchronous so it should be in an other thread."); TaskManager taskManager = new TaskManager(); //System.out.println("WorkSynchronouslyInOneThread"); //taskManager.work(new WorkSynchronouslyInOneThread()); //System.out.println("WorkSynchronouslyInManyThread"); //taskManager.work(new WorkSynchronouslyInManyThread()); System.out.println("WorkAsynchronouslyInOneThread"); taskManager.work(new WorkAsynchronouslyInOneThread()); //System.out.println("WorkAsynchronouslyInManyThread"); //taskManager.work(new WorkAsynchronouslyInManyThread()); } }
[ "houssem.zaier@gmail.com" ]
houssem.zaier@gmail.com
1019ca571807b6e011afc9796e6a9873da70f194
50aaec6a57f4b2e399f6909a976b31c1b9facb31
/core/src/proto/message/Accumulation.java
4b0950d521351a0c16b06d1d24e6f23814fad25e
[]
no_license
ecraftagency/fishot
a543f4f85081050381498f18d53acada18013db4
ed2ddfa7f645432a42057bd51ccea053f60708d7
refs/heads/master
2022-06-21T18:53:36.370042
2020-05-09T10:22:21
2020-05-09T10:22:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,821
java
package proto.message; @javax.annotation.Generated("/Users/vunguyen/project/gdxsocket/core/src/proto/msg_ingame.proto") public final class Accumulation implements io.protostuff.Message<Accumulation> { private static final Accumulation DEFAULT_INSTANCE = newBuilder().build(); private int id; private int current; private java.util.List<Integer> milestones; private java.util.List<Integer> gifts; private boolean __merge_lock = false; private int __bitField0; private Accumulation() { this.id = 0; this.current = 0; this.milestones = java.util.Collections.emptyList(); this.gifts = java.util.Collections.emptyList(); } private Accumulation(Builder builder) { __merge_lock = true; } public static Builder newBuilder() { return new Builder(); } public static Accumulation getDefaultInstance() { return DEFAULT_INSTANCE; } public static io.protostuff.Schema<Accumulation> getSchema() { return Schema.INSTANCE; } public int getId() { return id; } public boolean hasId() { return (__bitField0 & 1) == 1; } public Accumulation withId(int value) { return Accumulation.newBuilder() .mergeFrom(this) .setId(value) .build(); } public int getCurrent() { return current; } public boolean hasCurrent() { return (__bitField0 & 2) == 2; } public Accumulation withCurrent(int value) { return Accumulation.newBuilder() .mergeFrom(this) .setCurrent(value) .build(); } public java.util.List<Integer> getMilestonesList() { return milestones; } public int getMilestonesCount() { return milestones.size(); } public int getMilestones(int index) { return milestones.get(index); } public Accumulation withMilestones(java.util.List<Integer> value) { return Accumulation.newBuilder() .mergeFrom(this) .clearMilestones() .addAllMilestones(value) .build(); } public java.util.List<Integer> getGiftsList() { return gifts; } public int getGiftsCount() { return gifts.size(); } public int getGifts(int index) { return gifts.get(index); } public Accumulation withGifts(java.util.List<Integer> value) { return Accumulation.newBuilder() .mergeFrom(this) .clearGifts() .addAllGifts(value) .build(); } @Override public io.protostuff.Schema<Accumulation> cachedSchema() { return Schema.INSTANCE; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || this.getClass() != obj.getClass()) { return false; } Accumulation that = (Accumulation) obj; if (!java.util.Objects.equals(this.id, that.id)) { return false; } if (!java.util.Objects.equals(this.current, that.current)) { return false; } if (!java.util.Objects.equals(this.milestones, that.milestones)) { return false; } if (!java.util.Objects.equals(this.gifts, that.gifts)) { return false; } return true; } @Override public int hashCode() { int result = 1; result = 31 * result + Integer.hashCode(this.id); result = 31 * result + Integer.hashCode(this.current); result = 31 * result + (this.milestones == null ? 0 : this.milestones.hashCode()); result = 31 * result + (this.gifts == null ? 0 : this.gifts.hashCode()); return result; } @Override public String toString() { java.util.List<String> parts = new java.util.ArrayList<>(); if (hasId()) { parts.add("id=" + getId()); } if (hasCurrent()) { parts.add("current=" + getCurrent()); } if (!milestones.isEmpty()) { parts.add("milestones=" + getMilestonesList()); } if (!gifts.isEmpty()) { parts.add("gifts=" + getGiftsList()); } return "Accumulation{" + String.join(", ", parts) + "}"; } public static final class Schema implements io.protostuff.Schema<Accumulation>{ private static final Schema INSTANCE = new Schema(); private static final java.util.Map<String,Integer> __fieldMap = new java.util.HashMap<>(); static { __fieldMap.put("id", 1); __fieldMap.put("current", 2); __fieldMap.put("milestones", 4); __fieldMap.put("gifts", 5); } @Override public Accumulation newMessage() { return new Accumulation(); } @Override public Class<Accumulation> typeClass() { return Accumulation.class; } @Override public String messageName() { return Accumulation.class.getSimpleName(); } @Override public String messageFullName() { return Accumulation.class.getName(); } @Override @Deprecated public boolean isInitialized(Accumulation message) { return true; } @Override public void mergeFrom(io.protostuff.Input input, Accumulation instance) throws java.io.IOException { if (instance.__merge_lock) { throw new IllegalStateException("Cannot reuse message instance"); } else { instance.__merge_lock = true; } while(true) { int number = input.readFieldNumber(this); if (number == 0) { break; } switch(number) { case 1: instance.id = input.readInt32(); instance.__bitField0 |= 1; break; case 2: instance.current = input.readInt32(); instance.__bitField0 |= 2; break; case 4: if(!((instance.__bitField0 & 4) == 4)) { instance.milestones = new java.util.ArrayList<>(); instance.__bitField0 |= 4; } instance.milestones.add(input.readInt32()); break; case 5: if(!((instance.__bitField0 & 8) == 8)) { instance.gifts = new java.util.ArrayList<>(); instance.__bitField0 |= 8; } instance.gifts.add(input.readInt32()); break; default: input.handleUnknownField(number, this); } } if((instance.__bitField0 & 4) == 4) { instance.milestones = java.util.Collections.unmodifiableList(instance.milestones); } if((instance.__bitField0 & 8) == 8) { instance.gifts = java.util.Collections.unmodifiableList(instance.gifts); } } @Override public void writeTo(io.protostuff.Output output, Accumulation instance) throws java.io.IOException { if((instance.__bitField0 & 1) == 1) { output.writeInt32(1, instance.id, false); } if((instance.__bitField0 & 2) == 2) { output.writeInt32(2, instance.current, false); } for(int milestones : instance.milestones) { output.writeInt32(4, milestones, true); } for(int gifts : instance.gifts) { output.writeInt32(5, gifts, true); } } @Override public String getFieldName(int number) { switch(number) { case 1: return "id"; case 2: return "current"; case 4: return "milestones"; case 5: return "gifts"; default: return null; } } @Override public int getFieldNumber(String name) { final Integer number = __fieldMap.get(name); return number == null ? 0 : number.intValue(); } } public static final class Builder { private int id; private int current; private java.util.List<Integer> milestones; private java.util.List<Integer> gifts; private int __bitField0; private Builder() { this.id = 0; this.current = 0; this.milestones = java.util.Collections.emptyList(); this.gifts = java.util.Collections.emptyList(); } public Builder mergeFrom(Accumulation instance) { if (instance.hasId()) { this.setId(instance.getId()); } if (instance.hasCurrent()) { this.setCurrent(instance.getCurrent()); } this.addAllMilestones(instance.getMilestonesList()); this.addAllGifts(instance.getGiftsList()); return this; } public int getId() { return id; } public Builder setId(int value) { this.id = value; __bitField0 |= 1; return this; } public Builder clearId() { this.id = 0; __bitField0 &= ~1; return this; } public boolean hasId() { return (__bitField0 & 1) == 1; } public int getCurrent() { return current; } public Builder setCurrent(int value) { this.current = value; __bitField0 |= 2; return this; } public Builder clearCurrent() { this.current = 0; __bitField0 &= ~2; return this; } public boolean hasCurrent() { return (__bitField0 & 2) == 2; } public java.util.List<Integer> getMilestonesList() { return milestones; } public Builder setMilestones(int index, int value) { if(!((__bitField0 & 4) == 4)) { this.milestones = new java.util.ArrayList<>(); __bitField0 |= 4; } this.milestones.set(index, value); return this; } public Builder addMilestones(int value) { if(!((__bitField0 & 4) == 4)) { this.milestones = new java.util.ArrayList<>(); __bitField0 |= 4; } this.milestones.add(value); return this; } public Builder addAllMilestones(java.lang.Iterable<Integer> values) { if (values == null) { throw new NullPointerException("Cannot set Accumulation#milestones to null"); } if(!((__bitField0 & 4) == 4)) { this.milestones = new java.util.ArrayList<>(); __bitField0 |= 4; } for (final Integer value : values) { if (value == null) { throw new NullPointerException("Cannot set Accumulation#milestones to null"); } this.milestones.add(value); } return this; } public Builder clearMilestones() { this.milestones = java.util.Collections.emptyList(); __bitField0 &= ~4; return this; } public int getMilestonesCount() { return milestones.size(); } public int getMilestones(int index) { return milestones.get(index); } public java.util.List<Integer> getGiftsList() { return gifts; } public Builder setGifts(int index, int value) { if(!((__bitField0 & 8) == 8)) { this.gifts = new java.util.ArrayList<>(); __bitField0 |= 8; } this.gifts.set(index, value); return this; } public Builder addGifts(int value) { if(!((__bitField0 & 8) == 8)) { this.gifts = new java.util.ArrayList<>(); __bitField0 |= 8; } this.gifts.add(value); return this; } public Builder addAllGifts(java.lang.Iterable<Integer> values) { if (values == null) { throw new NullPointerException("Cannot set Accumulation#gifts to null"); } if(!((__bitField0 & 8) == 8)) { this.gifts = new java.util.ArrayList<>(); __bitField0 |= 8; } for (final Integer value : values) { if (value == null) { throw new NullPointerException("Cannot set Accumulation#gifts to null"); } this.gifts.add(value); } return this; } public Builder clearGifts() { this.gifts = java.util.Collections.emptyList(); __bitField0 &= ~8; return this; } public int getGiftsCount() { return gifts.size(); } public int getGifts(int index) { return gifts.get(index); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || this.getClass() != obj.getClass()) { return false; } Builder that = (Builder) obj; if (!java.util.Objects.equals(this.id, that.id)) { return false; } if (!java.util.Objects.equals(this.current, that.current)) { return false; } if (!java.util.Objects.equals(this.milestones, that.milestones)) { return false; } if (!java.util.Objects.equals(this.gifts, that.gifts)) { return false; } return true; } @Override public int hashCode() { int result = 1; result = 31 * result + Integer.hashCode(this.id); result = 31 * result + Integer.hashCode(this.current); result = 31 * result + (this.milestones == null ? 0 : this.milestones.hashCode()); result = 31 * result + (this.gifts == null ? 0 : this.gifts.hashCode()); return result; } @Override public String toString() { java.util.List<String> parts = new java.util.ArrayList<>(); if (hasId()) { parts.add("id=" + getId()); } if (hasCurrent()) { parts.add("current=" + getCurrent()); } if (!milestones.isEmpty()) { parts.add("milestones=" + getMilestonesList()); } if (!gifts.isEmpty()) { parts.add("gifts=" + getGiftsList()); } return "Accumulation{" + String.join(", ", parts) + "}"; } public Accumulation build() { proto.message.Accumulation result = new proto.message.Accumulation(); result.__bitField0 = __bitField0; result.id = this.id; result.current = this.current; result.milestones = java.util.Collections.unmodifiableList(this.milestones); result.gifts = java.util.Collections.unmodifiableList(this.gifts); return result; } } }
[ "ecraft.eventagency@gmail.com" ]
ecraft.eventagency@gmail.com
45a448841b9dac7e659255028715eae373b8d1e0
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/22/22_b68efce94d276e1875bfc2404837717c45208f5b/HeaderServiceTest/22_b68efce94d276e1875bfc2404837717c45208f5b_HeaderServiceTest_s.java
9a73d7036701be6142c22de2c0036e7547af457a
[]
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
3,945
java
package org.codehaus.xfire.annotations.jsr181; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import org.codehaus.xfire.annotations.AnnotationServiceFactory; import org.codehaus.xfire.service.Service; import org.codehaus.xfire.soap.SoapConstants; import org.codehaus.xfire.test.AbstractXFireTest; import org.codehaus.xfire.wsdl.WSDLWriter; import org.jdom.Document; public class HeaderServiceTest extends AbstractXFireTest { private AnnotationServiceFactory osf; public void setUp() throws Exception { super.setUp(); osf = new AnnotationServiceFactory(new Jsr181WebAnnotations(), getXFire().getTransportManager(), null); Service service = osf.create(HeaderService.class); getXFire().getServiceRegistry().register(service); } public void testHeaders() throws Exception { Document response = invokeService("HeaderService", "/org/codehaus/xfire/annotations/jsr181/headerMessage.xml"); assertNotNull(HeaderService.a); assertEquals("one", HeaderService.a); assertNotNull(HeaderService.b); assertEquals("three", HeaderService.b); assertNotNull(HeaderService.header); assertEquals("two", HeaderService.header); } public void testWSDL() throws Exception { Document wsdl = getWSDLDocument("HeaderService"); //printNode(wsdl); addNamespace("wsdl", WSDLWriter.WSDL11_NS); addNamespace("wsdlsoap", WSDLWriter.WSDL11_SOAP_NS); addNamespace("xsd", SoapConstants.XSD); assertValid("//wsdl:message[@name='doSomethingRequestHeaders']", wsdl); assertValid("//wsdl:message[@name='doSomethingRequestHeaders']/wsdl:part[@element='tns:header'][@name='header']", wsdl); assertValid("//wsdlsoap:header[@message='tns:doSomethingRequestHeaders'][@part='header'][@use='literal']", wsdl); assertValid("//xsd:element[@name='header']", wsdl); assertInvalid("//xsd:element[@name='header'][2]", wsdl); } @WebService(name="HeaderService", targetNamespace="urn:HeaderService") @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED) public static class HeaderService { static String a; static String b; static String header; static UserToken authHeader; @WebMethod public void doSomething(@WebParam(name="a") String a, @WebParam(name="header", header=true) String header, @WebParam(name="b") String b) { HeaderService.a = a; HeaderService.b = b; HeaderService.header = header; } @WebMethod public void doSomethingAuthenticated(@WebParam(name="header", header=true) UserToken authHeader) { HeaderService.authHeader = authHeader; } @WebMethod public void doSomethingAuthenticated2(@WebParam(name="header", header=true) UserToken authHeader) { HeaderService.authHeader = authHeader; } } public static class UserToken { private String username; private String password; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
bde4da5774121ba4a92f99b0f95b1381846500fb
c816f16e0a09c1591345d9d10409565bf4b2b265
/src/main/java/ch/unibe/scg/lexica/Lexica.java
70a2d847705320cbca096a5916ddd3d5686c584e
[]
no_license
fluxroot/lexica
385df0df84c6422a9be5901a42bd01ec50029c4a
7948d561b85ad6a863a8c632318892e8741577e4
refs/heads/master
2016-09-09T19:53:10.590738
2013-12-09T22:20:20
2013-12-09T22:20:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
/* ** Copyright 2013 Software Composition Group, University of Bern. All rights reserved. */ package ch.unibe.scg.lexica; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class Lexica { private static final Logger logger = LoggerFactory.getLogger(Lexica.class); private Lexica() { } public static void main(String[] args) { try { Configuration.getInstance().parseArguments(args); IOperationMode mode = Configuration.getInstance().getMode(); mode.execute(); } catch (IOException e) { logger.error("An error occured", e); } } }
[ "pn@nonava.com" ]
pn@nonava.com
6ceac172145f5aa727c1b09563b1a32ba063f097
935f17edb2f96b9424992ad6b822223f248de12f
/InterviewPrep/src/ArraysandString/reverseWords.java
83c20e192a432e29800500f2e61dda677b34668d
[]
no_license
Shrezz/Top-Coder-Problems
70885eab0db2b146fb8907a601a5f8995a8ccc55
1b37b89dab46a7d663fab3970a539a86bdc35cb7
refs/heads/master
2021-03-12T22:31:49.855896
2015-03-18T02:12:44
2015-03-18T02:12:44
32,432,408
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
package ArraysandString; public class reverseWords { public static String reverseWords(String s) { if (s == null || s.length() == 0) { return ""; } // split to words by space String[] arr = s.split(" "); StringBuilder sb = new StringBuilder(); for (int i = arr.length - 1; i >= 0; --i) { if (!arr[i].equals("")) { sb.append(arr[i]).append(" "); } } return sb.length() == 0 ? "" : sb.substring(0, sb.length() - 1); } public static void main(String args[]){ System.out.println(reverseWords("Hello world")); } }
[ "Shreya@10.189.184.101" ]
Shreya@10.189.184.101
07335477afab9af407760e3c0c1d88e72cf61f48
6f01c9cff8b4060e8b049fe0b0e9a3134c27a729
/tuples/src/main/java/org/web3j/tuples/generated/Tuple10.java
905631dd6f1211c73dd4010162c87c61ade1f0b7
[ "Apache-2.0" ]
permissive
MIQS/web3j
ec02dbf550f05f5862a9f12d632b9f5a8b1dec12
de853c710e85c3fe3dd0c0c04be24c4c1a2fbeb4
refs/heads/master
2020-03-21T22:07:43.976586
2018-06-29T07:00:11
2018-06-29T07:00:11
139,105,422
2
0
Apache-2.0
2018-06-29T05:37:08
2018-06-29T05:37:08
null
UTF-8
Java
false
false
4,596
java
package org.web3j.tuples.generated; import org.web3j.tuples.Tuple; /** * Auto generated code. * <p><strong>Do not modifiy!</strong> * <p>Please use org.web3j.codegen.TupleGenerator in the * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update. */ public final class Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> implements Tuple { private static final int SIZE = 10; private final T1 value1; private final T2 value2; private final T3 value3; private final T4 value4; private final T5 value5; private final T6 value6; private final T7 value7; private final T8 value8; private final T9 value9; private final T10 value10; public Tuple10(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10) { this.value1 = value1; this.value2 = value2; this.value3 = value3; this.value4 = value4; this.value5 = value5; this.value6 = value6; this.value7 = value7; this.value8 = value8; this.value9 = value9; this.value10 = value10; } public T1 getValue1() { return value1; } public T2 getValue2() { return value2; } public T3 getValue3() { return value3; } public T4 getValue4() { return value4; } public T5 getValue5() { return value5; } public T6 getValue6() { return value6; } public T7 getValue7() { return value7; } public T8 getValue8() { return value8; } public T9 getValue9() { return value9; } public T10 getValue10() { return value10; } @Override public int getSize() { return SIZE; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Tuple10<?, ?, ?, ?, ?, ?, ?, ?, ?, ?> tuple10 = (Tuple10<?, ?, ?, ?, ?, ?, ?, ?, ?, ?>) o; if (value1 != null ? !value1.equals(tuple10.value1) : tuple10.value1 != null) { return false; } if (value2 != null ? !value2.equals(tuple10.value2) : tuple10.value2 != null) { return false; } if (value3 != null ? !value3.equals(tuple10.value3) : tuple10.value3 != null) { return false; } if (value4 != null ? !value4.equals(tuple10.value4) : tuple10.value4 != null) { return false; } if (value5 != null ? !value5.equals(tuple10.value5) : tuple10.value5 != null) { return false; } if (value6 != null ? !value6.equals(tuple10.value6) : tuple10.value6 != null) { return false; } if (value7 != null ? !value7.equals(tuple10.value7) : tuple10.value7 != null) { return false; } if (value8 != null ? !value8.equals(tuple10.value8) : tuple10.value8 != null) { return false; } if (value9 != null ? !value9.equals(tuple10.value9) : tuple10.value9 != null) { return false; } return value10 != null ? value10.equals(tuple10.value10) : tuple10.value10 == null; } @Override public int hashCode() { int result = value1.hashCode(); result = 31 * result + (value2 != null ? value2.hashCode() : 0); result = 31 * result + (value3 != null ? value3.hashCode() : 0); result = 31 * result + (value4 != null ? value4.hashCode() : 0); result = 31 * result + (value5 != null ? value5.hashCode() : 0); result = 31 * result + (value6 != null ? value6.hashCode() : 0); result = 31 * result + (value7 != null ? value7.hashCode() : 0); result = 31 * result + (value8 != null ? value8.hashCode() : 0); result = 31 * result + (value9 != null ? value9.hashCode() : 0); result = 31 * result + (value10 != null ? value10.hashCode() : 0); return result; } @Override public String toString() { return "Tuple10{" + "value1=" + value1 + ", value2=" + value2 + ", value3=" + value3 + ", value4=" + value4 + ", value5=" + value5 + ", value6=" + value6 + ", value7=" + value7 + ", value8=" + value8 + ", value9=" + value9 + ", value10=" + value10 + "}"; } }
[ "conor10@gmail.com" ]
conor10@gmail.com
1b5e743c402ac9ead047b74c7672167da1beb780
a6c6fd0c6a76224aae8765715c3f7a87c7b96c6b
/src/main/java/com/mycompany/mavenproject1/QueryInit.java
b5d3bda09615926aef3b2c246107f9870f935801
[]
no_license
marcosgf/mavenproject1
73add1379e0dd73e6f70fa75bc489de9dab9b84b
bf98ba514681e2761881488b1a7681c0865fe92f
refs/heads/master
2021-01-19T23:53:31.373809
2017-04-25T19:35:29
2017-04-25T19:35:29
89,048,594
0
0
null
null
null
null
UTF-8
Java
false
false
3,473
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.mavenproject1; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; /** * * @author marcos */ public class QueryInit { private String base; private ArrayList<CFQuery> querys; public QueryInit(String base) { this.base = base; this.querys = new ArrayList<CFQuery>(); } public ArrayList<CFQuery> getQuerys() throws IOException { File f = new File(this.base); String[] files = f.list(); String line[], auxRelevants[]; String tagAux = " "; String aux = "", id = null, description, nrRelevant = null, relevants = ""; int qr = 0; for (String file : files) { if (file.equals("cfquery")) { String text = new String(Files.readAllBytes(Paths.get(this.base + file)), StandardCharsets.UTF_8); line = text.split("\n"); for (int i = 0; i < line.length; i++) { tagAux = (String) line[i].subSequence(0, 3); while (!tagAux.equals("RD ")) { switch (tagAux) { case "QN ": id = line[i].replace(tagAux, ""); break; case "QU ": aux = line[i].replace(tagAux, ""); break; case "NR ": nrRelevant = line[i].replace(tagAux, ""); break; case " ": aux += line[i].replace(tagAux, " "); default: break; } i++; tagAux = (String) line[i].subSequence(0, 3); } description = aux; this.querys.add(new CFQuery(id, description, nrRelevant)); relevants += " "+line[i].replace(tagAux, " ") + " "; i++; while (!line[i].equals("") && !line[i].equals(" ") && !line[i].equals(" ") && !line[i].equals(" ")&& !line[i].equals(" ")&& !line[i].equals(" ")&& !line[i].equals(" ")) { relevants += " "+line[i]+" "; i++; } relevants = relevants.replace(" ", " "); relevants = relevants.replace(" ", " "); relevants = relevants.replace(" ", " "); relevants = relevants.replace(" ", " "); auxRelevants = relevants.split(" "); for (int j = 1; j < auxRelevants.length; j += 2) { this.querys.get(qr).addRelevantScore(auxRelevants[j], auxRelevants[j + 1]); } //this.querys.get(qr).PrintQuery(); qr++; aux = ""; relevants = ""; } } } return this.querys; } }
[ "marcosvgf95@gmail.com" ]
marcosvgf95@gmail.com
9ada0536be77a736097d370a74f05a6bb5bbe893
3000bda99ff5f5863744b917d81b405aedf7137c
/TitlesFrame.java
c19501e481cd15bd57b71e4deebe70c75cf35667
[]
no_license
DiOSParK1/lab-3
123dc5e273c1545c26fd1075467f08e4741b5b9f
07f26566ca0ec00add528382bc4220bf326cf873
refs/heads/master
2020-03-18T12:35:57.307722
2018-05-24T16:08:26
2018-05-24T16:08:26
134,733,707
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
import javax.swing.*; /** *метод для выбора параметров TitlesFrame */ class TitlesFrame extends JFrame { private TitlesFrame() { initUI(); } private void initUI() { setTitle("Кривые фигуры"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); add(new TitlesPanel(17)); setSize(350, 350); setLocationRelativeTo(null); } /** * Метод main для запуска программы */ public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { TitlesFrame ps = new TitlesFrame(); ps.setVisible(true); } }); } }
[ "noreply@github.com" ]
noreply@github.com
d969fc06b4b9fbde1b8df9f78c39c7b0a52f96a9
f85f9b3f65d5a15d4df55764e07f7bc768070bc1
/monster-web/src/test/java/br/gov/prodepa/monster/project/business/BookmarkBCTest.java
5a57466c14b27cc8348b6574fec99791d4d2c106
[]
no_license
thiagoprodepa/project_monster_demoiselle
3e57cb9f8fe353f72b98b77a6617046e70d49800
aa9f667d416fa9a1e775b738727c39ab3382c347
refs/heads/master
2021-01-13T02:19:04.591695
2012-08-24T19:48:40
2012-08-24T19:48:40
5,614,874
0
1
null
null
null
null
UTF-8
Java
false
false
2,255
java
package br.gov.prodepa.monster.project.business; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.List; import javax.inject.Inject; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import br.gov.frameworkdemoiselle.junit.DemoiselleRunner; import br.gov.prodepa.monster.project.business.BookmarkBC; import br.gov.prodepa.monster.project.domain.Bookmark; @RunWith(DemoiselleRunner.class) public class BookmarkBCTest { @Inject private BookmarkBC bookmarkBC; @Before public void before() { for (Bookmark bookmark : bookmarkBC.findAll()) { bookmarkBC.delete(bookmark.getId()); } } @Test public void testLoad() { bookmarkBC.load(); List<Bookmark> listaBookmarks = bookmarkBC.findAll(); assertNotNull(listaBookmarks); assertEquals(10, listaBookmarks.size()); } @Test public void testInsert() { Bookmark bookmark = new Bookmark("Demoiselle Portal", "http://www.frameworkdemoiselle.gov.br"); bookmarkBC.insert(bookmark); List<Bookmark> listaBookmarks = bookmarkBC.findAll(); assertNotNull(listaBookmarks); assertEquals(1, listaBookmarks.size()); } @Test public void testDelete() { Bookmark bookmark = new Bookmark("Demoiselle Portal", "http://www.frameworkdemoiselle.gov.br"); bookmarkBC.insert(bookmark); List<Bookmark> listaBookmarks = bookmarkBC.findAll(); assertNotNull(listaBookmarks); assertEquals(1, listaBookmarks.size()); bookmarkBC.delete(bookmark.getId()); listaBookmarks = bookmarkBC.findAll(); assertEquals(0, listaBookmarks.size()); } @Test public void testUpdate() { Bookmark bookmark = new Bookmark("Demoiselle Portal", "http://www.frameworkdemoiselle.gov.br"); bookmarkBC.insert(bookmark); List<Bookmark> listaBookmarks = bookmarkBC.findAll(); Bookmark bookmark2 = (Bookmark)listaBookmarks.get(0); assertNotNull(listaBookmarks); assertEquals("Demoiselle Portal", bookmark2.getDescription()); bookmark2.setDescription("Demoiselle Portal alterado"); bookmarkBC.update(bookmark2); listaBookmarks = bookmarkBC.findAll(); Bookmark bookmark3 = (Bookmark)listaBookmarks.get(0); assertEquals("Demoiselle Portal alterado", bookmark3.getDescription()); } }
[ "tfs.capanema@gmail.com" ]
tfs.capanema@gmail.com
95af9a95a50b3c7b7dfcd4d71a5bb87ec48bcf43
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/brandservice/ui/timeline/a$6.java
2ac9285cb32e4794bef5ca6cb60a109ad143e9e1
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
1,452
java
package com.tencent.mm.plugin.brandservice.ui.timeline; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.brandservice.ui.timeline.video.a.c; import com.tencent.mm.storage.q; final class a$6 implements View.OnClickListener { a$6(a parama, int paramInt, q paramq) { } public final void onClick(View paramView) { AppMethodBeat.i(14103); int i = (int)(System.currentTimeMillis() / 1000L); if ((this.jEo > 0) || (!this.jEl.xHT)); for (paramView = paramView.findViewById(2131821842); ; paramView = paramView.findViewById(2131821404)) { Bundle localBundle = new Bundle(); localBundle.putInt("biz_video_scene", 90); localBundle.putInt("biz_video_subscene", a.a(this.jNG).getIntent().getIntExtra("KOpenArticleSceneFromScene", 10000)); localBundle.putInt("geta8key_scene", 56); c.a(a.a(this.jNG), this.jEl.field_msgId, this.jEl.field_msgSvrId, this.jEo, paramView, localBundle); a.f(this.jNG).a(this.jEl, this.jEo, i); AppMethodBeat.o(14103); return; } } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.brandservice.ui.timeline.a.6 * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
2ed048239b50603f1d2e8228c4d1fa9375ca6607
bc4a0b036000832b5c1c1e902afa21f41722b35f
/Main.java
0b97789975ace04ff03a80cd3fcd414012d84801
[]
no_license
ekta1502/repo4
df5f2d17f00e7c38127b65d4c309eb9a8d570d91
bc589862f8262269f887ecab636fb854b6064562
refs/heads/master
2020-09-04T10:39:19.387567
2019-11-05T23:54:53
2019-11-05T23:54:53
219,712,314
0
0
null
null
null
null
UTF-8
Java
false
false
102
java
public class Main{ public static void main(String args[]){ System.out.println("Hello World!"); } }
[ "ekta8652@gmail.com" ]
ekta8652@gmail.com
a51e9c314ee3f4c41515ebc92ea01e9519b5aa13
9ce31055cc5467c2655f60030103beb502db125b
/spring/core/Annotations/src/com/javaconfig/annon/JavaConfig.java
21fee01e00befcbecb28f3a397d3b3bd8e1713c9
[]
no_license
manishfullDev/All-Project
969cfadbb608a76054c675fd854fb2c05f5f8ee2
888f852aea6f4271d8a2737bf6ab1eec7525bad2
refs/heads/master
2023-08-03T10:55:45.437393
2020-04-07T06:44:08
2020-04-07T06:44:08
253,693,976
1
0
null
2023-07-23T11:10:07
2020-04-07T05:17:53
Java
UTF-8
Java
false
false
488
java
package com.javaconfig.annon; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Scope; @Configuration public class JavaConfig { @Bean(name = { "sportsBike", "bike", "raceBike" }) @Scope("prototype") @Lazy public Bike bike() { Bike bike = null; System.out.println("bike()"); bike = new Bike(); return bike; } }
[ "manish.vishwakarma@s-force.org" ]
manish.vishwakarma@s-force.org
282405c52425eb8952cb326fd419eef6ba1db58b
05f297eb4246bd3e71cc923de5af24c2efb0da72
/src/main/java/com/epam/hostel/model/room/Room.java
3bfbd0506ec76a0158f269f9c93d526ec3a2ab44
[]
no_license
Vershal-Igor/Final-project
7b3c42e11b9741e6307ada0b7e049b225d79bbe8
9bb6f6230375b671bc3c2bd5584f92870f46d0aa
refs/heads/master
2021-06-30T13:11:54.406560
2017-09-17T17:15:29
2017-09-17T17:15:29
103,846,665
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
package com.epam.hostel.model.room; import com.epam.hostel.model.entity.Entity; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Date; /** * Class stores the room object with fields: * <b>roomNumber</b> * <b>roomPlaces</b> * <b>surname</b> * <b>price</b> * * @author Vershal * @version 1.0 */ public class Room extends Entity implements Serializable { private byte roomNumber; private byte roomPlaces; private BigDecimal price; public byte getRoomNumber() { return roomNumber; } public void setRoomNumber(byte roomNumber) { this.roomNumber = roomNumber; } public byte getRoomPlaces() { return roomPlaces; } public void setRoomPlaces(byte roomPlaces) { this.roomPlaces = roomPlaces; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } @Override public String toString() { return "Room{" + "roomNumber=" + roomNumber + ", roomPlaces=" + roomPlaces + ", price=" + price + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Room room = (Room) o; if (roomNumber != room.roomNumber) return false; if (roomPlaces != room.roomPlaces) return false; return price != null ? price.equals(room.price) : room.price == null; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (int) roomNumber; result = 31 * result + (int) roomPlaces; result = 31 * result + (price != null ? price.hashCode() : 0); return result; } }
[ "igorvershal@gmail.com" ]
igorvershal@gmail.com
042a5f20588410e93d84e4ec32ddff26ea196bbc
59083c6ffd10eca03fbc346df92d23878b0ecac3
/spring-boot-mbp/src/test/java/top/flobby/boot/mbp/mapper/UserMapperTest.java
5211e2e2f0f9335eecc1fc6aa63a4983d48a2a21
[]
no_license
Flobby949/spring-basic
181dec1b04d1a98e8ec4691790a1a140c1c6b210
6dfe896df8cd559fc8b30c118e4a1eb1d355f5a0
refs/heads/master
2023-07-22T09:46:54.204916
2021-04-28T08:08:06
2021-04-28T08:08:06
350,594,450
0
0
null
null
null
null
UTF-8
Java
false
false
8,280
java
package top.flobby.boot.mbp.mapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import top.flobby.boot.mbp.domain.User; import javax.annotation.Resource; import java.util.*; import static org.junit.jupiter.api.Assertions.assertEquals; @SpringBootTest @Slf4j class UserMapperTest { @Resource private UserMapper userMapper; @Test void save() { User user = User.builder() .name("fffffff") .age(20) .email("fff@qq.com") .build(); int rows = userMapper.insert(user); assertEquals(1, rows); } @Test void deleteById() { int rows = userMapper.deleteById(1376708510928080897L); assertEquals(1, rows); } @Test void selectById() { User user = userMapper.selectById(1376706211665215490L); log.info("###########" + user); assertEquals(1376706211665215490L, user.getId()); } @Test void batchDelete() { List<Long> ids = new ArrayList<>(); ids.add(1376701712674381825L); ids.add(1376703607883218945L); ids.add(1376703654687473665L); int rows = userMapper.deleteBatchIds(ids); assertEquals(3, rows); } @Test void update() { User user = User.builder() .id(1376706211665215490L) .name("update") .age(19) .email("update@qq.com") .build(); int rows = userMapper.updateById(user); assertEquals(1, rows); } @Test void deleteByMap() { Map<String, Object> map = new HashMap<>(); // map.put("name", "fff"); map.put("age", 23); int rows = userMapper.deleteByMap(map); assertEquals(2, rows); } @Test void selectByMap() { Map<String, Object> map = new HashMap<>(); map.put("name", "bbb"); List<User> userList = userMapper.selectByMap(map); userList.forEach(System.out::println); assertEquals(1, userList.size()); } @Test void selectList() { QueryWrapper<User> query = new QueryWrapper<>(); query.select("name", "age") //指定查询结果字段 .in("age", Arrays.asList(18, 19, 20)) .last("limit 2"); List<User> list = userMapper.selectList(query); list.forEach(System.out::println); assertEquals(2, list.size()); } @Test void selectMap() { QueryWrapper<User> query = new QueryWrapper<>(); query.like("name", "J%") //like是MP的条件构造器,表示"模糊查询" .lt("age", 30) //lt是MP的条件构造器,表示"⼩于"关系 .select("name", "age"); List<Map<String, Object>> maps = userMapper.selectMaps(query); maps.forEach(System.out::println); assertEquals(2, maps.size()); } @Test void updateEq() { UpdateWrapper<User> update = new UpdateWrapper<>(); update.eq("name", "Jack").eq("age", 29); //eq是MP的条件构造器,表示"等于"关系 User user = new User(); user.setAge(27); user.setEmail("hadoopcn2@163.com"); int rows = userMapper.update(user, update); System.out.println("影响记录数:" + rows); assertEquals(1, rows); } @Test void selectLike() { String name = "Jack"; //name不为空 String email = ""; //email为空串 QueryWrapper<User> query = new QueryWrapper<>(); query.like(StringUtils.isNotEmpty(name), "name", name) //因为email为空串,该条件未⽣效 .like(StringUtils.isNotEmpty(email), "email", email); List<User> list = userMapper.selectList(query); list.forEach(System.out::println); } @Test void selectAllEq() { //构造条件 QueryWrapper<User> query = new QueryWrapper<>(); Map<String, Object> params = new HashMap<>(); params.put("name", "Jack"); params.put("age", 18); params.put("email", null); // query.allEq(params,false); query.allEq((k, v) -> !k.equals("name"), params, false); List<User> list = userMapper.selectList(query); list.forEach(System.out::println); assertEquals(1, list.size()); } @Test void selectLambda() { LambdaQueryWrapper<User> lambdaQ = new QueryWrapper<User>().lambda(); // LambdaQueryWrapper<User> lambdaQ = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<User> lambdaQ = Wrappers.lambdaQuery(); // lambdaQ.like(User::getName, "Jack") // .lt(User::getAge, 30); // List<User> list = userMapper.selectList(lambdaQ); List<User> list = new LambdaQueryChainWrapper<User> (userMapper) .likeRight(User::getName, "Jack") .and(q -> q.lt(User::getAge, 40) .or() .isNotNull(User::getEmail) ) .list(); list.forEach(System.out::println); assertEquals(1, list.size()); } @Test public void testCustomSQL() { String name = "Jack"; //name不为空 String email = ""; //email为空串 List<User> list = userMapper.findUser(name,email); list.forEach(System.out::println); assertEquals(1, list.size()); } @Test public void testCustomSQL2() { LambdaQueryWrapper<User> query = new LambdaQueryWrapper<>(); query.eq(User::getName, "eee"); // 注解实现 List<User> list = userMapper.selectAllByAnnotations(query); // xml实现 // List<User> list = userMapper.selectAllByXml(query); list.forEach(System.out::println); } @Test public void testSelectByPage() { LambdaQueryWrapper<User> query = new LambdaQueryWrapper<>(); query.ge(User::getAge, 10) //查询条件:年龄⼤于10 .orderByDesc(User::getAge); //按照年龄的倒序排序 Page<User> page = new Page<>(1, 5); //查询第1⻚,每⻚5条数据 userMapper.selectPage(page, query); //page分⻚信息,query查询条件 System.out.println("总⻚数:" + page.getPages()); System.out.println("总记录数:" + page.getTotal()); // 分⻚返回的对象与传⼊的对象是同⼀个 List<User> list = page.getRecords(); list.forEach(System.out::println); assertEquals(5, list.size()); } // Active Record模式 @Test public void testInsert() { User user = new User(); user.setName("springboot"); user.setAge(18); user.setEmail("springboot@163.com"); boolean success = user.insert(); assertEquals(true, success); } @Test public void testSelect() { User user = new User(); List<User> users = user.selectAll(); users.forEach(System.out::println); assertEquals(10,users.size()); } @Test public void testUpdate() { User user = User.builder() .id(1283915378849751041L) .name("mbp") .age(30) .build(); boolean success = user.insertOrUpdate(); assertEquals(true, success); } @Test public void testDelete() { User user = new User(); user.setId(1283915378849751041L); boolean success = user.deleteById(); assertEquals(true, success); } @Test public void testInsertAutoFill() { User user = User.builder().name("软件学⼦").age(19).email("soft@niit.edu.cn").build(); int row = userMapper.insert(user); assertEquals(1, row); } }
[ "2541226493@qq.com" ]
2541226493@qq.com
4e30393e468805890a709774f33803f495551145
6c539cd127a6c77291ab65f0649aa1ad1a676e73
/app/src/main/java/com/example/foxtrotfrontend/UpdateActivity.java
8a126e2adb89c89c2c01f538e4c4e982204745c4
[]
no_license
johncooper199/FoxtrotFrontend
99f38ab2a52c41237c97632b666ea24ec9b5c441
d81a657f018e47200e7f7288b76b46556022a798
refs/heads/master
2021-01-07T07:29:06.243590
2020-03-04T13:40:14
2020-03-04T13:40:14
241,619,950
0
0
null
null
null
null
UTF-8
Java
false
false
4,009
java
package com.example.foxtrotfrontend; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.NavUtils; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.Toast; import java.util.Set; public class UpdateActivity extends AppCompatActivity { String[] reports; String[] dummy = {"12/01/2018 04:01 AM - Bean rust", "24/08/2018 09:20 PM - Chocolate spot", "22/04/2018 04:21 AM - Downy mildew", "11/01/2018 02:57 AM - Pea and been weevil", "10/07/2018 04:00 AM - Chocolate spot", "11/01/2018 03:53 PM - Pea and been weevil", "20/05/2018 07:14 PM - Pea and been weevil", "22/08/2018 06:36 PM - Aphid", "13/09/2018 09:37 AM - Chocolate spot", "19/07/2018 03:53 PM - Aphid", "09/05/2018 09:25 AM - Chocolate spot", "16/07/2018 09:23 AM - Aphid", "20/09/2018 12:10 PM - Bean seed beetle", "25/05/2018 07:47 AM - Aphid", "01/08/2018 06:54 AM - Bean seed beetle", "22/12/2018 01:54 AM - Chocolate spot", "24/03/2018 04:46 PM - Bean rust", "06/05/2018 11:26 PM - Bean seed beetle", "14/12/2018 01:05 PM - Bean seed beetle", "15/12/2018 12:15 AM - Bean seed beetle"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_update); Intent intent = getIntent(); getSupportActionBar().setTitle("Update Report"); reports = getMyDataset(); //Creating the instance of ArrayAdapter containing list of fruit names ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.select_dialog_item, reports); //Getting the instance of AutoCompleteTextView AutoCompleteTextView actv = (AutoCompleteTextView) findViewById(R.id.reportName); actv.setThreshold(1);//will start working from first character actv.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView // Setting Button to Go Back To Main Once Sent Button buttonSend = (Button) findViewById(R.id.Send); buttonSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { sendIntent(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); return super.onOptionsItemSelected(item); } private void sendIntent() { NavUtils.navigateUpFromSameTask(this); Toast.makeText(this, "Report Sent", Toast.LENGTH_LONG).show(); } public String[] getMyDataset(){ Set<String> idvals; SharedPreferences sharedPreferences = getSharedPreferences("REPORTS", MODE_PRIVATE); idvals = sharedPreferences.getStringSet("MYREPORTS", null); String[] result; if (idvals == null){ result = dummy; } else{ result = new String[idvals.size()]; int current = 0; for (String item : idvals){ result[current] = item; } } return result; } }
[ "mail@johnathancooper.co.uk" ]
mail@johnathancooper.co.uk
ffed96294fe67b9a4966614390ea8f84508aefc0
4630fd2d1c6d8fa13c8e5fd439c3472af779ba0a
/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java
6214044a5fe9ea8e6607a371972c2631ad41477e
[ "Apache-2.0" ]
permissive
ppalaga/GMavenPlus
ae6e5e3c186fd6d60257693fcbd35bc778c9707f
7c84ff2f66227eb90fc17cacdc2692b258536b16
refs/heads/master
2020-07-08T19:07:21.296177
2019-07-14T15:30:20
2019-07-14T15:30:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,488
java
/* * Copyright (C) 2011 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 org.codehaus.gmavenplus.mojo; import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.gmavenplus.groovyworkarounds.DotGroovyFile; import org.codehaus.gmavenplus.model.Version; import org.codehaus.gmavenplus.util.FileUtils; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.util.*; import static org.codehaus.gmavenplus.util.ReflectionUtils.*; /** * The base generate stubs mojo, which all generate stubs mojos extend. * * @author Keegan Witt * @since 1.0-beta-1 */ public abstract class AbstractGenerateStubsMojo extends AbstractGroovyStubSourcesMojo { /* * TODO: support Groovy 1.5.0 - 1.8.1? * For some reason, the JavaStubCompilationUnit is silently not creating my stubs * (although it does create the target directory) when I use other versions. */ /** * Groovy 3.0.0 beta-1 version. */ protected static final Version GROOVY_3_0_0_BETA1 = new Version(3, 0, 0, "beta-1"); /** * Groovy 3.0.0 alpha-4 version. */ protected static final Version GROOVY_3_0_0_ALPHA4 = new Version(3, 0, 0, "alpha-4"); /** * Groovy 3.0.0 alpha-2 version. */ protected static final Version GROOVY_3_0_0_ALPHA2 = new Version(3, 0, 0, "alpha-2"); /** * Groovy 3.0.0 alpha-1 version. */ protected static final Version GROOVY_3_0_0_ALPHA1 = new Version(3, 0, 0, "alpha-1"); /** * Groovy 2.6.0 alpha-4 version. */ protected static final Version GROOVY_2_6_0_ALPHA4 = new Version(2, 6, 0, "alpha-4"); /** * Groovy 2.6.0 alpha-1 version. */ protected static final Version GROOVY_2_6_0_ALPHA1 = new Version(2, 6, 0, "alpha-1"); /** * Groovy 2.5.7 version. */ protected static final Version GROOVY_2_5_7 = new Version(2, 5, 7); /** * Groovy 2.5.3 version. */ protected static final Version GROOVY_2_5_3 = new Version(2, 5, 3); /** * Groovy 2.3.3 version. */ protected static final Version GROOVY_2_3_3 = new Version(2, 3, 3); /** * Groovy 2.1.3 version. */ protected static final Version GROOVY_2_1_3 = new Version(2, 1, 3); /** * Groovy 2.9.0 beta-1 version. */ protected static final Version GROOVY_1_9_0_BETA1 = new Version(1, 9, 0, "beta-1"); /** * Groovy 1.9.0 beta-3 version. */ protected static final Version GROOVY_1_9_0_BETA3 = new Version(1, 9, 0, "beta-3"); /** * Groovy 1.8.2 version. */ protected static final Version GROOVY_1_8_2 = new Version(1, 8, 2); /** * Groovy 1.8.3 version. */ protected static final Version GROOVY_1_8_3 = new Version(1, 8, 3); /** * The encoding of source files. */ @Parameter(defaultValue = "${project.build.sourceEncoding}") protected String sourceEncoding; /** * The Groovy compiler bytecode compatibility. One of * <ul> * <li>1.4</li> * <li>1.5</li> * <li>1.6</li> * <li>1.7</li> * <li>1.8</li> * <li>9</li> * <li>10</li> * <li>11</li> * <li>12</li> * <li>13</li> * </ul> * Using 1.6 or 1.7 requires Groovy &gt;= 2.1.3. * Using 1.8 requires Groovy &gt;= 2.3.3. * Using 9 requires Groovy &gt;= 2.5.3, or Groovy &gt;= 2.6.0 alpha 4, or Groovy &gt;= 3.0.0 alpha 2. * Using 9 with invokedynamic requires Groovy &gt;= 2.5.3, or Groovy &gt;= 3.0.0 alpha 2, but not any 2.6 versions. * Using 10, 11, or 12 requires Groovy &gt;= 2.5.3, or Groovy &gt;= 3.0.0 alpha 4, but not any 2.6 versions. * Using 13 requires Groovy &gt;= 2.5.7, or Groovy &gt;= 3.0.0-beta-1, but not any 2.6 versions. * * @since 1.0-beta-3 */ @Parameter(property = "maven.compiler.target", defaultValue = "1.8") protected String targetBytecode; /** * Whether Groovy compiler should be set to debug. */ @Parameter(defaultValue = "false") protected boolean debug; /** * Whether Groovy compiler should be set to verbose. */ @Parameter(defaultValue = "false") protected boolean verbose; /** * Groovy compiler warning level. Should be one of: * <dl> * <dt>0</dt> * <dd>None</dd> * <dt>1</dt> * <dd>Likely Errors</dd> * <dt>2</dt> * <dd>Possible Errors</dd> * <dt>3</dt> * <dd>Paranoia</dd> * </dl> */ @Parameter(defaultValue = "1") protected int warningLevel; /** * Groovy compiler error tolerance (the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted). */ @Parameter(defaultValue = "0") protected int tolerance; /** * Whether to use a shared classloader that includes both the project classpath and plugin classpath. * Use only if you know what you're doing. * * @since 1.6.3 */ @Parameter(defaultValue = "false") protected boolean useSharedClassLoader; /** * Whether the bytecode version has preview features enabled (JEP 12). * Requires Groovy &gt;= 3.0.0-beta-1 or Groovy &gt;= 2.5.7, but not any 2.6 versions and Java &gt;= 12. * * @since 1.7.1 */ @Parameter(defaultValue = "false") protected boolean previewFeatures; /** * Performs the stub generation on the specified source files. * * @param stubSources the sources to perform stub generation on * @param classpath The classpath to use for compilation * @param outputDirectory the directory to write the stub files to * @throws ClassNotFoundException when a class needed for stub generation cannot be found * @throws InstantiationException when a class needed for stub generation cannot be instantiated * @throws IllegalAccessException when a method needed for stub generation cannot be accessed * @throws InvocationTargetException when a reflection invocation needed for stub generation cannot be completed * @throws MalformedURLException when a classpath element provides a malformed URL */ protected synchronized void doStubGeneration(final Set<File> stubSources, final List<?> classpath, final File outputDirectory) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException, MalformedURLException { if (stubSources == null || stubSources.isEmpty()) { getLog().info("No sources specified for stub generation. Skipping."); return; } setupClassWrangler(classpath, useSharedClassLoader); logPluginClasspath(); classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal()); if (groovyVersionSupportsAction()) { verifyGroovyVersionSupportsTargetBytecode(); } else { getLog().error("Your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support stub generation. The minimum version of Groovy required is " + minGroovyVersion + ". Skipping stub generation."); return; } // get classes we need with reflection Class<?> compilerConfigurationClass = classWrangler.getClass("org.codehaus.groovy.control.CompilerConfiguration"); Class<?> javaStubCompilationUnitClass = classWrangler.getClass("org.codehaus.groovy.tools.javac.JavaStubCompilationUnit"); Class<?> groovyClassLoaderClass = classWrangler.getClass("groovy.lang.GroovyClassLoader"); // setup stub generation options Object compilerConfiguration = setupCompilerConfiguration(outputDirectory, compilerConfigurationClass); Object groovyClassLoader = invokeConstructor(findConstructor(groovyClassLoaderClass, ClassLoader.class, compilerConfigurationClass), classWrangler.getClassLoader(), compilerConfiguration); Object javaStubCompilationUnit = invokeConstructor(findConstructor(javaStubCompilationUnitClass, compilerConfigurationClass, groovyClassLoaderClass, File.class), compilerConfiguration, groovyClassLoader, outputDirectory); // add Groovy sources addGroovySources(stubSources, compilerConfigurationClass, javaStubCompilationUnitClass, compilerConfiguration, javaStubCompilationUnit); // generate the stubs invokeMethod(findMethod(javaStubCompilationUnitClass, "compile"), javaStubCompilationUnit); } /** * Sets up the CompilerConfiguration to use for stub generation. * * @param outputDirectory the directory to write the stub files to * @param compilerConfigurationClass the CompilerConfiguration class * @return the CompilerConfiguration to use for stub generation * @throws InstantiationException when a class needed for stub generation cannot be instantiated * @throws IllegalAccessException when a method needed for stub generation cannot be accessed * @throws InvocationTargetException when a reflection invocation needed for stub generation cannot be completed */ protected Object setupCompilerConfiguration(final File outputDirectory, final Class<?> compilerConfigurationClass) throws InvocationTargetException, IllegalAccessException, InstantiationException { Object compilerConfiguration = invokeConstructor(findConstructor(compilerConfigurationClass)); invokeMethod(findMethod(compilerConfigurationClass, "setDebug", boolean.class), compilerConfiguration, debug); invokeMethod(findMethod(compilerConfigurationClass, "setVerbose", boolean.class), compilerConfiguration, verbose); invokeMethod(findMethod(compilerConfigurationClass, "setWarningLevel", int.class), compilerConfiguration, warningLevel); invokeMethod(findMethod(compilerConfigurationClass, "setTolerance", int.class), compilerConfiguration, tolerance); invokeMethod(findMethod(compilerConfigurationClass, "setTargetBytecode", String.class), compilerConfiguration, targetBytecode); if (previewFeatures) { if (isJavaSupportPreviewFeatures()) { if (groovyOlderThan(GROOVY_2_5_7) || (groovyAtLeast(GROOVY_2_6_0_ALPHA1) && groovyOlderThan(GROOVY_3_0_0_BETA1))) { getLog().warn("Requested to use preview features, but your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support it (must be " + GROOVY_2_5_7 + "/" + GROOVY_3_0_0_BETA1 + " or newer. No 2.6 version is supported. Ignoring previewFeatures parameter."); } else { invokeMethod(findMethod(compilerConfigurationClass, "setPreviewFeatures", boolean.class), compilerConfiguration, previewFeatures); } } else { getLog().warn("Requested to use to use preview features, but your Java version (" + getJavaVersionString() + ") doesn't support it. Ignoring previewFeatures parameter."); } } if (sourceEncoding != null) { invokeMethod(findMethod(compilerConfigurationClass, "setSourceEncoding", String.class), compilerConfiguration, sourceEncoding); } Map<String, Object> options = new HashMap<String, Object>(); options.put("stubDir", outputDirectory); options.put("keepStubs", Boolean.TRUE); invokeMethod(findMethod(compilerConfigurationClass, "setJointCompilationOptions", Map.class), compilerConfiguration, options); return compilerConfiguration; } /** * Adds the Groovy sources to the CompilationUnit. * * @param stubSources the sources to perform stub generation on * @param compilerConfigurationClass the CompilerConfiguration class * @param javaStubCompilationUnitClass the JavaStubCompilationUnit class * @param compilerConfiguration the CompilerConfiguration to use for stub generation * @param javaStubCompilationUnit the JavaStubCompilationUnit to use for stub generation * @throws IllegalAccessException when a method needed for stub generation cannot be accessed * @throws InvocationTargetException when a reflection invocation needed for stub generation cannot be completed */ protected void addGroovySources(final Set<File> stubSources, final Class<?> compilerConfigurationClass, final Class<?> javaStubCompilationUnitClass, final Object compilerConfiguration, final Object javaStubCompilationUnit) throws InvocationTargetException, IllegalAccessException { Set<String> scriptExtensions = new HashSet<String>(); for (File stubSource : stubSources) { scriptExtensions.add(FileUtils.getFileExtension(stubSource)); } getLog().debug("Detected Groovy file extensions: "+ scriptExtensions + "."); if (supportsSettingExtensions()) { invokeMethod(findMethod(compilerConfigurationClass, "setScriptExtensions", Set.class), compilerConfiguration, scriptExtensions); } getLog().debug("Adding Groovy to generate stubs for:"); Method addSource = findMethod(javaStubCompilationUnitClass, "addSource", File.class); for (File stubSource : stubSources) { getLog().debug(" " + stubSource); if (supportsSettingExtensions()) { invokeMethod(addSource, javaStubCompilationUnit, stubSource); } else { DotGroovyFile dotGroovyFile = new DotGroovyFile(stubSource).setScriptExtensions(scriptExtensions); invokeMethod(addSource, javaStubCompilationUnit, dotGroovyFile); } } } /** * Determines whether the version of Groovy supports stub generation. * * @return <code>true</code> if the version of Groovy supports stub generation, <code>false</code> otherwise */ protected boolean supportsSettingExtensions() { return groovyAtLeast(GROOVY_1_8_3) && (groovyOlderThan(GROOVY_1_9_0_BETA1) || groovyNewerThan(GROOVY_1_9_0_BETA3)); } /** * Logs the stubs that have been generated. * * @param outputDirectory the output directory for the stubs */ protected void logGeneratedStubs(File outputDirectory) { Set<File> stubs = getStubs(outputDirectory); getLog().info("Generated " + stubs.size() + " stub" + (stubs.size() > 1 || stubs.size() == 0 ? "s" : "") + "."); } /** * This is a fix for http://jira.codehaus.org/browse/MGROOVY-187 * It modifies the dates of the created stubs to 1/1/1970, ensuring that the Java compiler will not overwrite perfectly * good compiled Groovy just because it has a newer source stub. Basically, this prevents the stubs from causing a * side-effect with the Java compiler, but still allows stubs to work with JavaDoc. * * @param stubs the files on which to reset the modified date */ protected void resetStubModifiedDates(final Set<File> stubs) { for (File stub : stubs) { boolean success = stub.setLastModified(0L); if (!success) { getLog().warn("Unable to set modified time on stub " + stub.getAbsolutePath() + "."); } } } /** * Throws an exception if targetBytecode is not supported with this version of Groovy. That is, when Groovy added * the option to org.codehaus.groovy.control.CompilerConfiguration and used it in * org.codehaus.groovy.classgen.asm.WriterController. */ protected void verifyGroovyVersionSupportsTargetBytecode() { if ("13".equals(targetBytecode)) { if (groovyOlderThan(GROOVY_2_5_7) || (groovyAtLeast(GROOVY_2_6_0_ALPHA1) && groovyOlderThan(GROOVY_3_0_0_BETA1))) { throw new IllegalArgumentException("Target bytecode 13 requires Groovy " + GROOVY_2_5_7 + "/" + GROOVY_3_0_0_BETA1 + " or newer. No 2.6 version is supported."); } } else if ("12".equals(targetBytecode) || "11".equals(targetBytecode) || "10".equals(targetBytecode)) { if (groovyOlderThan(GROOVY_2_5_3) || (groovyAtLeast(GROOVY_2_6_0_ALPHA1) && groovyOlderThan(GROOVY_3_0_0_ALPHA4))) { throw new IllegalArgumentException("Target bytecode 10, 11, or 12 requires Groovy " + GROOVY_2_5_3 + "/" + GROOVY_3_0_0_ALPHA4 + " or newer. No 2.6 version is supported."); } } else if ("9".equals(targetBytecode)) { if (!isGroovyIndy() && (groovyOlderThan(GROOVY_2_5_3) || (groovyAtLeast(GROOVY_2_6_0_ALPHA1) && groovyOlderThan(GROOVY_2_6_0_ALPHA4)) || (groovyAtLeast(GROOVY_3_0_0_ALPHA1) && groovyOlderThan(GROOVY_3_0_0_ALPHA2)))) { throw new IllegalArgumentException("Target bytecode 9 requires Groovy " + GROOVY_2_5_3 + "/" + GROOVY_2_6_0_ALPHA4 + "/" + GROOVY_3_0_0_ALPHA2 + " or newer."); } else if (isGroovyIndy() && (groovyOlderThan(GROOVY_2_5_3) || (groovyAtLeast(GROOVY_2_6_0_ALPHA1) && groovyOlderThan(GROOVY_3_0_0_ALPHA4)))) { throw new IllegalArgumentException("Target bytecode 9 with invokedynamic requires Groovy " + GROOVY_2_5_3 + "/" + GROOVY_3_0_0_ALPHA4 + " or newer. No 2.6 version is supported."); } } else if ("1.8".equals(targetBytecode)) { if (groovyOlderThan(GROOVY_2_3_3)) { throw new IllegalArgumentException("Target bytecode 1.8 requires Groovy " + GROOVY_2_3_3 + " or newer."); } } else if ("1.7".equals(targetBytecode) || "1.6".equals(targetBytecode)) { if (groovyOlderThan(GROOVY_2_1_3)) { throw new IllegalArgumentException("Target bytecode 1.6 and 1.7 require Groovy " + GROOVY_2_1_3 + " or newer."); } } else if (!"1.5".equals(targetBytecode) && !"1.4".equals(targetBytecode)) { throw new IllegalArgumentException("Unrecognized target bytecode: '" + targetBytecode + "'."); } } }
[ "keeganwitt@gmail.com" ]
keeganwitt@gmail.com
a2a0224badc0dab74a7eb08a6266809e1d126b9d
d2c41c2f0edaba27d09b70b6d49cc6afd7263937
/src/com/shubham/rastogi/dto/TicTacToe.java
c2b37ca6256984c0482dd7971761df5b269a1b17
[]
no_license
scryptobyte/TicToe-Game
6ce9900665a6847d9ca94428c052879941749aa8
425a0f70d24202b1bf107c0a27091d32971b3f41
refs/heads/master
2020-05-30T04:40:41.872553
2019-05-31T07:34:22
2019-05-31T07:34:22
189,544,334
0
0
null
null
null
null
UTF-8
Java
false
false
1,064
java
package com.shubham.rastogi.dto; public class TicTacToe { private int player; private int[][] board; private boolean isEmpty; public int getPlayer() { return player; } public void setPlayer(int player) { this.player = player; } public int[][] getBoard() { return board; } public void setBoard(int[][] board) { this.board = board; } public boolean isEmpty() { return isEmpty; } public void setEmpty(boolean isEmpty) { this.isEmpty = isEmpty; } public TicTacToe() { this.player = 1; this.board = new int[3][3]; this.isEmpty = false; } @Override public String toString() { StringBuilder s = new StringBuilder(); isEmpty = false; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { switch(board[i][j]) { case 1: s.append(" X "); break; case -1: s.append(" O "); break; case 0: s.append(" "); isEmpty=true; break; } if(j<2) { s.append("|"); } } if(i<2) { s.append("\n-----------\n"); } } return s.toString(); } }
[ "yesrastogi@gmail.com" ]
yesrastogi@gmail.com
a8b7efd883c9e52d70b85b83fa793ef009b3609a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_6fb859834cccbdfff769a30df3444bf42f5c9bed/DriverWrapper/8_6fb859834cccbdfff769a30df3444bf42f5c9bed_DriverWrapper_s.java
64def3da46bb8e872d1db39b920a45432352713d
[]
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
1,935
java
// Openbravo POS is a point of sales application designed for touch screens. // Copyright (C) 2007-2009 Openbravo, S.L. // http://www.openbravo.com/product/pos // // This file is part of Openbravo POS. // // Openbravo POS 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, either version 3 of the License, or // (at your option) any later version. // // Openbravo POS 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 Openbravo POS. If not, see <http://www.gnu.org/licenses/>. package com.openbravo.pos.forms; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverPropertyInfo; import java.sql.SQLException; import java.util.Properties; /** * * @author adrianromero */ public class DriverWrapper implements Driver { private Driver driver; public DriverWrapper(Driver d) { driver = d; } public boolean acceptsURL(String u) throws SQLException { return driver.acceptsURL(u); } public Connection connect(String u, Properties p) throws SQLException { return driver.connect(u, p); } public int getMajorVersion() { return driver.getMajorVersion(); } public int getMinorVersion() { return driver.getMinorVersion(); } public DriverPropertyInfo[] getPropertyInfo(String u, Properties p) throws SQLException { return driver.getPropertyInfo(u, p); } public boolean jdbcCompliant() { return driver.jdbcCompliant(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
206639a5476e088a5d18ac453987f1e4c08ab058
50e8e88c397b3792a2be1183ec7c9039fa9738be
/src/Ch10/Examples/staticImportNew.java
c052f6bc0c72734c4ec56c3eba37867a723440d5
[]
no_license
foryourselfand/oreilly_java
b7a56d21639e7f13f0d7a2f3ac0ac71e7412c002
40acddb711612f3edc144b6ef292944f8011aeaf
refs/heads/master
2020-04-01T18:46:48.195976
2019-09-12T20:58:23
2019-09-12T20:58:23
153,514,113
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package Ch10.Examples; import static java.lang.Math.sqrt; import static java.lang.Math.tan; import static java.lang.System.out; public class staticImportNew { public static void main(String[] args) { out.println("sqrt " + sqrt(2.0)); out.println("tan " + tan(60)); } }
[ "foryourselfand@gmail.com" ]
foryourselfand@gmail.com
9ee4e57eb77c605765711ec4d8374401b10b1810
dede6aaca13e69cb944986fa3f9485f894444cf0
/media-soa/media-soa-api/src/main/java/com/dangdang/digital/model/Style.java
b6a1c195c8a0aa2abd6ff2f4a12f3435e4e632dc
[]
no_license
summerxhf/dang
c0d1e7c2c9436a7c7e7f9c8ef4e547279ec5d441
f1b459937d235637000fb433919a7859dcd77aba
refs/heads/master
2020-03-27T08:32:33.743260
2015-06-03T08:12:45
2015-06-03T08:12:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,362
java
package com.dangdang.digital.model; import java.util.Date; public class Style { private Integer styleId; private String name; private String code; private String desc; private Date creationDate; private Integer price; private Integer status; public Integer getStyleId() { return styleId; } public void setStyleId(Integer styleId) { this.styleId = styleId; } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getCode() { return code; } public void setCode(String code) { this.code = code == null ? null : code.trim(); } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc == null ? null : desc.trim(); } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } }
[ "maqiang@dangdang.com" ]
maqiang@dangdang.com
7af9cc678daa80f1170ecceb76b2d356f2ffdcf9
8b7cdde05f21c56458c8171ce201b4612016314d
/src/carsrus/Car.java
15dcc1fe8799b5ac69d2c610aaa8b7c3ccc11c9d
[ "Apache-2.0" ]
permissive
MatrixNAN/Cars-R-Us
f58ad20d26426023c971a5b9463bd2a08037eaf3
b6297cdca3333749f41f6cfe2ece5a5b6b4c29a1
refs/heads/master
2021-03-12T19:27:14.037424
2017-09-08T15:50:10
2017-09-08T15:50:10
102,878,216
0
0
null
null
null
null
UTF-8
Java
false
false
3,690
java
package carsrus; /*******************************************************************/ /*******************************************************************/ /* Created By Nate Nesler */ /* =============================================================== */ /* Date 05/05/2013 */ /* --------------------------------------------------------------- */ /* Class Car */ /* =============================================================== */ /* Class Description - car object represents a car at a car */ /* dealership lot. */ /* --------------------------------------------------------------- */ /* property id - will hold the id number from a database record. */ /* property vinNumber - holds the vin number from a database */ /* record. */ /* property trimLevel - holds the trim level from a database */ /* record. */ /* property model - holds the model from a database record. */ /* property make - holds the make from a database record. */ /* property preview - holds the preview image from a database */ /* record. */ /* property description - holds the description from a database */ /* record. */ /* property price - holds the price from a database record. */ /*******************************************************************/ /*******************************************************************/ public class Car { private Integer id; private String vinNumber; private String trimLevel; private String model; private String make; private String preview; private String description; private String price; public Car() { } public Car(Integer id, String vinNumber, String trimLevel, String model, String make, String description, String preview, String price) { this.id = id; this.vinNumber = vinNumber; this.trimLevel = trimLevel; this.model = model; this.make = make; this.preview = preview; this.description = description; this.price = price; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPreview() { return preview; } public void setPreview(String preview) { this.preview = preview; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getVinNumber() { return vinNumber; } public void setVinNumber(String vinNumber) { this.vinNumber = vinNumber; } public String getTrimLevel() { return trimLevel; } public void setTrim(String trimLevel) { this.trimLevel = trimLevel; } }
[ "noreply@github.com" ]
noreply@github.com
7ffbde8f27061db07290f70248a914b8998f7ab1
0d7029f91225bc824cfd2c80303b6a8b1fb8bc4e
/Java/Projectakhir/src/projectakhir/Checkout.java
9cc91ccb75a079f4f475b8e37f71eaef830fd69d
[]
no_license
WayanPande/All-Code
0900b5e91e3c2f99fe1bccc8093cae0ccf84952e
43a0de2d24b6bf3abecce070966f68632578c9d2
refs/heads/main
2023-02-06T00:15:27.143503
2021-01-02T15:05:26
2021-01-02T15:05:26
310,770,426
0
1
null
null
null
null
UTF-8
Java
false
false
65,939
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package projectakhir; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumnModel; /** * * @author Togami */ public class Checkout extends javax.swing.JFrame { /** Creates new form DataPelanggan */ public Checkout() { initComponents(); loadData(); } public void loadData(){ try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = "SELECT * FROM pelanggan"; ResultSet r = s.executeQuery(sql); while(r.next()){ String data[] = {r.getString("id"),r.getString("no_ktp"), r.getString("no_hp"), r.getString("no_kamar"), r.getString("nama_satu"), r.getString("nama_dua"), r.getString("jenis_kamar"), r.getString("tgl_checkin"), r.getString("tgl_checkout")}; DefaultTableModel tblModel = (DefaultTableModel)Tabel.getModel(); tblModel.addRow(data); } r.close(); s.close(); }catch(SQLException e){ System.out.println("terjadi error"); } } /** 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() { jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem(); buttonGroup1 = new javax.swing.ButtonGroup(); buttonGroup2 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); Tabel = new javax.swing.JTable(); Tcari = new javax.swing.JTextField(); cari = new javax.swing.JButton(); sort = new javax.swing.JComboBox<>(); jLabel1 = new javax.swing.JLabel(); ASC = new javax.swing.JCheckBox(); DESC = new javax.swing.JCheckBox(); Tubah = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); Tktp = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); Thp = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); Tkamar = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); Tnamasatu = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); Tnamadua = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); Tjeniskamar = new javax.swing.JTextField(); Lmenu32 = new javax.swing.JPanel(); Menuside32 = new javax.swing.JLabel(); Reservasi32 = new javax.swing.JButton(); Restoran32 = new javax.swing.JButton(); jButton66 = new javax.swing.JButton(); jButton67 = new javax.swing.JButton(); Thome = new javax.swing.JButton(); jLabel120 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); Tclose = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jCheckBoxMenuItem1.setSelected(true); jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(0, 153, 153)); Tabel.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "ID", "No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" } ) { boolean[] canEdit = new boolean [] { false, false, false, false, false, false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); Tabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { TabelMouseClicked(evt); } }); jScrollPane1.setViewportView(Tabel); if (Tabel.getColumnModel().getColumnCount() > 0) { Tabel.getColumnModel().getColumn(0).setResizable(false); Tabel.getColumnModel().getColumn(0).setPreferredWidth(2); Tabel.getColumnModel().getColumn(1).setResizable(false); Tabel.getColumnModel().getColumn(2).setResizable(false); Tabel.getColumnModel().getColumn(3).setResizable(false); Tabel.getColumnModel().getColumn(4).setResizable(false); Tabel.getColumnModel().getColumn(5).setResizable(false); Tabel.getColumnModel().getColumn(6).setResizable(false); Tabel.getColumnModel().getColumn(7).setResizable(false); Tabel.getColumnModel().getColumn(8).setResizable(false); } Tcari.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); Tcari.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { TcariMouseClicked(evt); } }); cari.setText("Cari"); cari.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { cariMouseClicked(evt); } }); sort.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "no_ktp", "no_hp", "no_kamar", "nama_satu", "nama_dua", "jenis_kamar", "tgl_checkin", "tgl_checkout" })); sort.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sortActionPerformed(evt); } }); jLabel1.setBackground(new java.awt.Color(255, 255, 255)); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Sort by"); ASC.setText("ASC"); ASC.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { ASCMouseClicked(evt); } }); DESC.setText("DESC"); DESC.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { DESCMouseClicked(evt); } }); Tubah.setText("Checkout"); Tubah.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { TubahMouseClicked(evt); } }); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("No. Ktp"); Tktp.setEditable(false); Tktp.setBackground(new java.awt.Color(204, 204, 204)); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("No. Hp"); Thp.setEditable(false); Thp.setBackground(new java.awt.Color(204, 204, 204)); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("No. Kamar"); Tkamar.setEditable(false); Tkamar.setBackground(new java.awt.Color(204, 204, 204)); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("Nama 1"); Tnamasatu.setEditable(false); Tnamasatu.setBackground(new java.awt.Color(204, 204, 204)); jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("Nama 2"); Tnamadua.setEditable(false); Tnamadua.setBackground(new java.awt.Color(204, 204, 204)); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel7.setForeground(new java.awt.Color(255, 255, 255)); jLabel7.setText("Jenis Kamar"); Tjeniskamar.setEditable(false); Tjeniskamar.setBackground(new java.awt.Color(204, 204, 204)); Lmenu32.setBackground(new java.awt.Color(54, 70, 78)); Lmenu32.setToolTipText(""); Menuside32.setIcon(new javax.swing.ImageIcon("D:\\Code\\Java\\SideBar\\src\\Icons\\icons8-menu-30.png")); // NOI18N Reservasi32.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N Reservasi32.setForeground(new java.awt.Color(255, 255, 255)); Reservasi32.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/default.png"))); // NOI18N Reservasi32.setText("Reservasi"); Reservasi32.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); Reservasi32.setMinimumSize(new java.awt.Dimension(170, 40)); Reservasi32.setPreferredSize(new java.awt.Dimension(170, 40)); Reservasi32.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hover.png"))); // NOI18N Reservasi32.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/selected.png"))); // NOI18N Reservasi32.setSelected(true); Reservasi32.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Reservasi32ActionPerformed(evt); } }); Restoran32.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N Restoran32.setForeground(new java.awt.Color(255, 255, 255)); Restoran32.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/default.png"))); // NOI18N Restoran32.setText("Restoran"); Restoran32.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); Restoran32.setPreferredSize(new java.awt.Dimension(170, 40)); Restoran32.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hover.png"))); // NOI18N Restoran32.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/selected.png"))); // NOI18N Restoran32.setSelected(true); Restoran32.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Restoran32ActionPerformed(evt); } }); jButton66.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton66.setForeground(new java.awt.Color(255, 255, 255)); jButton66.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/default.png"))); // NOI18N jButton66.setText("Kamar"); jButton66.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton66.setPreferredSize(new java.awt.Dimension(170, 40)); jButton66.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hover.png"))); // NOI18N jButton66.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/selected.png"))); // NOI18N jButton66.setSelected(true); jButton67.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton67.setForeground(new java.awt.Color(255, 255, 255)); jButton67.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/default.png"))); // NOI18N jButton67.setText("Laporan"); jButton67.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton67.setMinimumSize(new java.awt.Dimension(170, 40)); jButton67.setPreferredSize(new java.awt.Dimension(170, 40)); jButton67.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hover.png"))); // NOI18N jButton67.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/selected.png"))); // NOI18N jButton67.setSelected(true); Thome.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N Thome.setForeground(new java.awt.Color(255, 255, 255)); Thome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/default.png"))); // NOI18N Thome.setText("Home"); Thome.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); Thome.setMinimumSize(new java.awt.Dimension(170, 40)); Thome.setPreferredSize(new java.awt.Dimension(170, 40)); Thome.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hover.png"))); // NOI18N Thome.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/selected.png"))); // NOI18N Thome.setSelected(true); Thome.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { ThomeMouseClicked(evt); } }); jLabel120.setBackground(new java.awt.Color(255, 255, 255)); jLabel120.setForeground(new java.awt.Color(255, 255, 255)); jLabel120.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/hotel.png"))); // NOI18N javax.swing.GroupLayout Lmenu32Layout = new javax.swing.GroupLayout(Lmenu32); Lmenu32.setLayout(Lmenu32Layout); Lmenu32Layout.setHorizontalGroup( Lmenu32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Lmenu32Layout.createSequentialGroup() .addContainerGap() .addGroup(Lmenu32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Lmenu32Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(Menuside32)) .addGroup(Lmenu32Layout.createSequentialGroup() .addGroup(Lmenu32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(Thome, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Restoran32, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton67, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton66, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Reservasi32, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 8, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Lmenu32Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel120) .addGap(29, 29, 29)) ); Lmenu32Layout.setVerticalGroup( Lmenu32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Lmenu32Layout.createSequentialGroup() .addComponent(Menuside32) .addGap(35, 35, 35) .addComponent(jLabel120) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE) .addComponent(Thome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(Reservasi32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(Restoran32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton66, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton67, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(54, 54, 54)) ); jPanel2.setBackground(new java.awt.Color(0, 0, 0)); Tclose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/remove.png"))); // NOI18N Tclose.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); Tclose.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { TcloseMouseClicked(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Tclose) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(Tclose) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(Lmenu32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(385, 385, 385) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(sort, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(ASC) .addGap(18, 18, 18) .addComponent(DESC)))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(Tcari, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cari)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 735, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 56, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(74, 74, 74) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Tktp, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Thp, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tkamar, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tnamadua, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tnamasatu, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Tjeniskamar, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addComponent(Tubah, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE)))))) .addContainerGap()) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Lmenu32, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(124, 124, 124) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(Tktp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(48, 48, 48) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(Thp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(46, 46, 46) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(Tkamar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(46, 46, 46) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(Tnamasatu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(48, 48, 48) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(Tnamadua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(40, 40, 40) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(Tjeniskamar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Tubah)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(sort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addGap(12, 12, 12) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ASC) .addComponent(DESC) .addComponent(Tcari, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cari)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 456, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(34, 34, 34)))) ); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void DESCMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DESCMouseClicked ASC.setSelected(false); String Sort = sort.getSelectedItem().toString(); Tabel.setModel(new DefaultTableModel(null, new String[]{ "ID", "No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" })); TableColumnModel columnModel = Tabel.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(2); try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = "SELECT * FROM pelanggan ORDER BY " + Sort + " DESC"; ResultSet r = s.executeQuery(sql); while(r.next()){ String data[] = {r.getString("id"), r.getString("no_ktp"), r.getString("no_hp"), r.getString("no_kamar"), r.getString("nama_satu"), r.getString("nama_dua"), r.getNString("jenis_kamar"), r.getString("tgl_checkin"), r.getString("tgl_checkout")}; DefaultTableModel tblModel = (DefaultTableModel)Tabel.getModel(); tblModel.addRow(data); } r.close(); s.close(); }catch(SQLException e){ System.out.println("terjadi error Sort data"); } }//GEN-LAST:event_DESCMouseClicked private void ASCMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ASCMouseClicked DESC.setSelected(false); String Sort = sort.getSelectedItem().toString(); Tabel.setModel(new DefaultTableModel(null, new String[]{ "ID","No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" })); TableColumnModel columnModel = Tabel.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(2); try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = "SELECT * FROM pelanggan ORDER BY " + Sort + " ASC"; ResultSet r = s.executeQuery(sql); while(r.next()){ String data[] = {r.getString("id"), r.getString("no_ktp"), r.getString("no_hp"), r.getString("no_kamar"), r.getString("nama_satu"), r.getString("nama_dua"), r.getNString("jenis_kamar"), r.getString("tgl_checkin"), r.getString("tgl_checkout")}; DefaultTableModel tblModel = (DefaultTableModel)Tabel.getModel(); tblModel.addRow(data); } r.close(); s.close(); }catch(SQLException e){ System.out.println("terjadi error Sort data"); } }//GEN-LAST:event_ASCMouseClicked private void sortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortActionPerformed String Sort = sort.getSelectedItem().toString(); Tabel.setModel(new DefaultTableModel(null, new String[]{ "ID", "No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" })); TableColumnModel columnModel = Tabel.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(2); try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = "SELECT * FROM pelanggan ORDER BY " + Sort; ResultSet r = s.executeQuery(sql); while(r.next()){ String data[] = {r.getString("id"), r.getString("no_ktp"), r.getString("no_hp"), r.getString("no_kamar"), r.getString("nama_satu"), r.getString("nama_dua"), r.getString("jenis_kamar"), r.getString("tgl_checkin"), r.getString("tgl_checkout")}; DefaultTableModel tblModel = (DefaultTableModel)Tabel.getModel(); tblModel.addRow(data); } r.close(); s.close(); }catch(SQLException e){ System.out.println("terjadi error Sort data"); } }//GEN-LAST:event_sortActionPerformed private void cariMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cariMouseClicked String kunci = Tcari.getText(); Tabel.setModel(new DefaultTableModel(null, new String[]{ "ID", "No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" })); TableColumnModel columnModel = Tabel.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(2); try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = "SELECT * FROM pelanggan WHERE nama_satu LIKE " + "'%" + kunci + "%' OR no_ktp LIKE " + "'%" + kunci + "%' OR no_hp LIKE " + "'%" + kunci + "%' OR no_kamar LIKE" + "'%" + kunci + "%' OR nama_dua LIKE " + "'%" + kunci + "%' OR jenis_kamar LIKE "+ "'%" + kunci + "%'"; ResultSet r = s.executeQuery(sql); while(r.next()){ String data[] = {r.getString("id"), r.getString("no_ktp"), r.getString("no_hp"), r.getString("no_kamar"), r.getString("nama_satu"), r.getString("nama_dua"), r.getString("jenis_kamar"), r.getString("tgl_checkin"), r.getString("tgl_checkout")}; DefaultTableModel tblModel = (DefaultTableModel)Tabel.getModel(); tblModel.addRow(data); } r.close(); s.close(); }catch(SQLException e){ System.out.println("terjadi error Search data"); } }//GEN-LAST:event_cariMouseClicked private void TcariMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TcariMouseClicked Tcari.setText(""); }//GEN-LAST:event_TcariMouseClicked private void TabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelMouseClicked int row = Tabel.getSelectedRow(); String value1 = Tabel.getModel().getValueAt(row, 1).toString(); String value2 = Tabel.getModel().getValueAt(row, 2).toString(); String value3 = Tabel.getModel().getValueAt(row, 3).toString(); String value4 = Tabel.getModel().getValueAt(row, 4).toString(); String value5 = Tabel.getModel().getValueAt(row, 5).toString(); String value6 = Tabel.getModel().getValueAt(row, 6).toString(); Tktp.setText(value1); Thp.setText(value2); Tkamar.setText(value3); Tnamasatu.setText(value4); Tnamadua.setText(value5); Tjeniskamar.setText(value6); }//GEN-LAST:event_TabelMouseClicked private void TubahMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TubahMouseClicked int row = Tabel.getSelectedRow(); String id = Tabel.getModel().getValueAt(row, 0).toString(); int a=JOptionPane.showConfirmDialog(this,"Anda yakin?"); if (a==JOptionPane.YES_OPTION){ try{ KonekMYSQL konek = new KonekMYSQL(); java.sql.Connection c = konek.getKoneksi(); Statement s = c.createStatement(); String sql = String.format("DELETE FROM pelanggan WHERE id='%s'", id); s.execute(sql); }catch(SQLException e){ System.out.println("terjadi error delete data"); System.out.println(e.getMessage()); } Tabel.setModel(new DefaultTableModel(null, new String[]{ "ID", "No. Ktp", "No. Hp", "No. Kamar", "Nama 1", "Nama 2", "Jenis Kamar", "Tgl Checkin", "Tgl Checkout" })); loadData(); TableColumnModel columnModel = Tabel.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(2); JOptionPane.showMessageDialog(this, "Data Berhasil Dihapus"); Tktp.setText(""); Thp.setText(""); Tkamar.setText(""); Tnamasatu.setText(""); Tnamadua.setText(""); Tjeniskamar.setText(""); } }//GEN-LAST:event_TubahMouseClicked private void Reservasi32ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Reservasi32ActionPerformed Reservasi reservasi = new Reservasi(); reservasi.setVisible(true); reservasi.pack(); reservasi.setLocationRelativeTo(null); this.dispose(); }//GEN-LAST:event_Reservasi32ActionPerformed private void Restoran32ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Restoran32ActionPerformed // TODO add your handling code here: kasir_resto restoran = new kasir_resto(); restoran.setVisible(true); restoran.pack(); restoran.setLocationRelativeTo(null); this.dispose(); }//GEN-LAST:event_Restoran32ActionPerformed private void ThomeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ThomeMouseClicked Dashboard menu = new Dashboard(); menu.setVisible(true); menu.pack(); menu.setLocationRelativeTo(null); this.dispose(); }//GEN-LAST:event_ThomeMouseClicked private void TcloseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TcloseMouseClicked this.dispose(); }//GEN-LAST:event_TcloseMouseClicked /** * @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(Checkout.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Checkout.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Checkout.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Checkout.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Checkout().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox ASC; private javax.swing.JCheckBox ASC1; private javax.swing.JCheckBox ASC10; private javax.swing.JCheckBox ASC11; private javax.swing.JCheckBox ASC12; private javax.swing.JCheckBox ASC13; private javax.swing.JCheckBox ASC14; private javax.swing.JCheckBox ASC15; private javax.swing.JCheckBox ASC16; private javax.swing.JCheckBox ASC2; private javax.swing.JCheckBox ASC3; private javax.swing.JCheckBox ASC4; private javax.swing.JCheckBox ASC5; private javax.swing.JCheckBox ASC6; private javax.swing.JCheckBox ASC7; private javax.swing.JCheckBox ASC8; private javax.swing.JCheckBox ASC9; private javax.swing.JCheckBox DESC; private javax.swing.JCheckBox DESC1; private javax.swing.JCheckBox DESC10; private javax.swing.JCheckBox DESC11; private javax.swing.JCheckBox DESC12; private javax.swing.JCheckBox DESC13; private javax.swing.JCheckBox DESC14; private javax.swing.JCheckBox DESC15; private javax.swing.JCheckBox DESC16; private javax.swing.JCheckBox DESC2; private javax.swing.JCheckBox DESC3; private javax.swing.JCheckBox DESC4; private javax.swing.JCheckBox DESC5; private javax.swing.JCheckBox DESC6; private javax.swing.JCheckBox DESC7; private javax.swing.JCheckBox DESC8; private javax.swing.JCheckBox DESC9; private javax.swing.JPanel Lmenu; private javax.swing.JPanel Lmenu1; private javax.swing.JPanel Lmenu10; private javax.swing.JPanel Lmenu11; private javax.swing.JPanel Lmenu12; private javax.swing.JPanel Lmenu13; private javax.swing.JPanel Lmenu14; private javax.swing.JPanel Lmenu15; private javax.swing.JPanel Lmenu16; private javax.swing.JPanel Lmenu17; private javax.swing.JPanel Lmenu18; private javax.swing.JPanel Lmenu19; private javax.swing.JPanel Lmenu2; private javax.swing.JPanel Lmenu20; private javax.swing.JPanel Lmenu21; private javax.swing.JPanel Lmenu22; private javax.swing.JPanel Lmenu23; private javax.swing.JPanel Lmenu24; private javax.swing.JPanel Lmenu25; private javax.swing.JPanel Lmenu26; private javax.swing.JPanel Lmenu27; private javax.swing.JPanel Lmenu28; private javax.swing.JPanel Lmenu29; private javax.swing.JPanel Lmenu3; private javax.swing.JPanel Lmenu30; private javax.swing.JPanel Lmenu31; private javax.swing.JPanel Lmenu32; private javax.swing.JPanel Lmenu4; private javax.swing.JPanel Lmenu5; private javax.swing.JPanel Lmenu6; private javax.swing.JPanel Lmenu7; private javax.swing.JPanel Lmenu8; private javax.swing.JPanel Lmenu9; private javax.swing.JLabel Menuside; private javax.swing.JLabel Menuside1; private javax.swing.JLabel Menuside10; private javax.swing.JLabel Menuside11; private javax.swing.JLabel Menuside12; private javax.swing.JLabel Menuside13; private javax.swing.JLabel Menuside14; private javax.swing.JLabel Menuside15; private javax.swing.JLabel Menuside16; private javax.swing.JLabel Menuside17; private javax.swing.JLabel Menuside18; private javax.swing.JLabel Menuside19; private javax.swing.JLabel Menuside2; private javax.swing.JLabel Menuside20; private javax.swing.JLabel Menuside21; private javax.swing.JLabel Menuside22; private javax.swing.JLabel Menuside23; private javax.swing.JLabel Menuside24; private javax.swing.JLabel Menuside25; private javax.swing.JLabel Menuside26; private javax.swing.JLabel Menuside27; private javax.swing.JLabel Menuside28; private javax.swing.JLabel Menuside29; private javax.swing.JLabel Menuside3; private javax.swing.JLabel Menuside30; private javax.swing.JLabel Menuside31; private javax.swing.JLabel Menuside32; private javax.swing.JLabel Menuside4; private javax.swing.JLabel Menuside5; private javax.swing.JLabel Menuside6; private javax.swing.JLabel Menuside7; private javax.swing.JLabel Menuside8; private javax.swing.JLabel Menuside9; private javax.swing.JButton Reservasi; private javax.swing.JButton Reservasi1; private javax.swing.JButton Reservasi10; private javax.swing.JButton Reservasi11; private javax.swing.JButton Reservasi12; private javax.swing.JButton Reservasi13; private javax.swing.JButton Reservasi14; private javax.swing.JButton Reservasi15; private javax.swing.JButton Reservasi16; private javax.swing.JButton Reservasi17; private javax.swing.JButton Reservasi18; private javax.swing.JButton Reservasi19; private javax.swing.JButton Reservasi2; private javax.swing.JButton Reservasi20; private javax.swing.JButton Reservasi21; private javax.swing.JButton Reservasi22; private javax.swing.JButton Reservasi23; private javax.swing.JButton Reservasi24; private javax.swing.JButton Reservasi25; private javax.swing.JButton Reservasi26; private javax.swing.JButton Reservasi27; private javax.swing.JButton Reservasi28; private javax.swing.JButton Reservasi29; private javax.swing.JButton Reservasi3; private javax.swing.JButton Reservasi30; private javax.swing.JButton Reservasi31; private javax.swing.JButton Reservasi32; private javax.swing.JButton Reservasi4; private javax.swing.JButton Reservasi5; private javax.swing.JButton Reservasi6; private javax.swing.JButton Reservasi7; private javax.swing.JButton Reservasi8; private javax.swing.JButton Reservasi9; private javax.swing.JButton Restoran; private javax.swing.JButton Restoran1; private javax.swing.JButton Restoran10; private javax.swing.JButton Restoran11; private javax.swing.JButton Restoran12; private javax.swing.JButton Restoran13; private javax.swing.JButton Restoran14; private javax.swing.JButton Restoran15; private javax.swing.JButton Restoran16; private javax.swing.JButton Restoran17; private javax.swing.JButton Restoran18; private javax.swing.JButton Restoran19; private javax.swing.JButton Restoran2; private javax.swing.JButton Restoran20; private javax.swing.JButton Restoran21; private javax.swing.JButton Restoran22; private javax.swing.JButton Restoran23; private javax.swing.JButton Restoran24; private javax.swing.JButton Restoran25; private javax.swing.JButton Restoran26; private javax.swing.JButton Restoran27; private javax.swing.JButton Restoran28; private javax.swing.JButton Restoran29; private javax.swing.JButton Restoran3; private javax.swing.JButton Restoran30; private javax.swing.JButton Restoran31; private javax.swing.JButton Restoran32; private javax.swing.JButton Restoran4; private javax.swing.JButton Restoran5; private javax.swing.JButton Restoran6; private javax.swing.JButton Restoran7; private javax.swing.JButton Restoran8; private javax.swing.JButton Restoran9; private javax.swing.JTable Tabel; private javax.swing.JTable Tabel1; private javax.swing.JTable Tabel10; private javax.swing.JTable Tabel11; private javax.swing.JTable Tabel12; private javax.swing.JTable Tabel13; private javax.swing.JTable Tabel14; private javax.swing.JTable Tabel15; private javax.swing.JTable Tabel16; private javax.swing.JTable Tabel2; private javax.swing.JTable Tabel3; private javax.swing.JTable Tabel4; private javax.swing.JTable Tabel5; private javax.swing.JTable Tabel6; private javax.swing.JTable Tabel7; private javax.swing.JTable Tabel8; private javax.swing.JTable Tabel9; private javax.swing.JTextField Tcari; private javax.swing.JTextField Tcari1; private javax.swing.JTextField Tcari10; private javax.swing.JTextField Tcari11; private javax.swing.JTextField Tcari12; private javax.swing.JTextField Tcari13; private javax.swing.JTextField Tcari14; private javax.swing.JTextField Tcari15; private javax.swing.JTextField Tcari16; private javax.swing.JTextField Tcari2; private javax.swing.JTextField Tcari3; private javax.swing.JTextField Tcari4; private javax.swing.JTextField Tcari5; private javax.swing.JTextField Tcari6; private javax.swing.JTextField Tcari7; private javax.swing.JTextField Tcari8; private javax.swing.JTextField Tcari9; private javax.swing.JLabel Tclose; private javax.swing.JButton Thome; private javax.swing.JTextField Thp; private javax.swing.JTextField Thp1; private javax.swing.JTextField Thp10; private javax.swing.JTextField Thp11; private javax.swing.JTextField Thp12; private javax.swing.JTextField Thp13; private javax.swing.JTextField Thp14; private javax.swing.JTextField Thp15; private javax.swing.JTextField Thp16; private javax.swing.JTextField Thp2; private javax.swing.JTextField Thp3; private javax.swing.JTextField Thp4; private javax.swing.JTextField Thp5; private javax.swing.JTextField Thp6; private javax.swing.JTextField Thp7; private javax.swing.JTextField Thp8; private javax.swing.JTextField Thp9; private javax.swing.JTextField Tjeniskamar; private javax.swing.JTextField Tjeniskamar1; private javax.swing.JTextField Tjeniskamar10; private javax.swing.JTextField Tjeniskamar11; private javax.swing.JTextField Tjeniskamar12; private javax.swing.JTextField Tjeniskamar13; private javax.swing.JTextField Tjeniskamar14; private javax.swing.JTextField Tjeniskamar15; private javax.swing.JTextField Tjeniskamar16; private javax.swing.JTextField Tjeniskamar2; private javax.swing.JTextField Tjeniskamar3; private javax.swing.JTextField Tjeniskamar4; private javax.swing.JTextField Tjeniskamar5; private javax.swing.JTextField Tjeniskamar6; private javax.swing.JTextField Tjeniskamar7; private javax.swing.JTextField Tjeniskamar8; private javax.swing.JTextField Tjeniskamar9; private javax.swing.JTextField Tkamar; private javax.swing.JTextField Tkamar1; private javax.swing.JTextField Tkamar10; private javax.swing.JTextField Tkamar11; private javax.swing.JTextField Tkamar12; private javax.swing.JTextField Tkamar13; private javax.swing.JTextField Tkamar14; private javax.swing.JTextField Tkamar15; private javax.swing.JTextField Tkamar16; private javax.swing.JTextField Tkamar2; private javax.swing.JTextField Tkamar3; private javax.swing.JTextField Tkamar4; private javax.swing.JTextField Tkamar5; private javax.swing.JTextField Tkamar6; private javax.swing.JTextField Tkamar7; private javax.swing.JTextField Tkamar8; private javax.swing.JTextField Tkamar9; private javax.swing.JTextField Tktp; private javax.swing.JTextField Tktp1; private javax.swing.JTextField Tktp10; private javax.swing.JTextField Tktp11; private javax.swing.JTextField Tktp12; private javax.swing.JTextField Tktp13; private javax.swing.JTextField Tktp14; private javax.swing.JTextField Tktp15; private javax.swing.JTextField Tktp16; private javax.swing.JTextField Tktp2; private javax.swing.JTextField Tktp3; private javax.swing.JTextField Tktp4; private javax.swing.JTextField Tktp5; private javax.swing.JTextField Tktp6; private javax.swing.JTextField Tktp7; private javax.swing.JTextField Tktp8; private javax.swing.JTextField Tktp9; private javax.swing.JTextField Tnamadua; private javax.swing.JTextField Tnamadua1; private javax.swing.JTextField Tnamadua10; private javax.swing.JTextField Tnamadua11; private javax.swing.JTextField Tnamadua12; private javax.swing.JTextField Tnamadua13; private javax.swing.JTextField Tnamadua14; private javax.swing.JTextField Tnamadua15; private javax.swing.JTextField Tnamadua16; private javax.swing.JTextField Tnamadua2; private javax.swing.JTextField Tnamadua3; private javax.swing.JTextField Tnamadua4; private javax.swing.JTextField Tnamadua5; private javax.swing.JTextField Tnamadua6; private javax.swing.JTextField Tnamadua7; private javax.swing.JTextField Tnamadua8; private javax.swing.JTextField Tnamadua9; private javax.swing.JTextField Tnamasatu; private javax.swing.JTextField Tnamasatu1; private javax.swing.JTextField Tnamasatu10; private javax.swing.JTextField Tnamasatu11; private javax.swing.JTextField Tnamasatu12; private javax.swing.JTextField Tnamasatu13; private javax.swing.JTextField Tnamasatu14; private javax.swing.JTextField Tnamasatu15; private javax.swing.JTextField Tnamasatu16; private javax.swing.JTextField Tnamasatu2; private javax.swing.JTextField Tnamasatu3; private javax.swing.JTextField Tnamasatu4; private javax.swing.JTextField Tnamasatu5; private javax.swing.JTextField Tnamasatu6; private javax.swing.JTextField Tnamasatu7; private javax.swing.JTextField Tnamasatu8; private javax.swing.JTextField Tnamasatu9; private javax.swing.JButton Tubah; private javax.swing.JButton Tubah1; private javax.swing.JButton Tubah10; private javax.swing.JButton Tubah11; private javax.swing.JButton Tubah12; private javax.swing.JButton Tubah13; private javax.swing.JButton Tubah14; private javax.swing.JButton Tubah15; private javax.swing.JButton Tubah16; private javax.swing.JButton Tubah2; private javax.swing.JButton Tubah3; private javax.swing.JButton Tubah4; private javax.swing.JButton Tubah5; private javax.swing.JButton Tubah6; private javax.swing.JButton Tubah7; private javax.swing.JButton Tubah8; private javax.swing.JButton Tubah9; private javax.swing.ButtonGroup buttonGroup1; private javax.swing.ButtonGroup buttonGroup2; private javax.swing.JButton cari; private javax.swing.JButton cari1; private javax.swing.JButton cari10; private javax.swing.JButton cari11; private javax.swing.JButton cari12; private javax.swing.JButton cari13; private javax.swing.JButton cari14; private javax.swing.JButton cari15; private javax.swing.JButton cari16; private javax.swing.JButton cari2; private javax.swing.JButton cari3; private javax.swing.JButton cari4; private javax.swing.JButton cari5; private javax.swing.JButton cari6; private javax.swing.JButton cari7; private javax.swing.JButton cari8; private javax.swing.JButton cari9; private javax.swing.JButton jButton10; private javax.swing.JButton jButton11; private javax.swing.JButton jButton12; private javax.swing.JButton jButton13; private javax.swing.JButton jButton14; private javax.swing.JButton jButton15; private javax.swing.JButton jButton16; private javax.swing.JButton jButton17; private javax.swing.JButton jButton18; private javax.swing.JButton jButton19; private javax.swing.JButton jButton2; private javax.swing.JButton jButton20; private javax.swing.JButton jButton21; private javax.swing.JButton jButton22; private javax.swing.JButton jButton23; private javax.swing.JButton jButton24; private javax.swing.JButton jButton25; private javax.swing.JButton jButton26; private javax.swing.JButton jButton27; private javax.swing.JButton jButton28; private javax.swing.JButton jButton29; private javax.swing.JButton jButton3; private javax.swing.JButton jButton30; private javax.swing.JButton jButton31; private javax.swing.JButton jButton32; private javax.swing.JButton jButton33; private javax.swing.JButton jButton34; private javax.swing.JButton jButton35; private javax.swing.JButton jButton36; private javax.swing.JButton jButton37; private javax.swing.JButton jButton38; private javax.swing.JButton jButton39; private javax.swing.JButton jButton4; private javax.swing.JButton jButton40; private javax.swing.JButton jButton41; private javax.swing.JButton jButton42; private javax.swing.JButton jButton43; private javax.swing.JButton jButton44; private javax.swing.JButton jButton45; private javax.swing.JButton jButton46; private javax.swing.JButton jButton47; private javax.swing.JButton jButton48; private javax.swing.JButton jButton49; private javax.swing.JButton jButton5; private javax.swing.JButton jButton50; private javax.swing.JButton jButton51; private javax.swing.JButton jButton52; private javax.swing.JButton jButton53; private javax.swing.JButton jButton54; private javax.swing.JButton jButton55; private javax.swing.JButton jButton56; private javax.swing.JButton jButton57; private javax.swing.JButton jButton58; private javax.swing.JButton jButton59; private javax.swing.JButton jButton6; private javax.swing.JButton jButton60; private javax.swing.JButton jButton61; private javax.swing.JButton jButton62; private javax.swing.JButton jButton63; private javax.swing.JButton jButton64; private javax.swing.JButton jButton65; private javax.swing.JButton jButton66; private javax.swing.JButton jButton67; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel100; private javax.swing.JLabel jLabel101; private javax.swing.JLabel jLabel102; private javax.swing.JLabel jLabel103; private javax.swing.JLabel jLabel104; private javax.swing.JLabel jLabel105; private javax.swing.JLabel jLabel106; private javax.swing.JLabel jLabel107; private javax.swing.JLabel jLabel108; private javax.swing.JLabel jLabel109; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel110; private javax.swing.JLabel jLabel111; private javax.swing.JLabel jLabel112; private javax.swing.JLabel jLabel113; private javax.swing.JLabel jLabel114; private javax.swing.JLabel jLabel115; private javax.swing.JLabel jLabel116; private javax.swing.JLabel jLabel117; private javax.swing.JLabel jLabel118; private javax.swing.JLabel jLabel119; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel120; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel30; private javax.swing.JLabel jLabel31; private javax.swing.JLabel jLabel32; private javax.swing.JLabel jLabel33; private javax.swing.JLabel jLabel34; private javax.swing.JLabel jLabel35; private javax.swing.JLabel jLabel36; private javax.swing.JLabel jLabel37; private javax.swing.JLabel jLabel38; private javax.swing.JLabel jLabel39; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel40; private javax.swing.JLabel jLabel41; private javax.swing.JLabel jLabel42; private javax.swing.JLabel jLabel43; private javax.swing.JLabel jLabel44; private javax.swing.JLabel jLabel45; private javax.swing.JLabel jLabel46; private javax.swing.JLabel jLabel47; private javax.swing.JLabel jLabel48; private javax.swing.JLabel jLabel49; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel50; private javax.swing.JLabel jLabel51; private javax.swing.JLabel jLabel52; private javax.swing.JLabel jLabel53; private javax.swing.JLabel jLabel54; private javax.swing.JLabel jLabel55; private javax.swing.JLabel jLabel56; private javax.swing.JLabel jLabel57; private javax.swing.JLabel jLabel58; private javax.swing.JLabel jLabel59; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel60; private javax.swing.JLabel jLabel61; private javax.swing.JLabel jLabel62; private javax.swing.JLabel jLabel63; private javax.swing.JLabel jLabel64; private javax.swing.JLabel jLabel65; private javax.swing.JLabel jLabel66; private javax.swing.JLabel jLabel67; private javax.swing.JLabel jLabel68; private javax.swing.JLabel jLabel69; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel70; private javax.swing.JLabel jLabel71; private javax.swing.JLabel jLabel72; private javax.swing.JLabel jLabel73; private javax.swing.JLabel jLabel74; private javax.swing.JLabel jLabel75; private javax.swing.JLabel jLabel76; private javax.swing.JLabel jLabel77; private javax.swing.JLabel jLabel78; private javax.swing.JLabel jLabel79; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel80; private javax.swing.JLabel jLabel81; private javax.swing.JLabel jLabel82; private javax.swing.JLabel jLabel83; private javax.swing.JLabel jLabel84; private javax.swing.JLabel jLabel85; private javax.swing.JLabel jLabel86; private javax.swing.JLabel jLabel87; private javax.swing.JLabel jLabel88; private javax.swing.JLabel jLabel89; private javax.swing.JLabel jLabel9; private javax.swing.JLabel jLabel90; private javax.swing.JLabel jLabel91; private javax.swing.JLabel jLabel92; private javax.swing.JLabel jLabel93; private javax.swing.JLabel jLabel94; private javax.swing.JLabel jLabel95; private javax.swing.JLabel jLabel96; private javax.swing.JLabel jLabel97; private javax.swing.JLabel jLabel98; private javax.swing.JLabel jLabel99; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel10; private javax.swing.JPanel jPanel11; private javax.swing.JPanel jPanel12; private javax.swing.JPanel jPanel13; private javax.swing.JPanel jPanel14; private javax.swing.JPanel jPanel15; private javax.swing.JPanel jPanel16; private javax.swing.JPanel jPanel17; private javax.swing.JPanel jPanel18; private javax.swing.JPanel jPanel19; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel20; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JPanel jPanel7; private javax.swing.JPanel jPanel8; private javax.swing.JPanel jPanel9; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane10; private javax.swing.JScrollPane jScrollPane11; private javax.swing.JScrollPane jScrollPane12; private javax.swing.JScrollPane jScrollPane13; private javax.swing.JScrollPane jScrollPane14; private javax.swing.JScrollPane jScrollPane15; private javax.swing.JScrollPane jScrollPane16; private javax.swing.JScrollPane jScrollPane17; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JScrollPane jScrollPane5; private javax.swing.JScrollPane jScrollPane6; private javax.swing.JScrollPane jScrollPane7; private javax.swing.JScrollPane jScrollPane8; private javax.swing.JScrollPane jScrollPane9; private javax.swing.JComboBox<String> sort; private javax.swing.JComboBox<String> sort1; private javax.swing.JComboBox<String> sort10; private javax.swing.JComboBox<String> sort11; private javax.swing.JComboBox<String> sort12; private javax.swing.JComboBox<String> sort13; private javax.swing.JComboBox<String> sort14; private javax.swing.JComboBox<String> sort15; private javax.swing.JComboBox<String> sort16; private javax.swing.JComboBox<String> sort2; private javax.swing.JComboBox<String> sort3; private javax.swing.JComboBox<String> sort4; private javax.swing.JComboBox<String> sort5; private javax.swing.JComboBox<String> sort6; private javax.swing.JComboBox<String> sort7; private javax.swing.JComboBox<String> sort8; private javax.swing.JComboBox<String> sort9; // End of variables declaration//GEN-END:variables }
[ "yande554@gmail.com" ]
yande554@gmail.com
1bb5516af8587fa0dd25b30c695dc78db8d1629c
56b2463d5d8514c404d1236c4c8d34674d55ef66
/Weather/Weather/app/src/main/java/com/avash/weather/model/Channel.java
f021f038095e963d61301a961b632d292ef1ed4b
[]
no_license
AlphaTech16/Weather
517e3ba14d021a9f7d0b05bdbdc8c4542f24c0bb
1683a6cc6a9386380b38628513d31e816d30f307
refs/heads/master
2021-01-11T16:11:16.987967
2017-01-29T18:44:17
2017-01-29T18:44:17
80,030,361
0
0
null
null
null
null
UTF-8
Java
false
false
2,997
java
package com.avash.weather.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Channel { @SerializedName("units") @Expose private Units units; @SerializedName("title") @Expose private String title; @SerializedName("link") @Expose private String link; @SerializedName("description") @Expose private String description; @SerializedName("language") @Expose private String language; @SerializedName("lastBuildDate") @Expose private String lastBuildDate; @SerializedName("ttl") @Expose private String ttl; @SerializedName("location") @Expose private Location location; @SerializedName("wind") @Expose private Wind wind; @SerializedName("atmosphere") @Expose private Atmosphere atmosphere; @SerializedName("astronomy") @Expose private Astronomy astronomy; @SerializedName("image") @Expose private Image image; @SerializedName("item") @Expose private Item item; public Units getUnits() { return units; } public void setUnits(Units units) { this.units = units; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public String getLastBuildDate() { return lastBuildDate; } public void setLastBuildDate(String lastBuildDate) { this.lastBuildDate = lastBuildDate; } public String getTtl() { return ttl; } public void setTtl(String ttl) { this.ttl = ttl; } public Location getLocation() { return location; } public void setLocation(Location location) { this.location = location; } public Wind getWind() { return wind; } public void setWind(Wind wind) { this.wind = wind; } public Atmosphere getAtmosphere() { return atmosphere; } public void setAtmosphere(Atmosphere atmosphere) { this.atmosphere = atmosphere; } public Astronomy getAstronomy() { return astronomy; } public void setAstronomy(Astronomy astronomy) { this.astronomy = astronomy; } public Image getImage() { return image; } public void setImage(Image image) { this.image = image; } public Item getItem() { return item; } public void setItem(Item item) { this.item = item; } }
[ "avash10@yahoo.com" ]
avash10@yahoo.com
e4bd426849cea8059ba9367761d602efbea14c5b
9caf0ec5f7297c0b17d4cdfcab738606563fed7d
/interview/src/main/java/constxiong/interview/proxy/springaop/GreetingIntroAdvice.java
c1e799b399b5f32c8805e73a5551c22cf3d25c71
[]
no_license
guomingzhang2008/xtools
6e52568d2d77d5c287ddd8bbd108fee6c0fede48
c288d45901f5c598a0e7601b832effb23142077e
refs/heads/master
2020-11-24T00:07:42.606276
2019-12-09T08:22:39
2019-12-09T08:22:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
679
java
package constxiong.interview.proxy.springaop; import org.aopalliance.intercept.MethodInvocation; import org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor; public class GreetingIntroAdvice extends DelegatePerTargetObjectIntroductionInterceptor implements Apology { public GreetingIntroAdvice(Class<?> defaultImplType, Class<?> interfaceType) { super(defaultImplType, interfaceType); } private static final long serialVersionUID = -8928078133866166702L; @Override public Object invoke(MethodInvocation mi) throws Throwable { return super.invoke(mi); } public void saySorry(String name) { System.out.println("Sorry! " + name); } }
[ "javanav@163.com" ]
javanav@163.com
9e85d5021e96b5812e91c459d69a483bd829484d
cbedbc6a31f1e672620dc7749822ed3e916e5d4a
/auto007_site/auto007_core/src/main/java/com/fenghua/auto/backend/core/security/DefaultRolesPrefixPostProcessor.java
f985c9b14ae8bba86ee109fb3e9d3ddef9956497
[]
no_license
comedsh/skeleton-modules-software
d67f8d37a0a80f6042798b1c6b5e2605930513fe
c6eea2d01500230bb9b71962fe33a476d66efd46
refs/heads/master
2016-08-11T15:36:23.272598
2015-12-10T09:15:37
2015-12-10T09:15:37
47,751,924
0
1
null
null
null
null
UTF-8
Java
false
false
1,821
java
package com.fenghua.auto.backend.core.security; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.PriorityOrdered; import org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource; import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter; /** *<des> *</des> * @author lijie * @date 2015年10月28日 * @version */ public class DefaultRolesPrefixPostProcessor implements BeanPostProcessor, PriorityOrdered { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { // remove this if you are not using JSR-250 if(bean instanceof Jsr250MethodSecurityMetadataSource) { ((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(null); } if(bean instanceof DefaultMethodSecurityExpressionHandler) { ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null); } if(bean instanceof DefaultWebSecurityExpressionHandler) { ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null); } if(bean instanceof SecurityContextHolderAwareRequestFilter) { ((SecurityContextHolderAwareRequestFilter)bean).setRolePrefix(""); } return bean; } @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } @Override public int getOrder() { return PriorityOrdered.HIGHEST_PRECEDENCE; } }
[ "wings.king@hotmail.com" ]
wings.king@hotmail.com
5be6f3e4dacea7876975b6f52e80e23e5e454443
f613d01a3ef7278214c43a950afffba9cfc73479
/PACom/src/main/java/org/proteored/pacom/analysis/exporters/tasks/PexExportingMessage.java
ccb671da042e38fae6a3fc5dbe156c4ac41d0a80
[ "Apache-2.0" ]
permissive
smdb21/PACOM
b724ddfb2a3937bb4e7198223019a88cc37e1c9f
82026e9cf3299e8cd887e4de731c45174fb92b2f
refs/heads/master
2022-05-13T11:36:16.340784
2022-03-16T16:27:40
2022-03-16T16:27:40
48,765,901
4
2
null
null
null
null
UTF-8
Java
false
false
346
java
package org.proteored.pacom.analysis.exporters.tasks; public class PexExportingMessage { private final String body; private final String tip; public PexExportingMessage(String body, String tip) { super(); this.body = body; this.tip = tip; } public String getBody() { return body; } public String getTip() { return tip; } }
[ "salvador@scripps.edu" ]
salvador@scripps.edu
c572e4a6113147218dd7e031c767d7c311906490
09c4b92d7bb1b715bdd33ffc5f437d7e134235e7
/app/src/main/java/ahmet/com/eatit/model/ShippingOrder.java
36d3559b90a1aa5e3bd758569b7a9858b98dab3c
[]
no_license
ahmedwasfe/EatItClient
769050109d1a8606e09b4378a799544a1687102e
df50855ecc526640299c30f481f372e70c93f6bf
refs/heads/master
2022-09-17T23:07:52.642386
2020-05-25T23:53:44
2020-05-25T23:53:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,563
java
package ahmet.com.eatit.model; public class ShippingOrder { private String key, shipperPhone, shipperName; private double currentLat, currentLng; private Order order; private boolean isStartTrip; private String estimateTime; public ShippingOrder() { } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getShipperPhone() { return shipperPhone; } public void setShipperPhone(String shipperPhone) { this.shipperPhone = shipperPhone; } public String getShipperName() { return shipperName; } public void setShipperName(String shipperName) { this.shipperName = shipperName; } public double getCurrentLat() { return currentLat; } public void setCurrentLat(double currentLat) { this.currentLat = currentLat; } public double getCurrentLng() { return currentLng; } public void setCurrentLng(double currentLng) { this.currentLng = currentLng; } public Order getOrder() { return order; } public void setOrder(Order order) { this.order = order; } public boolean isStartTrip() { return isStartTrip; } public void setStartTrip(boolean startTrip) { isStartTrip = startTrip; } public String getEstimateTime() { return estimateTime; } public void setEstimateTime(String estimateTime) { this.estimateTime = estimateTime; } }
[ "ahmedwasfe84@gmail.com" ]
ahmedwasfe84@gmail.com
a862a841cfdc676df10af025f121370fbb7de441
25a491fc7fa96d5c67eab197d8c3017a38a097fe
/src/IteratorDemo.java
722635060baa287c6b9d27f3993efd6fd01dd8d9
[]
no_license
morpheous27/java
9a3241c9c49393980768656222c2e3a1ee87e0c2
de924036bb1fcf3a83dbaf8d8c0eefdf572c8269
refs/heads/master
2023-07-21T04:26:56.225039
2022-05-14T12:56:22
2022-05-14T12:56:22
144,978,285
0
0
null
2023-07-17T17:52:17
2018-08-16T11:24:14
Java
UTF-8
Java
false
false
942
java
import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; public class IteratorDemo { public static void main(String[] args) { Map<String, Integer> map = new HashMap<String, Integer>(); /* * map.put("1", 1); map.put("2", 2); Iterator itr = * map.keySet().iterator(); while(itr.hasNext()) { map.put("3",3); * System.out.println(itr.next()); } */ /* * List<String> list = new ArrayList<String>(); list.add("one"); */ List<String> list = new LinkedList<String>(); Iterator itr = list.iterator(); // instance locked // list.remove("one"); System.out.println(list.size()); Collections.sort(list); while (itr.hasNext()) { System.out.println(itr.next()); // itr.remove(); list.remove("one"); list.add("two"); // System.out.println(itr.next()); } System.out.println(list.size()); } }
[ "nitsaxen0@publicisgroupe.net" ]
nitsaxen0@publicisgroupe.net
9495c35049f8f503ef9fb4f7c92a58946b4b6ef8
826642720da414981580c599a32dce9ba2179da1
/sources/ca/albertahealthservices/contacttracing/fragment/EnterPinFragment$onViewCreated$2.java
fc713a8c6f07aa8ef6b5d3a80520e85275c2ab35
[]
no_license
bclehmann/abtracetogether_1.0.1.apk_disassembled
be60aa11b4f798952de68b985a138019cc79a4ab
562cb759f0b45007ac4d3db171926654393ebc0b
refs/heads/master
2022-11-07T11:13:17.926766
2020-06-20T04:55:34
2020-06-20T04:55:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,266
java
package ca.albertahealthservices.contacttracing.fragment; import android.view.View; import android.view.View.OnClickListener; import androidx.fragment.app.Fragment; import kotlin.Metadata; import kotlin.TypeCastException; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "onClick"}, k = 3, mv = {1, 1, 16}) /* compiled from: EnterPinFragment.kt */ final class EnterPinFragment$onViewCreated$2 implements OnClickListener { final /* synthetic */ EnterPinFragment this$0; EnterPinFragment$onViewCreated$2(EnterPinFragment enterPinFragment) { this.this$0 = enterPinFragment; } public final void onClick(View view) { Fragment parentFragment = this.this$0.getParentFragment(); if (parentFragment != null) { ((UploadPageFragment) parentFragment).popStack(); return; } throw new TypeCastException("null cannot be cast to non-null type ca.albertahealthservices.contacttracing.fragment.UploadPageFragment"); } }
[ "bclehmann@yahoo.ca" ]
bclehmann@yahoo.ca
293f3a41b7cfab4d65f1fae87b3e5c0c8c77eb62
2f5ae9a55394355d6541fd09119dfab28b50e604
/CucumberPOMClone/src/test/java/basics/CucumberPOM/AppTest.java
9dd0b8f4e196732be4e1449df29414e7d3245553
[]
no_license
simrandk/git7Oct
1130e9314c7f7df08bd5dab124d301e14251a1d8
be6b21a09edf02fd2305a66e4ec8a4969d5683da
refs/heads/master
2021-07-11T14:48:25.900168
2019-10-07T10:01:02
2019-10-07T10:01:02
213,349,884
0
0
null
2020-10-13T16:32:06
2019-10-07T10:02:22
Java
UTF-8
Java
false
false
684
java
package basics.CucumberPOM; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "PDC3A-Training.PDC3A@P3A-HVGRXJ2.dir.svc.accenture.com" ]
PDC3A-Training.PDC3A@P3A-HVGRXJ2.dir.svc.accenture.com
35949de699497c5b03a898ae539f607f4e3a82b7
71cf8a07c8fddd3c66d6a4efd41aa6b5c69c7c5f
/app/src/main/java/okhttp/request/CountingRequestBody.java
a519faae1d310524ea8ae91923ab47cb768980bf
[]
no_license
zhoupeng2/NeiHanTV
d3016fa52a184a849e2fbbe1f6a71d9729d71b53
e17b9cbb0853fa7a5278bfeda67d74e99952e7a0
refs/heads/master
2020-03-22T07:23:01.212967
2019-11-19T05:55:56
2019-11-19T05:55:56
139,696,766
7
0
null
null
null
null
UTF-8
Java
false
false
1,994
java
package okhttp.request; import java.io.IOException; import okhttp3.MediaType; import okhttp3.RequestBody; import okio.Buffer; import okio.BufferedSink; import okio.ForwardingSink; import okio.Okio; import okio.Sink; /** * Decorates an OkHttp request body to count the number of bytes written when writing it. Can * decorate any request body, but is most useful for tracking the upload progress of large * multipart requests. * * @author Leo Nikkilä */ public class CountingRequestBody extends RequestBody { protected RequestBody delegate; protected Listener listener; protected CountingSink countingSink; public CountingRequestBody(RequestBody delegate, Listener listener) { this.delegate = delegate; this.listener = listener; } @Override public MediaType contentType() { return delegate.contentType(); } @Override public long contentLength() { try { return delegate.contentLength(); } catch (IOException e) { e.printStackTrace(); } return -1; } @Override public void writeTo(BufferedSink sink) throws IOException { countingSink = new CountingSink(sink); BufferedSink bufferedSink = Okio.buffer(countingSink); delegate.writeTo(bufferedSink); bufferedSink.flush(); } protected final class CountingSink extends ForwardingSink { private long bytesWritten = 0; public CountingSink(Sink delegate) { super(delegate); } @Override public void write(Buffer source, long byteCount) throws IOException { super.write(source, byteCount); bytesWritten += byteCount; listener.onRequestProgress(bytesWritten, contentLength()); } } public static interface Listener { public void onRequestProgress(long bytesWritten, long contentLength); } }
[ "zp83959653@163.com" ]
zp83959653@163.com
4544a07de877180f5a4e3879a186f67cb942976c
e4966561a4c75514a568682975acee3fb4ddc229
/src/TeamProject.java
d1772aa76bc14af25532beea57a249e4f69ed90d
[]
no_license
nileshsherla/TrainingProject
e9d9a4d3ef54a42bb3d0362c27a4b503643a6c5e
329b81b56966861472969dd453760db86056e7ae
refs/heads/master
2020-05-29T08:46:29.234245
2016-09-29T15:06:30
2016-09-29T15:06:30
69,462,549
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
public class TeamProject { public TeamProject() { } public static void main(String[] args) { } }
[ "n.sherla@DSS-433.dsslp.com" ]
n.sherla@DSS-433.dsslp.com
ffac7fed18d969008604b0229d09085a0457afe8
03f9caaefecfc046eca460eaf29bc450c78c4219
/src/rex/graphics/mdxeditor/mdxbuilder/nodes/MBTArgLogicalNode.java
9dbed886626e03f9d7ee9aee6a755cb9cc070494
[]
no_license
amirsaleh-salehzadeh/NIOPDC-BI
27829673da5114733ee25be21e5373abcebf4ed8
173ea89c1983d1e20551cb1254e891eefac24c4c
refs/heads/master
2021-01-22T22:44:21.963921
2017-03-20T12:33:18
2017-03-20T12:33:18
85,563,246
0
0
null
null
null
null
UTF-8
Java
false
false
2,486
java
package rex.graphics.mdxeditor.mdxbuilder.nodes; import rex.graphics.mdxeditor.mdxbuilder.dnd.TransferableMdxBuilderTreeNode; import javax.swing.JOptionPane; import rex.utils.I18n; /** * Node representing MdxFunction's logical argument. * @author Igor Mekterovic * @version 0.3 */ public class MBTArgLogicalNode extends MBTArgStringNode{ public MBTArgLogicalNode(){ super(); } public MBTArgLogicalNode( String _argName ) { super(false, _argName, false, false); } public MBTArgLogicalNode( String _argName , boolean _respawnArg ) { super(false, _argName, _respawnArg, false); } public MBTArgLogicalNode( boolean _isHeadArg , String _argName ) { super(_isHeadArg, _argName, false, false); } public MBTArgLogicalNode( boolean _isHeadArg , String _argName , boolean _respawnArg , boolean _optionalArg ) { super(_isHeadArg, _argName, _respawnArg, _optionalArg); } /** * */ void setAcceptableFlavorsArray(){ acceptableFlavorsMimeTypes = new String[] { TransferableMdxBuilderTreeNode.MDX_BUILDER_TREE_LOGICAL_FUNCTION_NODE_FLAVOR_STRING , TransferableMdxBuilderTreeNode.MDX_BUILDER_TREE_STRING_FUNCTION_NODE_FLAVOR_STRING // I'll alow a String also }; } /** * Displays a dialog to enter a logical expression. */ void setValue(){ /** * Copyright (C) 2006 CINCOM SYSTEMS, INC. * All Rights Reserved * Copyright (C) 2006 Igor Mekterovic * All Rights Reserved */ /* implementing localization */ value = JOptionPane.showInputDialog(I18n.getString("msgText.logicalExpr"), ""); /* end of modification for I18n */ } /** * Displays a dialog to edit current logical expression. */ void editValue(){ String newValue; /** * Copyright (C) 2006 CINCOM SYSTEMS, INC. * All Rights Reserved * Copyright (C) 2006 Igor Mekterovic * All Rights Reserved */ /* implementing localization */ newValue = JOptionPane.showInputDialog(I18n.getString("msgText.logicalExpr"), value); /* end of modification for I18n */ if (newValue != null && newValue.trim().length()>0) value = newValue; } }
[ "salehzadeh@gmail.com" ]
salehzadeh@gmail.com
6db662b0e64c62ab48907048da8797c59cf54b3c
e5ece3b5a94302f349d3c03d5cf0f8054b223045
/src/TEmp.java
9dc28a968b5026de5cc8e0e748450b6f31265587
[]
no_license
ssiedu/InheritanceExamples630
66ddc340f66b01233034f43a1001e337b53ec660
184b5b1894a3a36cbbcdbfe8b7d4300ffb9d26b9
refs/heads/master
2020-07-07T00:11:24.277480
2019-08-28T14:11:06
2019-08-28T14:11:06
203,181,484
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
public class TEmp extends Emp { public void computeSalary(){ System.out.println("Computing Salary of TEmp"); } }
[ "manoj.sarwate@ssiedu.in" ]
manoj.sarwate@ssiedu.in
806cf558116ab87f84815855b9e910e44fa30067
e2b9f0617bdda8a563dacec24418b80d5af87063
/PortablePotty/src/main/java/com/portable/potty/model/Dispatcher.java
4ca1f900d2d016e4162b612077e5ed1c1a4e9d25
[]
no_license
HaroldMac/PortablePotty
72ef0b8d56c739740b053104fd653b51af6d135d
26c956ca8632da32015aca09ecb81093f77b52b4
refs/heads/master
2020-04-10T15:12:02.731149
2019-01-01T06:23:41
2019-01-01T06:23:41
161,100,650
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package com.portable.potty.model; public class Dispatcher { }
[ "harold.macdonald52@gmail.com" ]
harold.macdonald52@gmail.com
5fd0cf1568c41081f4571542ca4e42b55ffe9776
0f38c4652c8cbb18eba0b05187f0a7ba188c6dc5
/RegularLangaugeSearchCode/Regex Matcher/src/regex/matcher/NodeBuilder.java
430819954869e2526eb78bc89ba45f125d32d807
[]
no_license
URSIGameDesign2015/Adversary-Search-Algorithm
dc798b1702c54cfba59bb63b26c48a58ba2b5095
d70234f82bd695e7b85fc1af2a8d8a4ba7421abc
refs/heads/master
2021-01-12T21:46:21.080666
2015-09-22T14:05:53
2015-09-22T14:05:53
39,215,134
1
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package regex.matcher; public class NodeBuilder { private Alphabet alphabet; private int id = 0; public NodeBuilder(Alphabet alphabet) { this.alphabet = alphabet; } public Node createSymbolNode(char symbol) { return initNode(new SymbolNode(symbol)); } public Node createParenthesesNode(Node childNode) { return initNode(new ParenthesesNode(childNode)); } public Node createUnionNode(Node leftChild, Node rightChild) { return initNode(new UnionNode(leftChild, rightChild)); } public Node createConcatenationNode(Node leftChild, Node rightChild) { return initNode(new ConcatenationNode(leftChild, rightChild)); } public Node createKleeneClosureNode(Node childNode) { return initNode(new KleeneClosureNode(childNode)); } private Node initNode(Node node) { node.setId(id++); node.setAlphabet(alphabet); return node; } }
[ "kahodge@vassar.edu" ]
kahodge@vassar.edu
cae817a7852ecc71b5d52908a22165b4063a9dda
1156d348c03c363107a4c5ce67ef6af8d7ad1103
/app/src/main/java/com/example/singhkshitiz/letschat/FirebaseMessagingService.java
14d4820dab43c1332a2d502c244eaa24aeb1a66a
[]
no_license
itanraju/LetsChat
08484cdc233f7e4c52b4470b44af7c53b764db40
8e3c9f4b6c179c38ef07a717a7338f6e4c03b65e
refs/heads/master
2023-07-08T02:12:34.735020
2021-08-03T12:02:05
2021-08-03T12:02:05
392,302,312
0
0
null
null
null
null
UTF-8
Java
false
false
2,200
java
package com.example.singhkshitiz.letschat; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import android.support.v4.app.NotificationCompat; import android.util.Log; import com.google.firebase.messaging.RemoteMessage; /** * Created by KSHITIZ on 3/22/2018. * -----WHENEVER NOTIFICATION IS RECEIEVED----- */ public class FirebaseMessagingService extends com.google.firebase.messaging.FirebaseMessagingService { //---opening the application on recieving notification--- @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); try{ String notification_title= remoteMessage.getNotification().getTitle(); String notification_message=remoteMessage.getNotification().getBody(); String click_action=remoteMessage.getNotification().getClickAction(); String from_user_id=remoteMessage.getData().get("from_user_id"); //Log.e("from_user_id in FMS is:",from_user_id); //----BUILDING NOTIFICATION LAYOUT---- NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(notification_title) .setContentText(notification_message) .setPriority(NotificationCompat.PRIORITY_DEFAULT); //--CLICK ACTION IS PROVIDED--- Intent resultIntent = new Intent(click_action); resultIntent.putExtra("user_id",from_user_id); PendingIntent resultPendingIntent = PendingIntent.getActivity(this,0,resultIntent,PendingIntent.FLAG_UPDATE_CURRENT); mBuilder.setContentIntent(resultPendingIntent); int mNotificationId=(int)System.currentTimeMillis(); NotificationManager mNotifyManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); mNotifyManager.notify(mNotificationId,mBuilder.build()); // Log.e("from_user_id 5 is:",from_user_id); }catch(Exception e){ Log.e("Exception is ",e.toString()); } } }
[ "mrsl8898@gmail.com" ]
mrsl8898@gmail.com
885fde00fdaa60110be7b667558d5164bdbe7c09
686a07e5db6a2080631d7c45743694ecb5f75142
/mvpdemo2/src/main/java/com/example/mvpdemo2/base/BasePresenter.java
daca69a6095ca7e5ae77c61fbb16a72e47aaed4c
[]
no_license
RaoChong/MvpDemo
e99930db70d5b735bd3d6e63e3f24a2c29ddf015
07b0f616fb10f1200d4912f8be5e06f6c2a4c256
refs/heads/master
2020-03-26T08:30:09.762572
2018-08-14T10:36:31
2018-08-14T10:36:31
144,706,002
0
0
null
null
null
null
UTF-8
Java
false
false
203
java
package com.example.mvpdemo2.base; import android.view.View; import com.example.mvpdemo2.model.network.RetrofitUtils; public interface BasePresenter<T>{ void attacth(T view); void death(); }
[ "18434839788@163.com" ]
18434839788@163.com
7ae3dfdd8e1022d84d33d67e923cb9f6f1889bd0
094371c36eff5d3de0eb780d95c328a13e765a02
/java/Comparable1.java
dfd12e80cc103be607e71ae5ce5f48830e7fb5b5
[]
no_license
Balu-ust/Java-FSD-Training
288252dcfcaaea56336d18d79b5017acb56de78b
88a643707fbd0b3c07fc9bba6a0834f743d32113
refs/heads/main
2023-07-26T15:30:32.292320
2021-09-09T06:46:22
2021-09-09T06:46:22
388,085,000
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package com.ust.example; import java.util.ArrayList; import java.util.Collections; import java.io.*; class Student5 implements Comparable<Student5>{ int rollno; String name; int age; Student5(int rollno, String name, int age){ this.rollno= rollno; this.name= name; this.age= age; } public int compareTo(Student5 st) { if(age==st.age) return 0; else if(age>st.age) return 1; else return -1; } } public class Comparable1 { public static void main(String[] args) { ArrayList<Student5>ala= new ArrayList<Student5>(); ala.add(new Student5(101,"balu",23)); ala.add(new Student5(102,"hari",25)); ala.add(new Student5(103,"anand",21)); Collections.sort(ala); for(Student5 st:ala) { System.out.println(st.rollno+" "+st.name+" "+st.age); } } }
[ "noreply@github.com" ]
noreply@github.com
a17cb86e2466ed53ae01d55d1f83d5d89de1ca76
ba37ea72e6971f6151fe92da9320138070809fcd
/GameServer/src/com/player/GameConst.java
b4c3001ecafa0dc27ec56f3cd2df7e18412bdad1
[ "MIT" ]
permissive
yhfly/RushServer
2b217f1dba205a01a8f6242d439ac1012c3116ac
62ed293e253bf8e253b64eab8d1082e67a24121b
refs/heads/master
2020-03-24T08:25:17.369386
2018-01-08T12:00:41
2018-01-08T12:00:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,501
java
package com.player; /** * 游戏中使用的一些公共的变量 */ public interface GameConst { /** * 单个职业所拥有的职业技能数量 */ short PER_JOB_SKILL_COUNT = 9; /** * 每个技能链拥有的技能个数 */ short PERSKILLCHAINCOUNT = 6; /** * 万分几率 */ double TEN_THOUSAND_RATE = 0.0001; /** * 用于万分率计算使用 */ short TEN_THOUSAND = 10000; /** * 用于随机万分率计算使用 */ short TEN_THOUSAND_ONE = 10001; /** * 用于百分比计算使用 */ short HUNDRED_PERCENT = 100; /** * 取名长度 */ short MAX_NAME_LENGTH = 14; /** * 房间的最大容量 */ short ROOM_MAX_CAPACITY = 10; /** * 邮件的最大数量 */ short MAX_MAIL_COUNT = 50; /** * 公会公告的最大长度 */ short MAX_GUILD_SLOGAN_LEN = 50; /** * 公会名字的最大长度 */ short MAX_GUILDNAME_LEN = 20; /** * 公会的初始人数 */ int GUILD_BASE_MEMBER_COUNT = 9; /** * 公会的最高等级 */ int MAX_GUILD_LEVEL = 30; /** * 聊天时间间隔 */ int CHAT_TIME = 5; /** * 队伍的最大人数 */ int MAX_TEAM_MEMBER_COUNT = 5; /** * 装备卡槽的个数 */ int EQUIP_HOLE_COUNT = 3; /** * 装备进阶最大的材料个数 */ int MAX_EQUIP_ADVANCE_MATERIAL_COUNT = 10; /** * 装备的属性总数 */ short FIGHT_ATTRIBUTE_COUNT = 5; }
[ "zhong264love@gmail.com" ]
zhong264love@gmail.com
957d4dcff18b96717bdf7eed26360ea1eb94674e
e22dbde65d5603afbc07bd18b31f0af84520a84b
/src/com/kc/supcattle/MusicFragment.java
458ed578a306134a91c992917c25c9da0ead0ab7
[]
no_license
keynescao/addemo2
6739a0e3a395f44b44de6fda6ba342a20e75702e
bf8f919132298ffc0b9081f3a59ad5757a16623a
refs/heads/master
2021-01-17T18:32:35.803086
2016-05-25T09:53:44
2016-05-25T09:53:44
58,915,792
0
0
null
null
null
null
UTF-8
Java
false
false
3,772
java
package com.kc.supcattle; import com.handmark.pulltorefresh.library.PullToRefreshListView; import com.kc.supcattle.adpter.MusicListAdapter; import com.kc.supcattle.utils.MusicTools; import com.kc.supcattle.vo.Music; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.content.LocalBroadcastManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AnimationUtils; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageView; import android.widget.LinearLayout; /** * 音乐 * */ public class MusicFragment extends Fragment { private PullToRefreshListView mListView; private LinearLayout loadingLayout; private ImageView layoutImg; private MusicListAdapter musicAdatper; private LocalBroadcastManager localBroadCast; private BroadcastReceiver receiver; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); localBroadCast = LocalBroadcastManager.getInstance(getContext()); receiver = new BroadcastReceiver(){ public void onReceive(Context context, Intent intent) { int cmd = intent.getIntExtra("cmd", 0); if(cmd == 0 && musicAdatper!=null){ musicAdatper.notifyDataSetChanged(); } } }; IntentFilter filter = new IntentFilter(); filter.addAction(MusicTools.MUSIC_BORDCAST); localBroadCast.registerReceiver(receiver, filter); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); new LoadMusicTask().execute(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.music_fragment, container,false); loadingLayout = (LinearLayout)view.findViewById(R.id.loading_layout); layoutImg = (ImageView)view.findViewById(R.id.loading_img); layoutImg.setAnimation(AnimationUtils.loadAnimation(getContext(),R.anim.loading)); mListView = (PullToRefreshListView )view.findViewById(R.id.muicListView); mListView.setVisibility(View.GONE); mListView.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Music data = (Music)parent.getItemAtPosition(position); Intent intent = new Intent(getActivity(),MusicPlayActivity.class); intent.putExtra("mid", String.valueOf(data.getId())); MusicTools.CURRENT_PLAY_SONG = data.getId(); startActivity(intent); } }); return view; } @Override public void onResume() { super.onResume(); if(musicAdatper!=null){ musicAdatper.notifyDataSetChanged(); } } private class LoadMusicTask extends AsyncTask<Void, Void, Void>{ protected Void doInBackground(Void... params) { if(MusicTools.musicList.size()==0){ MusicTools.scanMusic(getContext()); } return null; } protected void onPostExecute(Void result) { super.onPostExecute(result); musicAdatper = new MusicListAdapter(MusicTools.musicList,MusicFragment.this.getContext()); mListView.setAdapter(musicAdatper); mListView.setVisibility(View.VISIBLE); loadingLayout.setVisibility(View.GONE); mListView.onRefreshComplete(); } } @Override public void onDestroy() { super.onDestroy(); localBroadCast.unregisterReceiver(receiver); } }
[ "keynescao@163.com" ]
keynescao@163.com
152263cc844dd86071f80cd0e94afb77c66d8b87
3103d06f0286ddaee0c27711c26653d0aa408db0
/spring-security-learn/src/main/java/com/ss/ssdemo/controller/HelloController.java
5a040628ca1e09e708888ce31871453044be10a7
[]
no_license
mighto/spring-security-learn
09a85c99745c0a7687e8442490c7aca5b97cc00f
6c9203cf75b6b56fdaf2b0ac272a4d8c0e1fb69e
refs/heads/master
2020-04-25T09:42:11.635401
2019-03-04T08:59:44
2019-03-04T08:59:44
172,683,670
1
0
null
null
null
null
UTF-8
Java
false
false
601
java
package com.ss.ssdemo.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Date; /** * @author mistaker * @description: * @create 2019/02/26 */ @RestController public class HelloController { @RequestMapping("/hello") public Date hello() { return new Date(); } @RequestMapping("/hl") public String hl(String username, String password) { System.out.println(username); System.out.println(password); return (username + password); } }
[ "2029635554@qq.com" ]
2029635554@qq.com
70824dfa375642b22871659fb3c919cfc3f673e2
78562a31fed401e475491e243dd797577b4b663e
/magnet-library/magnet-processor/src/test/resources/SelectorInFactoryClassTest/generated/Implementation8MagnetFactory.java
f163e2c680962fe47a1273a6b3d9802392579514
[ "Apache-2.0" ]
permissive
realdadfish/magnet
5337891af6468e042de6f2bd6ada948bc19fe73a
2f9e773cf0fe7f88e765ca4bcd166b82682371c5
refs/heads/master
2020-04-23T16:07:32.441100
2019-01-02T09:53:01
2019-01-02T09:53:01
171,287,367
0
0
Apache-2.0
2019-02-18T13:16:04
2019-02-18T13:16:04
null
UTF-8
Java
false
false
504
java
package selector; import magnet.Scope; import magnet.internal.InstanceFactory; public final class Implementation8MagnetFactory extends InstanceFactory<Interface> { private static String[] SELECTOR = { "android", "api", "in", "1", "19" }; @Override public Interface create(Scope scope) { return new Implementation8(); } @Override public String[] getSelector() { return SELECTOR; } public static Class getType() { return Interface.class; } }
[ "beworker@gmail.com" ]
beworker@gmail.com
27c7ab2ac438b3d6ccfd1acaac637fbe2a50634d
5daa5d77f81add30d696ec92a325a8a79368cf59
/ServletTest/src/kr/or/ddit/basic/T01_ServletLifeCycle_Log4j.java
be9ec478ea868e84d846ad56f25dde9ad82a78c0
[]
no_license
ejyoo1/DDITStep2
22bc613e7702e9d29c806a24e5a70e05f12e032f
169c150e8b304a4748082e5ae3c4ae805344f93e
refs/heads/master
2023-04-24T07:32:19.500114
2021-05-06T12:10:52
2021-05-06T12:10:52
342,445,135
0
0
null
null
null
null
UTF-8
Java
false
false
2,280
java
package kr.or.ddit.basic; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * 서블릿의 라이프사이클을 확인하기 위한 예제 * (서블릿이란? 웹 애플리케이션 개발 시 스펙) * 컨테이너(서블릿엔진)에 의해 관리되는 **자바기반 웹 컴포넌트**로서, 동적인 웹 컨텐츠를 가능하게 해준다. * @author 유은지 * 서블릿 ? 자바로 만든 웹 어플리케이션 .. 컨테이너 역할을 하는 것이 톰캣이다. * 서비스를 실행하기 위해서는 컨테이너 즉 톰캣(WAS)에 올려야 한다. * * 톰캣에 프로젝트를 올려서 web.xml 설정정보 기반으로 실행 * * WebContent - root * WEB-INF에 web.xml이 존재해야 톰캣이 인식함. * WEB-INF : lib 는 외부에서 참조해서 사용하는 라이브러리를 이 폴더에 넣어야 인식한다. * WEB-INF : classes(클래스 Path가 모여있는 곳) */ public class T01_ServletLifeCycle_Log4j extends HttpServlet { //http 프로토콜을 사용하는 클래스 @Override public void init() throws ServletException{ //초기화 코드 작성 System.out.println("init() 호출됨."); } @Override protected void service(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException{ //실제적인 작업 수행이 시작되는 지점.(Entry Point) //자바의main메서드 역할 super.service(arg0, arg1); System.out.println("service 호출됨."); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //메서드 방식이 get인 경우 호출됨 System.out.println("doGet() 호출됨."); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //메서드 방식이 post인 경우에 호출됨 System.out.println("doPost() 호출됨."); // doGet(req, resp); } @Override public void destroy() { //객체 소멸 시 (컨테이너로부터 서블릿 객체 제거 시) 필요한 코드 작성... System.out.println("destory() 호출됨."); } }
[ "o3k3585@gmail.com" ]
o3k3585@gmail.com
bd99b014c562f7542d3190510a039db64f0cf077
d1d20238592cece9ee3abafe1277ba88756f6048
/src/test/Ts.java
4cbe937a9d2f7af6ba7a5aceec2940649b870d33
[]
no_license
DuskRazor/CuckooBird
436de5dec2e4b27b3138fe431ae21671c05df8df
3d82b23e60c4592616b5f791852a08fca5be83c0
refs/heads/master
2023-08-24T19:36:47.591842
2021-09-27T00:37:23
2021-09-27T00:37:23
410,676,469
1
0
null
null
null
null
UTF-8
Java
false
false
470
java
package test; import org.junit.Assert; import org.junit.Test; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; public class Ts { @Test public void get(){ try { BufferedImage image = ImageIO.read(Ts.class.getClassLoader().getResourceAsStream("images/bg_light.png")); Assert.assertNotNull(image); } catch (IOException e) { e.printStackTrace(); } } }
[ "18700050389@163.com" ]
18700050389@163.com
cce2f7ad57e96e64b0335d5ad5e6d9eda828bc0d
96f8f21f5659f84b90b4f5eafb0bd8723551592b
/tetris/src/com/zjw/tetris/controller/PlayerController.java
a26c77858be86f4d5d06a0a59557e4d184b4b9d9
[]
no_license
hydra3015/hydra3015
e5d59b51fb7950b244f7c4ee3a061bfd81b51b66
f84377b46342f4c3245e99142eea6209600010c3
refs/heads/master
2021-05-21T09:20:31.224008
2020-04-09T10:21:55
2020-04-09T10:21:55
252,634,450
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package com.zjw.tetris.controller; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import com.zjw.tetris.factory.FrameGameFactory; import com.zjw.tetris.ui.lay.Layer; public class PlayerController implements KeyListener { private GameController gameController; public GameController getGameController() { return gameController; } public void setGameController(GameController gameController) { this.gameController = gameController; } @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_S: gameController.moveDown(); break; case KeyEvent.VK_A: gameController.moveLeft(); break; case KeyEvent.VK_D: gameController.moveRight(); break; case KeyEvent.VK_ENTER: gameController.rorate(); break; case KeyEvent.VK_SPACE: gameController.suspend(); break; case KeyEvent.VK_SHIFT: gameController.newGame(); break; case KeyEvent.VK_ESCAPE: System.exit(0); break; } } @Override public void keyReleased(KeyEvent e) { } }
[ "hydra3015@163.com" ]
hydra3015@163.com
dd28478c5d7618978e37ef6c52e7fc33d7f8cf4d
f4d47330429a699f079524baec131d145f8c33f5
/src/helper/Parser.java
94f36a2992da2e3d2cdb1e9dcb405c6c3f715cea
[ "MIT" ]
permissive
hsandt/GraphDrawerApp
99681bf35358ccd936c4525f52b1e5d59ae6b6fe
975208dea464e2ad6d0383ac1e8a7bc261fa01c3
refs/heads/master
2020-04-03T03:35:12.376116
2018-10-27T17:21:20
2018-10-27T17:21:20
154,989,959
0
0
null
null
null
null
UTF-8
Java
false
false
3,308
java
package helper; import java.io.*; import java.util.ArrayList; import java.util.List; /** * Outil pour parser les fichiers texte * * @author Karim Vindas * */ public class Parser { /** * Parse le fichier .txt contentant le * graphe. * @param filePath chemin du fichier à parser * @return lists la liste des listes d'entiers présents à chaque ligne et séparés par des espaces */ public static List<List<Integer>> parseFile(String filePath){ BufferedReader bufferedReader = null; List<List<Integer>> lists = new ArrayList<List<Integer>>(); // on initialise la grande liste à une liste vide List<Integer> currentList = null; try { bufferedReader = new BufferedReader(new FileReader(filePath)); // on ouvre un flux vers le fichier en s'aidant d'un tampon String line = null; while (true){ currentList = new ArrayList<Integer>(); // on initialise la liste des entiers (liste courante) à une liste vide line = bufferedReader.readLine(); // on lit la ligne suivante if (line == null) break; // On sort de la boucle une fois que la tête de lecture a atteint la fin du fichier .txt int i = 0; // On initialise un pointeur qui va parcourir la liste (indice du début de la fenêtre de lecture) while (i < line.length()){ // Cette étape s'arrête une fois qu'on arrive à la fin de la ligne. int j = 1; // On initialise la longueur de la fenêtre de lecture à 1. // On va analyser le prochain caractère (s'il existe) pour repérer les espaces et bien séparer les voisins. while ((i+j+1 < line.length()+1) && (!line.substring(i+j,i+j+1).contentEquals(" "))){ j++; // tant qu'on ne lit pas d'espace (donc a priori des chiffres), on agrandit la fenêtre de lecture } currentList.add(Integer.parseInt(line.substring(i,i+j))); // On transforme la String relative aux noeuds en entier indexant le noeud. i=i+j+1; // on décale le début de la fenêtre juste après le dernier espace détecté (si ce n'était pas la fin de la ligne) } lists.add(currentList); // on complète la grande liste avec la liste des entiers lus sur cette ligne } } catch (FileNotFoundException ex) { // Gestion des exceptions : fichier non trouvé ex.printStackTrace(); System.out.print("Veuillez vérifier votre premier paramètre de commande" + " ainsi que le contenu du dossier 'data'."); } catch (IOException ex) { ex.printStackTrace(); } finally { try { if (bufferedReader != null) // s'il reste des données dans le buffer... bufferedReader.close(); // ... vider le buffer } catch (IOException ex) { ex.printStackTrace(); } } return lists; // On renvoie la liste contenant la liste des voisins pour chaque noeud. } }
[ "n.huu.long@gmail.com" ]
n.huu.long@gmail.com
1db65d3cb9085935d928eb613fd5a3232797838f
8fb961cfe3a1f9b5861dd894a19b0d5840e6752b
/app/src/main/java/com/example/messadmin/models/UserAccountSetting.java
d4b74cf1b3c1f30b127df78d2abc3fc99ad8fe90
[]
no_license
khnsahil/MessAdmin
b62e1a84d9c0ad228602c40cd81e711ccd72ab7c
fcc013944f96c602ea08f90e4cd405082427d45b
refs/heads/master
2022-11-24T08:40:08.686361
2020-05-29T11:36:11
2020-05-29T11:36:11
283,708,475
0
0
null
null
null
null
UTF-8
Java
false
false
2,205
java
package com.example.messadmin.models; public class UserAccountSetting { private String description; private String display_name; private long followers; private long following; private long posts; private String profile_photo; private String user_name; private String website; public UserAccountSetting(String description, String display_name, long followers, long following, long posts, String profile_photo, String user_name, String website) { this.description = description; this.display_name = display_name; this.followers = followers; this.following = following; this.posts = posts; this.profile_photo = profile_photo; this.user_name = user_name; this.website = website; } public UserAccountSetting() { } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getDisplay_name() { return display_name; } public void setDisplay_name(String display_name) { this.display_name = display_name; } public long getFollowers() { return followers; } public void setFollowers(long followers) { this.followers = followers; } public long getFollowing() { return following; } public void setFollowing(long following) { this.following = following; } public long getPosts() { return posts; } public void setPosts(long posts) { this.posts = posts; } public String getProfile_photo() { return profile_photo; } public void setProfile_photo(String profile_photo) { this.profile_photo = profile_photo; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getWebsite() { return website; } public void setWebsite(String website) { this.website = website; } }
[ "sahilbt6@gmail.com" ]
sahilbt6@gmail.com
ff92de8cf0b77d71d403c1a0be34218a8b01ba1d
6533922a5a9fd4d130318a8c1d8fabe52c6be5e6
/src/main/java/com/github/lindenb/ngsproject/model/Genotype.java
54f7cd7ef703381697eef7d0e5bc09af393a89b5
[]
no_license
lindenb/ngsproject
4d8337f897c5cda60591cdd3a2c79a36a2c28ede
016bd1491e1871f301fea46a0d3e75cd92894094
refs/heads/master
2020-06-07T06:53:15.194795
2013-06-17T15:21:26
2013-06-17T15:21:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,115
java
package com.github.lindenb.ngsproject.model; public class Genotype { private Variation variation; private Sample sample; private String A1; private String A2; public Genotype(Variation variation, Sample sample, String A1,String A2) { this.variation = variation; this.sample = sample; if(A1.compareTo(A2)<0) { this.A1=A1; this.A2=A2; } else { this.A1=A2; this.A2=A1; } } public Variation getVariation() { return variation; } public Sample getSample() { return sample; } public String getA1() { return A1; } public String getA2() { return A2; } public String getChrom() { return variation.getChrom(); } public int getPos() { return variation.getPos(); } public String getID() { return variation.getID(); } public String getRef() { return variation.getRef(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((sample == null) ? 0 : sample.hashCode()); result = prime * result + ((A1 == null) ? 0 : A1.hashCode()); result = prime * result + ((A2 == null) ? 0 : A2.hashCode()); result = prime * result + ((variation == null) ? 0 : variation.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Genotype other = (Genotype) obj; if (sample == null) { if (other.sample != null) return false; } else if (!sample.equals(other.sample)) return false; if (A1 == null) { if (other.A1 != null) return false; } else if (!A1.equals(other.A1)) return false; if (A2 == null) { if (other.A2 != null) return false; } else if (!A2.equals(other.A2)) return false; if (variation == null) { if (other.variation != null) return false; } else if (!variation.equals(other.variation)) return false; return true; } @Override public String toString() { return "Genotype [variation=" + variation + ", sample=" + sample + ", value=" + A1+"/"+A2 + "]"; } }
[ "plindenbaum@yahoo.fr" ]
plindenbaum@yahoo.fr
be41bebbd05c4f64ef12f4bf5b9615d4200ad74b
0da56067fa978cbcd7dbc5e546bd4279a40bec0e
/src/main/java/com/insomniacoder/orderservice/order/repositories/SalesOrderRepository.java
d97145e94a0f4f19f0af7f11ba4d7e22d4d29b6b
[]
no_license
InsomniaCoder/order-service
e68ff5e991019ff79b183f180329199eee0e45c7
090b8942a3bc702bd1764918b2b3ac8f5c3564f9
refs/heads/master
2020-03-22T15:15:14.343213
2018-07-11T04:22:35
2018-07-11T04:22:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.insomniacoder.orderservice.order.repositories; import com.insomniacoder.orderservice.order.entities.SalesOrder; import org.springframework.data.repository.CrudRepository; public interface SalesOrderRepository extends CrudRepository<SalesOrder, Long> { }
[ "tanatloke@gmail.com" ]
tanatloke@gmail.com
37095e4cf184c6248cc6eb79b28bbb2578603159
b760f94cba183e9c1f58190401230bb4a979ca92
/系统班/day19/代码/interfaceJDK8/InterStaticImpl.java
2b5b261158400605fa0aefa7f77817206af1118a
[]
no_license
zym-bass/Java--
866d302963e89a81a1285d683f06916d19a10166
10617f3f5d1446f6a5f54e32464ed82f4c5c0628
refs/heads/main
2023-02-09T12:42:13.369757
2021-01-08T11:44:19
2021-01-08T11:44:19
304,755,939
0
0
null
null
null
null
GB18030
Java
false
false
174
java
package com.ujiuye.interfaceJDK8; public class InterStaticImpl implements MyInterStaticMethod { // InterStaticImpl实现类没有继承到父接口中的静态方法 }
[ "824122161@qq.com" ]
824122161@qq.com
99fcc0a1989c9e9697d8c8df87755f35d30f2b33
79248a6f5f25798cd9ceadd20d49b16d169087da
/src/main/java/org/hatis/parser/data/exceptions/SyntaxException.java
e51536e0b8933930033c2f73afedc42ea129ded7
[]
no_license
chis123/parser
29b5366c6a8c6bff7dff2ee6867c2ab90badb92f
42a55326ca1fc1f8b89a678a59e9dec2d6dcf235
refs/heads/master
2020-09-29T10:55:54.131329
2016-11-17T19:11:39
2016-11-17T19:11:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,914
java
package org.hatis.parser.data.exceptions; import org.hatis.parser.Context; import org.hatis.parser.data.DebugInformation; import org.hatis.parser.expressions.Expression; import org.apache.commons.lang3.StringUtils; /** * * Created by Andrey on 01.06.2015. */ public class SyntaxException extends ParserException { public static final int TOKENS_COUNT_OFFSET = 10; private static final long serialVersionUID = 1L; private Expression exp; public SyntaxException(String msg, Context context) { super(msg, context); } public SyntaxException(String msg, Throwable t, Context context) { super(msg, t, context); } public SyntaxException(String msg, Expression exp, Context context) { super("Ощибка синтаксиса в выражении {" + StringUtils.join(exp.getArguments(), ":") + "}: " + msg, context); this.exp = exp; } public SyntaxException(String msg, Throwable t, Expression exp, Context context) { super("Ощибка синтаксиса в выражении {" + StringUtils.join(exp.getArguments(), ":") + "}: " + msg, t, context); this.exp = exp; } public String getExceptionDetails() { return getExceptionDetails(TOKENS_COUNT_OFFSET); } public String getExceptionDetails(int tokensCountOffset) { StringBuilder sb = new StringBuilder(); sb.append("Сообщение: ").append(getMessage()).append("\n"); if (exp != null) { sb.append("\n"); sb.append("Класс выражения: ").append(exp.getClass().getCanonicalName()).append("\n"); sb.append("Значения агрументов: ").append("\n"); exp.printDebug(context, sb); sb.append("\n"); } sb = new DebugInformation(context).getDetails(tokensCountOffset, sb); return sb.toString(); } }
[ "andro999b@gmail.com" ]
andro999b@gmail.com
041e96bfd478aaf5ab927c052e650b047ab9a1ef
1285ee838dcc642055171c5facacd617532326c1
/HIbernate/Hibernate-OneToMany/src/org/bridgelabz/hibernate/Bag.java
fcfabcda5f177cca82d29bc3c344c8d7e20686b9
[]
no_license
chandrakishore314/Algorithms
89d9b4ff596881f277fcbd75f76af4efd7cde9fb
52334c62c3f7572f2d609de8fe80cb60c053cb23
refs/heads/master
2023-04-04T03:47:47.121427
2021-03-29T09:04:16
2021-03-29T09:04:16
197,759,058
0
0
null
null
null
null
UTF-8
Java
false
false
914
java
package org.bridgelabz.hibernate; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.OrderColumn; import javax.persistence.Table; @Entity @Table(name="BAG1_DATA") public class Bag { @Id @GeneratedValue(strategy = GenerationType.AUTO) int id; String name; @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name="bid") @OrderColumn(name="type") List<Book> books; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Book> getBooks() { return books; } public void setBooks(List<Book> books) { this.books = books; } }
[ "chandrakishore314@gmail.com" ]
chandrakishore314@gmail.com
d35844aebb15b8796b7b24014c5d25587d5dda39
88c716cfc8ace2dd54488fbcf45d5876ed0d1331
/cms-admin/src/main/java/com/framework/modules/sys/dao/SeCollectionDao.java
11f322e73a2d97bc18f94d0f214407131c04df50
[]
no_license
yanch-a/yanch
1462e2e538a133b5d3f663ec26a702742cbe4540
ecfe1825432de12430dfc0ef4e4de2fc707bb10b
refs/heads/master
2020-04-30T19:54:58.047695
2019-03-22T04:32:02
2019-03-22T04:32:02
177,052,152
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package com.framework.modules.sys.dao; import com.framework.modules.sys.entity.SeCollectionEntity; import com.baomidou.mybatisplus.mapper.BaseMapper; /** * * * @author MIT * @email framework@gmail.com * @date 2018-09-26 10:16:24 */ public interface SeCollectionDao extends BaseMapper<SeCollectionEntity> { }
[ "yanch-a@yanch-a-note02.grandsoft.com.cn" ]
yanch-a@yanch-a-note02.grandsoft.com.cn
41d8ee9a81c83d9167be07bd82f34d76723fae5e
f1e5fde9af08dabad3e624418e4ac3747f23a325
/app/src/main/java/com/ypwl/xiaotouzi/ui/activity/BindPlatformAccountActivity.java
9aa81bf5d98e4ca4ba67823987dde736473e5a67
[]
no_license
freedomjavaer/XTZ
63fd7d9b99a5462011db132008c22340fd64e63f
173a20e9de009b184c1b78bc1470caffa27a6b88
refs/heads/master
2021-01-11T02:58:29.446859
2016-10-14T07:14:45
2016-10-14T07:14:45
70,871,985
3
0
null
null
null
null
UTF-8
Java
false
false
5,446
java
package com.ypwl.xiaotouzi.ui.activity; import android.annotation.SuppressLint; import android.net.http.SslError; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.webkit.SslErrorHandler; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; import android.widget.TextView; import com.squareup.otto.Subscribe; import com.ypwl.xiaotouzi.R; import com.ypwl.xiaotouzi.base.BaseActivity; import com.ypwl.xiaotouzi.common.URLConstant; import com.ypwl.xiaotouzi.event.BindAccountEvent; import com.ypwl.xiaotouzi.manager.EventHelper; import com.ypwl.xiaotouzi.utils.GlobalUtils; import com.ypwl.xiaotouzi.utils.StringUtil; import com.ypwl.xiaotouzi.utils.UIUtil; /** * @author tengtao * @time 2015/11/11 21:12 * @des ${自动记账绑定帐号页面} */ public class BindPlatformAccountActivity extends BaseActivity implements View.OnClickListener { private TextView mTvTitle; private ProgressBar mBindAccountProgressBar; private WebView mBindAccountWebView; private String pid; private String p_name; private Skip2DetailTask mTask; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bind_platform_account); initView(); initData(); } private void initView() { pid = getIntent().getStringExtra("pid"); p_name = getIntent().getStringExtra("p_name"); findViewById(R.id.layout_title_back).setOnClickListener(this); mTvTitle = (TextView) findViewById(R.id.tv_title); mBindAccountProgressBar = (ProgressBar) findViewById(R.id.pb_bind_account); mBindAccountWebView = (WebView) findViewById(R.id.wv_bind_account); mTvTitle.setText("绑定帐号"); if (mTask == null) { mTask = new Skip2DetailTask(); } } private void initData() { String url = String.format(URLConstant.BIND_PLATFORM_ACCOUNT, GlobalUtils.token, pid); requestData(url); } @SuppressLint("SetJavaScriptEnabled") private void requestData(String url) { if (StringUtil.isEmptyOrNull(GlobalUtils.token)) { UIUtil.showToastShort("用户信息有误"); finish(); return; } WebSettings settings = mBindAccountWebView.getSettings(); settings.setJavaScriptEnabled(true);//启用js脚本 settings.setCacheMode(WebSettings.LOAD_NO_CACHE);//禁用缓存 settings.setAllowFileAccess(true);//设置可以访问文件 settings.setBuiltInZoomControls(false); //设置支持缩放 //设置Web视图 mBindAccountWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { /**加载晓投资路径*/ if (url.contains("xtznative://") && url.contains("back")) {//不跳转,返回 mTask.postDelayed(mTask, 200); // BindPlatformAccountActivity.this.onBackPressed();//返回 } else if (url.contains("xtznative://") && url.contains("gourl?url")) {//跳转url mBindAccountWebView.loadUrl(url.split("=")[1]); }else{ /**加载合作方的网页路径*/ mBindAccountWebView.loadUrl(url); } return true; } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { handler.proceed(); } }); mBindAccountWebView.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int newProgress) { if (0 == newProgress || 100 == newProgress) { mBindAccountProgressBar.setVisibility(View.GONE); return; } mBindAccountProgressBar.setVisibility(View.VISIBLE); mBindAccountProgressBar.setProgress(newProgress); } }); mBindAccountWebView.loadUrl(url); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.layout_title_back: this.onBackPressed(); break; default: break; } } /** 跳转到平台投资详情 */ private class Skip2DetailTask extends Handler implements Runnable { @Override public void run() { if(isFinishing()) { EventHelper.post(new BindAccountEvent(true));//通知绑定成功,并且页面已关闭 }else{ EventHelper.post(new BindAccountEvent(false));//通知绑定成功,页面没有关闭 } } } @Override public void onBackPressed() { if(this.isFinishing()){return;} if (mBindAccountWebView != null && mBindAccountWebView.canGoBack()) { mBindAccountWebView.goBack(); return; } super.onBackPressed(); } @Subscribe public void onBindAccountEvent(BindAccountEvent event){ if(event!=null && !isFinishing()){ finish(); } } }
[ "pengdakai@163.com" ]
pengdakai@163.com
152ee7c985c0f984f7b17be55774c9c208b78157
002cb1430b4752d648cbd0a2db8f888e0efe7309
/desktop/src/net/mms_projects/copy_it/DesktopIntegration.java
9880090674e1eafb8897df3ceb597cae3843217b
[]
no_license
MMS-Projects/copyit-app
d738d7aa6f75147c1bc5344fe34d424a01bcbfd5
fdda76062e4f0430b9777114b329714cb2540b84
refs/heads/master
2020-04-11T00:42:15.503376
2013-08-02T13:47:26
2013-08-02T13:47:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,449
java
package net.mms_projects.copy_it; import org.freedesktop.dbus.DBusInterface; import org.freedesktop.dbus.DBusSignal; import org.freedesktop.dbus.exceptions.DBusException; public interface DesktopIntegration extends DBusInterface { public void setup(String icon, String attention_icon); public void set_enabled(boolean state); public void set_state(String state); public class ready extends DBusSignal { public ready(String path) throws DBusException { super(path); } } public class action_push extends DBusSignal { public action_push(String path) throws DBusException { super(path); } } public class action_pull extends DBusSignal { public action_pull(String path) throws DBusException { super(path); } } public class action_open_preferences extends DBusSignal { public action_open_preferences(String path) throws DBusException { super(path); } } public class action_open_about extends DBusSignal { public action_open_about(String path) throws DBusException { super(path); } } public class action_quit extends DBusSignal { public action_quit(String path) throws DBusException { super(path); } } public class action_enable_sync extends DBusSignal { public action_enable_sync(String path) throws DBusException { super(path); } } public class action_disable_sync extends DBusSignal { public action_disable_sync(String path) throws DBusException { super(path); } } }
[ "m.cremers@mms-projects.net" ]
m.cremers@mms-projects.net
5af8ed631aa908f0ffa995190357342e257dadd7
bb9140f335d6dc44be5b7b848c4fe808b9189ba4
/Extra-DS/Corpus/class/aspectj/803.java
5afd426b259c5a1c66459e815aab072a29bc8577
[]
no_license
masud-technope/EMSE-2019-Replication-Package
4fc04b7cf1068093f1ccf064f9547634e6357893
202188873a350be51c4cdf3f43511caaeb778b1e
refs/heads/master
2023-01-12T21:32:46.279915
2022-12-30T03:22:15
2022-12-30T03:22:15
186,221,579
5
3
null
null
null
null
UTF-8
Java
false
false
1,212
java
package org.aspectj.apache.bcel.generic; /** * FSTORE - Store float into local variable * <PRE>Stack: ..., value -&gt; ... </PRE> * * @version $Id: FSTORE.java,v 1.2 2004/11/19 16:45:18 aclement Exp $ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> */ public class FSTORE extends StoreInstruction { /** * Empty constructor needed for the Class.newInstance() statement in * Instruction.readInstruction(). Not to be used otherwise. */ FSTORE() { super(org.aspectj.apache.bcel.Constants.FSTORE, org.aspectj.apache.bcel.Constants.FSTORE_0); } /** Store float into local variable * @param n index of local variable */ public FSTORE(int n) { super(org.aspectj.apache.bcel.Constants.FSTORE, org.aspectj.apache.bcel.Constants.FSTORE_0, n); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ public void accept(Visitor v) { super.accept(v); v.visitFSTORE(this); } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
1b43d41b263d3c5849c98bd4303ae8eea622fc3d
59117ed3b1021b14686594e2bb3f93a383fa8c37
/Final Exams/EmojiDetector.java
ea9d31f9aa448f30a49d2d409ec1132a7c576fce
[]
no_license
LoraYonova/Fundamentals
c7bd07129d33b05ec676eb88f6a805174656cee7
c50a15b84c5f467b230f556d129d5283dc13d853
refs/heads/main
2023-07-24T04:37:44.385507
2021-08-21T13:36:43
2021-08-21T13:36:43
398,536,781
1
0
null
null
null
null
UTF-8
Java
false
false
1,846
java
package FinalExam; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class EmojiDetector { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String regexName = "(?<separator>[\\\\:*])\\1(?<names>[A-Z][a-z]{2,})\\1\\1"; String regexDigit = "(?<digit>\\d)"; String text = scan.nextLine(); List<String> emojis = new ArrayList<>(); long sumDigit = 1; int countEmoji = 0; Pattern patternDigit = Pattern.compile(regexDigit); Matcher matcherDigit = patternDigit.matcher(text); while (matcherDigit.find()) { int digit = Integer.parseInt(matcherDigit.group("digit")); sumDigit *= digit; } Pattern patternName = Pattern.compile(regexName); Matcher matcherName = patternName.matcher(text); while (matcherName.find()) { String firstSeparator = matcherName.group("separator"); String emoji = matcherName.group("names"); String endSeparator = matcherName.group("separator"); int sumOfEmoji = 0; countEmoji++; for (int i = 0; i < emoji.length(); i++) { int symbol = emoji.charAt(i); sumOfEmoji += symbol; } if (sumOfEmoji >= sumDigit) { String result = firstSeparator + firstSeparator + emoji + endSeparator + endSeparator; emojis.add(result); } } System.out.printf("Cool threshold: %d%n", sumDigit); System.out.printf("%d emojis found in the text. The cool ones are:%n", countEmoji); if (!emojis.isEmpty()) { for (String emoji : emojis) { System.out.println(emoji); } } } }
[ "79514429+LoraYonova@users.noreply.github.com" ]
79514429+LoraYonova@users.noreply.github.com
b661e16abc3ef8dec154f6dfbc1eaa99e4a66446
00c3098738e3f0fbef79e99fc962bc297e28a05f
/src/main/java/com/surenpi/jenkins/client/credential/Credentials.java
f9652f34a250177c7888a41fbd450e621c7918cc
[ "MIT" ]
permissive
yJunS/jenkins-client-java
8f620125a8d7aa107dae4d5a6c2d34ef6791be63
6b25d70148e03fb69c731d7d63f5f4fe5f4da20d
refs/heads/master
2020-06-28T23:45:00.941873
2019-09-24T06:37:14
2019-09-24T06:37:14
200,374,419
0
0
MIT
2019-08-03T12:43:17
2019-08-03T12:43:17
null
UTF-8
Java
false
false
6,454
java
package com.surenpi.jenkins.client.credential; import com.surenpi.jenkins.client.BaseManager; import com.surenpi.jenkins.client.BaseModel; import java.io.IOException; import java.util.*; /** * Jenkins Credentials Managers * @author suren */ public class Credentials extends BaseManager { public static final String V1URL = "/credential-store/domain/_"; public static final String V2URL = "/credentials/store/system/domain/_"; private String baseUrl = V2URL; private boolean isVersion1 = false; public Credentials(){} public Credentials(String baseUrl) { this.baseUrl = baseUrl; if(V1URL.equals(baseUrl)){ isVersion1 = true; } } /** * Create a credential<br/> * 创建一个凭据 * @see #create(Credential, Boolean) * @param credential * @throws IOException */ public void create(Credential credential) throws IOException { create(credential, isCrumb()); } /** * Create credential then return with id<br/> * 创建并返回一个带有ID的凭据 * @param credential * @return * @throws IOException */ public Credential createAndFetch(Credential credential) throws IOException { String uuid = UUID.randomUUID().toString(); credential.setId(null); credential.setDescription(uuid); create(credential, isCrumb()); Map<String, Credential> credentialsMap = list(); Collection<Credential> credentials = credentialsMap.values(); for(Credential item : credentials) { if(uuid.equals(item.getDescription())) { return item; } } return null; } /** * 创建凭据 * @param credential * @param crumbFlag * @throws IOException */ public void create(Credential credential, Boolean crumbFlag) throws IOException { String url = String.format("%s/%s?", this.baseUrl, "createCredentials"); getClient().postFormJson(url, credential.dataForCreate(), crumbFlag); } /** * 列出所有的凭据 * @return * @throws IOException */ public Map<String, Credential> list() throws IOException { String url = String.format("%s?depth=2", this.baseUrl); if (this.isVersion1) { CredentialResponseV1 response = getClient().get(url, CredentialResponseV1.class); Map<String, Credential> credentials = response.getCredentials(); //need to set the id on the credentials as it is not returned in the body for (String crendentialId : credentials.keySet()) { credentials.get(crendentialId).setId(crendentialId); } return credentials; } else { CredentialResponse response = getClient().get(url, CredentialResponse.class); List<Credential> credentials = response.getCredentials(); Map<String, Credential> credentialMap = new HashMap<>(); for(Credential credential : credentials) { credentialMap.put(credential.getId(), credential); } return credentialMap; } } /** * Check target credential is exists by id. * @param credentialId * @return * @throws IOException */ public boolean exists(String credentialId) throws IOException { if(credentialId == null) { return false; } Map<String, Credential> credentialMap = list(); Iterator<String> it = credentialMap.keySet().iterator(); while(it.hasNext()) { String key = it.next(); if(credentialId.equals(credentialMap.get(key).getId())) { return true; } } return false; } /** * 根据ID来更新一个凭据 * @see #update(String, Credential, Boolean) * @param credentialId * @param credential * @throws IOException */ public void update(String credentialId, Credential credential) throws IOException { update(credentialId, credential, isCrumb()); } /** * Update an existing credential. * @param credentialId the id of the credential to update * @param credential the credential to update * @param crumbFlag * @throws IOException */ public void update(String credentialId, Credential credential, Boolean crumbFlag) throws IOException { credential.setId(credentialId); String url = String.format("%s/%s/%s/%s?", this.baseUrl, "credential", credentialId, "updateSubmit"); getClient().postFormJson(url, credential.dataForUpdate(), crumbFlag); } /** * 根据ID删除一个凭据 * @see #delete(String, Boolean) * @param credentialId * @throws IOException */ public void delete(String credentialId) throws IOException { delete(credentialId, isCrumb()); } /** * Delete the credential with the given id * @param credentialId the id of the credential * @param crumbFlag * @throws IOException */ public void delete(String credentialId, Boolean crumbFlag) throws IOException { String url = String.format("%s/%s/%s/%s?", this.baseUrl, "credential", credentialId, "doDelete"); getClient().postForm(url, new HashMap<String, String>(), crumbFlag); } /** * Represents the list response from Jenkins with the 2.x credentials plugin */ public static class CredentialResponse extends BaseModel { private List<Credential> credentials; public void setCredentials(List<Credential> credentials) { this.credentials = credentials; } public List<Credential> getCredentials() { return credentials; } } /** * Represents the list response from Jenkins with the 1.x credentials plugin */ public static class CredentialResponseV1 extends BaseModel { private Map<String, Credential> credentials; public Map<String, Credential> getCredentials() { return credentials; } public void setCredentials(Map<String, Credential> credentials) { this.credentials = credentials; } } @Override protected String[] getDependencyArray() { return new String[0]; } }
[ "zxjlwt@126.com" ]
zxjlwt@126.com
87f8afa1ab04aa5f09e804f1fd8ba8365935703a
cc2f7e11b92c07a57cb8c408e270e1a7941b440d
/ActionBarTest/src/com/yang/test/ActionBarTest.java
616d41bb0c3a436359a2cd93e9daa3f5cd2e3f9b
[]
no_license
takephoto/content
bcca40897aa0aaf255ee70e8ab674f7cba32ee1f
0bee165724521543e44ca3e104fb3b9400d5f595
refs/heads/master
2020-03-29T10:55:25.230364
2015-01-05T16:34:32
2015-01-05T16:34:32
28,816,189
0
0
null
null
null
null
UTF-8
Java
false
false
8,771
java
package com.yang.test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Resources; import android.media.Ringtone; import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.animation.Animation; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.android.http.RequestManager; import com.android.http.RequestManager.RequestListener; import com.android.volley.RequestQueue; import com.example.actionbartest.R; public class ActionBarTest extends FragmentActivity { RequestQueue quene ; Button mGetData ; EditText mShowData ; TextView mIP ; TextView mCountry ; Animation ainim ; ImageView clock ; ClockAnimManager mClockAnim ; ViewPager viewPager ; Bundle mRingtoneTitleCache ; FragmentAdapter adapter ; TextView mName ; TextView mSex ; TextView mAddress ; List<Map<String,Object>> gridDatas = new ArrayList<Map<String,Object>>() ; public ProgressDialog mProgress ; private static final int REQUEST_CODE_RINGTONE = 1; private static final String KEY_RINGTONE_TITLE_CACHE = "ringtoneTitleCache" ; static final String url = "http://apistore.baidu.com/microservice/iplookup?ip=117.89.35.58" ; static final String baseIDCardURL = "http://apistore.baidu.com/microservice/icardinfo?id=" ; String mIdCard = "" ; GridView mGridView ; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main) ; mGridView = (GridView) findViewById(R.id.gridView) ; mGridView.setAdapter(new MyGridAdapter()) ; /*getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.huise)) ; ; getActionBar().setDisplayOptions(ActionBar.DISPLAY_USE_LOGO) ; getActionBar().setTitle("") ; //getActionBar().setHomeAsUpIndicator(getResources().getDrawable(R.drawable.back)) ; View v = LayoutInflater.from(this).inflate(R.layout.nagv, new LinearLayout(this),false) ; getActionBar().setCustomView(v) ;*/ //mRingtoneTitleCache = savedInstanceState.getBundle(KEY_RINGTONE_TITLE_CACHE) ; /*ActionBar bar = (ActionBar)findViewById(R.id.actionBar) ; bar.setType(Type.Normal) ; bar.setTitle("测试一下actionbar") ;*/ /*viewPager = (ViewPager) findViewById(R.id.viewpager) ; List<Fragment> fragments = new ArrayList<Fragment>() ; fragments.add(new FragmentOne()) ; fragments.add(new FragmentTwo()) ; adapter = new FragmentAdapter(getSupportFragmentManager(),fragments) ; viewPager.setAdapter(adapter) ; viewPager.setCurrentItem(0) ;*/ mName = (TextView) findViewById(R.id.name) ; mSex = (TextView) findViewById(R.id.sex) ; mAddress = (TextView) findViewById(R.id.address) ; Button btn = (Button) findViewById(R.id.button) ; final Bundle bundle = savedInstanceState ; mProgress = new ProgressDialog(this) ; mProgress.setMessage("loading......") ; btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //Intent t = new Intent(ActionBarTest.this,RepeatClock.class) ; //startActivity(t) ; //getFragmentManager().putFragment(bundle, "oneFragment", new TestFragment()) ; //launchRingTonePicker(new Alarm()) ; mProgress.show() ; RequestManager.getInstance().init(getApplicationContext()) ; RequestManager.getInstance().get("http://apistore.baidu.com/microservice/icardinfo?id=610321199101061113", new RequestListener() { @Override public void onSuccess(String response, String url, int actionId) { // TODO Auto-generated method stub mProgress.cancel() ; try { JSONObject obj = new JSONObject(response) ; JSONObject user = obj.getJSONObject("retData") ; mSex.setText(user.getString("sex")) ; mName.setText(user.getString("birthday")) ; mAddress.setText(user.getString("address")); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG).show() ; } @Override public void onRequest() { // TODO Auto-generated method stub } @Override public void onError(String errorMsg, String url, int actionId) { // TODO Auto-generated method stub } }, 1) ; } }) ; } public void initGridData(){ Map<String,Object> mMap = new HashMap<String, Object>() ; mMap.put("resource", R.drawable.mail) ; mMap.put("title", "短信") ; gridDatas.add(mMap) ; } public class MyGridAdapter extends BaseAdapter{ @Override public int getCount() { // TODO Auto-generated method stub return gridDatas.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return gridDatas.get(position); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub Map<String,Object> mm = gridDatas.get(position) ; View v = LayoutInflater.from(getApplicationContext()).inflate(R.layout.grid_item, null) ; ViewHolder vh = new ViewHolder() ; vh.mBackground = (Button)v.findViewById(R.id.cell_icon) ; vh.title = (TextView)v.findViewById(R.id.cell_title) ; //v.setTag(0, vh) ; Object res = mm.get("resource") ; String title = (String) mm.get("title") ; if(position == 0){ vh.mBackground.setBackgroundResource((Integer) res) ; vh.title.setText(mm.get("title")) ; } return v; } class ViewHolder{ TextView title ; Button mBackground; } } private void launchRingTonePicker(Alarm alarm) { //mSelectedAlarm = alarm; // Log.i("ringdow", "2222222222222========="+alarm); Uri oldRingtone = alarm.alert ; final Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, oldRingtone); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALARM); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false); startActivityForResult(intent, 0); } public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { switch (requestCode) { case 0: saveRingtoneUri(data); break; default: ; } } } private String getRingToneTitle(Uri uri) { // Try the cache first String title = null ; if (title == null) { // This is slow because a media player is created during Ringtone object creation. Ringtone ringTone = RingtoneManager.getRingtone(this, uri); title = ringTone.getTitle(this); Toast.makeText(this, title, Toast.LENGTH_LONG).show() ; if (title != null) { //mRingtoneTitleCache.putString(uri.toString(), title); } } return title; } private void saveRingtoneUri(Intent intent) { Uri uri = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); if (uri == null) { // uri = Alarm.NO_RINGTONE_URI; } Toast.makeText(this, uri.toString(), Toast.LENGTH_LONG).show() ; getRingToneTitle(uri) ; /*mSelectedAlarm.alert = uri; // Save the last selected ringtone as the default for new alarms if (!Alarm.NO_RINGTONE_URI.equals(uri)) { ///M: Don't set the ringtone to the system, just to the preference @{ //RingtoneManager.setActualDefaultRingtoneUri( // getActivity(), RingtoneManager.TYPE_ALARM, uri); setDefaultRingtone(uri.toString()); ///@} Log.v("saveRingtoneUri = " + uri.toString()); } asyncUpdateAlarm(mSelectedAlarm, false);*/ } }
[ "yang92139@163.com" ]
yang92139@163.com
2811e3729c785dc919e6fb5f004d5eaeaf5f65b1
d5ff95ed273d14297d72b3a22e4576559f278793
/oneplatform-services/organisation-service/src/main/java/com/oneplatform/organisation/controller/DepartmentController.java
76e737590137ff087580f9b19cef6df272583292
[ "Apache-2.0" ]
permissive
reference-project/oneplatform
e36e888263e607736b9d14996ea89aca247e619e
06c8b5ef15d0f33652ca8072fdbaadfbed68ecb1
refs/heads/master
2020-07-19T00:20:41.836652
2019-06-25T14:53:08
2019-06-25T14:53:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,698
java
package com.oneplatform.organisation.controller; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.jeesuite.common.JeesuiteBaseException; import com.jeesuite.common.model.SelectOption; import com.jeesuite.common.util.BeanUtils; import com.jeesuite.security.client.LoginContext; import com.jeesuite.springweb.model.WrapperResponse; import com.oneplatform.base.exception.ExceptionCode; import com.oneplatform.base.model.SelectOptGroup; import com.oneplatform.organisation.dao.entity.CompanyEntity; import com.oneplatform.organisation.dao.entity.DepartmentEntity; import com.oneplatform.organisation.dto.param.DepartmentParam; import com.oneplatform.organisation.service.CompanyService; import com.oneplatform.organisation.service.DepartmentService; import io.swagger.annotations.ApiOperation; /** * generated by www.jeesuite.com */ @Controller @RequestMapping("/department") public class DepartmentController { private @Autowired DepartmentService departmentService; private @Autowired CompanyService companyService; @ApiOperation(value = "按id查询") @RequestMapping(value = "{id}", method = RequestMethod.GET) public @ResponseBody WrapperResponse<DepartmentEntity> getById(@PathVariable("id") int id) { DepartmentEntity entity = departmentService.findDepartmentById(id); return new WrapperResponse<>(entity); } @ApiOperation(value = "保存") @RequestMapping(value = "save", method = RequestMethod.POST) public @ResponseBody WrapperResponse<String> addDepartment(@RequestBody DepartmentParam param) { if(param.getCompanyId() == null || param.getCompanyId() == 0){ throw new JeesuiteBaseException(ExceptionCode.REQUEST_PARAM_REQUIRED.code, "请先选择公司"); } DepartmentEntity entity = BeanUtils.copy(param, DepartmentEntity.class); if (param.getId() == null || param.getId() == 0) { entity.setCreatedAt(new Date()); entity.setCreatedBy(LoginContext.getIntFormatUserId()); departmentService.addDepartment(entity); } else { entity.setUpdatedAt(new Date()); entity.setUpdatedBy(LoginContext.getIntFormatUserId()); departmentService.updateDepartment(entity); } return new WrapperResponse<>(); } @ApiOperation(value = "删除") @RequestMapping(value = "delete/{id}", method = RequestMethod.POST) public @ResponseBody WrapperResponse<String> deleteDepartment(@PathVariable("id") int id) { departmentService.deleteDepartment(id); return new WrapperResponse<>(); } @ApiOperation(value = "下拉选项") @RequestMapping(value = "options", method = RequestMethod.GET) public @ResponseBody WrapperResponse<List<SelectOptGroup>> getOptions() { List<CompanyEntity> companys = companyService.findCompanys(); Map<Integer, List<DepartmentEntity>> departments = departmentService.findAllActive(); List<SelectOptGroup> optGroups = new ArrayList<>(companys.size()); SelectOptGroup optGroup; for (CompanyEntity company : companys) { optGroup = new SelectOptGroup(); optGroup.setLabel(company.getName()); for (DepartmentEntity d : departments.get(company.getId())) { optGroup.getOptions().add(new SelectOption(String.valueOf(d.getId()), d.getName())); } optGroups.add(optGroup); } return new WrapperResponse<>(optGroups); } }
[ "vakinge@gmail.com" ]
vakinge@gmail.com
56eb8f2ca43bc0277d875e8e2176da8137470417
329d9af89c8c0461e13d2d4dc964a128be45fbdc
/recipe/app/src/main/java/com/echsylon/recipe/network/FinishListener.java
63d4710802a6e915510c0ad074c470b9d17041d5
[ "Apache-2.0" ]
permissive
laszlourszuly/kday-03
9d3f8fdb71594b85c765d77901fb3aeb19f85113
d71181203b18aff5f445d8c80abddd607407803f
refs/heads/master
2020-06-15T06:47:08.951272
2016-12-20T21:12:57
2016-12-20T21:12:57
75,317,280
0
0
null
null
null
null
UTF-8
Java
false
false
577
java
package com.echsylon.recipe.network; /** * This interface describes the "done" signaling callback. This callback doesn't deliver any result * or error cause, it just signals that a request has been finished. The use case is for callers * that need to perform some operations common to both the success and error branches, for example * dismissing a progress dialog or so. */ public interface FinishListener { /** * Signals that a request has been fully handled. No information on success or failure is * available from here. */ void onFinish(); }
[ "laszlo.urszuly@jayway.com" ]
laszlo.urszuly@jayway.com
6490474e4d6a205eb9a4a004836c21bc14e59723
7197f6e4de2d5bd7a7df303a61460808f014616e
/src/main/java/structural/bridge/UNIX.java
2d3c431cf0dedfd8e5072c93b98fc8435466850b
[ "Apache-2.0" ]
permissive
githubmnume/Design-Pattern-In-Java
c69029ec16f2c66a3b001dcc7c85c05f9399dbcb
c9b3978d410bb2667d841a04f2af7750b6800d2e
refs/heads/master
2020-04-08T18:48:16.825041
2018-11-29T07:43:27
2018-11-29T07:43:27
159,625,741
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package structural.bridge; public class UNIX implements OS { @Override public void work() { System.out.println("UNIX "); } }
[ "feng.zhou@tieto.com" ]
feng.zhou@tieto.com
4171c77419d04bd69b60529a435d6014f711a540
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/transform/GetResourcesRequestProtocolMarshaller.java
fab685ba0e85cccd452b18c5794ea75115eac5a6
[ "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,608
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.workdocs.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.workdocs.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * GetResourcesRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class GetResourcesRequestProtocolMarshaller implements Marshaller<Request<GetResourcesRequest>, GetResourcesRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON).requestUri("/api/v1/resources") .httpMethodName(HttpMethodName.GET).hasExplicitPayloadMember(false).hasPayloadMembers(false).serviceName("AmazonWorkDocs").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public GetResourcesRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<GetResourcesRequest> marshall(GetResourcesRequest getResourcesRequest) { if (getResourcesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<GetResourcesRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING, getResourcesRequest); protocolMarshaller.startMarshalling(); GetResourcesRequestMarshaller.getInstance().marshall(getResourcesRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
ca3f646f8ec2b378be154099e663901a343ac6f0
2e56aaa81c8307a2eea85d3b7341542129ca6bf5
/SignUp/src/main/java/com/roomiee/SignUp/Domain/SignUpResponse.java
87987d5cf7014c10628f4e21bb15588d99b1c64b
[]
no_license
pavandkvrk/Roomiee-SignUp
2b99d5df00dead74ebe284e16a3e9033d5cedbb0
846600635841c64c631955a3b77ce1b73d5d85c9
refs/heads/master
2020-09-10T20:40:22.375129
2019-11-15T04:11:23
2019-11-15T04:11:23
221,829,180
0
0
null
null
null
null
UTF-8
Java
false
false
451
java
package com.roomiee.SignUp.Domain; public class SignUpResponse { public String name; public int hashCd; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getHashCd() { return hashCd; } public void setHashCd(int hashCd) { this.hashCd = hashCd; } @Override public String toString() { return "SignUpResponse [name=" + name + ", hashCd=" + hashCd + "]"; } }
[ "Pavand@Kethinedis-MBP.fios-router.home" ]
Pavand@Kethinedis-MBP.fios-router.home
8247e2de05f3fdc044e726ff6b44b070d5470e8e
bff0c4e7b7dcc297feceaa71dab27ad3833536c7
/idcardcamera/src/main/java/com/example/idcardcamera/camera/cropper/CropImageView.java
8a38ed72ce1952e0ca85d5b9dac4c92f2dcfa925
[]
no_license
dengw8/IDCardCamera
8587524f1733a61565bb529e398b1e0dad0d1f88
096ec78ee9273caf428150ccb761fa6385c7f53d
refs/heads/master
2021-09-21T08:02:25.630466
2018-08-22T15:26:19
2018-08-22T15:26:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,437
java
package com.example.idcardcamera.camera.cropper; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import com.example.idcardcamera.R; public class CropImageView extends FrameLayout { private ImageView mImageView; private CropOverlayView mCropOverlayView; public CropImageView(@NonNull Context context) { super(context); } public CropImageView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); LayoutInflater inflater = LayoutInflater.from(context); View v = inflater.inflate(R.layout.crop_image_view, this, true); mImageView = v.findViewById(R.id.img_crop); mCropOverlayView = v.findViewById(R.id.overlay_crop); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); } public void setImageBitmap(Bitmap bitmap) { mImageView.setImageBitmap(bitmap); mCropOverlayView.setBitmap(bitmap); } public void crop(CropListener listener, boolean needStretch) { if (listener == null) return; mCropOverlayView.crop(listener, needStretch); } }
[ "duang0626@qq.com" ]
duang0626@qq.com
0fb6eac5e23ef78c9db19524e5b62b16c0a8b33a
b404d45d3303e98fb4016394d29460f42362267e
/gocd/plugin-infra/go-plugin-access/src/com/thoughtworks/go/plugin/access/authentication/AuthenticationPluginRegistry.java
41e5339fab62d63327d44390c05c76b58f89de7d
[ "Apache-2.0" ]
permissive
1010101012101/team-LHL
6ec17ea7447175dc13ac7034f7f4f4901821d41c
663882e84600c47d1991a9fb391f3cb039788aa7
refs/heads/master
2020-04-15T04:40:54.283861
2015-06-07T00:12:54
2015-06-07T00:12:54
164,391,940
1
0
null
2019-01-07T07:05:15
2019-01-07T07:05:14
null
UTF-8
Java
false
false
3,516
java
/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, 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. *************************GO-LICENSE-END***********************************/ package com.thoughtworks.go.plugin.access.authentication; import com.thoughtworks.go.plugin.access.authentication.model.AuthenticationPluginConfiguration; import org.springframework.stereotype.Component; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; @Component public class AuthenticationPluginRegistry { private final Map<String, AuthenticationPluginConfiguration> pluginToConfigurationMap = new ConcurrentHashMap<String, AuthenticationPluginConfiguration>(); private final Set<String> pluginsThatSupportsPasswordBasedAuthentication = new ConcurrentSkipListSet<String>(); private final Set<String> pluginsThatSupportsUserSearch = new ConcurrentSkipListSet<String>(); public void registerPlugin(String pluginId, AuthenticationPluginConfiguration configuration) { pluginToConfigurationMap.put(pluginId, configuration); if (configuration.supportsPasswordBasedAuthentication()) { pluginsThatSupportsPasswordBasedAuthentication.add(pluginId); } if (configuration.supportsUserSearch()) { pluginsThatSupportsUserSearch.add(pluginId); } } public void deregisterPlugin(String pluginId) { pluginToConfigurationMap.remove(pluginId); pluginsThatSupportsPasswordBasedAuthentication.remove(pluginId); pluginsThatSupportsUserSearch.remove(pluginId); } public Set<String> getAuthenticationPlugins() { return new HashSet<String>(pluginToConfigurationMap.keySet()); } public Set<String> getPluginsThatSupportsPasswordBasedAuthentication() { return new HashSet<String>(pluginsThatSupportsPasswordBasedAuthentication); } public Set<String> getPluginsThatSupportsUserSearch() { return new HashSet<String>(pluginsThatSupportsUserSearch); } public String getDisplayNameFor(String pluginId) { AuthenticationPluginConfiguration configuration = pluginToConfigurationMap.get(pluginId); return configuration == null ? null : configuration.getDisplayName(); } public boolean supportsPasswordBasedAuthentication(String pluginId) { AuthenticationPluginConfiguration configuration = pluginToConfigurationMap.get(pluginId); return configuration == null ? false : configuration.supportsPasswordBasedAuthentication(); } public boolean supportsUserSearch(String pluginId) { AuthenticationPluginConfiguration configuration = pluginToConfigurationMap.get(pluginId); return configuration == null ? false : configuration.supportsUserSearch(); } @Deprecated public void clear() { pluginToConfigurationMap.clear(); } }
[ "isaachanstar@gmail.com" ]
isaachanstar@gmail.com
5c4d74ea60f738e902aff175e0f37ffc39df0749
be092bed17d9f1235f326a505a70b6bfd39604b6
/app/src/main/java/com/mcdenny/atesodictionary/Word.java
32a06807b503140da5458c5eea92183a966c0464
[]
no_license
OlukaDenis/AtesoDictionary
3595ed5240d86d7fc9ed9273bd34d6c84c4838ca
e8f1319471e3195d335a5e4d49f7c44d704f34cc
refs/heads/master
2020-06-02T00:04:58.378563
2019-06-09T06:37:13
2019-06-09T06:37:13
190,972,690
2
0
null
null
null
null
UTF-8
Java
false
false
1,728
java
package com.mcdenny.atesodictionary; public class Word { private String englishTranslation; private String atesoTranslation; private String englishSentence; private String atesoSentence; private int resourceAudio; public Word(String english, String ateso, String englishSentence, String atesoSentence, int resourceAudio ){ this.englishTranslation = english; this.atesoTranslation = ateso; this.englishSentence = englishSentence; this.atesoSentence = atesoSentence; this.resourceAudio =resourceAudio; } public String getAtesoTranslation() { return atesoTranslation; } public String getEnglishTranslation() { return englishTranslation; } public void setEnglishTranslation(String englishTranslation) { this.englishTranslation = englishTranslation; } public void setAtesoTranslation(String atesoTranslation) { this.atesoTranslation = atesoTranslation; } public String getEnglishSentence() { return englishSentence; } public void setEnglishSentence(String englishSentence) { this.englishSentence = englishSentence; } public String getAtesoSentence() { return atesoSentence; } public void setAtesoSentence(String atesoSentence) { this.atesoSentence = atesoSentence; } public int getResourceAudio() { return resourceAudio; } public void setResourceAudio(int resourceAudio) { this.resourceAudio = resourceAudio; } }
[ "olukadeno@gmail.com" ]
olukadeno@gmail.com
3ca15ea1329e7625b95eaad96468da6015501c0a
422cffa62258cb07e1bd1cdf774969015b0d6aa9
/src/test/java/com/tts/IntroProject/IntroProjectApplicationTests.java
5a6ec72865be7034f9191c9d2c310c95ce5bf224
[]
no_license
ramseyknighton/Intro-SpringBoot
63288583238cfb8deaf9d1269da6c507b375b87e
85f8d2f5ec13e3e19d3ac977303cd3fcc2793cc5
refs/heads/main
2023-03-08T07:03:43.231732
2021-02-25T21:56:16
2021-02-25T21:56:16
342,384,721
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package com.tts.IntroProject; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class IntroProjectApplicationTests { @Test void contextLoads() { } }
[ "ramseyknighton@gmail.com" ]
ramseyknighton@gmail.com
7591db63b9a39581f588ecb5dbbc11cc7cffe8ba
1d7784cfb88b6cb4386e162c231b271fe84070cf
/app/src/main/java/by/overpass/gather/commons/android/lifecycle/LiveDataUtils.java
f81f43ee69f8078fd2c9bd77251213c2ca219c87
[]
no_license
overpas/Gather
9d25732677d79b9eb173b5a9e9ad8019e8001379
2f462d99cd73b6721fc6b11cc41d013c27a96408
refs/heads/master
2020-04-30T04:33:58.974776
2019-12-02T17:51:25
2019-12-02T17:51:25
176,613,565
0
0
null
null
null
null
UTF-8
Java
false
false
1,989
java
package by.overpass.gather.commons.android.lifecycle; import androidx.lifecycle.LiveData; import androidx.lifecycle.MediatorLiveData; import androidx.lifecycle.MutableLiveData; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; public class LiveDataUtils { public static <T> LiveData<List<T>> zip(List<LiveData<T>> liveDatas) { MediatorLiveData<List<T>> mediatorLiveData = new MediatorLiveData<>(); if (liveDatas.isEmpty()) { mediatorLiveData.setValue(null); } Map<LiveData<T>, Integer> liveDataVersions = new HashMap<>(); List<T> buffer = new ArrayList<>(); for (LiveData<T> liveData: liveDatas) { liveDataVersions.put(liveData, 0); } for (LiveData<T> liveData: liveDatas) { mediatorLiveData.addSource(liveData, t -> { Integer version = liveDataVersions.get(liveData); liveDataVersions.put(liveData, ++version); buffer.add(t); if (areSameVersions(liveDataVersions) && allStarted(liveDataVersions, liveDatas)) { mediatorLiveData.setValue(buffer); buffer.clear(); } }); } return mediatorLiveData; } private static <T> boolean allStarted(Map<LiveData<T>, Integer> liveDataVersions, List<LiveData<T>> liveDatas) { return liveDataVersions.size() == liveDatas.size(); } private static <T> boolean areSameVersions(Map<LiveData<T>, Integer> liveDataVersions) { HashSet<Integer> set = new HashSet<>(); for (Map.Entry<LiveData<T>, Integer> entry : liveDataVersions.entrySet()) { set.add(entry.getValue()); } return set.size() < 2; } public static <T> LiveData<T> just(T t) { MutableLiveData<T> data = new MutableLiveData<>(); data.setValue(t); return data; } }
[ "pckeycalculator@gmail.com" ]
pckeycalculator@gmail.com
450cfa7541540e5991361598fb80ba2b373b7093
a18b55e591c0fc96718e02713d05348c857d441d
/src/test/java/io/bwl/yyp/gateway/web/rest/UserResourceIntTest.java
99d137905f61650ec0cf12acb93febc88d472c0e
[]
no_license
Wandering/test-gateway
49d3a89752377c252e9d63bf475f1214d60cc24b
51aec2efc41bc350cac9f156d56196139bb41f0d
refs/heads/master
2020-04-12T13:05:34.144849
2018-12-20T01:45:38
2018-12-20T01:45:38
162,511,529
0
0
null
null
null
null
UTF-8
Java
false
false
27,172
java
package io.bwl.yyp.gateway.web.rest; import io.bwl.yyp.gateway.TestGatewayApp; import io.bwl.yyp.gateway.domain.Authority; import io.bwl.yyp.gateway.domain.User; import io.bwl.yyp.gateway.repository.UserRepository; import io.bwl.yyp.gateway.repository.search.UserSearchRepository; import io.bwl.yyp.gateway.security.AuthoritiesConstants; import io.bwl.yyp.gateway.service.MailService; import io.bwl.yyp.gateway.service.UserService; import io.bwl.yyp.gateway.service.dto.UserDTO; import io.bwl.yyp.gateway.service.mapper.UserMapper; import io.bwl.yyp.gateway.web.rest.errors.ExceptionTranslator; import io.bwl.yyp.gateway.web.rest.vm.ManagedUserVM; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cache.CacheManager; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import java.time.Instant; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the UserResource REST controller. * * @see UserResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = TestGatewayApp.class) public class UserResourceIntTest { private static final String DEFAULT_LOGIN = "johndoe"; private static final String UPDATED_LOGIN = "jhipster"; private static final Long DEFAULT_ID = 1L; private static final String DEFAULT_PASSWORD = "passjohndoe"; private static final String UPDATED_PASSWORD = "passjhipster"; private static final String DEFAULT_EMAIL = "johndoe@localhost"; private static final String UPDATED_EMAIL = "jhipster@localhost"; private static final String DEFAULT_FIRSTNAME = "john"; private static final String UPDATED_FIRSTNAME = "jhipsterFirstName"; private static final String DEFAULT_LASTNAME = "doe"; private static final String UPDATED_LASTNAME = "jhipsterLastName"; private static final String DEFAULT_IMAGEURL = "http://placehold.it/50x50"; private static final String UPDATED_IMAGEURL = "http://placehold.it/40x40"; private static final String DEFAULT_LANGKEY = "en"; private static final String UPDATED_LANGKEY = "fr"; @Autowired private UserRepository userRepository; /** * This repository is mocked in the io.bwl.yyp.gateway.repository.search test package. * * @see io.bwl.yyp.gateway.repository.search.UserSearchRepositoryMockConfiguration */ @Autowired private UserSearchRepository mockUserSearchRepository; @Autowired private MailService mailService; @Autowired private UserService userService; @Autowired private UserMapper userMapper; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private EntityManager em; @Autowired private CacheManager cacheManager; private MockMvc restUserMockMvc; private User user; @Before public void setup() { cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).clear(); cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).clear(); UserResource userResource = new UserResource(userService, userRepository, mailService, mockUserSearchRepository); this.restUserMockMvc = MockMvcBuilders.standaloneSetup(userResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } /** * Create a User. * * This is a static method, as tests for other entities might also need it, * if they test an entity which has a required relationship to the User entity. */ public static User createEntity(EntityManager em) { User user = new User(); user.setLogin(DEFAULT_LOGIN + RandomStringUtils.randomAlphabetic(5)); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); user.setEmail(RandomStringUtils.randomAlphabetic(5) + DEFAULT_EMAIL); user.setFirstName(DEFAULT_FIRSTNAME); user.setLastName(DEFAULT_LASTNAME); user.setImageUrl(DEFAULT_IMAGEURL); user.setLangKey(DEFAULT_LANGKEY); return user; } @Before public void initTest() { user = createEntity(em); user.setLogin(DEFAULT_LOGIN); user.setEmail(DEFAULT_EMAIL); } @Test @Transactional public void createUser() throws Exception { int databaseSizeBeforeCreate = userRepository.findAll().size(); // Create the User ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setLogin(DEFAULT_LOGIN); managedUserVM.setPassword(DEFAULT_PASSWORD); managedUserVM.setFirstName(DEFAULT_FIRSTNAME); managedUserVM.setLastName(DEFAULT_LASTNAME); managedUserVM.setEmail(DEFAULT_EMAIL); managedUserVM.setActivated(true); managedUserVM.setImageUrl(DEFAULT_IMAGEURL); managedUserVM.setLangKey(DEFAULT_LANGKEY); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restUserMockMvc.perform(post("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isCreated()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeCreate + 1); User testUser = userList.get(userList.size() - 1); assertThat(testUser.getLogin()).isEqualTo(DEFAULT_LOGIN); assertThat(testUser.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); assertThat(testUser.getLastName()).isEqualTo(DEFAULT_LASTNAME); assertThat(testUser.getEmail()).isEqualTo(DEFAULT_EMAIL); assertThat(testUser.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); assertThat(testUser.getLangKey()).isEqualTo(DEFAULT_LANGKEY); } @Test @Transactional public void createUserWithExistingId() throws Exception { int databaseSizeBeforeCreate = userRepository.findAll().size(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setId(1L); managedUserVM.setLogin(DEFAULT_LOGIN); managedUserVM.setPassword(DEFAULT_PASSWORD); managedUserVM.setFirstName(DEFAULT_FIRSTNAME); managedUserVM.setLastName(DEFAULT_LASTNAME); managedUserVM.setEmail(DEFAULT_EMAIL); managedUserVM.setActivated(true); managedUserVM.setImageUrl(DEFAULT_IMAGEURL); managedUserVM.setLangKey(DEFAULT_LANGKEY); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); // An entity with an existing ID cannot be created, so this API call must fail restUserMockMvc.perform(post("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isBadRequest()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void createUserWithExistingLogin() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); int databaseSizeBeforeCreate = userRepository.findAll().size(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setLogin(DEFAULT_LOGIN);// this login should already be used managedUserVM.setPassword(DEFAULT_PASSWORD); managedUserVM.setFirstName(DEFAULT_FIRSTNAME); managedUserVM.setLastName(DEFAULT_LASTNAME); managedUserVM.setEmail("anothermail@localhost"); managedUserVM.setActivated(true); managedUserVM.setImageUrl(DEFAULT_IMAGEURL); managedUserVM.setLangKey(DEFAULT_LANGKEY); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); // Create the User restUserMockMvc.perform(post("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isBadRequest()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void createUserWithExistingEmail() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); int databaseSizeBeforeCreate = userRepository.findAll().size(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setLogin("anotherlogin"); managedUserVM.setPassword(DEFAULT_PASSWORD); managedUserVM.setFirstName(DEFAULT_FIRSTNAME); managedUserVM.setLastName(DEFAULT_LASTNAME); managedUserVM.setEmail(DEFAULT_EMAIL);// this email should already be used managedUserVM.setActivated(true); managedUserVM.setImageUrl(DEFAULT_IMAGEURL); managedUserVM.setLangKey(DEFAULT_LANGKEY); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); // Create the User restUserMockMvc.perform(post("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isBadRequest()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void getAllUsers() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); // Get all the users restUserMockMvc.perform(get("/api/users?sort=id,desc") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].login").value(hasItem(DEFAULT_LOGIN))) .andExpect(jsonPath("$.[*].firstName").value(hasItem(DEFAULT_FIRSTNAME))) .andExpect(jsonPath("$.[*].lastName").value(hasItem(DEFAULT_LASTNAME))) .andExpect(jsonPath("$.[*].email").value(hasItem(DEFAULT_EMAIL))) .andExpect(jsonPath("$.[*].imageUrl").value(hasItem(DEFAULT_IMAGEURL))) .andExpect(jsonPath("$.[*].langKey").value(hasItem(DEFAULT_LANGKEY))); } @Test @Transactional public void getUser() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); // Get the user restUserMockMvc.perform(get("/api/users/{login}", user.getLogin())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.login").value(user.getLogin())) .andExpect(jsonPath("$.firstName").value(DEFAULT_FIRSTNAME)) .andExpect(jsonPath("$.lastName").value(DEFAULT_LASTNAME)) .andExpect(jsonPath("$.email").value(DEFAULT_EMAIL)) .andExpect(jsonPath("$.imageUrl").value(DEFAULT_IMAGEURL)) .andExpect(jsonPath("$.langKey").value(DEFAULT_LANGKEY)); assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); } @Test @Transactional public void getNonExistingUser() throws Exception { restUserMockMvc.perform(get("/api/users/unknown")) .andExpect(status().isNotFound()); } @Test @Transactional public void updateUser() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); int databaseSizeBeforeUpdate = userRepository.findAll().size(); // Update the user User updatedUser = userRepository.findById(user.getId()).get(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setId(updatedUser.getId()); managedUserVM.setLogin(updatedUser.getLogin()); managedUserVM.setPassword(UPDATED_PASSWORD); managedUserVM.setFirstName(UPDATED_FIRSTNAME); managedUserVM.setLastName(UPDATED_LASTNAME); managedUserVM.setEmail(UPDATED_EMAIL); managedUserVM.setActivated(updatedUser.getActivated()); managedUserVM.setImageUrl(UPDATED_IMAGEURL); managedUserVM.setLangKey(UPDATED_LANGKEY); managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restUserMockMvc.perform(put("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isOk()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeUpdate); User testUser = userList.get(userList.size() - 1); assertThat(testUser.getFirstName()).isEqualTo(UPDATED_FIRSTNAME); assertThat(testUser.getLastName()).isEqualTo(UPDATED_LASTNAME); assertThat(testUser.getEmail()).isEqualTo(UPDATED_EMAIL); assertThat(testUser.getImageUrl()).isEqualTo(UPDATED_IMAGEURL); assertThat(testUser.getLangKey()).isEqualTo(UPDATED_LANGKEY); } @Test @Transactional public void updateUserLogin() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); int databaseSizeBeforeUpdate = userRepository.findAll().size(); // Update the user User updatedUser = userRepository.findById(user.getId()).get(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setId(updatedUser.getId()); managedUserVM.setLogin(UPDATED_LOGIN); managedUserVM.setPassword(UPDATED_PASSWORD); managedUserVM.setFirstName(UPDATED_FIRSTNAME); managedUserVM.setLastName(UPDATED_LASTNAME); managedUserVM.setEmail(UPDATED_EMAIL); managedUserVM.setActivated(updatedUser.getActivated()); managedUserVM.setImageUrl(UPDATED_IMAGEURL); managedUserVM.setLangKey(UPDATED_LANGKEY); managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restUserMockMvc.perform(put("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isOk()); // Validate the User in the database List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeUpdate); User testUser = userList.get(userList.size() - 1); assertThat(testUser.getLogin()).isEqualTo(UPDATED_LOGIN); assertThat(testUser.getFirstName()).isEqualTo(UPDATED_FIRSTNAME); assertThat(testUser.getLastName()).isEqualTo(UPDATED_LASTNAME); assertThat(testUser.getEmail()).isEqualTo(UPDATED_EMAIL); assertThat(testUser.getImageUrl()).isEqualTo(UPDATED_IMAGEURL); assertThat(testUser.getLangKey()).isEqualTo(UPDATED_LANGKEY); } @Test @Transactional public void updateUserExistingEmail() throws Exception { // Initialize the database with 2 users userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); User anotherUser = new User(); anotherUser.setLogin("jhipster"); anotherUser.setPassword(RandomStringUtils.random(60)); anotherUser.setActivated(true); anotherUser.setEmail("jhipster@localhost"); anotherUser.setFirstName("java"); anotherUser.setLastName("hipster"); anotherUser.setImageUrl(""); anotherUser.setLangKey("en"); userRepository.saveAndFlush(anotherUser); mockUserSearchRepository.save(anotherUser); // Update the user User updatedUser = userRepository.findById(user.getId()).get(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setId(updatedUser.getId()); managedUserVM.setLogin(updatedUser.getLogin()); managedUserVM.setPassword(updatedUser.getPassword()); managedUserVM.setFirstName(updatedUser.getFirstName()); managedUserVM.setLastName(updatedUser.getLastName()); managedUserVM.setEmail("jhipster@localhost");// this email should already be used by anotherUser managedUserVM.setActivated(updatedUser.getActivated()); managedUserVM.setImageUrl(updatedUser.getImageUrl()); managedUserVM.setLangKey(updatedUser.getLangKey()); managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restUserMockMvc.perform(put("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isBadRequest()); } @Test @Transactional public void updateUserExistingLogin() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); User anotherUser = new User(); anotherUser.setLogin("jhipster"); anotherUser.setPassword(RandomStringUtils.random(60)); anotherUser.setActivated(true); anotherUser.setEmail("jhipster@localhost"); anotherUser.setFirstName("java"); anotherUser.setLastName("hipster"); anotherUser.setImageUrl(""); anotherUser.setLangKey("en"); userRepository.saveAndFlush(anotherUser); mockUserSearchRepository.save(anotherUser); // Update the user User updatedUser = userRepository.findById(user.getId()).get(); ManagedUserVM managedUserVM = new ManagedUserVM(); managedUserVM.setId(updatedUser.getId()); managedUserVM.setLogin("jhipster");// this login should already be used by anotherUser managedUserVM.setPassword(updatedUser.getPassword()); managedUserVM.setFirstName(updatedUser.getFirstName()); managedUserVM.setLastName(updatedUser.getLastName()); managedUserVM.setEmail(updatedUser.getEmail()); managedUserVM.setActivated(updatedUser.getActivated()); managedUserVM.setImageUrl(updatedUser.getImageUrl()); managedUserVM.setLangKey(updatedUser.getLangKey()); managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restUserMockMvc.perform(put("/api/users") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) .andExpect(status().isBadRequest()); } @Test @Transactional public void deleteUser() throws Exception { // Initialize the database userRepository.saveAndFlush(user); mockUserSearchRepository.save(user); int databaseSizeBeforeDelete = userRepository.findAll().size(); // Delete the user restUserMockMvc.perform(delete("/api/users/{login}", user.getLogin()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); // Validate the database is empty List<User> userList = userRepository.findAll(); assertThat(userList).hasSize(databaseSizeBeforeDelete - 1); } @Test @Transactional public void getAllAuthorities() throws Exception { restUserMockMvc.perform(get("/api/users/authorities") .accept(TestUtil.APPLICATION_JSON_UTF8) .contentType(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$").isArray()) .andExpect(jsonPath("$").value(hasItems(AuthoritiesConstants.USER, AuthoritiesConstants.ADMIN))); } @Test @Transactional public void testUserEquals() throws Exception { TestUtil.equalsVerifier(User.class); User user1 = new User(); user1.setId(1L); User user2 = new User(); user2.setId(user1.getId()); assertThat(user1).isEqualTo(user2); user2.setId(2L); assertThat(user1).isNotEqualTo(user2); user1.setId(null); assertThat(user1).isNotEqualTo(user2); } @Test public void testUserDTOtoUser() { UserDTO userDTO = new UserDTO(); userDTO.setId(DEFAULT_ID); userDTO.setLogin(DEFAULT_LOGIN); userDTO.setFirstName(DEFAULT_FIRSTNAME); userDTO.setLastName(DEFAULT_LASTNAME); userDTO.setEmail(DEFAULT_EMAIL); userDTO.setActivated(true); userDTO.setImageUrl(DEFAULT_IMAGEURL); userDTO.setLangKey(DEFAULT_LANGKEY); userDTO.setCreatedBy(DEFAULT_LOGIN); userDTO.setLastModifiedBy(DEFAULT_LOGIN); userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); User user = userMapper.userDTOToUser(userDTO); assertThat(user.getId()).isEqualTo(DEFAULT_ID); assertThat(user.getLogin()).isEqualTo(DEFAULT_LOGIN); assertThat(user.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); assertThat(user.getLastName()).isEqualTo(DEFAULT_LASTNAME); assertThat(user.getEmail()).isEqualTo(DEFAULT_EMAIL); assertThat(user.getActivated()).isEqualTo(true); assertThat(user.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); assertThat(user.getLangKey()).isEqualTo(DEFAULT_LANGKEY); assertThat(user.getCreatedBy()).isNull(); assertThat(user.getCreatedDate()).isNotNull(); assertThat(user.getLastModifiedBy()).isNull(); assertThat(user.getLastModifiedDate()).isNotNull(); assertThat(user.getAuthorities()).extracting("name").containsExactly(AuthoritiesConstants.USER); } @Test public void testUserToUserDTO() { user.setId(DEFAULT_ID); user.setCreatedBy(DEFAULT_LOGIN); user.setCreatedDate(Instant.now()); user.setLastModifiedBy(DEFAULT_LOGIN); user.setLastModifiedDate(Instant.now()); Set<Authority> authorities = new HashSet<>(); Authority authority = new Authority(); authority.setName(AuthoritiesConstants.USER); authorities.add(authority); user.setAuthorities(authorities); UserDTO userDTO = userMapper.userToUserDTO(user); assertThat(userDTO.getId()).isEqualTo(DEFAULT_ID); assertThat(userDTO.getLogin()).isEqualTo(DEFAULT_LOGIN); assertThat(userDTO.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); assertThat(userDTO.getLastName()).isEqualTo(DEFAULT_LASTNAME); assertThat(userDTO.getEmail()).isEqualTo(DEFAULT_EMAIL); assertThat(userDTO.isActivated()).isEqualTo(true); assertThat(userDTO.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); assertThat(userDTO.getLangKey()).isEqualTo(DEFAULT_LANGKEY); assertThat(userDTO.getCreatedBy()).isEqualTo(DEFAULT_LOGIN); assertThat(userDTO.getCreatedDate()).isEqualTo(user.getCreatedDate()); assertThat(userDTO.getLastModifiedBy()).isEqualTo(DEFAULT_LOGIN); assertThat(userDTO.getLastModifiedDate()).isEqualTo(user.getLastModifiedDate()); assertThat(userDTO.getAuthorities()).containsExactly(AuthoritiesConstants.USER); assertThat(userDTO.toString()).isNotNull(); } @Test public void testAuthorityEquals() { Authority authorityA = new Authority(); assertThat(authorityA).isEqualTo(authorityA); assertThat(authorityA).isNotEqualTo(null); assertThat(authorityA).isNotEqualTo(new Object()); assertThat(authorityA.hashCode()).isEqualTo(0); assertThat(authorityA.toString()).isNotNull(); Authority authorityB = new Authority(); assertThat(authorityA).isEqualTo(authorityB); authorityB.setName(AuthoritiesConstants.ADMIN); assertThat(authorityA).isNotEqualTo(authorityB); authorityA.setName(AuthoritiesConstants.USER); assertThat(authorityA).isNotEqualTo(authorityB); authorityB.setName(AuthoritiesConstants.USER); assertThat(authorityA).isEqualTo(authorityB); assertThat(authorityA.hashCode()).isEqualTo(authorityB.hashCode()); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
cd7c1fad47c6e2c91680de5c24b74d8a6f17dbd1
1a8c632e00bd49ed308563f0ab44b6974482e3e0
/src/KR/StructureAnalyse.java
d3aa5fdcc713bb853807eea00bb355cc02e4cd08
[]
no_license
uilymmot/restart-heuristics-for-angry-birds
44f2b9cdb9b048d951c0fda7962b6936a6e5fb55
83afb7e55afe18419396056db5f1b205be87949c
refs/heads/master
2020-09-26T11:40:46.818866
2019-12-06T04:48:03
2019-12-06T04:48:03
226,245,449
0
0
null
null
null
null
UTF-8
Java
false
false
18,310
java
package KR; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; import KR.util.KeyPair; import KR.util.VisionObject; import ab.vision.ABType; import ab.vision.Vision; //import ab.utils.ShowDebuggingImage; //import ab.vision.TestVision; //import KR.util.ShowStructure; public class StructureAnalyse extends PhysicalRelation { public HashMap<KeyPair, ERA[]> RA; public HashMap<Integer, VisionObject> objsVision; private HashMap<Integer, ArrayList<Entry<Integer, Integer>>> SupportStructure; private HashMap<Integer, ArrayList<Integer>> ShelteringStructure; private HashMap<Integer, Double> Stability; private HashMap<KeyPair, SUPPORT_RELATION> SupportRel; public ArrayList<Integer> pigs; public int[][] SupportGraph; public HashMap<Integer, Integer> graphDoneCheck; public StructureAnalyse() { } /** * * @param objs * @param refLength * for normalization */ public StructureAnalyse(HashMap<Integer, VisionObject> objs, double refLength) { super(objs, refLength); System.out.println("AFTER SUPER, THE SIZE OF OBJS IS " + objs.size()); this.SupportGraph = new int[objs.size()+1][objs.size()+1]; this.graphDoneCheck = new HashMap<>(); for (Map.Entry<Integer, VisionObject> vb : objs.entrySet()) { graphDoneCheck.put(vb.getValue().abo.id, 0); // this.SupportGraph = new int[vb.getValue().abo.id + 1][vb.getValue().abo.id + 1]; } this.SupportStructure = new HashMap<Integer, ArrayList<Entry<Integer, Integer>>>(); this.ShelteringStructure = new HashMap<Integer, ArrayList<Integer>>(); this.Stability = new HashMap<Integer, Double>(); // this.SupportRel = new HashMap<KeyPair,Integer>(); // this.RA = new HashMap<KeyPair,ArrayList<Integer>>(); this.SupportRel = super.getSupportRel(); this.RA = super.getRArel(); this.objsVision = objs; this.setSupportAndShelteringStructure(); this.setStability(); } private void setSupportAndShelteringStructure() { TreeMap<Integer, Integer> SupportMap; ArrayList<Integer> ShelteringList; ABType objClass = null; ArrayList<Entry<Integer, Integer>> SupportList = null; this.pigs = new ArrayList<Integer>(); VisionObject vo; //System.out.println("SIZE OF OBJECTS: " + this.objsVision.size()); for (Integer k : this.objsVision.keySet()) { // for (int k = 0; k <= this.objsVision.size(); k++) { vo = this.objsVision.get(k); // System.out.println("INTEGER IN SUPPORTSHELTERING: " + k + "," + vo.abo.id); if (this.graphDoneCheck.get(k) != 1 && vo.abo.type != ABType.BlackBird && vo.abo.type != ABType.YellowBird && vo.abo.type != ABType.RedBird && vo.abo.type != ABType.WhiteBird && vo.abo.type != ABType.BlueBird && vo.abo.type != ABType.Sling) { //System.out.println("PASSED CHECK"); getSupportGraph(vo, 1, 100); } //System.out.println("GRAPH CHECK PASSED"); objClass = vo.abo.type; if (IgnoreNoise(vo)) continue; if (objClass == ABType.Pig) { //System.out.println("THIS THING IS A PIG"); this.pigs.add(k); SupportMap = new TreeMap<Integer, Integer>(); ShelteringList = new ArrayList<Integer>(); getSupportor(vo, 1, SupportMap); //System.out.println("GOT SUPPORTER"); /** Convert EntrySet to List **/ SupportList = new ArrayList<Map.Entry<Integer, Integer>>( SupportMap.entrySet()); /** Sort by value **/ Collections.sort(SupportList, new Comparator<Map.Entry<Integer, Integer>>() { @Override public int compare( Map.Entry<Integer, Integer> mapping1, Map.Entry<Integer, Integer> mapping2) { return mapping1.getValue().compareTo( mapping2.getValue()); } }); this.SupportStructure.put(k, SupportList); this.getSheltering(vo, ShelteringList); this.ShelteringStructure.put(k, ShelteringList); } } } public void getSupportGraph(VisionObject vo, int depth, int maxDepth) { this.graphDoneCheck.put(vo.id,1); int d = depth + 1; for (KeyPair k : this.SupportRel.keySet()) { if (vo.id == k.getSecond() && d <= maxDepth) { // System.out.println("PASSED IF STATEMENT CHECK"); this.SupportGraph[k.getFirst()][k.getSecond()] = 1; // System.out.println("PASSED ARRAY ACCESS"); getSupportGraph(this.objsVision.get(k.getFirst()), d, maxDepth); // System.out.println("PASSED SUPPGRAPH MODIFICATION"); } } } /* * private void setSheltingStructure() { String objClass = null; * * if(this.InputType == INPUT_VISION) { VisionObject vo; for (Double k : * this.objsVision.keySet()) { vo = new VisionObject(); vo = * this.objsVision.get(k); objClass = vo.getVision_name(); * if(IgnoreNoise(vo)) continue; * * * } * * } } */ /** * stability of single object that consider the height and width ratio and * the vertical level of the object */ private void setStability() { VisionObject vo = null; for (Integer k : this.objsVision.keySet()) { vo = this.objsVision.get(k); if (IgnoreNoise(vo)) continue; if (this.Stability.keySet().contains(k)) continue; calStability(vo); } } /** * default depth is 0 and default maxDepth is 100 * * @param vo * @param supporteelist */ public void getSupportor(VisionObject vo, TreeMap<Integer, Integer> supporteelist) { getSupportor(vo, 0, supporteelist, 100); } /** * default maxDepth is 100 * * @param vo * @param depth * @param supporteelist */ public void getSupportor(VisionObject vo, int depth, TreeMap<Integer, Integer> supporteelist) { getSupportor(vo, depth, supporteelist, 100); } /** * default depth is 0 * * @param vo * @param supporteelist * @param maxDepth */ public void getSupportor(VisionObject vo, TreeMap<Integer, Integer> supporteelist, int maxDepth) { getSupportor(vo, 0, supporteelist, maxDepth); } /** * get supportors within maxDepth of a queried object with depth * * @param vo * @param depth * @param supportlist * @param maxDepth */ public void getSupportor(VisionObject vo, int depth, TreeMap<Integer, Integer> supportlist, int maxDepth) { int d = depth + 1; for (KeyPair k : this.SupportRel.keySet()) { if (vo.id == k.getSecond() && d <= maxDepth) { supportlist.put(k.getFirst(), depth); getSupportor(this.objsVision.get(k.getFirst()), d, supportlist, maxDepth); } } } /** Get supportees methods, similar **/ public void getSupportee(VisionObject vo, TreeMap<Integer, Integer> supporteelist) { getSupportee(vo, 0, supporteelist, 100); } public void getSupportee(VisionObject vo, int depth, TreeMap<Integer, Integer> supporteelist) { getSupportee(vo, depth, supporteelist, 100); } public void getSupportee(VisionObject vo, TreeMap<Integer, Integer> supporteelist, int maxDepth) { getSupportee(vo, 0, supporteelist, maxDepth); } public void getSupportee(VisionObject vo, int depth, TreeMap<Integer, Integer> supporteelist, int maxDepth) { int d = depth + 1; for (KeyPair k : this.SupportRel.keySet()) { if (vo.id == k.getFirst() && d <= maxDepth) { supporteelist.put(k.getSecond(), depth); getSupportee(this.objsVision.get(k.getSecond()), d, supporteelist, maxDepth); } } } public void getSheltering(VisionObject vo, ArrayList<Integer> ShelteringList) { ERA RArel = ERA.UNKNOWN; int RoofDepthL = 100; int RoofDepthR = 100; int RoofID = -1; int Left = -1; int Right = -1; TreeMap<Integer, Integer> supporteelistLeft, supporteelistRight, supportlistLeft, supportlistRight; supporteelistLeft = new TreeMap<Integer, Integer>(); supporteelistRight = new TreeMap<Integer, Integer>(); supportlistLeft = new TreeMap<Integer, Integer>(); supportlistRight = new TreeMap<Integer, Integer>(); for (KeyPair k : this.RA.keySet()) { if (vo.id == k.getFirst() && vo.id != k.getSecond()) { RArel = this.RA.get(k)[1]; // get left sheltering objs if (RArel != ERA.BEFORE && RArel != ERA.AFTER && RArel != ERA.MEET && RArel != ERA.MEET_I) { RArel = this.RA.get(k)[0]; if (RArel == ERA.BEFORE || RArel == ERA.MEET || RArel == ERA.LESS_OVERLAP_MOST || RArel == ERA.LESS_OVERLAP_LESS || RArel == ERA.MOST_OVERLAP_MOST || RArel == ERA.MOST_OVERLAP_LESS || RArel == ERA.MOST_FINISH_I || RArel == ERA.LESS_FINISH_I || RArel == ERA.LEFT_DURING || RArel == ERA.RIGHT_DURING || RArel == ERA.CENTRE_DURING || RArel == ERA.LEFT_DURING_I || RArel == ERA.RIGHT_DURING_I || RArel == ERA.CENTRE_DURING_I) { if (Left < 0) Left = k.getSecond(); else if (DistanceCompare(this.objsVision.get(Left), // previous // obj this.objsVision.get(k.getSecond()), // current // obj this.objsVision.get(k.getFirst())) // pig == 1) { Left = k.getSecond(); } } } // get right sheltering objs RArel = this.RA.get(k)[1]; if (RArel != ERA.BEFORE && RArel != ERA.AFTER && RArel != ERA.MEET && RArel != ERA.MEET_I) { RArel = this.RA.get(k)[0]; if (RArel == ERA.AFTER || RArel == ERA.MEET_I || RArel == ERA.LESS_OVERLAP_MOST_I || RArel == ERA.LESS_OVERLAP_LESS_I || RArel == ERA.MOST_OVERLAP_MOST_I || RArel == ERA.MOST_OVERLAP_LESS_I || RArel == ERA.MOST_START_I || RArel == ERA.LESS_START_I || RArel == ERA.LEFT_DURING || RArel == ERA.RIGHT_DURING || RArel == ERA.CENTRE_DURING || RArel == ERA.LEFT_DURING_I || RArel == ERA.RIGHT_DURING_I || RArel == ERA.CENTRE_DURING_I) { if (Right < 0) Right = k.getSecond(); else if (DistanceCompare(this.objsVision.get(Right), // previous // obj this.objsVision.get(k.getSecond()), // current // obj this.objsVision.get(k.getFirst())) // pig == 1) { Right = k.getSecond(); } } } } } if (Left >= 0) { getSupportee(this.objsVision.get(Left), 1, supporteelistLeft); getSupportor(this.objsVision.get(Left), 1, supportlistLeft); } if (Right >= 0) { getSupportee(this.objsVision.get(Right), 1, supporteelistRight); getSupportor(this.objsVision.get(Right), 1, supportlistRight); } for (int kl : supporteelistLeft.keySet()) { for (int kr : supporteelistRight.keySet()) { if (kl == kr) { if (RoofDepthL > supporteelistLeft.get(kl)) { RoofDepthL = supporteelistLeft.get(kl); RoofDepthR = supporteelistRight.get(kr); RoofID = kl; } } } } if (RoofID >= 0) { ShelteringList.add(RoofID); ShelteringList.add(Left); ShelteringList.add(Right); for (int kl : supporteelistLeft.keySet()) { if (supporteelistLeft.get(kl) < RoofDepthL) ShelteringList.add(kl); } for (int kr : supporteelistRight.keySet()) { if (supporteelistRight.get(kr) < RoofDepthR) ShelteringList.add(kr); } for (int kl : supportlistLeft.keySet()) { ERA RAy = ERA.UNKNOWN; for (KeyPair kp : this.RA.keySet()) { if (kp.getFirst() == kl && kp.getSecond() == vo.id) RAy = this.RA.get(kp)[1]; } if (RAy != ERA.BEFORE && RAy != ERA.AFTER && RAy != ERA.MEET && RAy != ERA.MEET_I) ShelteringList.add(kl); } for (int kr : supportlistRight.keySet()) { ERA RAy = ERA.UNKNOWN; for (KeyPair kp : this.RA.keySet()) { if (kp.getFirst() == kr && kp.getSecond() == vo.id) RAy = this.RA.get(kp)[1]; } if (RAy != ERA.BEFORE && RAy != ERA.AFTER && RAy != ERA.MEET && RAy != ERA.MEET_I) ShelteringList.add(kr); } } else { } } private void calStability(VisionObject vo) { double stability; double suppstab = 0; TreeMap<Integer, Integer> SupportMap; String objClass = null; objClass = vo.type; SupportMap = new TreeMap<Integer, Integer>(); for (KeyPair k : this.SupportRel.keySet()) { if (vo.id == k.getSecond()) { SupportMap.put(k.getFirst(), 1); } } stability = (double) vo.shape.width / (double) vo.shape.height / this.maxWLratio; for (int k : SupportMap.keySet()) { if (this.Stability.keySet().contains(k)) { suppstab += this.Stability.get(k); } else { calStability(this.objsVision.get(k)); suppstab += this.Stability.get(k); } } if (SupportMap.size() > 0) stability = stability * suppstab / SupportMap.size(); else stability *= this.maxWLratio; this.Stability.put(vo.id, stability); } /** * * @return Support structure for pigs */ public HashMap<Integer, ArrayList<Entry<Integer, Integer>>> getSupportStructure() { return this.SupportStructure; } /** * * @return Sheltering structure for pigs */ public HashMap<Integer, ArrayList<Integer>> getShelteringStructure() { return this.ShelteringStructure; } public HashMap<Integer, Double> getStability() { return this.Stability; } public void printSupportStructure( HashMap<Integer, ArrayList<Entry<Integer, Integer>>> SupportStructure, HashMap<Double, VisionObject> SupportObjs) { for (int k : SupportStructure.keySet()) { ArrayList<Entry<Integer, Integer>> SupportList = SupportStructure .get(k); System.out.println("Support Structures for PigID" + k + ":"); for (int i = 0; i < SupportList.size(); i++) { double supportorID = SupportList.get(i).getKey(); int depth = SupportList.get(i).getValue(); System.out.println(" SupportorID : " + supportorID + "Support Depth : " + depth); this.getStructureObjsVision(supportorID, SupportObjs); } } } public void printStability(HashMap<Double, Double> Stability) { System.out.println("\nStability:"); for (Double k : Stability.keySet()) { System.out.println(" objID : " + k + " Stability : " + Stability.get(k)); } } public void printShelteringStructure( HashMap<Double, ArrayList<Double>> ShelteringStructure, HashMap<Double, VisionObject> ShelteringObjs) { System.out.print("\nSheltering Structure:\n"); for (double k : ShelteringStructure.keySet()) { System.out.print(" PigID : " + k + "\n"); for (int i = 0; i < ShelteringStructure.get(k).size(); i++) { System.out.print(" objID: " + ShelteringStructure.get(k).get(i) + "\n"); this.getStructureObjsVision(ShelteringStructure.get(k).get(i), ShelteringObjs); } } } public void getStructureObjsVision(Double key, HashMap<Double, VisionObject> StrucutureObjs) { StrucutureObjs.put(key, this.objsVision.get(key)); } /** * * @param vo1 * first obj * @param vo2 * second obj * @param vo * target obj * @return 1 if dis(vo1,vo) > dis(vo2,vo), -1 if dis(vo1,vo) < dis(vo2,vo), * 0 if dis(vo1,vo) = dis(vo2,vo) * */ public int DistanceCompare(VisionObject vo1, VisionObject vo2, VisionObject vo) { // System.out.print("\n" + vo1.getVision_id() + " " + vo2.getVision_id() // +" " +vo.getVision_id() + "\n"); double sqd1 = Math.pow(vo1.centrePoint.getX() - vo.centrePoint.getX(), 2); double sqd2 = Math.pow(vo2.centrePoint.getX() - vo.centrePoint.getX(), 2); if (sqd1 > sqd2) return 1; else if (sqd1 < sqd2) return -1; else return 0; } public static void main(String[] args) { // BufferedImage screenshot = null; // ShowDebuggingImage frame = null; // Proxy game = TestVision.getGameConnection(9000); // HashMap<Integer, VisionObject> objs = null; // // //while (true) { // // capture an image // byte[] imageBytes = game.send(new ProxyScreenshotMessage()); // try { // screenshot = ImageIO.read(new ByteArrayInputStream(imageBytes)); // } catch (IOException e) { // e.printStackTrace(); // } // // ObjectCollector oc = new ObjectCollector(screenshot); // // HashMap<KeyPair, ERA[]> RA = new HashMap<KeyPair, ERA[]>(); // // System.out.println(oc.refLength); // objs = oc.getObjects(); // StructureAnalyse sa = new StructureAnalyse(objs, oc.refLength); // HashMap<Integer, ArrayList<Entry<Integer, Integer>>> SupportStructure = sa // .getSupportStructure(); // HashMap<Integer, ArrayList<Integer>> ShelteringStructure = sa // .getShelteringStructure(); // // HashMap<Double, VisionObject> SupportObjs = new HashMap<Double, VisionObject>(); // HashMap<Double, VisionObject> ShelteringObjs = new HashMap<Double, VisionObject>(); // // sa.printSupportStructure(SupportStructure, SupportObjs); //// sa.printStability(Stability); //// sa.printShelteringStructure(ShelteringStructure, ShelteringObjs); // //analyse and show image // int[][] meta = TestVision.computeMetaInformation(screenshot); // screenshot = ReasonerUtils.showBoundings(screenshot); // if (frame == null) { // frame = new ShowDebuggingImage("TestVision", screenshot, // meta); // } // // sleep for 100ms // try { // Thread.sleep(100); // } catch (InterruptedException e) { // // do nothing // } // //} // // oc.collect(cv); // // String image_path = Env.getMatlabDir() + Env.getSystemSeparator() // // + "im.png"; // // // // StructureAnalyse sa = new StructureAnalyse(oc.getObjs(), // // oc.refLength); // // // // /* // // * HashMap<Double PigID,ArrayList<Entry<Double SupportorID, Integer // // * depth>>> // // */ // // HashMap<Double, ArrayList<Entry<Integer, Integer>>> SupportStructure // // = sa // // .getSupportStructure(); // // HashMap<Double, Double> Stability = sa.getStability(); // // HashMap<Double, ArrayList<Double>> ShelteringStructure = sa // // .getShelteringStructure(); // // // // HashMap<Double, VisionObject> SupportObjs = new HashMap<Double, // // VisionObject>(); // // HashMap<Double, VisionObject> ShelteringObjs = new HashMap<Double, // // VisionObject>(); // // // // sa.printSupportStructure(SupportStructure, SupportObjs); // // sa.printStability(Stability); // // sa.printShelteringStructure(ShelteringStructure, ShelteringObjs); // // // // try { // // new ShowStructure(image_path, ShelteringObjs, oc); // // new ShowStructure(image_path, SupportObjs, oc); // // } catch (Exception e) { // // e.printStackTrace(); // // } } }
[ "u6409902@anu.edu.au" ]
u6409902@anu.edu.au
02d28014028fea1066f6a55d62270130d17fdbf1
dbdadb4889d74b5b54ca3fb95fd725bb2fc5b4d5
/admin/src/main/java/com/royal/admin/modular/api/entity/TopicModel.java
968e1ddb9067073c2cc5a29bed2fbe60f0fbc3b8
[ "Apache-2.0" ]
permissive
sihuo-hu/tiaoxiAnswer
66975455353688ae5bacf237a6415d66fb422cdd
31e48460bacb95aa02092c7b2bb40feff8f7ec1c
refs/heads/master
2022-10-22T06:54:01.592247
2021-02-05T01:57:27
2021-02-05T01:57:27
216,947,134
0
0
null
2022-10-12T20:32:59
2019-10-23T02:04:32
Java
UTF-8
Java
false
false
1,043
java
package com.royal.admin.modular.api.entity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; import java.util.Date; @TableName("b_topic") @Data public class TopicModel implements Serializable { private static final long serialVersionUID = 1L; /** * 主键id * AUTO 数据库ID自增 * INPUT 用户输入ID * ID_WORKER 全局唯一ID,Long类型的主键 * ID_WORKER_STR 字符串全局唯一ID * UUID 全局唯一ID,UUID类型的主键 * NONE 该类型为未设置主键类型 */ @TableId(value = "b_id", type = IdType.AUTO) private Integer id; @TableField("b_title") private String title; @TableField("b_options") private String options; @TableField("b_answer") private String answer; @TableField("b_q_id") private String qId; @TableField("b_w_id") private String wId; @TableField(exist = false) private String wName; @TableField(exist = false) private String qName; }
[ "royal_hu@126.com" ]
royal_hu@126.com