blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
0af6647db154c85b4d28aeea83cbf70d6df61543
762e749ca2ac09be4a2181d8bcb1e11ef590f283
/Telerik Academy Alpha Java May All Modules - trainers solutions/3. HQC/3. Exceptions and Input Output/Practice/Exceptions Practice/src/com/telerikacademy/exceptions/task6/Thrower.java
1af70b0acd6c67ad747837e76cab8f5fa8fc499a
[ "MIT" ]
permissive
yavoryankov83/Java_Web_Telerik_Academy_Alpha_May_2019
b07050acf23388a898e7a923540bc1af260900ee
f40138f2aea7e06ed51869b86a1ae7da18db35ce
refs/heads/master
2020-07-15T23:57:50.793976
2019-11-17T21:45:51
2019-11-17T21:45:51
204,431,967
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package com.telerikacademy.exceptions.task6; public class Thrower { public void f() throws Ex1, Ex2, Ex3 { throw new Ex1(); // You aren't forced to throw all the // exceptions in the specification. } }
[ "yavoryankov83@gmail.com" ]
yavoryankov83@gmail.com
01c1be0d0f486eb3353ef4581dc6875aa944e961
b6bcb79cc076512f8e4c9ba29c36cca4567dca63
/eureka_client_two/src/main/java/com/jiangbei/learn/eureka_client_two/EurekaClientTwoApplication.java
d671e9e907af297866990da4c416858ffb3d818d
[]
no_license
JiangBeiZheng/eurekaForLearn
7d8b9dbb302716acf08818298fa2b557a965856a
589c63d192a94d25ad53137d75cb5126abf88e35
refs/heads/master
2022-12-27T01:19:17.837933
2020-10-18T05:14:14
2020-10-18T05:14:14
305,027,015
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.jiangbei.learn.eureka_client_two; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringBootApplication @EnableEurekaClient public class EurekaClientTwoApplication { public static void main(String[] args) { SpringApplication.run(EurekaClientTwoApplication.class, args); } }
[ "813476318@qq.com" ]
813476318@qq.com
647a5a79a159b00e7945cf76487f9f974f1b19fb
dc72947f7cd1c3cdb4dcc63a640eb522a79d3db4
/LeetCode/src/leetcode/IntersectionOfTwoArrays.java
0e0991c3a107271420acd8761ee61c337ef57eb3
[]
no_license
srivassumit/LeetCode
b3259d34a8ad72ce05caab8fcf9a0dd018a75a05
5f82766433b810655b65710596fb054a0a8cbad6
refs/heads/master
2020-07-05T18:36:19.553789
2017-01-29T09:00:23
2017-01-29T09:00:23
73,986,150
0
0
null
null
null
null
UTF-8
Java
false
false
1,631
java
package com.leetcode.accepted; import java.util.HashSet; import java.util.Set; /** * <h1>349. Intersection of Two Arrays (E)</h1> * <p> * Given two arrays, write a function to compute their intersection. * </p> * <p> * <b> Example:</b> * </p> * Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. * <p> * <b> Note: </b> Each element in the result must be unique. The result can be * in any order. * </p> * * @author Sumit */ public class IntersectionOfTwoArrays { /** * @param args */ public static void main(String[] args) { IntersectionOfTwoArrays iota = new IntersectionOfTwoArrays(); int[] nums1 = { 1, 2, 2, 1, 2 }; int[] nums2 = { 2, 2, 1 }; int[] intersection = iota.intersection(nums1, nums2); for (int i : intersection) { System.out.print(i + ", "); } System.out.println(""); } /** * LeetCode accepted solution for Intersection of Two Arrays * * @param nums1 * the first integer array * @param nums2 * the second integer array * @return the intersection integer array */ public int[] intersection(int[] nums1, int[] nums2) { Set<Integer> intersectionSet = new HashSet<Integer>(); int[] returnVal; if (nums1.length == 0 || nums2.length == 0) { return new int[0]; } else { for (int i = 0; i < nums1.length; i++) { for (int j = 0; j < nums2.length; j++) { if (nums1[i] == nums2[j]) { intersectionSet.add(nums1[i]); break; } } } returnVal = new int[intersectionSet.size()]; int i = 0; for (int val : intersectionSet) { returnVal[i++] = val; } return returnVal; } } }
[ "srivassumit@gmail.com" ]
srivassumit@gmail.com
8d0a45ffc41c3c46c90e18c79a8247d7986eecbf
5110ca01e16524d8c29cf041009dc69d84dfa92f
/src/com/lian/action/IndexAction.java
7f206b10b37e59b5077b2a1c54f4a1acad40a96e
[]
no_license
white-black/qzSSH
4994731b01355e68c7367f556f0187c657483a5f
7ceaf7edb42c47d7b619e5fd41c56264fba63017
refs/heads/master
2021-04-06T20:29:43.525514
2016-06-01T17:39:33
2016-06-01T17:39:33
60,197,926
0
0
null
null
null
null
UTF-8
Java
false
false
9,596
java
package com.lian.action; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.struts2.ServletActionContext; import org.springframework.stereotype.Controller; import com.lian.dao.TbCommentDao; import com.lian.dao.TbCompanyDao; import com.lian.dao.TbNewsDao; import com.lian.dao.TbRecruitDao; import com.lian.dao.TbResumeDao; import com.lian.entity.TbComment; import com.lian.entity.TbCompany; import com.lian.entity.TbNews; import com.lian.entity.TbRecruit; import com.lian.entity.TbResume; import com.lian.entity.TbUser; import com.opensymphony.xwork2.ActionSupport; @Controller("index") public class IndexAction extends ActionSupport{ private static final long serialVersionUID = 1L; private int id; private int setRecruit;//简历是否投递成功的标志 private int pageNumber;//分页处理的当前页数 private TbRecruit recruit; private TbRecruitDao rd; private List<TbRecruit> recruits; private String companyName; public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } private TbCompany company; private TbCompanyDao cd; private FenYe fenye; private List<TbRecruit> indexRecruits; private List<TbNews> indexNews; private TbNews news; private TbNewsDao nd; private String searchRecruit; private TbComment comment; private TbCommentDao comd; private List<TbComment> comments; private TbResume resume; private List<TbResume> resumes; private TbResumeDao rsd; private TbUser user; public TbCompany getCompany() { return company; } public void setCompany(TbCompany company) { this.company = company; } public TbComment getComment() { return comment; } public void setComment(TbComment comment) { this.comment = comment; } public TbCommentDao getComd() { return comd; } @Resource(name="TbCommentDao") public void setComd(TbCommentDao comd) { this.comd = comd; } public List<TbComment> getComments() { return comments; } public void setComments(List<TbComment> comments) { this.comments = comments; } public TbResume getResume() { return resume; } public void setResume(TbResume resume) { this.resume = resume; } public TbUser getUser() { return user; } public void setUser(TbUser user) { this.user = user; } public List<TbResume> getResumes() { return resumes; } public void setResumes(List<TbResume> resumes) { this.resumes = resumes; } public TbResumeDao getRsd() { return rsd; } @Resource(name="TbResumeDao") public void setRsd(TbResumeDao rsd) { this.rsd = rsd; } public String getSearchRecruit() { return searchRecruit; } public void setSearchRecruit(String searchRecruit) { this.searchRecruit = searchRecruit; } public TbNews getNews() { return news; } public void setNews(TbNews news) { this.news = news; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getSetRecruit() { return setRecruit; } public void setSetRecruit(int setRecruit) { this.setRecruit = setRecruit; } public TbRecruit getRecruit() { return recruit; } public void setRecruit(TbRecruit recruit) { this.recruit = recruit; } public TbRecruitDao getRd() { return rd; } @Resource(name="TbRecruitDao") public void setRd(TbRecruitDao rd) { this.rd = rd; } public TbCompanyDao getCd() { return cd; } public List<TbRecruit> getRecruits() { return recruits; } public void setRecruits(List<TbRecruit> recruits) { this.recruits = recruits; } @Resource(name="TbCompanyDao") public void setCd(TbCompanyDao cd) { this.cd = cd; } public FenYe getFenye() { return fenye; } public void setFenye(FenYe fenye) { this.fenye = fenye; } public int getPageNumber() { return pageNumber; } public void setPageNumber(int pageNumber) { this.pageNumber = pageNumber; } public List<TbRecruit> getIndexRecruits() { return indexRecruits; } public void setIndexRecruits(List<TbRecruit> indexRecruits) { this.indexRecruits = indexRecruits; } public List<TbNews> getIndexNews() { return indexNews; } public void setIndexNews(List<TbNews> indexNews) { this.indexNews = indexNews; } public TbNewsDao getNd() { return nd; } @Resource(name="TbNewsDao") public void setNd(TbNewsDao nd) { this.nd = nd; } //查找职位 public String searchRecruit(){ HttpServletRequest request = ServletActionContext.getRequest(); request.setAttribute("search_flag", 1); String hql = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.rcName like '" + searchRecruit +"'"; indexRecruits = rd.findByHQL(hql); return SUCCESS; } public String getSomerecruitAndNews(){ HttpServletRequest request = ServletActionContext.getRequest(); request.setAttribute("frist_flag", 1); String hql = "from TbRecruit rec left outer join fetch rec.tbCompany"; indexRecruits = rd.findByHQL(hql, 0, 3); String hql1 = "from TbNews"; indexNews = nd.findByHQL(hql1); return SUCCESS; } public String redirectNew(){ news = nd.findById(id); return SUCCESS; } public String redirectResume(){ resume = rsd.findById(id); user = resume.getTbUser(); return SUCCESS; } //在首页点击职位时跳转 public String redirectRecruit(){ //String hql = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.rcId =" + id; recruit = rd.findById(id); company = recruit.getTbCompany(); companyName =company.getCComname(); System.out.println(company.getCId()); String getRecruitFromCompany = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.tbCompany.CId =" +company.getCId() ; recruits = rd.findByHQL(getRecruitFromCompany); comments = getCompanyComment(company.getCId()); return SUCCESS; } //在首页点击公司名称时跳转 public String redirectCompany(){ //String hql = "from TbCompany com left outer join fetch com.tbRecruits where com.CId =" +id; company = cd.findById(id); String getRecruitFromCompany = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.tbCompany.CId =" +company.getCId() ; recruits = rd.findByHQL(getRecruitFromCompany); comments = getCompanyComment(id); return SUCCESS; } private List<TbComment> getCompanyComment(int comid){ String hql = "from TbComment comt left outer join fetch comt.tbCompany where comt.tbCompany.CId =" +comid; comments = comd.findByHQL(hql); return comments; } /*public String redirectPage(){ //这里的id是公司的id String hql = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.tbCompany.CId =" + id; if(!rd.findByHQL(hql).isEmpty()){ recruit = rd.findByHQL(hql).get(0); company = recruit.getTbCompany(); } //这个id是职位id Set<TbRecruit> recs = company.getTbRecruits(); Iterator<TbRecruit> it = recs.iterator(); recruits = new ArrayList<TbRecruit>(); if(!recs.isEmpty()){ while(it.hasNext()){ recruits.add(it.next()); } }else{ String hql2 = "from TbRecruit rec left outer join fetch rec.tbCompany where rec.rcId =" + id; recruits = rd.findByHQL(hql2); } Set<TbComment> comSet = company.getTbComments() ; Iterator<TbComment> comit = comSet.iterator(); comments = new ArrayList<TbComment>(); if(!comSet.isEmpty()){ while(comit.hasNext()){ comments.add(comit.next()); } } return SUCCESS; }*/ public String getAllRecruits(){ String count = "select count(*) from TbRecruit"; String hql = "from TbRecruit rec left outer join fetch rec.tbCompany"; fenye = new FenYe(); int totalPage = rd.getTotal(count); fenye.setPageSize(4); fenye.setTotalPage(totalPage); if(this.pageNumber <= 0){ this.pageNumber = 1; } if(this.pageNumber > fenye.getTotalPage()){ this.pageNumber = fenye.getTotalPage(); } fenye.setPageNumber(pageNumber); recruits = rd.findByHQL(hql, fenye.getPageNumber()-1, fenye.getPageSize()); return SUCCESS; } public String getAllResumes(){ String count = "select count(*) from TbResume"; String hql = "from TbResume res left outer join fetch res.tbUser"; fenye = new FenYe(); int totalPage = rd.getTotal(count); fenye.setPageSize(4); fenye.setTotalPage(totalPage); if(this.pageNumber <= 0){ this.pageNumber = 1; } if(this.pageNumber > fenye.getTotalPage()){ this.pageNumber = fenye.getTotalPage(); } fenye.setPageNumber(pageNumber); resumes = rsd.findByHQL(hql, fenye.getPageNumber()-1, fenye.getPageSize()); return SUCCESS; } public String myResume(){ HttpServletRequest request = ServletActionContext.getRequest(); HttpSession session = request.getSession(); TbUser user= (TbUser) session.getAttribute("user"); if(user == null){ request.setAttribute("myResumeandRecruit", 0); return INPUT; } return SUCCESS; } public String myRecruit(){ HttpServletRequest request = ServletActionContext.getRequest(); HttpSession session = request.getSession(); TbUser user= (TbUser) session.getAttribute("user"); if(user == null){ request.setAttribute("myResumeandRecruit", 0); return INPUT; } return SUCCESS; } public String saveComment(){ HttpServletRequest request = ServletActionContext.getRequest(); HttpSession session = request.getSession(); TbUser user = (TbUser) session.getAttribute("user"); //这是公司的id company = cd.findById(id); System.out.println("保存评论"+id); comment.setTbUser(user); comment.setTbCompany(company); comment.setCtDate(new java.util.Date()); comd.save(comment); return SUCCESS; } }
[ "billsteve@sina.com" ]
billsteve@sina.com
d22248076d504596bcbd0dc0db4d88cb8e2e7194
0392cfa435254e6eb5126db9bacd9ab1d2608c2e
/src/DataModelLayer/DataModel.java
ba705b99b4a1a782aa69ed108813c32007980602
[]
no_license
fullhaider1997/HMS
6f2df8e531dc726f554356d054dc445a24894dd6
7bdc7cf049a5020d8ebeab564e67d5c2282ef044
refs/heads/master
2023-01-19T18:59:14.998046
2020-10-18T04:20:56
2020-10-18T04:20:56
300,722,936
0
2
null
null
null
null
UTF-8
Java
false
false
271
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 DataModelLayer; /** * * @author Haider */ public class DataModel { }
[ "haideralhafiz@gmail.com" ]
haideralhafiz@gmail.com
3fd529473350309983a2269ed81dfe1c13492369
0785999c35602fe08cbabd033e13460b2afb752b
/src/main/java/factoryMethod/contactPage/CommentPage.java
7aef8a3734d1849b45c09cb3657b167a5d273c35
[]
no_license
manoj1995madushanka/designPatternCreational
04168800ea1503216d321f5b18e925963deb4247
76b2b05d82743ba335f9d499e63d4053680788b8
refs/heads/master
2023-08-11T01:07:20.339862
2020-04-17T15:16:19
2020-04-17T15:16:19
255,344,706
0
0
null
2023-07-23T11:49:27
2020-04-13T14:05:23
Java
UTF-8
Java
false
false
78
java
package factoryMethod.contactPage; public class CommentPage extends Page { }
[ "madushankamanoj414@gmail.com" ]
madushankamanoj414@gmail.com
516422335e7f3685ec495998b425fdcf529dbc93
73e0e16b8d2e21c81e685649830e5b56ad899c5e
/concept/src/main/java/concept/Planet.java
9e8ef0a46737a42ddba9f1ecad1cf8dbab6aff4f
[]
no_license
Jamnic/solar-system
d8bf0edb819a9372b4df245cd038308ff8f472b1
f36ce7f8e0e46a4c841baba8868363a0f1996243
refs/heads/master
2021-01-18T17:18:56.378608
2014-11-07T14:53:25
2014-11-07T14:53:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
547
java
package concept; import java.math.BigDecimal; import kepler.Trajectory; public class Planet extends CelestialObject { public Planet(String name, BigDecimal radius, Trajectory trajectory, PlanetType planetType) { super(name, radius, CelestialObjectType.PLANET, trajectory); this.planetType = planetType; } public PlanetType getPlanetType() { return planetType; } public void setPlanetType(PlanetType planetType) { this.planetType = planetType; } /* Private */ private PlanetType planetType; }
[ "satanjamnic@gmail.com" ]
satanjamnic@gmail.com
c3e1286f782e35e83becc671bf7fd666d3ed37ef
bf7b05c70ef933ba7c41c9e87fe938073a433a2f
/src/main/java/com/example/demo/DemoApplication.java
ce977e8c68a835a97fdc7d7f0fa8b11a9c8dfaad
[]
no_license
Ahmed97Muhammad/Test-Spring-Boot
8e6e2cf7a7dee923cc35021539e8e4af0b1722f4
4806e1c9b88fc65343e220ba2582c95807535570
refs/heads/master
2023-04-05T10:05:38.684470
2021-04-12T13:16:47
2021-04-12T13:16:47
353,694,379
0
0
null
null
null
null
UTF-8
Java
false
false
926
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.EnableScheduling; @EnableCircuitBreaker @PropertySource("classpath:/application.properties") @SpringBootApplication public class DemoApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(DemoApplication.class); } public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
[ "muhammadahmed.aqeel@systemsltd.com" ]
muhammadahmed.aqeel@systemsltd.com
c81384488745d1cd1fe7cde0fab968351f5602a1
510fb14d269cde51cac8c0f762cd2d9ae6a4d6b3
/src/main/java/com/xky/mall/model/request/UpdateProductReq.java
1de7d2585e962453db9d29ac8f8d3fcc9bd84043
[]
no_license
1004/mall
59c70c1cfbbf44d7c8d7ee2ff61b052d90840c6a
71ecb15cc5db4a3dd9ff55dda5ea3125ef1ad6b5
refs/heads/main
2023-07-27T18:55:30.963650
2021-09-16T02:18:55
2021-09-16T02:18:55
387,659,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,816
java
package com.xky.mall.model.request; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; /** * 修改商品 */ public class UpdateProductReq { @NotNull(message = "商品ID不能为空") private Integer id; private String name; private String image; private String detail; private Integer categoryId; @Min(value = 1, message = "价格不能小于1分") private Integer price; @Max(value = 10000, message = "库存不能超过10000") private Integer stock; private Integer status; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getImage() { return image; } public void setImage(String image) { this.image = image == null ? null : image.trim(); } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail == null ? null : detail.trim(); } public Integer getCategoryId() { return categoryId; } public void setCategoryId(Integer categoryId) { this.categoryId = categoryId; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Integer getStock() { return stock; } public void setStock(Integer stock) { this.stock = stock; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } }
[ "xiekongying001@ke.com" ]
xiekongying001@ke.com
3cbf13d72edc678122c7c75b61c67254d0042106
e9f671edda745b666d0297431c94a67304de6d50
/spring_bootstrap/src/main/java/kr/or/ddit/command/ReplyModifyCommand.java
3b3532cc3de7cbba827a939ae9c23fafecf944fa
[]
no_license
rabo2/Spring
ca026fca00fac1a8b2729b65eebcc8830afa7d18
41428dbfd94400edce338f446f02245ead269e56
refs/heads/master
2023-08-17T07:33:37.848099
2021-09-28T07:51:47
2021-09-28T07:51:47
390,545,364
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package kr.or.ddit.command; import kr.or.ddit.dto.ReplyVO; public class ReplyModifyCommand extends ReplyRegistCommand{ private int rno; public int getRno() { return rno; } public void setRno(int rno) { this.rno = rno; } @Override public ReplyVO toReolyVO() { ReplyVO reply = super.toReolyVO(); reply.setRno(this.rno); return reply; } }
[ "raboy500@gmail.com" ]
raboy500@gmail.com
87c1da57063e1da63e309746d4e4926a6a117d15
c7e25547dc70edd9eda50cb901ef7d56ebae4994
/java_project_2_master/Section5/exercises/SharedDigit/src/academy/learnprogramming/Main.java
dd496a6ff3dfadacdd1542f6f4e5b076749fb8e4
[]
no_license
James-Strom/Java_main
6a7d6b8ad0f7ce3a14994ca290e02d25de7d64c0
493d012ba758bed6889e50e19878397d41651e6d
refs/heads/main
2023-08-14T05:51:27.180686
2021-10-15T09:51:01
2021-10-15T09:51:01
380,944,825
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package academy.learnprogramming; public class Main { public static void main(String[] args) { System.out.println(SharedDigit.hasSharedDigit(23,12)); System.out.println(SharedDigit.hasSharedDigit(23,11)); System.out.println(SharedDigit.hasSharedDigit(53,35)); } }
[ "james.stromnes@gmail.com" ]
james.stromnes@gmail.com
9549cbe663c98e62ef36ae5f0d920b635e34e730
a34c452ac7f6ba6da262ecd3526c3eb22a626f2c
/LRApplication/app/src/main/java/lifeng/example/com/lrapplication/Main4Activity.java
ea5526af41fe67b2e091c7ff1d075eb18746e6ef
[]
no_license
Ajiajiajia/AjDemos
f87287a66ab608648e3629e20dbe5833474a4fb5
aa3cecfcf0049d24173a06a29299f2d1754ef4cb
refs/heads/master
2020-03-15T20:34:57.255511
2018-05-06T12:30:27
2018-05-06T12:30:27
132,336,220
0
0
null
null
null
null
UTF-8
Java
false
false
1,038
java
package lifeng.example.com.lrapplication; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; public class Main4Activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main4); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } }
[ "549044363@qq.com" ]
549044363@qq.com
7baa0aa82c5d39efbef65ba405ef200aeffff7d0
c5ab21f0a282186f0db2fe0df9fef4e2dd45c748
/TIO/app/src/main/java/com/example/wxhgxj/tio/UserViewHolder.java
5daf802004ad911ccfb2a9f8ebc4d91bcec99ea5
[]
no_license
AllenZB/orbital
9c9c4a30a1b6568c8a60c85f293aefc0da97d3f6
ef6eea811d125e0521a03c82ae51d916cf2e2e0a
refs/heads/master
2021-09-19T10:14:39.347249
2018-07-26T15:56:58
2018-07-26T15:56:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
660
java
package com.example.wxhgxj.tio; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import org.w3c.dom.Text; public class UserViewHolder extends RecyclerView.ViewHolder { protected View mView; public UserViewHolder(View itemView) { super(itemView); mView = itemView; } public void setName(String name) { TextView userName = mView.findViewById(R.id.userNameDisplay); userName.setText(name); } public void setEmail(String email) { TextView userEmail = mView.findViewById(R.id.userEmailDisplay); userEmail.setText(email); } }
[ "lancelotwillow@gmail.com" ]
lancelotwillow@gmail.com
4f6bc771c113f681ebef4f68f9d7532982efba91
f86799dd7cc3087498cb7b911d7a53514a60f6e1
/src/NewJFrame.java
d2be0dc7eb8c26f2b103a65914ecf1192ba596a2
[]
no_license
miloman26/Inventory-Program
d6bdf1bbb6e11d910e32d1fda5e99088b79edcfd
44af6948c9c79318a5af06c9d6ae7607218288fa
refs/heads/master
2021-01-01T19:06:09.291676
2013-07-12T08:27:43
2013-07-12T08:27:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
20,987
java
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author milo */ public class NewJFrame extends javax.swing.JFrame { /** * Creates new form NewJFrame */ public String username; public NewJFrame() { super("Daer Client Main"); initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jFormattedTextField1 = new javax.swing.JFormattedTextField(); jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jSeparator1 = new javax.swing.JSeparator(); jLabel5 = new javax.swing.JLabel(); jComboBox2 = new javax.swing.JComboBox(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jSeparator2 = new javax.swing.JSeparator(); jSeparator3 = new javax.swing.JSeparator(); jProgressBar1 = new javax.swing.JProgressBar(); jScrollPane2 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jLabel6 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jTextArea2 = new javax.swing.JTextArea(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jSlider1 = new javax.swing.JSlider(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea3 = new javax.swing.JTextArea(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jFormattedTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jFormattedTextField1ActionPerformed(evt); } }); jLabel1.setText("Phone"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel2.setText("Email"); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jLabel3.setText("Customer Name"); jLabel4.setText("Prefix"); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mr", "Mrs", "Miss", "Sen" })); jLabel5.setText("ID Type"); jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Regular", "Gold", "Plainum", "VIP" })); jButton1.setText("Account"); jButton2.setText("Actions"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Remote"); jButton4.setText("Billing"); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane2.setViewportView(jTextArea1); jLabel6.setText("Recent Comments"); jTextArea2.setColumns(20); jTextArea2.setRows(5); jScrollPane3.setViewportView(jTextArea2); jButton5.setText("Add"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setText("Edit"); jButton7.setText("View"); jButton7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton7MouseClicked(evt); } }); jTextArea3.setColumns(20); jTextArea3.setRows(5); jScrollPane1.setViewportView(jTextArea3); jLabel7.setText("Account Activity"); jLabel8.setText("Data Explorer"); jMenu1.setText("File"); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator1) .addGap(172, 172, 172)) .addComponent(jSeparator3) .addGroup(layout.createSequentialGroup() .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel4) .addGap(30, 30, 30) .addComponent(jLabel3))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5)) .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton4)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1) .addComponent(jButton3)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(262, 262, 262) .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 533, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 789, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 789, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7)))))) .addGap(0, 99, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jLabel1) .addComponent(jLabel3) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jButton1) .addComponent(jButton2) .addComponent(jLabel6) .addComponent(jButton5) .addComponent(jButton6) .addComponent(jButton7)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jComboBox1, 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(jLabel8)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton4) .addComponent(jButton3))) .addGap(0, 7, Short.MAX_VALUE))) .addGap(5, 5, 5) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 614, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 6, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jFormattedTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jFormattedTextField1ActionPerformed private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jButton2ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed username = jTextField2.getText(); //perform your operation framecust recust = new framecust(); recust.setVisible(true); // TODO add your handling code here: }//GEN-LAST:event_jButton5ActionPerformed private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField2ActionPerformed private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseClicked username = jTextField2.getText(); framecust recust = new framecust(); recust.setVisible(true);// TODO add your handling code here: }//GEN-LAST:event_jButton7MouseClicked /** * @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(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewJFrame().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JComboBox jComboBox1; private javax.swing.JComboBox jComboBox2; private javax.swing.JFormattedTextField jFormattedTextField1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JProgressBar jProgressBar1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2; private javax.swing.JSeparator jSeparator3; private javax.swing.JSlider jSlider1; private javax.swing.JTextArea jTextArea1; private javax.swing.JTextArea jTextArea2; private javax.swing.JTextArea jTextArea3; private javax.swing.JTextField jTextField1; public javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables }
[ "milothompson@rocketmail.com" ]
milothompson@rocketmail.com
6df47a7aeef293a9f2188e4d98338c402b1627ba
73458087c9a504dedc5acd84ecd63db5dfcd5ca1
/src/com/estrongs/android/pop/view/bu.java
195b644f361e7d1014ae25f858b01d745d89fca7
[]
no_license
jtap60/com.estr
99ff2a6dd07b02b41a9cc3c1d28bb6545e68fb27
8b70bf2da8b24c7cef5973744e6054ef972fc745
refs/heads/master
2020-04-14T02:12:20.424436
2018-12-30T10:56:45
2018-12-30T10:56:45
163,578,360
0
0
null
null
null
null
UTF-8
Java
false
false
2,022
java
package com.estrongs.android.pop.view; import android.support.v7.widget.RecyclerView; import android.view.View; import com.estrongs.android.pop.z; import com.estrongs.android.ui.drag.d; import com.estrongs.android.util.ap; import com.estrongs.android.view.cp; import com.estrongs.android.view.cr; import com.estrongs.android.widget.ThumbContentViewSwitcher; import com.estrongs.fs.h; import java.util.List; class bu implements cp { bu(FileExplorerActivity paramFileExplorerActivity) {} public boolean a(RecyclerView paramRecyclerView, View paramView, int paramInt, boolean paramBoolean) { a.o(); paramRecyclerView = a.O(); if (paramRecyclerView == null) {} label287: for (;;) { return true; String str = a.P(); a.r = ((h)paramRecyclerView.e(paramInt)); if (a.r != null) { boolean bool2 = false; boolean bool1; if (paramRecyclerView.N()) { if (!paramRecyclerView.o().contains(a.r)) { paramView.performClick(); } bool1 = true; } for (;;) { if ((z.v) || (paramBoolean) || (ap.br(str)) || (ap.aY(str)) || (ap.aQ(str)) || (ap.X(str)) || (ap.t(str)) || (ap.ba(str)) || (ap.ao(str)) || (ap.cg(str))) { break label287; } if (FileExplorerActivity.g(a) == null) { FileExplorerActivity.h(a); } FileExplorerActivity.l(a).a(new bv(this, str)); if (FileExplorerActivity.l(a).b()) { break; } a.h.a(a.r, paramRecyclerView, bool1); return true; a.p(); paramView.performClick(); bool1 = bool2; if (!FileExplorerActivity.f(a)) { a.b(true); FileExplorerActivity.b(a, true); bool1 = bool2; } } } } } } /* Location: * Qualified Name: com.estrongs.android.pop.view.bu * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
bdc13c6acef25c9961c566d8d7f11946ec527506
c15d90af0ca59973a8a1c5ab4b487aca2b162e8b
/main/java/com/example/sample/mediaplayer/AudioFile.java
8c8fb4308f08c9c0eeebb6cc2ff7be11d4ac2660
[]
no_license
VladaGrebennik/MPlayerAndroid
776f6ba0dcbbcdde804606efef49982abeb45eee
accb79bf1ded81a58d48af8fbfb17927afe911d1
refs/heads/master
2020-04-11T13:50:01.726294
2018-12-14T19:30:39
2018-12-14T19:30:39
161,831,495
0
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
package com.example.sample.mediaplayer; import java.io.Serializable; public class AudioFile implements Serializable { private String data; private String title; private String album; private String artist; public AudioFile(String data, String title, String album, String artist) { this.data = data; this.title = title; this.album = album; this.artist = artist; } public String getData() { return data; } public void setData(String data) { this.data = data; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAlbum() { return album; } public void setAlbum(String album) { this.album = album; } public String getArtist() { return artist; } public void setArtist(String artist) { this.artist = artist; } }
[ "noreply@github.com" ]
VladaGrebennik.noreply@github.com
4f2f1dd6ea0ab588f459161ae30a11442bd4cf14
f7b8f97978df4c5dbe2421a48b9e679d2e9efdbe
/app/src/main/java/presenter/EmployeeListPresenter.java
36c91ae1fd95f44a3b51be7dc2264c406ce6cefb
[]
no_license
Karina210428/ResidentialSystemAndroidApp
39c299bc665b04a84f3b90954275ba16c2b9f382
6719cb4df7e0f4e8f5fdf8e708fcbf826303d007
refs/heads/master
2022-12-22T10:42:23.644769
2020-09-08T13:05:40
2020-09-08T13:05:40
293,790,123
0
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
package presenter; import android.content.Context; import android.os.Build; import androidx.annotation.RequiresApi; import api.EmployeeApi; import api.RetrofitClient; import model.Employee; import model.SharedPreference; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import view.EmployeeView; import java.util.List; public class EmployeeListPresenter { private EmployeeView employeeView; private EmployeeApi employeeApi; @RequiresApi(api = Build.VERSION_CODES.O) public EmployeeListPresenter(EmployeeView view){ this.employeeView = view; employeeApi = RetrofitClient.getInstance().getEmployeeApi(); } public void getEmployees(Context context){ String token = SharedPreference.getInstance(context).getToken(); employeeApi.getAll(token).enqueue(new Callback<List<Employee>>() { @Override public void onResponse(Call<List<Employee>> call, Response<List<Employee>> response) { if(response.code()==200 && response.body()!=null){ List<Employee> list = response.body(); employeeView.employeeReady(list); } } @Override public void onFailure(Call<List<Employee>> call, Throwable t) { employeeView.showError(); } }); } }
[ "Karina.210428@gmail.com" ]
Karina.210428@gmail.com
acb149778ea60ef534dc6d0eac48550eb1280d6e
3f5f0a4732bd4a81c68c271635ada35a6c720ce8
/app/src/test/java/com/example/jmush/android_session9_assignment_91/ExampleUnitTest.java
001a88f1ee082e455aeeaa17a4a24a89c90e2a48
[]
no_license
Junaid17/Android_Session9_Assignment_9.1
dee6903020715df577fbd3d01c5eb26f304cafda
9235de7aa02f7049d2ddb6403edf66f402406d20
refs/heads/master
2021-01-19T19:44:43.345044
2017-08-23T17:25:23
2017-08-23T17:25:23
101,206,802
0
0
null
null
null
null
UTF-8
Java
false
false
426
java
package com.example.jmush.android_session9_assignment_91; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "junaidmangalwad.26@gmail.com" ]
junaidmangalwad.26@gmail.com
3961ff11781d6f6bc2a189f242ebef7218c7ea2e
7a2181b4b1f5c0cb4e70b303110363857d019691
/GestionVols/src/com/gui/listeVols.java
7e35405047dce79c31703965463ef89b4e94ee8a
[]
no_license
ImaneElhirech/GL-IHM-ProjetGestionVol
53561410e2a1d4e9e19baaea106144dcbc4429de
00a165c53f9187ff85afbb7f3f38ca740a8bbbe5
refs/heads/master
2021-09-07T00:08:25.488080
2018-02-13T21:35:10
2018-02-13T21:35:10
120,647,437
0
0
null
null
null
null
ISO-8859-2
Java
false
false
2,067
java
package com.gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.FlowLayout; import java.awt.GridLayout; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.RowFilter; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableRowSorter; import com.mysql.jdbc.PreparedStatement; public class listeVols extends JFrame { private JTable jTable1; private DefaultTableModel dtm; private BaseDonnees b = new BaseDonnees(); private Connection conn; private JLabel label1; public listeVols() { setTitle("Vols"); setSize(500,300); setLocationRelativeTo(null); setResizable(false); //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(new GridLayout (1,1)); JPanel panel2 = new JPanel(new GridLayout (0,1)); panel.setLayout(new FlowLayout()); panel.setBackground(Color.white); panel2.setLayout(new FlowLayout()); panel2.setBackground(Color.white); Container contenu = this.getContentPane(); contenu.add(panel, BorderLayout.CENTER); contenu.add(panel2, BorderLayout.NORTH); label1=new JLabel("Les vols disponibles" ); jTable1 = new JTable(); dtm = new DefaultTableModel(new String[] { "IdVol","Date de Départ","Date d'arrivé" }, 0); jTable1.setModel(dtm); panel.add(jTable1); panel2.add(label1); b.ConnexionBD(); conn = b.getConnect(); String query1 = "SELECT * FROM Vol"; try{ PreparedStatement stm = (PreparedStatement) conn.prepareStatement(query1); ResultSet rs = stm.executeQuery(query1); while (rs.next()) { dtm.addRow(new Object[]{ rs.getInt("NumeroVol"), rs.getDate("DateDepart"),rs.getDate("DateDarrive")}); } rs.close(); } catch(SQLException e) { e.printStackTrace(); } setVisible(true); } }
[ "elhirchimane21@gmail.com" ]
elhirchimane21@gmail.com
2862f087fc3f985e2fbd56fe340e7d777e99c75c
61b4974c75db80667115db6997732deffc8b841f
/src/main/java/io/github/apace100/origins/mixin/ServerPlayerInteractionManagerAccessor.java
536e6bac7753c7035174554c97ebf696d3b4d844
[ "MIT" ]
permissive
florensie/origins-fabric
0e4de559cf2ba36772613c3f2b332294e30d7f3d
36a6f8971ee44faf558f6fefdb5764b1179b2a1c
refs/heads/master
2023-04-07T08:11:17.427784
2021-01-24T23:41:42
2021-01-24T23:41:53
332,576,318
0
0
MIT
2023-03-22T20:38:11
2021-01-24T23:06:12
Java
UTF-8
Java
false
false
433
java
package io.github.apace100.origins.mixin; import net.minecraft.server.network.ServerPlayerInteractionManager; import net.minecraft.util.math.BlockPos; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(ServerPlayerInteractionManager.class) public interface ServerPlayerInteractionManagerAccessor { @Accessor BlockPos getMiningPos(); @Accessor boolean getMining(); }
[ "apace100@web.de" ]
apace100@web.de
2dafe66d3640c7d560136b2ec26c9f7306cf9027
7eed9d6424524de8839df13a16655deaecb27265
/MemberManager/src/kr/ac/shinhan/csp/ReadMemberServlet.java
36d25c211bd8607b1ac012cde0d376fc8074f535
[]
no_license
sevenlucky1/shinhancsp
57e56e542596455420040c759904c81d0cbd6f57
40317e5ddc0ff2c94ef09e11d5158333460220ea
refs/heads/master
2021-01-18T16:32:15.231873
2015-04-06T13:13:38
2015-04-06T13:13:38
33,482,489
0
0
null
null
null
null
UHC
Java
false
false
1,318
java
package kr.ac.shinhan.csp; import java.io.IOException; import java.util.List; import javax.servlet.http.*; public class ReadMemberServlet extends HttpServlet{ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String name = req.getParameter("name"); String number = req.getParameter("number"); String phone = req.getParameter("phone"); String mail = req.getParameter("mail"); String cacaotalk = req.getParameter("cacaotalk"); String manager = req.getParameter("manager"); String gitId = req.getParameter("gitID"); List<Member> namedMemberList = MemberManager.getMemberByName(name); Member m = namedMemberList.get(0); resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/plain"); resp.getWriter().println("이름 : "+m.getName()); resp.getWriter().println("학번 : "+m.getNumber()); resp.getWriter().println("전화번호 : "+m.getPhone()); resp.getWriter().println("메일주소 : "+m.getMail()); resp.getWriter().println("카카오톡 아이디 : "+m.getCacaotalk()); resp.getWriter().println("팀장여부 : "+m.getManager()); resp.getWriter().println("GitID : "+m.getGitID()); resp.getWriter().println("</body>"); resp.getWriter().println("</html>"); } }
[ "bigeye0701@naver.com" ]
bigeye0701@naver.com
e19d7a025ae1dd89967844c60ecd305665f1e9be
203bc45d40109ac327c1f5d8878fd31279d102be
/ssm_spring/day02_01anno_ioc/src/main/java/com/dao/impl/AccountDaoImpl.java
a5cd85ca31c3591fc04c3b3067fc6d0a8a278d02
[]
no_license
xzhyj93/ssm_learning
b9fc68b2891c42ceb9fe322713d3d6df1800373d
75f5456c08f0e648d5cfb53a895c5a7499ae1c16
refs/heads/master
2022-07-11T08:44:33.974296
2019-09-23T12:38:59
2019-09-23T12:38:59
204,126,235
0
0
null
null
null
null
UTF-8
Java
false
false
278
java
package com.dao.impl; import com.dao.IAccountDao; import org.springframework.stereotype.Repository; @Repository("accountDao1") public class AccountDaoImpl implements IAccountDao { public void saveAccount() { System.out.println("保存了账户11111111"); } }
[ "xzhyj93@gmail.com" ]
xzhyj93@gmail.com
16ed254a98567c7dd24124e692a05155e8ee3fce
f5dccbdb0c2c8db27e303f4fbe1d1877f7114ac8
/app/src/main/java/com/corporation/helloworld/Join.java
8116da3cfd3476bbcafc6f8d11e0fe43397ff91f
[]
no_license
8793COMPANY/HellOworld_rev
c7a4c7c00abbe47c5661fcd4191bfd357cb66a1d
12d75e044731b4f239e1753b1a393cbfc2738005
refs/heads/master
2023-08-30T02:37:07.141887
2021-10-20T04:59:56
2021-10-20T04:59:56
374,518,399
0
1
null
null
null
null
UTF-8
Java
false
false
1,174
java
package com.corporation.helloworld; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.widget.ImageButton; import android.widget.ImageView; public class Join extends AppCompatActivity { Handler handler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_join); ImageButton join_btn = findViewById(R.id.join_btn); ImageView join_call_me_2 = findViewById(R.id.join_call_me_2); join_btn.setOnClickListener(v -> { //Intent intent = new Intent(getApplicationContext(), Join_input.class); Intent intent = new Intent(getApplicationContext(), Admin_code.class); startActivity(intent); overridePendingTransition(R.anim.fade_in, R.anim.fade_out); }); join_call_me_2.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://sayhello.co.kr/privacy")); startActivity(intent); }); } //11 }
[ "ehd6754@gmail.com" ]
ehd6754@gmail.com
246b33fec0fc571f77f04235596d2b922fea601c
d059c89aa32912cb1fb25038b690dda5176cc7e0
/src/main/java/model/dao/DatabaseCleaner.java
229e4635420435d7b5293540b63a5a2c5c5de3f1
[]
no_license
domenicodale/gamehub
4622b1d11dd2d3e4a43568050900ee7b58cfc09f
93254dd332de3a3f8737d3e5561ef886b3f851dd
refs/heads/main
2023-03-22T09:03:32.909085
2021-01-21T22:56:13
2021-01-21T22:56:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,852
java
package model.dao; import model.bean.*; import java.util.ArrayList; public class DatabaseCleaner { public static void main(String[] args) { User u1 = new User("username1","password", "Name", "Surname", "Address", "City", "Country", "2020-11-16", "Mail1", 'M', "1111111111"); User u2 = new User("username2","password", "Name", "Surname", "Address", "City", "Country", "2020-11-16", "Mail2", 'M', "1111111111"); User u3 = new User("username3","password", "Name", "Surname", "Address", "City", "Country", "2020-11-16", "Mail3", 'M', "1111111111"); User u4 = new User("username4","password", "Name", "Surname", "Address", "City", "Country", "2020-11-16", "Mail4", 'M', "1111111111"); UserDAO ud = new UserDAO(); ud.doDeleteFromUsername(u1.getUsername()); ud.doDeleteFromUsername(u2.getUsername()); ud.doDeleteFromUsername(u3.getUsername()); ud.doDeleteFromUsername(u4.getUsername()); Tag t1 = new Tag("Sparatutto"); Tag t2 = new Tag("Azione"); Tag t3 = new Tag("Avventura"); Tag t4 = new Tag("Rompicapo"); TagDAO td = new TagDAO(); td.doDelete(t1.getName()); td.doDelete(t2.getName()); td.doDelete(t3.getName()); td.doDelete(t4.getName()); Category c1 = new Category("game", "DescrizioneCategory1", "immagine1"); Category c2 = new Category("dlc", "DescrizioneCategory2", "immagine2"); Category c3 = new Category("video", "DescrizioneCategory3", "immagine3"); Category c4 = new Category("categoria", "DescrizioneCategory4", "immagine4"); CategoryDAO cd = new CategoryDAO(); cd.doDeleteByName(c1.getName()); cd.doDeleteByName(c2.getName()); cd.doDeleteByName(c3.getName()); cd.doDeleteByName(c4.getName()); DigitalProduct d1 = new DigitalProduct(1, "GiocoDigitale1", 12.3, "DescrizioneDigitale1", "immagine1", new ArrayList<>(), new ArrayList<>(), 1, "ps4", "1999-12-12", 10, "SoftwareHouse", "publisher"); DigitalProduct d2 = new DigitalProduct(2, "GiocoDigitale2", 12.3, "DescrizioneDigitale2", "immagine2", new ArrayList<>(), new ArrayList<>(), 1, "ps4", "1999-12-12", 10, "SoftwareHouse", "publisher"); DigitalProduct d3 = new DigitalProduct(3, "GiocoDigitale3", 12.3, "DescrizioneDigitale3", "immagine3", new ArrayList<>(), new ArrayList<>(), 1, "ps4", "1999-12-12", 10, "SoftwareHouse", "publisher"); DigitalProduct d4 = new DigitalProduct(4, "GiocoDigitale4", 12.3, "DescrizioneDigitale4", "immagine4", new ArrayList<>(), new ArrayList<>(), 1, "ps4", "1999-12-12", 10, "SoftwareHouse", "publisher"); DigitalProductDAO dp = new DigitalProductDAO(); // -- NON FUNZIONA -- PERCHE' L'ID // DEL PRODOTTO E' DIVERSO DA QUELLO SALVATO // NEL DB dp.doDelete(d1.getId()); dp.doDelete(d2.getId()); dp.doDelete(d3.getId()); dp.doDelete(d4.getId()); PhysicalProduct p1 = new PhysicalProduct(1,"GiocoFisico1", 12.1, "DescrizioneFisico1", "imamgine1", new ArrayList<>(), new ArrayList<>(), 1, "12x12x12", 12.1); PhysicalProduct p2 = new PhysicalProduct(2,"GiocoFisico2", 12.1, "DescrizioneFisico2", "imamgine2", new ArrayList<>(), new ArrayList<>(), 1, "12x12x12", 12.1); PhysicalProduct p3 = new PhysicalProduct(3,"GiocoFisico3", 12.1, "DescrizioneFisico3", "imamgine3", new ArrayList<>(), new ArrayList<>(), 1, "12x12x12", 12.1); PhysicalProduct p4 = new PhysicalProduct(4,"GiocoFisico4", 12.1, "DescrizioneFisico4", "imamgine4", new ArrayList<>(), new ArrayList<>(), 1, "12x12x12", 12.1); PhysicalProductDAO pd = new PhysicalProductDAO(); // -- NON FUNZIONA -- PERCHE' L'ID // DEL PRODOTTO E' DIVERSO DA QUELLO SALVATO // NEL DB pd.doDelete(p1.getId()); pd.doDelete(p2.getId()); pd.doDelete(p3.getId()); pd.doDelete(p4.getId()); Order o1 = new Order(1, u1, null, "2000-10-10"); Order o2 = new Order(2, u1, null, "2020-2-2"); OrderDAO od = new OrderDAO(); od.doDelete(o1.getId()); od.doDelete(o2.getId()); Operator o = new Operator(u2, "2020-11-12", "Ciao"); OperatorDAO opd = new OperatorDAO(); opd.doDeleteByUsername(o.getUsername()); } }
[ "r.esposito130@studenti.unisa.it" ]
r.esposito130@studenti.unisa.it
1b96e84e4ef261e04bfd4c32508a6920e6f7ba1a
a7deb7dda80811dfb21a6e1a766f15482d0015ed
/Netbeans/piaPW/src/main/java/com/mycompany/piapw/dao/UserDAO.java
45d63540dc8a155c3d720a897e2c7b95884f53c4
[]
no_license
AngelC84/Progra-web-Proyecto-
7c2124a0a44d55126cfca77261042b5d6f00eacb
19da86b446eea2c0c31c99463ddf4073a6f2751c
refs/heads/master
2023-05-25T12:17:17.984546
2021-06-12T22:15:36
2021-06-12T22:15:36
353,857,487
0
0
null
null
null
null
UTF-8
Java
false
false
2,400
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.piapw.dao; import com.mycompany.piapw.models.User; import com.mycompany.piapw.utils.DbConnection; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; /** * * @author jctor */ public class UserDAO { public static int insertUSer(User user){ try{ Connection con = DbConnection.getConnection(); String qry = "CALL spUsuario('Insert',?,?,?,?,?,?,?,?,1);"; CallableStatement statement = con.prepareCall(qry); statement.setString(1, user.getUsuario()); statement.setString(2, user.getNombre()); statement.setString(3, user.getApellidoP()); statement.setString(4, user.getApellidoM()); statement.setString(5, user.getContra()); // java.util.Date uFechaNac = user.getFechaNac(); // java.sql.Date sqlFechaNac = new java.sql.Date(uFechaNac.getTime()); statement.setString(6, user.getFechaNac()); statement.setString(7, user.getCorreo()); statement.setString(8, user.getImgPerfil()); return statement.executeUpdate(); }catch(SQLException exc){ System.out.println(exc.getMessage()); } return 0; } public static User logInUser(User user){ try{ Connection con = DbConnection.getConnection(); String qry = "CALL spUsuario('LoginUsuario',?,NULL,NULL,NULL,?,NULL,NULL,NULL,NULL);"; CallableStatement statement = con.prepareCall(qry); statement.setString(1, user.getUsuario()); statement.setString(2, user.getContra()); ResultSet resultSet = statement.executeQuery(); while(resultSet.next()){ String username = resultSet.getString("Id_Usuario"); String password = resultSet.getString("Contrasenia"); return new User(username, password); } }catch(SQLException exc){ System.out.println(exc.getMessage()); } return null; } }
[ "jctorresc2606@gmail.com" ]
jctorresc2606@gmail.com
e3e504053919416c6a4f89e23cda3aa3524633a1
ac4b3592ce3532e2e2b78deb48fcecfdb20a28d2
/src/translation/ArenaToView.java
94c20070396c43c4c49e56c5742cf6ab39dfc4dc
[]
no_license
bohmbac1/RobotBattle
afbfd88c8f35b66a645ce369e86456215a302130
9b1ef20affd706ded105c6c7abd6a45c4613da46
refs/heads/master
2021-01-18T19:29:45.236310
2013-07-06T03:17:01
2013-07-06T03:17:01
10,428,011
0
1
null
null
null
null
UTF-8
Java
false
false
1,804
java
package translation; import java.awt.Color; import java.awt.Point; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.List; import javax.imageio.ImageIO; import math.ImageLibrary; import entities.Arena; import entities.Robot; /** * Translate the information in the arena into the view. * Start this after all the robots have been added to the arena. * * @author stantonbohmbach * */ public class ArenaToView { private Arena arena; private View view; public ArenaToView(Arena a, View v) { arena = a; view = v; updateViewRobots(); } private void updateViewRobots() { view.clearRobots(); synchronized(arena.getRobots()) { for (Robot r : arena.getRobots()) { view.addRobot(r); } } } public BufferedImage displayAttack(Robot r, BufferedImage image) { Color attackColor = r.getAttackColor(); List<Point> attackPoints = r.attackPoints(); for (Point point : attackPoints) { if (arena.containsPoint(point)) { image.setRGB(point.x, point.y, attackColor.getRGB()); } } return image; } public Arena getArena() { return arena; } public View getView() { return view; } public void updateView() throws IOException { if (arena.getRobots().size() != view.getRobots().size()) { updateViewRobots(); } BufferedImage image = ImageIO.read(arena.getImageFile()); for (Robot r : arena.getRobots()) { BufferedImage rotatedRobot = ImageLibrary.rotateImage(r.getImage(), r.getDirectionFacing() - 270); image = ImageLibrary.overlayImages(image, rotatedRobot, (int) (r.getxPos() - rotatedRobot.getWidth() / 2), (int) (r.getyPos() - rotatedRobot.getHeight() / 2)); if (r.isAttacking()) { image = displayAttack(r, image); } } view.setArenaImage(image); System.gc(); } }
[ "stantonbohmbach@Stanton-Bohmbachs-MacBook-Pro.local" ]
stantonbohmbach@Stanton-Bohmbachs-MacBook-Pro.local
e8de140ffa277c4665a36bedbde5d533742d0c1d
d6cacf5d98faa5f5d812cffec3c1f623ce787c7e
/Eclipse_Workspace/spring-project/src/main/java/com/company/spring_project/bean/Coach.java
d5622fcd0cbdc6fc3071eea695c00560782c96e3
[]
no_license
AishwaryaManoharan/IBM-FSD-000GEO
058c7744c912c42613e33de328f4672d0c90d703
aea9caf89353d90e7bc48c69be19b6a19ff52a45
refs/heads/master
2022-12-23T00:13:24.679283
2019-10-04T04:28:22
2019-10-04T04:28:22
195,185,513
0
0
null
2022-12-22T11:55:09
2019-07-04T06:52:40
HTML
UTF-8
Java
false
false
142
java
package com.company.spring_project.bean; public interface Coach { public String getDailyWorkout(); public String getDailyFortune(); }
[ "aishwaryaengr@gmail.com" ]
aishwaryaengr@gmail.com
1b05c9dcde065ba84f3e1bf4faca233d74d0934f
772524d53e955d98bdafad6e57db0642dbfc41d5
/spring-source/src/main/java/com/bow/spring/transaction/DemoService.java
aec9e0be36c7f119b38331e9e69ae33f737e688c
[]
no_license
williamxww/spring-demo
67f979fa77f4b52f7ca3ee38a63f8dd92043aeec
5c0904d183630586e98cc5b85eb91308b0ec7358
refs/heads/master
2021-04-03T08:51:08.381550
2018-04-26T14:47:27
2018-04-26T14:47:27
125,065,897
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
package com.bow.spring.transaction; /** * @author ViVi * @date 2015年10月2日 上午10:00:43 */ public interface DemoService { public void testTransaction(); public void codeTransaction(); }
[ "550456590@qq.com" ]
550456590@qq.com
fca2ec40095772da81f14c87a21d222b2472eb46
abdad36fc1f4b4de9004bad9db7a5e403560ea67
/android-lite-orm-library/src/cn/litesuits/orm/db/annotation/NotNull.java
77ced7fdee4cc998517e26aba0b7f18e51d6208e
[]
no_license
LeungYong/MikeyDiary
feb10f22679df79f0af3f49888bf8694da5a6dda
00ae17d42de692d0162d11f21cd1bfb69379de89
refs/heads/master
2016-09-13T16:19:06.686664
2016-05-23T10:06:54
2016-05-23T10:06:55
59,471,875
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package cn.litesuits.orm.db.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 非空约束 */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface NotNull { }
[ "luengyong@163.com" ]
luengyong@163.com
7b081240b9958854f27ca6ffe0269a742d582c0b
68881d6a5f2b465ac9975b509b5a600a441d0a56
/src/main/java/com/domino/t1/board/qna/QnaController.java
d2c350b81d56d7a67af453b8c1409fa84f0862ed
[]
no_license
MYCHCH515/domino_project
75322e22ca4e88f1a6f5a4920a6a4fc9daf36d74
a7c6fc68a1a217367e04b4e997d8175111a41086
refs/heads/main
2023-09-04T07:02:22.525931
2021-11-03T14:41:53
2021-11-03T14:41:53
421,128,588
0
0
null
null
null
null
UTF-8
Java
false
false
2,532
java
package com.domino.t1.board.qna; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import com.domino.t1.board.file.BoardFileDTO; import com.domino.t1.util.Pager; @Controller @RequestMapping("/qna/**") public class QnaController { @Autowired private QnaService qnaService; @GetMapping("qnaList") public ModelAndView getList(Pager pager) throws Exception{ ModelAndView mv = new ModelAndView(); List<QnaDTO> ar = qnaService.getList(pager); mv.addObject("list", ar); mv.addObject("pager", pager); mv.setViewName("qna/qnaList"); return mv; } @GetMapping("qnaWrite") public ModelAndView setInsert() throws Exception{ ModelAndView mv = new ModelAndView(); mv.setViewName("qna/qnaWrite"); return mv; } @PostMapping("qnaWrite") public ModelAndView setInsert(QnaDTO qnaDTO, MultipartFile [] files, HttpSession session) throws Exception{ int result = qnaService.setInsert(qnaDTO, files, session); System.out.println("RESULT: " + result); String message="접수가 완료되지 않았습니다"; if(result>0) { message = "성공적으로 접수되었습니다"; } ModelAndView mv = new ModelAndView(); mv.addObject("msg", message); mv.addObject("path", "./qnaWrite"); mv.setViewName("common/result"); return mv; } @GetMapping("fileDown") public ModelAndView fileDown(BoardFileDTO boardFileDTO)throws Exception{ ModelAndView mv = new ModelAndView(); mv.addObject("news", "qna"); mv.addObject("fileDTO", boardFileDTO); mv.setViewName("fileDown"); return mv; } @GetMapping("qnaReply") public ModelAndView setReply() throws Exception{ ModelAndView mv = new ModelAndView(); mv.setViewName("qna/qnaReply"); return mv; } @GetMapping("qnaSelect") public ModelAndView getOne(QnaDTO qnaDTO) throws Exception { ModelAndView mv = new ModelAndView(); qnaDTO = qnaService.getOne(qnaDTO); if(qnaDTO!=null) { mv.setViewName("qna/qnaSelect"); mv.addObject("dto", qnaDTO); } else { mv.setViewName("common/result"); mv.addObject("msg", "No Data"); mv.addObject("path", "./qnaList"); } return mv; } }
[ "nam1738@naver.com" ]
nam1738@naver.com
9c2822aa62e99157426abc5b93fd8b052d930caf
3e8c60fdd01b9936c15161e7f5ae895083b94642
/app/src/main/java/com/steven/minitwitter/retrofit/respuesta/RespuestaAuth.java
11d8045c029a44ccb5b7800d434deda01a1c966a
[]
no_license
StevenGG19/miniTwitter
cd3168984f47f65d701b23c2b8f9fab3fdee7ee8
7c7869d05f0343e647d56a0e6837523cd7e5cc95
refs/heads/main
2023-02-12T14:04:33.969007
2020-12-28T04:09:48
2020-12-28T04:09:48
324,906,656
0
0
null
null
null
null
UTF-8
Java
false
false
2,070
java
package com.steven.minitwitter.retrofit.respuesta; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class RespuestaAuth { @SerializedName("token") @Expose private String token; @SerializedName("username") @Expose private String username; @SerializedName("email") @Expose private String email; @SerializedName("photoUrl") @Expose private String photoUrl; @SerializedName("created") @Expose private String created; @SerializedName("active") @Expose private Boolean active; /** * No args constructor for use in serialization * */ public RespuestaAuth() { } /** * * @param photoUrl * @param created * @param active * @param email * @param token * @param username */ public RespuestaAuth(String token, String username, String email, String photoUrl, String created, Boolean active) { super(); this.token = token; this.username = username; this.email = email; this.photoUrl = photoUrl; this.created = created; this.active = active; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhotoUrl() { return photoUrl; } public void setPhotoUrl(String photoUrl) { this.photoUrl = photoUrl; } public String getCreated() { return created; } public void setCreated(String created) { this.created = created; } public Boolean getActive() { return active; } public void setActive(Boolean active) { this.active = active; } }
[ "stevengg39@gmail.com" ]
stevengg39@gmail.com
bcd8c1335cab999fcd9b4b4e8ade72e20091af48
95e2070150f8d00d65b462431de2091a2bf86741
/src/kind/state/Runable.java
309bcbee02bac82dcdc9fe105f371c99d99a827f
[]
no_license
Dumushi/DesignModel
914ce630f3963dd81af62ebada8abe8724154c43
a160b05f11b31e50e8e4c93404b35d3fceb852b1
refs/heads/master
2023-03-16T12:25:20.165177
2021-03-12T13:16:54
2021-03-12T13:16:54
347,071,396
0
0
null
null
null
null
UTF-8
Java
false
false
297
java
package kind.state; /** * * Description: * 具体状态 * @author: mushi * @Date: 2021/2/21 9:25 */ public class Runable extends State{ @Override public void Handle(Context context) { System.out.println("就绪状态"); context.setState(new Run()); } }
[ "1379134481@qq.com" ]
1379134481@qq.com
c6a0f13d90a70313b6f64d3e34892c9a9748cef5
7929a3f9672f4227b76c8a95fe88b50945c3b526
/HelloWorld/src/MainOperation/Main.java
68b373646b15f054341d25659550b82e3fe25af5
[]
no_license
RomanIntex/HelloWorld
a510fe6a663655eb27d09876c13bf9c309a54034
daf397c5cdb63fbb874602af5696123e4969097e
refs/heads/master
2020-04-03T09:53:02.318764
2018-10-30T06:51:44
2018-10-30T06:51:44
155,178,886
0
0
null
null
null
null
UTF-8
Java
false
false
3,208
java
package MainOperation; import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { //method1(); //method2(); //method3(); method5(); } public static void method(){ int i = 1; i++; // Постфиксная форма i = i + 1; i--; // Постфиксная форма i = i - 1; System.out.println(i); int i2 = 1; ++i2; --i2; System.out.println(i2); int x = 10; int y = x++; System.out.println(x + " " + y); int a = 12; int b = 3; int c = a /= b; b /= 3; System.out.println(c); System.out.println(a); System.out.println(b); } public static void method1() { int mouse; int weight; mouse = 5; weight = 4500; if (mouse != 0 && weight / mouse < 1000) { System.out.println("Можно кормить кота"); } else { System.out.println("Нельзя кормить"); } if (false || true){ System.out.println("Ок!"); } int number = 10 == 5 ? 10:5; System.out.println(number); String numberofmouse = mouse > 5 ? "хорощий кот" : "плохой кот"; System.out.println(numberofmouse); } public static void method2(){ int a = 5; int b = 5; if (a<=b) { System.out.println("a меньше b"); if (a != b) { System.out.println("a не равно b"); } else { System.out.println("a равно b"); } } else System.out.println("a не меньше b"); } public static void method3(){ Random rnd = new Random(); int i = 0; while (i<7){ int a = 7; int b = rnd.nextInt(5) + 1; int c = rnd.nextInt(6) + 1; // if (a<b) System.out.println("a меньше b"); // else if (a==b) System.out.println("a==b"); // else if (a>b) System.out.println("a>b"); // i++; if (c<b) System.out.println("c меньше b"); else if (c==b) System.out.println("c==b"); else if (c>b) System.out.println("c>b"); else System.out.println("не один из вариантов не подходит"); i++; System.out.println(); } } public static void method4(){ Scanner scan = new Scanner(System.in); Random rnd = new Random(); System.out.println("введите число"); int a = rnd.nextInt(scan.nextInt()) + 1; int b = 4; int c = rnd.nextInt(6) + 1; if (a>b & a>c) System.out.println("a больше b,c"); else if (b>a & b>c) System.out.println("b больше a,c"); else if (c>a & c>b) System.out.println("c больше b,a"); } public static void method5() { if (true) { System.out.println("Какой-то текст"); System.out.println("Какой-то текст"); } } }
[ "romansadre@gmail.com" ]
romansadre@gmail.com
f68eb61d6119e06688b3527f9eaf0a0212691d7d
4f0efdc69eb2f7f620434659a79edff8d313c91c
/dntShop_war/src/java/AdminController/adminAddCustomer.java
00df426c964ed2d2a64217f4787bb66268047cde
[]
no_license
lucky991997/dnt
73b7930658b4f7181368b5d5f70afa7b6054dc83
5fdf69fe24230f1bbeb56521d1e49fd608d7c6fa
refs/heads/master
2020-05-30T17:09:43.439569
2019-06-02T15:45:52
2019-06-02T15:45:52
189,856,358
0
0
null
null
null
null
UTF-8
Java
false
false
5,586
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 AdminController; import bean.CustomersFacadeLocal; import entity.Customers; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import java.util.List; import javax.ejb.EJB; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; /** * * @author Duy */ @WebServlet(name = "adminAddCustomer", urlPatterns = {"/adminAddCustomer"}) public class adminAddCustomer extends HttpServlet { @EJB CustomersFacadeLocal cusFacade; private static final long serialVersionUID = 1L; // location to store file uploaded private static final String UPLOAD_DIRECTORY = "images/Avatars"; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // configures upload settings DiskFileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); String uploadPath = getServletContext().getRealPath("") + File.separator + UPLOAD_DIRECTORY; // creates the directory if it does not exist File uploadDir = new File(uploadPath); if (!uploadDir.exists()) { uploadDir.mkdir(); } try { // parses the request's content to extract file data @SuppressWarnings("unchecked") List<FileItem> formItems = upload.parseRequest(request); Customers bra = new Customers(); //auto create brand_id int num = cusFacade.count() + 1; String id = num + ""; int lenNum = 3; int lenZero = lenNum - id.length(); for (int i = 0; i < lenZero; i++) { id = "0" + id; } String bra_id = "CS" + id; bra.setCustomerID(bra_id); bra.setIsStatus(Boolean.TRUE); Date createDate = new Date(); bra.setCreatedDate(createDate); if (formItems != null && formItems.size() > 0) { // iterates over form's fields for (FileItem item : formItems) { // processes only fields that are not form fields if (item.isFormField()) { // Process regular form field (input type="text|radio|checkbox|etc", select, etc). switch (item.getFieldName()) { case "fName": bra.setFirstName(item.getString()); continue; case "lName": bra.setLastName(item.getString()); continue; case "email": bra.setEmail(item.getString()); continue; case "password": bra.setPassword(item.getString()); continue; case "gender": if (item.getString().equals("Male")) { bra.setGender(Boolean.TRUE); } else { bra.setGender(Boolean.FALSE); } continue; case "phone": bra.setPhone(item.getString()); continue; case "address": bra.setAddress(item.getString()); continue; } } else { String fileName = new File(item.getName()).getName(); if (fileName.isEmpty()) { String brandImage = "images/Avatars/avatar.png"; bra.setAvatar(brandImage); } else { String newfileName = fileName.substring(fileName.lastIndexOf('.')); String filePath = uploadPath + File.separator + bra_id + newfileName; File storeFile = new File(filePath); // saves the file on disk item.write(storeFile); String brandImage = (UPLOAD_DIRECTORY + "/" + bra_id + newfileName); bra.setAvatar(brandImage); } } } } cusFacade.create(bra); } catch (Exception ex) { ex.getStackTrace(); } // redirects client to message page getServletContext().getRequestDispatcher("/adminViewCustomer").forward(request, response); } }
[ "41136573+lucky991997@users.noreply.github.com" ]
41136573+lucky991997@users.noreply.github.com
37ff54cdbe7e04b68ab00080c0922774cf8608d4
ecf7d0ffff0b02a434e3c8219cd940d1bc631e6d
/SingletonPattern/SingleObject.java
866a49c5465bf5d788264ea760199f3e40cb1b18
[]
no_license
jianqiang-Zhang/DesignPattern
57851ccb6f63a0c608a6fd09abeea7ab1c4f4be3
b41ee8db2b2342882e3e3a4479a653807724f5e8
refs/heads/main
2023-02-27T14:04:48.348173
2021-02-05T10:36:50
2021-02-05T10:36:50
336,238,222
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
package SingletonPattern; class SingleObject0 { //这是饿汉式 private SingleObject0() {} private String name; private static SingleObject0 instance = new SingleObject0(); public static SingleObject0 getInstance() { return instance; } public void setName(String name1) { name = name1; } public String getName() { return name; } } class SingleObject1{ //这个是懒汉式 private SingleObject1() {} private String name; private static SingleObject1 instance; public static synchronized SingleObject1 getInstance() { if(instance == null) { instance = new SingleObject1(); } return instance; } public void setName(String name1) { name = name1; } public String getName() { return name; } } class DoubleCheck{ //双重校验锁 private DoubleCheck(){}; private static DoubleCheck instance; public static DoubleCheck getInstance(){ if(instance == null){ synchronized (instance){ if (instance == null){ instance = new DoubleCheck(); } } } return instance; } } enum Singleton{ INSTANCE; public void anyMethod(){ } }
[ "noreply@github.com" ]
jianqiang-Zhang.noreply@github.com
d608b7f0d418436723cd040482d0963e7a4fce66
d3ff76710ad9d48204fa8bbedfee8533a74f47cc
/monolithic/service/order/src/main/java/io/github/zutherb/appstash/shop/service/order/impl/OrderServiceImpl.java
6607b0d64edbce5234345abd269db0ec63024cb0
[ "Apache-2.0" ]
permissive
mehrdad2000/WEB1066-the-app
9b3ea8b31eb996c8c09c642885b620b87f38f5be
9fc2cf9d5db524c8257768ad3a3da713cb96a5cb
refs/heads/master
2021-05-24T08:36:58.027365
2020-04-06T11:15:14
2020-04-06T11:15:14
253,474,066
2
0
Apache-2.0
2020-04-06T11:13:20
2020-04-06T11:13:20
null
UTF-8
Java
false
false
5,001
java
package io.github.zutherb.appstash.shop.service.order.impl; import io.github.zutherb.appstash.common.service.AbstractServiceImpl; import io.github.zutherb.appstash.dataloader.reader.SupplierCsvReader; import io.github.zutherb.appstash.shop.repository.order.api.OrderIdProvider; import io.github.zutherb.appstash.shop.repository.order.api.OrderRepository; import io.github.zutherb.appstash.shop.repository.order.model.Order; import io.github.zutherb.appstash.shop.repository.order.model.Supplier; import io.github.zutherb.appstash.shop.service.cart.api.Cart; import io.github.zutherb.appstash.shop.service.order.api.OrderService; import io.github.zutherb.appstash.shop.service.order.model.OrderInfo; import io.github.zutherb.appstash.shop.service.user.api.UserService; import org.apache.commons.lang3.Validate; import org.dozer.Mapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.io.IOException; import java.util.Date; import java.util.List; import java.util.Random; /** * @author zutherb */ @Service("orderService") @Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES) public class OrderServiceImpl extends AbstractServiceImpl<OrderInfo, Order> implements OrderService { private static Logger logger = LoggerFactory.getLogger(OrderServiceImpl.class); private OrderRepository orderRepository; private Mapper dozerMapper; private OrderIdProvider orderIdProvider; private Cart cart; private SupplierCsvReader supplierCsvReader; private UserService userService; List<Supplier> suppliers; @Autowired public OrderServiceImpl(@Qualifier("orderRepository") OrderRepository repository, @Qualifier("dozerMapper") Mapper dozerMapper, @Qualifier("orderIdProvider") OrderIdProvider orderIdProvider, @Qualifier("cart") Cart cart, @Qualifier("supplierCsvReader") SupplierCsvReader supplierCsvReader, @Qualifier("userService") UserService userService) { super(repository, dozerMapper, OrderInfo.class, Order.class); orderRepository = repository; this.dozerMapper = dozerMapper; this.orderIdProvider = orderIdProvider; this.cart = cart; this.supplierCsvReader = supplierCsvReader; this.userService = userService; } @PostConstruct public void initSuppliers() throws IOException { suppliers = supplierCsvReader.parseCsv(); } @Override public OrderInfo submitOrder(OrderInfo orderInfo, String sessionId) { Long orderId = orderIdProvider.nextVal(); OrderInfo orderInfoToSave = new OrderInfo(orderId, sessionId, orderInfo); save(orderInfoToSave); logger.info(String.format("Order %d was submited", orderInfoToSave.getOrderId())); cart.clear(); return orderInfoToSave; } @Override public List<OrderInfo> findAll(int limit, int offset, Sort sort) { return mapListOfSourceEntitiesToDestinationEntities(orderRepository.findAll(limit, offset, sort)); } @Override public List<OrderInfo> findInRange(Date fromDate, Date toDate, int limit, int offset, Sort sort) { return mapListOfSourceEntitiesToDestinationEntities(orderRepository.findInRange(fromDate, toDate, limit, offset, sort)); } @Override public OrderInfo findFirstOrder() { return dozerMapper.map(orderRepository.findFirstOrder(), OrderInfo.class); } @Override public OrderInfo findLastOrder() { return dozerMapper.map(orderRepository.findLastOrder(), OrderInfo.class); } @Override public long countInRange(Date fromDate, Date toDate) { return orderRepository.countInRange(fromDate, toDate); } @Override public void save(OrderInfo object) { Order mappedObject = dozerMapper.map(object, Order.class); Validate.notNull(userService.findById(mappedObject.getUserId())); mappedObject.setSupplier(suppliers.get(getRandom(0, suppliers.size() - 1))); orderRepository.save(mappedObject); } public int getRandom(int minimum, int maximum) { Random rn = new Random(); int n = maximum - minimum + 1; int i = Math.abs(rn.nextInt()) % n; return minimum + i; } @Override protected OrderInfo mapSourceEntityToDestinationEntity(Order sourceEntity) { OrderInfo orderInfo = super.mapSourceEntityToDestinationEntity(sourceEntity); orderInfo.setUser(userService.findById(sourceEntity.getUserId())); return orderInfo; } }
[ "omar.chavez-orozco@hpe.com" ]
omar.chavez-orozco@hpe.com
02d6cfb35b0b6b88c3fd034f46e965a5637841e1
b2b669fd6a75c5e82ad0bf8c743d8ac7cd9b332c
/metron-analytics/metron-profiler/src/test/java/org/apache/metron/profiler/bolt/ProfileBuilderBoltTest.java
caeddee7e7de10f66ee2517ce8c8f03ab64124ed
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
digideskio/incubator-metron
c79a3b2ef3f7fafa1566266eb620015ef2251e26
8c4b0f1db94d02f390aae571bdc8085dc81ddbe1
refs/heads/master
2021-01-12T13:20:11.033456
2016-10-27T16:42:08
2016-10-27T16:42:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,196
java
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.metron.profiler.bolt; import backtype.storm.Constants; import backtype.storm.tuple.Tuple; import backtype.storm.tuple.Values; import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.common.configuration.profiler.ProfileConfig; import org.apache.metron.common.utils.JSONUtils; import org.apache.metron.profiler.ProfileMeasurement; import org.apache.metron.profiler.stellar.DefaultStellarExecutor; import org.apache.metron.test.bolt.BaseBoltTest; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.junit.Test; import org.mockito.ArgumentCaptor; import java.io.IOException; import java.util.HashMap; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; /** * Tests the ProfileBuilderBolt. */ public class ProfileBuilderBoltTest extends BaseBoltTest { /** * { * "ip_src_addr": "10.0.0.1", * "ip_dst_addr": "10.0.0.20" * } */ @Multiline private String input; /** * { * "profile": "test", * "foreach": "ip_src_addr", * "onlyif": "true", * "init": { * "x": "10", * "y": "20" * }, * "update": { * "x": "x + 10", * "y": "y + 20" * }, * "result": "x + y" * } */ @Multiline private String basicProfile; /** * { * "profile": "test", * "foreach": "ip_src_addr", * "onlyif": "true", * "init": { "x": 10 }, * "update": { "x": "x + 'string'" }, * "result": "x" * } */ @Multiline private String profileWithBadUpdate; /** * { * "profile": "test", * "foreach": "ip_src_addr", * "onlyif": "true", * "init": { "x": "10 + 'string'" }, * "update": { "x": "x + 2" }, * "result": "x" * } */ @Multiline private String profileWithBadInit; /** * { * "profile": "test", * "foreach": "ip_src_addr", * "update": { "x": "2" }, * "result": "x" * } */ @Multiline private String profileWithNoInit; /** * { * "profile": "test", * "foreach": "ip_src_addr", * "init": { "x": "2" }, * "result": "x" * } */ @Multiline private String profileWithNoUpdate; private JSONObject message; public static Tuple mockTickTuple() { return mockTuple(Constants.SYSTEM_COMPONENT_ID, Constants.SYSTEM_TICK_STREAM_ID); } public static Tuple mockTuple(String componentId, String streamId) { Tuple tuple = mock(Tuple.class); when(tuple.getSourceComponent()).thenReturn(componentId); when(tuple.getSourceStreamId()).thenReturn(streamId); return tuple; } public void setup(String profile) throws Exception { // parse the input message JSONParser parser = new JSONParser(); message = (JSONObject) parser.parse(input); // the tuple will contain the original message when(tuple.getValueByField(eq("message"))).thenReturn(message); // the tuple will contain the 'fully resolved' name of the entity when(tuple.getStringByField(eq("entity"))).thenReturn("10.0.0.1"); // the tuple will contain the profile definition ProfileConfig profileConfig = JSONUtils.INSTANCE.load(profile, ProfileConfig.class); when(tuple.getValueByField(eq("profile"))).thenReturn(profileConfig); } /** * Create a ProfileBuilderBolt to test */ private ProfileBuilderBolt createBolt() throws IOException { ProfileBuilderBolt bolt = new ProfileBuilderBolt("zookeeperURL"); bolt.setCuratorFramework(client); bolt.setTreeCache(cache); bolt.setExecutor(new DefaultStellarExecutor()); bolt.setPeriodDurationMillis(TimeUnit.MINUTES.toMillis(15)); bolt.prepare(new HashMap<>(), topologyContext, outputCollector); return bolt; } /** * Ensure that the bolt can update a profile based on new messages that it receives. */ @Test public void testProfileUpdate() throws Exception { setup(basicProfile); ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); bolt.execute(tuple); // validate that x=10+10+10 y=20+20+20 assertEquals(10+10+10.0, bolt.getExecutor().getState().get("x")); assertEquals(20+20+20.0, bolt.getExecutor().getState().get("y")); } /** * If the 'init' field is not defined, then the profile should * behave as normal, but with no variable initialization. */ @Test public void testProfileWithNoInit() throws Exception { setup(profileWithNoInit); ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); bolt.execute(tuple); // validate assertEquals(2, bolt.getExecutor().getState().get("x")); } /** * If the 'update' field is not defined, then no updates should occur as messages * are received. */ @Test public void testProfileWithNoUpdate() throws Exception { setup(profileWithNoUpdate); ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); bolt.execute(tuple); bolt.execute(tuple); // validate assertEquals(2, bolt.getExecutor().getState().get("x")); } /** * Ensure that the bolt can flush the profile when a tick tuple is received. */ @Test public void testProfileFlush() throws Exception { // setup setup(basicProfile); ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); bolt.execute(tuple); // execute - the tick tuple triggers a flush of the profile bolt.execute(mockTickTuple()); // capture the ProfileMeasurement that should be emitted ArgumentCaptor<Values> arg = ArgumentCaptor.forClass(Values.class); verify(outputCollector, times(1)).emit(refEq(tuple), arg.capture()); Values actual = arg.getValue(); ProfileMeasurement measurement = (ProfileMeasurement) actual.get(0); // verify assertThat(measurement.getValue(), equalTo(90.0)); assertThat(measurement.getEntity(), equalTo("10.0.0.1")); assertThat(measurement.getProfileName(), equalTo("test")); } /** * What happens if we try to flush, but have yet to receive any messages to * apply to the profile? * * The ProfileBuilderBolt will not have received the data necessary from the * ProfileSplitterBolt, like the entity and profile name, that is required * to perform the flush. The flush has to be skipped until this information * is received from the Splitter. */ @Test public void testProfileFlushWithNoMessages() throws Exception { setup(basicProfile); ProfileBuilderBolt bolt = createBolt(); // no messages have been received before a flush occurs bolt.execute(mockTickTuple()); bolt.execute(mockTickTuple()); bolt.execute(mockTickTuple()); // no ProfileMeasurement should be written to the ProfileStore verify(outputCollector, times(0)).emit(any(Values.class)); } /** * The executor's state should be cleared after a flush. */ @Test public void testStateClearedAfterFlush() throws Exception { setup(basicProfile); ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); bolt.execute(tuple); // execute - should clear state from previous tuples bolt.execute(mockTickTuple()); assertThat(bolt.getExecutor().getState().size(), equalTo(0)); } /** * What happens when the profile contains a bad Stellar expression? */ @Test public void testProfileWithBadUpdate() throws Exception { // setup - ensure the bad profile is used setup(profileWithBadUpdate); // execute ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); // verify - expect the tuple to be acked and an error reported verify(outputCollector, times(1)).ack(eq(tuple)); verify(outputCollector, times(1)).reportError(any()); } /** * What happens when the profile contains a bad Stellar expression? */ @Test public void testProfileWithBadInit() throws Exception { // setup - ensure the bad profile is used setup(profileWithBadInit); // execute ProfileBuilderBolt bolt = createBolt(); bolt.execute(tuple); // verify - expect the tuple to be acked and an error reported verify(outputCollector, times(1)).ack(eq(tuple)); verify(outputCollector, times(1)).reportError(any()); } }
[ "nick@nickallen.org" ]
nick@nickallen.org
6ca7548705cd2c40084606a871365227de60740d
1e95cd65d58927d334fc7c462a141458ebc5176d
/app/domain-common/src/main/java/com/cnu/spg/board/dto/request/BoardsRequset.java
360f4725519a44689f918185e367f8113f4b00d1
[]
no_license
Limm-jk/board-api
f73330adb401f952e57cd5577e3797047e9977f1
f0d2baafdaa4504edd873db1d35952f09e4b8412
refs/heads/master
2023-08-18T21:36:00.336772
2021-09-15T14:00:03
2021-09-15T14:00:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package com.cnu.spg.board.dto.request; import lombok.Data; import javax.validation.constraints.NotNull; @Data public class BoardsRequset { @NotNull(message = "page 번호를 입력해주세요") private Integer pageNum; @NotNull(message = "element 개수를 입력해주세요") private Integer elementSize; private String partTitle; private String writerName; private String partOfContent; }
[ "clack2933@gmail.com" ]
clack2933@gmail.com
4f55acf0d20bb8d408a8d33174d1f24b4957090d
2d9f7c091f97c7b6a617c40fa3acbb93234742bc
/app/src/main/java/ren/solid/ganhuoio/module/search/SearchResultListFragment.java
8c543b4ddb1812db8dc33f4dc4fb6f98e063473d
[]
no_license
baimuzhi/an-android-app-
30e65a71d13762fcae994d541ef70454aebaa319
1da45cd93564ac24c82f3abeea9ac9ea2d50af42
refs/heads/master
2021-01-20T01:56:47.518476
2017-06-03T10:33:16
2017-06-03T10:33:16
89,348,992
0
1
null
null
null
null
UTF-8
Java
false
false
2,139
java
package ren.solid.ganhuoio.module.search; import android.support.v7.widget.RecyclerView; import java.util.List; import ren.solid.ganhuoio.api.GankService; import ren.solid.ganhuoio.bean.SearchResult; import ren.solid.library.fragment.base.AbsListFragment; import ren.solid.library.http.HttpResult; import ren.solid.library.http.ServiceFactory; import ren.solid.library.http.subscriber.HttpResultSubscriber; import ren.solid.library.rx.RxUtils; import ren.solid.library.widget.LinearDecoration; /** * Created by _SOLID * Date:2016/11/22 * Time:9:56 * Desc: */ public class SearchResultListFragment extends AbsListFragment { private String keyWord = "Android"; private String category = "all"; public static SearchResultListFragment newInstance(String category, String keyWord) { SearchResultListFragment fragment = new SearchResultListFragment(); fragment.keyWord = keyWord; fragment.category = category; return fragment; } public void refresh(String category, String keyWord) { this.category = category; this.keyWord = keyWord; showLoading(); refreshData(); } @Override protected void customConfig() { addItemDecoration(new LinearDecoration(getContext(), RecyclerView.VERTICAL)); } @Override public void loadData(final int pageIndex) { ServiceFactory.getInstance().createService(GankService.class) .search(category, keyWord, pageIndex) .compose(this.<HttpResult<List<SearchResult>>>bindToLifecycle()) .compose(RxUtils.<HttpResult<List<SearchResult>>>defaultSchedulers_single()) .subscribe(new HttpResultSubscriber<List<SearchResult>>() { @Override public void _onError(Throwable e) { showError(new Exception(e)); } @Override public void _onSuccess(List<SearchResult> searchResults) { onDataSuccessReceived(pageIndex, searchResults); } }); } }
[ "apple@appledeMacBook-Pro-2.local" ]
apple@appledeMacBook-Pro-2.local
e709cc8f021fa87e6f625b1523066d88dae48af4
c9ad2c6b77156de0036cf260d4758ebcf2e8399d
/src/main/java/me/shakeforprotein/configsplaceholders/CommandReload.java
77c5d723b77549fa18cb5d7351288c783f4ae330
[]
no_license
ShakeforProtein/ConfigsPAPI
ad02a6181fe7fd016bbb9ffc62cc62c0be581c5c
b27d8a642f3af8bde907767afe4897a2f9d5abbe
refs/heads/master
2022-10-20T16:33:57.659993
2020-07-30T02:08:53
2020-07-30T02:08:53
283,646,480
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package me.shakeforprotein.configsplaceholders; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; public class CommandReload implements CommandExecutor { private ConfigsPlaceholders plugin; public CommandReload(ConfigsPlaceholders main){ this.plugin = main; } @Override public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) { return true; } }
[ "github@taktimer.net" ]
github@taktimer.net
d9f562f44f7778d56abedde4fe0bb2df4ed6ab40
806f76edfe3b16b437be3eb81639d1a7b1ced0de
/src/com/huawei/hwversionmgr/utils/p084b/C5386i.java
62e38cb7f8509ce111affc65c0cd3c2f103c4a7c
[]
no_license
magic-coder/huawei-wear-re
1bbcabc807e21b2fe8fe9aa9d6402431dfe3fb01
935ad32f5348c3d8c8d294ed55a5a2830987da73
refs/heads/master
2021-04-15T18:30:54.036851
2018-03-22T07:16:50
2018-03-22T07:16:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,328
java
package com.huawei.hwversionmgr.utils.p084b; import android.content.Context; import android.content.pm.PackageInfo; import android.os.Handler; import android.os.Message; import cn.com.fmsh.script.constants.ScriptToolsConst.TagName; import com.huawei.hwversionmgr.a.b; import com.huawei.hwversionmgr.a.e; import com.huawei.hwversionmgr.utils.c; import com.huawei.p190v.C2538c; import com.sina.weibo.sdk.component.GameManager; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; /* compiled from: CheckNewVersionThread */ public class C5386i implements Runnable { private static boolean f19157e = false; private Context f19158a; private String f19159b; private Handler f19160c; private Boolean f19161d; private PackageInfo f19162f = null; private String f19163g = ""; public static boolean m25904a() { return f19157e; } public static void m25903a(boolean z) { f19157e = z; } public void m25905a(PackageInfo packageInfo) { this.f19162f = packageInfo; } public void m25906a(String str) { this.f19163g = str; } public C5386i(Context context, String str, Handler handler, Boolean bool) { this.f19158a = context; this.f19159b = str; this.f19160c = handler; this.f19161d = bool; } public void run() { Object a; c.b(this.f19159b); if (this.f19162f != null) { a = C5388k.m25920a(this.f19158a, this.f19162f, this.f19163g); } else { a = C5388k.m25921a(this.f19158a, this.f19159b); } C2538c.c("CheckNewVersionThread", new Object[]{"send json: \n" + a.toString()}); String a2 = C5387j.m25913a(a.toString()); C2538c.c("CheckNewVersionThread", new Object[]{"receive json:" + a2}); if (a2 != null) { e a3 = C5385h.m25899a(a2); Message message = new Message(); if (a3 != null) { C2538c.c("CheckNewVersionThread", new Object[]{"==ww== new version buildNewVersionInfoXML applicationInfo = " + a3.toString()}); String str = a3.b; C2538c.c("CheckNewVersionThread", new Object[]{"sendJsonStreamToServer: applicationInfo.STATUS:" + a3.t + ";"}); String str2 = a3.e + "full/" + "filelist.xml"; if (a3.t == 0) { e a4 = m25902a(this.f19158a, str2, a3); if (a4 == null) { message.what = 0; } else { C2538c.c("CheckNewVersionThread", new Object[]{"getFileListXMLFromServer: applicationInfo.STATUS:" + a4.t + ";"}); a4.u = a4.e + "full/" + a4.j; b a5 = C5387j.m25908a(a4); a5.b = str; if (this.f19161d.booleanValue()) { message.what = 1; } else { message.what = 2; } message.obj = a5; a3 = a4; } } else { if (this.f19161d.booleanValue()) { message.what = 1; } else { message.what = 2; } C2538c.c("CheckNewVersionThread", new Object[]{"applicationInfo is NULL;"}); } } else { message.what = 0; } if (this.f19161d.booleanValue()) { c.a(null); c.a(a3); } else { c.b(null); c.b(a3); } if (!C5386i.m25904a()) { this.f19160c.sendMessage(message); return; } return; } Message message2 = new Message(); message2.what = 0; if (C5386i.m25904a()) { C2538c.c("CheckNewVersionThread", new Object[]{"CancelCheckFlag is ture;"}); return; } this.f19160c.sendMessage(message2); if (this.f19161d.booleanValue()) { c.a(null); } else { c.b(null); } } private e m25902a(Context context, String str, e eVar) { Object obj; e a; OutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int i = -1; Object toByteArray; try { i = C5387j.m25907a(context, str, byteArrayOutputStream); C2538c.c("CheckNewVersionThread", new Object[]{"retrieve filelist.xml: \n" + byteArrayOutputStream.toString(GameManager.DEFAULT_CHARSET)}); if (i == 200) { C2538c.c("CheckNewVersionThread", new Object[]{"get file list success"}); toByteArray = byteArrayOutputStream.toByteArray(); i = 0; while (i < toByteArray.length && toByteArray[i] != TagName.TagExpectationAndNext) { i++; } obj = new byte[(toByteArray.length - i)]; System.arraycopy(toByteArray, i, obj, 0, toByteArray.length - i); a = C5384g.m25894a(new ByteArrayInputStream(obj), eVar); } else { a = null; } try { byteArrayOutputStream.close(); } catch (IOException e) { C2538c.c("CheckNewVersionThread", new Object[]{"pack error!", e}); } } catch (IOException e2) { C2538c.c("CheckNewVersionThread", new Object[]{"IOException"}); if (i == 200) { C2538c.c("CheckNewVersionThread", new Object[]{"get file list success"}); toByteArray = byteArrayOutputStream.toByteArray(); i = 0; while (i < toByteArray.length && toByteArray[i] != TagName.TagExpectationAndNext) { i++; } obj = new byte[(toByteArray.length - i)]; System.arraycopy(toByteArray, i, obj, 0, toByteArray.length - i); a = C5384g.m25894a(new ByteArrayInputStream(obj), eVar); } else { a = null; } try { byteArrayOutputStream.close(); } catch (IOException e3) { C2538c.c("CheckNewVersionThread", new Object[]{"pack error!", e3}); } } catch (Throwable th) { if (i == 200) { C2538c.c("CheckNewVersionThread", new Object[]{"get file list success"}); obj = byteArrayOutputStream.toByteArray(); i = 0; while (i < obj.length && obj[i] != TagName.TagExpectationAndNext) { i++; } Object obj2 = new byte[(obj.length - i)]; System.arraycopy(obj, i, obj2, 0, obj.length - i); C5384g.m25894a(new ByteArrayInputStream(obj2), eVar); } try { byteArrayOutputStream.close(); } catch (IOException e4) { C2538c.c("CheckNewVersionThread", new Object[]{"pack error!", e4}); } } return a; } }
[ "lebedev1537@gmail.com" ]
lebedev1537@gmail.com
b1cc182ba524344640a72717395fa42aa3079ce7
4b02716fe4b91399d2bfda4dda3becc31a9d793a
/huigou-core-api/src/main/java/com/huigou/uasp/bmp/opm/domain/model/org/OrgNodeData.java
edc2aff5da478bc585cf965801bd988bbff66ca3
[]
no_license
wuyounan/drawio
19867894fef13596be31f4f5db4296030f2a19b6
d0d1a0836e6b3602c27a53846a472a0adbe15e93
refs/heads/develop
2022-12-22T05:12:08.062112
2020-02-06T07:28:12
2020-02-06T07:28:12
241,046,824
0
2
null
2022-12-16T12:13:57
2020-02-17T07:38:48
JavaScript
UTF-8
Java
false
false
8,094
java
package com.huigou.uasp.bmp.opm.domain.model.org; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Transient; import org.springframework.util.Assert; import com.huigou.context.Operator; import com.huigou.context.OrgNode; import com.huigou.context.OrgUnit; import com.huigou.context.ThreadLocalUtil; /** * 组织节点数据 * <p> * 业务数据的组织冗余数据 * * @author gongmm */ @Embeddable public class OrgNodeData { /** * ID全路径 */ @Column(name = "full_Id") private String fullId; /** * 名称全路径 */ @Column(name = "full_name") private String fullName; /** * 公司ID */ @Column(name = "org_id") private String orgId; /** * 公司编码 */ @Column(name = "org_code") private String orgCode; /** * 公司名称 */ @Column(name = "org_name") private String orgName; /** * 部门ID */ @Column(name = "dept_id") private String deptId; /** * 部门编码 */ @Column(name = "dept_code") private String deptCode; /** * 部门名称 */ @Column(name = "dept_name") private String deptName; /** * 岗位ID */ @Column(name = "position_id") private String positionId; /** * 岗位编码 */ @Column(name = "position_code") private String positionCode; /** * 岗位名称 */ @Column(name = "position_name") private String positionName; @Transient private String personMemberId; @Transient private String personMemberCode; @Transient private String personMemberName; public String getOrgId() { return orgId; } public void setOrgId(String orgId) { this.orgId = orgId; } public String getOrgCode() { return orgCode; } public void setOrgCode(String orgCode) { this.orgCode = orgCode; } public String getOrgName() { return orgName; } public void setOrgName(String orgName) { this.orgName = orgName; } public String getDeptId() { return deptId; } public void setDeptId(String deptId) { this.deptId = deptId; } public String getDeptCode() { return deptCode; } public void setDeptCode(String deptCode) { this.deptCode = deptCode; } public String getDeptName() { return deptName; } public void setDeptName(String deptName) { this.deptName = deptName; } public String getPositionId() { return positionId; } public void setPositionId(String positionId) { this.positionId = positionId; } public String getPositionCode() { return positionCode; } public void setPositionCode(String positionCode) { this.positionCode = positionCode; } public String getPositionName() { return positionName; } public void setPositionName(String positionName) { this.positionName = positionName; } public static OrgNodeData buildOrgNodeData(Org org) { Assert.notNull(org, "参数org不能为空。"); // 组织机构路径: /.ogn/.ctr/.ctr/.dpt/.pos/.psm // 项目组织路径:/.ogn/.fld/.fld/.prj/.grp/.psm/.fun String[] orgIds = org.getFullId().substring(1).split("/"); String[] orgCodes = org.getFullCode().substring(1).split("/"); String[] orgNames = org.getFullName().substring(1).split("/"); String[] orgKindIds = org.getFullOrgKindId().substring(1).split("/"); Assert.isTrue(orgIds.length == orgCodes.length && orgIds.length == orgNames.length && orgIds.length == orgKindIds.length, "构建组织机构数据出错,路径长度不等。"); int deptLevel = 0; int orgLevel = 0; OrgNodeData orgNodeData = new OrgNodeData(); orgNodeData.fullId = org.getFullId(); orgNodeData.fullName = org.getFullName(); for (int i = orgIds.length - 1; i >= 0; i--) { if (orgIds[i].endsWith(OrgNode.ORGAN)) { orgLevel++; if (orgLevel == 1) { orgNodeData.setOrgId(orgIds[i].replace("." + OrgNode.ORGAN, "")); orgNodeData.setOrgCode(orgCodes[i]); orgNodeData.setOrgName(orgNames[i]); } } else if (orgKindIds[i].equalsIgnoreCase(OrgNode.DEPT)) { deptLevel++; if (deptLevel == 1) { orgNodeData.setDeptId(orgIds[i].replace("." + OrgNode.DEPT, "")); orgNodeData.setDeptCode(orgCodes[i]); orgNodeData.setDeptName(orgNames[i]); } } else if (orgIds[i].endsWith(OrgNode.POSITION)) { orgNodeData.setPositionId(orgIds[i].replace("." + OrgNode.POSITION, "")); orgNodeData.setPositionCode(orgCodes[i]); orgNodeData.setPositionName(orgNames[i]); } else if (orgIds[i].endsWith(OrgNode.PERSONMEMBER)) { orgNodeData.setPersonMemberId(orgIds[i].replace("." + OrgNode.PERSONMEMBER, "")); orgNodeData.setPersonMemberCode(orgCodes[i]); orgNodeData.setPersonMemberName(orgNames[i]); } } return orgNodeData; } public static OrgNodeData buildOrgNodeData(OrgUnit orgUnit) { Assert.notNull(orgUnit, "参数orgUnit不能为空。"); OrgNodeData orgNodeData = new OrgNodeData(); orgNodeData.setFullId(orgUnit.getFullId()); orgNodeData.setFullName(orgUnit.getFullName()); orgNodeData.setOrgId(orgUnit.getAttributeValue("orgId")); orgNodeData.setOrgName(orgUnit.getAttributeValue("orgName")); orgNodeData.setDeptId(orgUnit.getAttributeValue("deptId")); orgNodeData.setDeptName(orgUnit.getAttributeValue("deptName")); orgNodeData.setPositionId(orgUnit.getAttributeValue("posId")); orgNodeData.setPositionName(orgUnit.getAttributeValue("posName")); orgNodeData.setPersonMemberId(orgUnit.getAttributeValue("psmId")); orgNodeData.setPersonMemberName(orgUnit.getAttributeValue("psmName")); return orgNodeData; } public static OrgNodeData buildOperatorOrgNodeData() { Operator operator = ThreadLocalUtil.getOperator(); Assert.notNull(operator, "操作员环境参数不能为空。"); OrgNodeData orgNodeData = new OrgNodeData(); orgNodeData.setFullId(operator.getFullId()); orgNodeData.setFullName(operator.getFullName()); orgNodeData.setOrgId(operator.getOrgId()); orgNodeData.setOrgName(operator.getOrgName()); orgNodeData.setDeptId(operator.getDeptId()); orgNodeData.setDeptName(operator.getDeptName()); orgNodeData.setPositionId(operator.getPositionId()); orgNodeData.setPositionName(operator.getPositionName()); orgNodeData.setPersonMemberId(operator.getPersonMemberId()); orgNodeData.setPersonMemberName(operator.getPersonMemberName()); return orgNodeData; } public String getFullId() { return fullId; } public void setFullId(String fullId) { this.fullId = fullId; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public String getPersonMemberId() { return personMemberId; } public void setPersonMemberId(String personMemberId) { this.personMemberId = personMemberId; } public String getPersonMemberCode() { return personMemberCode; } public void setPersonMemberCode(String personMemberCode) { this.personMemberCode = personMemberCode; } public String getPersonMemberName() { return personMemberName; } public void setPersonMemberName(String personMemberName) { this.personMemberName = personMemberName; } }
[ "2232911026@qq.com" ]
2232911026@qq.com
88e028936ae4ca3ea5d4a148fa7b34e6e59028ef
c0b37a664fde6a57ae61c4af635e6dea28d7905e
/Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/android/support/v7/app/AppCompatDelegateImplV14.java
11e79a41694effb01c9824c746de76bc270d5d38
[]
no_license
joshkmartinez/Grades
a21ce8ede1371b9a7af11c4011e965f603c43291
53760e47f808780d06c4fbc2f74028a2db8e2942
refs/heads/master
2023-01-30T13:23:07.129566
2020-12-07T18:20:46
2020-12-07T18:20:46
131,549,535
0
0
null
null
null
null
UTF-8
Java
false
false
8,895
java
package android.support.v7.app; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Build.VERSION; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.RequiresApi; import android.support.annotation.VisibleForTesting; import android.support.v7.view.SupportActionModeWrapper.CallbackWrapper; import android.util.DisplayMetrics; import android.util.Log; import android.view.ActionMode; import android.view.Window; import android.view.Window.Callback; @RequiresApi(14) class AppCompatDelegateImplV14 extends AppCompatDelegateImplV11 { private static final String KEY_LOCAL_NIGHT_MODE = "appcompat:local_night_mode"; private boolean mApplyDayNightCalled; private AutoNightModeManager mAutoNightModeManager; private boolean mHandleNativeActionModes = true; private int mLocalNightMode = -100; @VisibleForTesting final class AutoNightModeManager { private BroadcastReceiver mAutoTimeChangeReceiver; private IntentFilter mAutoTimeChangeReceiverFilter; private boolean mIsNight; private TwilightManager mTwilightManager; class C02371 extends BroadcastReceiver { C02371() { } public void onReceive(Context context, Intent intent) { AutoNightModeManager.this.dispatchTimeChanged(); } } AutoNightModeManager(@NonNull TwilightManager twilightManager) { this.mTwilightManager = twilightManager; this.mIsNight = twilightManager.isNight(); } final int getApplyableNightMode() { this.mIsNight = this.mTwilightManager.isNight(); return this.mIsNight ? 2 : 1; } final void dispatchTimeChanged() { boolean isNight = this.mTwilightManager.isNight(); if (isNight != this.mIsNight) { this.mIsNight = isNight; AppCompatDelegateImplV14.this.applyDayNight(); } } final void setup() { cleanup(); if (this.mAutoTimeChangeReceiver == null) { this.mAutoTimeChangeReceiver = new C02371(); } if (this.mAutoTimeChangeReceiverFilter == null) { this.mAutoTimeChangeReceiverFilter = new IntentFilter(); this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIME_SET"); this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIMEZONE_CHANGED"); this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIME_TICK"); } AppCompatDelegateImplV14.this.mContext.registerReceiver(this.mAutoTimeChangeReceiver, this.mAutoTimeChangeReceiverFilter); } final void cleanup() { if (this.mAutoTimeChangeReceiver != null) { AppCompatDelegateImplV14.this.mContext.unregisterReceiver(this.mAutoTimeChangeReceiver); this.mAutoTimeChangeReceiver = null; } } } class AppCompatWindowCallbackV14 extends AppCompatWindowCallbackBase { AppCompatWindowCallbackV14(Callback callback) { super(callback); } public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) { if (AppCompatDelegateImplV14.this.isHandleNativeActionModesEnabled()) { return startAsSupportActionMode(callback); } return super.onWindowStartingActionMode(callback); } final ActionMode startAsSupportActionMode(ActionMode.Callback callback) { Object callbackWrapper = new CallbackWrapper(AppCompatDelegateImplV14.this.mContext, callback); callback = AppCompatDelegateImplV14.this.startSupportActionMode(callbackWrapper); return callback != null ? callbackWrapper.getActionModeWrapper(callback) : null; } } AppCompatDelegateImplV14(Context context, Window window, AppCompatCallback appCompatCallback) { super(context, window, appCompatCallback); } public void onCreate(Bundle bundle) { super.onCreate(bundle); if (bundle != null && this.mLocalNightMode == -100) { this.mLocalNightMode = bundle.getInt(KEY_LOCAL_NIGHT_MODE, -100); } } Callback wrapWindowCallback(Callback callback) { return new AppCompatWindowCallbackV14(callback); } public void setHandleNativeActionModesEnabled(boolean z) { this.mHandleNativeActionModes = z; } public boolean isHandleNativeActionModesEnabled() { return this.mHandleNativeActionModes; } public boolean applyDayNight() { int nightMode = getNightMode(); int mapNightMode = mapNightMode(nightMode); boolean updateForNightMode = mapNightMode != -1 ? updateForNightMode(mapNightMode) : false; if (nightMode == 0) { ensureAutoNightModeManager(); this.mAutoNightModeManager.setup(); } this.mApplyDayNightCalled = true; return updateForNightMode; } public void onStart() { super.onStart(); applyDayNight(); } public void onStop() { super.onStop(); if (this.mAutoNightModeManager != null) { this.mAutoNightModeManager.cleanup(); } } public void setLocalNightMode(int i) { switch (i) { case -1: case 0: case 1: case 2: if (this.mLocalNightMode != i) { this.mLocalNightMode = i; if (this.mApplyDayNightCalled != 0) { applyDayNight(); return; } return; } return; default: Log.i("AppCompatDelegate", "setLocalNightMode() called with an unknown mode"); return; } } int mapNightMode(int i) { if (i == -100) { return -1; } if (i != 0) { return i; } ensureAutoNightModeManager(); return this.mAutoNightModeManager.getApplyableNightMode(); } private int getNightMode() { return this.mLocalNightMode != -100 ? this.mLocalNightMode : AppCompatDelegate.getDefaultNightMode(); } public void onSaveInstanceState(Bundle bundle) { super.onSaveInstanceState(bundle); if (this.mLocalNightMode != -100) { bundle.putInt(KEY_LOCAL_NIGHT_MODE, this.mLocalNightMode); } } public void onDestroy() { super.onDestroy(); if (this.mAutoNightModeManager != null) { this.mAutoNightModeManager.cleanup(); } } private boolean updateForNightMode(int i) { Resources resources = this.mContext.getResources(); Configuration configuration = resources.getConfiguration(); int i2 = configuration.uiMode & 48; i = i == 2 ? 32 : 16; if (i2 == i) { return false; } if (shouldRecreateOnNightModeChange()) { ((Activity) this.mContext).recreate(); } else { Configuration configuration2 = new Configuration(configuration); DisplayMetrics displayMetrics = resources.getDisplayMetrics(); configuration2.uiMode = i | (configuration2.uiMode & -49); resources.updateConfiguration(configuration2, displayMetrics); if (VERSION.SDK_INT < 26) { ResourcesFlusher.flush(resources); } } return true; } private void ensureAutoNightModeManager() { if (this.mAutoNightModeManager == null) { this.mAutoNightModeManager = new AutoNightModeManager(TwilightManager.getInstance(this.mContext)); } } @VisibleForTesting final AutoNightModeManager getAutoNightModeManager() { ensureAutoNightModeManager(); return this.mAutoNightModeManager; } private boolean shouldRecreateOnNightModeChange() { boolean z = false; if (!this.mApplyDayNightCalled || !(this.mContext instanceof Activity)) { return false; } try { if ((this.mContext.getPackageManager().getActivityInfo(new ComponentName(this.mContext, this.mContext.getClass()), 0).configChanges & 512) == 0) { z = true; } return z; } catch (Throwable e) { Log.d("AppCompatDelegate", "Exception while getting ActivityInfo", e); return true; } } }
[ "joshkmartinez@gmail.com" ]
joshkmartinez@gmail.com
4977c160bb2a94276529f15bb3ee4ec844d8311f
6d41678e7382afc9cb5f8fdc79e09d73501bc81d
/app/src/test/java/com/huawei/kirin/hiscout/ExampleUnitTest.java
ea8739119fb172c85a77207ef944b26682e4f29d
[]
no_license
hixio-mh/Kirin
32b247e160733c94ca780b15825482bd4b27e1a4
6c836673c6df355491341dd7f584b59eaf6148fc
refs/heads/master
2022-12-24T06:17:16.435148
2020-09-25T19:20:07
2020-09-25T19:20:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package com.huawei.kirin.hiscout; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "wenguorong@pateo.com.cn" ]
wenguorong@pateo.com.cn
2c6a9dfc53ad86a773314d1aae9f095d550acf72
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/productmodel/HOPGolfCartItem.java
de850feb8fc8bdcfca48ae3390dae15475b1d628
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
1,739
java
package productmodel; @gw.lang.SimplePropertyProcessing @javax.annotation.Generated(comments = "config/resources/productmodel/policylinepatterns/HOPLine/coveragepatterns/HOPGolfCartItem.xml", date = "", value = "com.guidewire.pc.productmodel.codegen.ProductModelCodegen") public class HOPGolfCartItem extends entity.HOPDwellSchCovItemCov { protected HOPGolfCartItem() { super((java.lang.Void)null); } public HOPGolfCartItem(entity.PolicyPeriod branch) { super(branch, "zdogeskkpv01dc9p8upk23dne09"); } public HOPGolfCartItem(entity.PolicyPeriod branch, java.util.Date effectiveDate, java.util.Date expirationDate) { super(branch, effectiveDate, expirationDate, "zdogeskkpv01dc9p8upk23dne09"); } public productmodel.GenericHOPGolfCartItemIncludeCollisionType getHOPGolfCartItemIncludeCollisionTerm() { return (productmodel.GenericHOPGolfCartItemIncludeCollisionType)getCovTerm("zetg68o4lcajf1nt9frdn77ogmb"); } public productmodel.DirectHOPGolfCartItemLimitType getHOPGolfCartItemLimitTerm() { return (productmodel.DirectHOPGolfCartItemLimitType)getCovTerm("z0pjsih9gkurgbh648e992svj88"); } public boolean getHasHOPGolfCartItemIncludeCollisionTerm() { return hasCovTerm("zetg68o4lcajf1nt9frdn77ogmb"); } public boolean getHasHOPGolfCartItemLimitTerm() { return hasCovTerm("z0pjsih9gkurgbh648e992svj88"); } static { com.guidewire._generated.productmodel.HOPGolfCartItemInternalAccess.FRIEND_ACCESSOR.init(new com.guidewire.pc.domain.productmodel.ProductModelFriendAccess<productmodel.HOPGolfCartItem>() { public productmodel.HOPGolfCartItem newEmptyInstance() { return new productmodel.HOPGolfCartItem(); } }); } }
[ "ashwini@cruxxtechnologies.com" ]
ashwini@cruxxtechnologies.com
ecf05696b18d06d069e35f4c9bd4eae94521b9ab
09bd69f2f99073d37a8c83810e22bb69424a1c27
/src/main/java/service/impl/UserServiceImpl.java
2217701f8bd7dbe793a67c70083adb6d35d2d5b5
[]
no_license
renchao1110/ssm-shiromanage
6cb4fd877439bc80bef7bc07235a9eb225f7500c
77a720d6b3f9a783aab588645a67971d9ec80f8e
refs/heads/master
2020-03-22T09:31:47.298620
2018-01-29T08:38:26
2018-01-29T08:38:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,229
java
package service.impl; import entity.User; import entity.UserExample; import mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import service.UserService; import java.util.List; /** * @Author qq_emial1002139909@qq.com * @Date 2017/5/16 14:44 */ @Service public class UserServiceImpl implements UserService { @Autowired UserMapper userMapper; @Autowired UserExample userExample; public User authentication(User user) { return userMapper.authentication(user); } public User selectByUsername(String username) { UserExample example = new UserExample(); example.createCriteria().andUsernameEqualTo(username); final List<User> list = userMapper.selectByExample(example); return list.get(0); } public void insert(User user) { userMapper.insert(user); } public List<User> selectAll() { UserExample.Criteria criteria = userExample.createCriteria(); criteria.andIdIsNotNull(); return userMapper.selectByExample(userExample); } public User selectByPrimaryKey(Long id) { return userMapper.selectByPrimaryKey(id); } }
[ "1002139909@qq.com" ]
1002139909@qq.com
c5d94010f983350646dcb8c1cd54eddd91215c42
a9d133883c59de21f646d0404cb66d1845b0f82c
/com/leadtek/nuu/schoolsynoymRepository/AllSynRepostiory.java
0af1efdf9875a8ffb4bfd4fb59a47736280f6fa1
[]
no_license
cingo85/NuuEnd
291508f4cb7e9bcb310e164f81bf60f26ddc35d5
68197c98c631a1b6a3dd3856420c737b8f620bd8
refs/heads/master
2022-10-09T06:59:13.197401
2020-06-08T05:49:36
2020-06-08T05:49:36
265,748,538
0
0
null
null
null
null
UTF-8
Java
false
false
520
java
package com.leadtek.nuu.schoolsynoymRepository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import com.leadtek.nuu.schoolsynoymEntity.AllSyn; @Repository public interface AllSynRepostiory extends JpaRepository<AllSyn, String>,PagingAndSortingRepository<AllSyn, String> , QuerydslPredicateExecutor<AllSyn>{ }
[ "cingo85@gmail.com" ]
cingo85@gmail.com
4e7ecaa3d55d045d90c7be0aa24f3f1737be1820
ccf82688f082e26cba5fc397c76c77cc007ab2e8
/Mage.Sets/src/mage/cards/b/BlisterspitGremlin.java
1e50b96692e7e385af53b06dc13675cc14e5f1b4
[ "MIT" ]
permissive
magefree/mage
3261a89320f586d698dd03ca759a7562829f247f
5dba61244c738f4a184af0d256046312ce21d911
refs/heads/master
2023-09-03T15:55:36.650410
2023-09-03T03:53:12
2023-09-03T03:53:12
4,158,448
1,803
1,133
MIT
2023-09-14T20:18:55
2012-04-27T13:18:34
Java
UTF-8
Java
false
false
1,744
java
package mage.cards.b; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.TargetController; import mage.filter.StaticFilters; import java.util.UUID; /** * @author TheElk801 */ public final class BlisterspitGremlin extends CardImpl { public BlisterspitGremlin(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); this.subtype.add(SubType.GREMLIN); this.power = new MageInt(1); this.toughness = new MageInt(1); // {1}, {T}: Blisterspit Gremlin deals 1 damage to each opponent. Ability ability = new SimpleActivatedAbility( new DamagePlayersEffect(1, TargetController.OPPONENT), new GenericManaCost(1) ); ability.addCost(new TapSourceCost()); this.addAbility(ability); // Whenever you cast a noncreature spell, untap Blisterspit Gremlin. this.addAbility(new SpellCastControllerTriggeredAbility( new UntapSourceEffect(), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false )); } private BlisterspitGremlin(final BlisterspitGremlin card) { super(card); } @Override public BlisterspitGremlin copy() { return new BlisterspitGremlin(this); } }
[ "theelk801@gmail.com" ]
theelk801@gmail.com
fa69caf25c1ca2667646da6856e08224ae4fe4ef
5b82e2f7c720c49dff236970aacd610e7c41a077
/QueryReformulation-master 2/data/ExampleSourceCodeFiles/AcceptAllFilter.java
1a9297ac531ab60251dc6a1851fca5b2477dd6fb
[]
no_license
shy942/EGITrepoOnlineVersion
4b157da0f76dc5bbf179437242d2224d782dd267
f88fb20497dcc30ff1add5fe359cbca772142b09
refs/heads/master
2021-01-20T16:04:23.509863
2016-07-21T20:43:22
2016-07-21T20:43:22
63,737,385
0
0
null
null
null
null
UTF-8
Java
false
false
449
java
/Users/user/eclipse.platform.ui/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AcceptAllFilter.java org eclipse jface viewers filter accepts available singleton instance wasteful accept all filter filter returns singleton instance accept all filter singleton instance accept all filter filter instance singleton singleton instance filter singleton accept all filter override select object test true override equals object accept all filter
[ "muktacseku@gmail.com" ]
muktacseku@gmail.com
efa1450379dd79a3fbe95b109feef70d83ff6a57
1b8912d8d96a4179f227404739a732f2a6d927d2
/src/com/gamesbykevin/mastermind/board/peg/Selection.java
ae04d74272dc0e6cad856aec1b3f54f3684209d8
[]
no_license
gamesbykevin/Mastermind
f4534e0276160fd1929e4adafa70953ddbca195f
785f9910627c222968192e32b9350a6ee991023a
refs/heads/master
2021-01-17T17:34:30.850283
2017-01-13T05:31:09
2017-01-13T05:31:09
60,964,707
4
0
null
null
null
null
UTF-8
Java
false
false
2,157
java
package com.gamesbykevin.mastermind.board.peg; import com.gamesbykevin.androidframework.resources.Images; import com.gamesbykevin.mastermind.assets.Assets; public final class Selection extends Peg { /** * All the possible selections */ public enum Key { Red(0,0), White(1,0), Black(0,1), Yellow(1,1), Orange(0,2), Brown(1,2), Blue(0,3), Green(1,3); //cell coordinate private final int col, row; private boolean enabled; private Key(final int col, final int row) { //store the location on the sprite sheet this.col = col; this.row = row; //flag true at default setEnabled(true); } /** * Is this selection enabled? * @return true if the user can select this color, false otherwise */ public boolean isEnabled() { return this.enabled; } /** * Flag the selection enabled. * @param enabled true if the user can select this color, false otherwise */ public void setEnabled(final boolean enabled) { this.enabled = enabled; } } /** * Animation dimensions of a peg */ private static final int PEG_SELECTION_ANIMATION_WIDTH = 64; /** * Animation dimensions of a peg */ private static final int PEG_SELECTION_ANIMATION_HEIGHT = 64; /** * The ratio compared to the board background selection */ public static final float SIZE_RATIO = 0.9f; /** * Dimensions of the peg selection */ public static int PEG_SELECTION_DIMENSION; /** * Default Constructor */ public Selection() { //add each selection as an animation for (Key key : Key.values()) { final int x = key.col * PEG_SELECTION_ANIMATION_WIDTH; final int y = key.row * PEG_SELECTION_ANIMATION_HEIGHT; final int w = PEG_SELECTION_ANIMATION_WIDTH; final int h = PEG_SELECTION_ANIMATION_HEIGHT; //add animation addAnimation(Images.getImage(Assets.ImageGameKey.Selections), key, x, y, w, h); } //set a default selection setAnimation(Key.Black); } @Override public void setAnimation(final Object key) { super.getSpritesheet().setKey(key); } }
[ "kevin@gamesbykevin.com" ]
kevin@gamesbykevin.com
a90c3d84c093971d0ac6c1fe9f806071e29b7261
b4866f9b7c9038b8e45442425aff99ee62d0e115
/jsinterface-example/src/com/google/chrome/android/example/jsinterface/MainActivity.java
d92810f9be8073a3f70cf899f080378e42d03feb
[ "Apache-2.0" ]
permissive
Cloud59/chromium-webview-samples
fbd12258991ded5d71667ad6c128d59fd4207eec
ceaed546723b841a6c9c25e81c7f2415a58b0d42
refs/heads/master
2020-12-11T02:12:27.623660
2014-07-01T20:16:09
2014-07-01T20:16:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,155
java
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.chrome.android.example.jsinterface; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.util.JsonReader; import android.util.JsonToken; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.ViewGroup; import android.webkit.ValueCallback; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; import java.io.IOException; import java.io.StringReader; @SuppressLint("SetJavaScriptEnabled") public class MainActivity extends Activity { public static final String EXTRA_FROM_NOTIFICATION = "EXTRA_FROM_NOTIFICATION"; private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Get reference of WebView from layout/activity_main.xml mWebView = (WebView) findViewById(R.id.activity_main_webview); // Add Javascript Interface, this will expose "window.NotificationBind" // in Javascript mWebView.addJavascriptInterface(new NotificationBindObject(getApplicationContext()), "NotificationBind"); setUpWebViewDefaults(mWebView); // Check whether we're recreating a previously destroyed instance if (savedInstanceState != null) { // Restore the previous URL and history stack mWebView.restoreState(savedInstanceState); } // Prepare the WebView and get the appropriate URL String url = prepareWebView(mWebView.getUrl()); // Load the local index.html file if(mWebView.getUrl() == null) { mWebView.loadUrl(url); } } /** * Inflate a menu for help menu option */ @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main, menu); return true; } /** * If the help menu option is selected, show a new * screen in the WebView */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_help: loadJavascript("showSecretMessage();"); return true; default: return super.onOptionsItemSelected(item); } } /** * Go back through the WebView back stack before * exiting the app */ @Override public void onBackPressed() { if(mWebView.canGoBack()) { mWebView.goBack(); } else { super.onBackPressed(); } } /** * When the screen orientation changes, we want to be able to * keep the history stack etc. */ @Override public void onSaveInstanceState(Bundle savedInstanceState) { // Save the WebView state (including history stack) mWebView.saveState(savedInstanceState); // Always call the superclass so it can save the view hierarchy state super.onSaveInstanceState(savedInstanceState); } /** * This method is designed to hide how Javascript is injected into * the WebView. * * In KitKat the new evaluateJavascript method has the ability to * give you access to any return values via the ValueCallback object. * * The String passed into onReceiveValue() is a JSON string, so if you * execute a javascript method which return a javascript object, you can * parse it as valid JSON. If the method returns a primitive value, it * will be a valid JSON object, but you should use the setLenient method * to true and then you can use peek() to test what kind of object it is, * * @param javascript */ private void loadJavascript(String javascript) { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // In KitKat+ you should use the evaluateJavascript method mWebView.evaluateJavascript(javascript, new ValueCallback<String>() { @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onReceiveValue(String s) { JsonReader reader = new JsonReader(new StringReader(s)); // Must set lenient to parse single values reader.setLenient(true); try { if(reader.peek() != JsonToken.NULL) { if(reader.peek() == JsonToken.STRING) { String msg = reader.nextString(); if(msg != null) { Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show(); } } } } catch (IOException e) { Log.e("TAG", "MainActivity: IOException", e); } finally { try { reader.close(); } catch (IOException e) { // NOOP } } } }); } else { /** * For pre-KitKat+ you should use loadUrl("javascript:<JS Code Here>"); * To then call back to Java you would need to use addJavascriptInterface() * and have your JS call the interface **/ mWebView.loadUrl("javascript:"+javascript); } } /** * Convenience method to set some generic defaults for a * given WebView * * @param webView */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void setUpWebViewDefaults(WebView webView) { WebSettings settings = webView.getSettings(); // Enable Javascript settings.setJavaScriptEnabled(true); // Use WideViewport and Zoom out if there is no viewport defined settings.setUseWideViewPort(true); settings.setLoadWithOverviewMode(true); // Enable pinch to zoom without the zoom buttons settings.setBuiltInZoomControls(true); if(Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) { // Hide the zoom controls for HONEYCOMB+ settings.setDisplayZoomControls(false); } // Enable remote debugging via chrome://inspect if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { WebView.setWebContentsDebuggingEnabled(true); } } /** * This is method where specific logic for this application is going to live * @return url to load */ private String prepareWebView(String currentUrl) { String hash = ""; int bgColor; if(currentUrl != null) { String[] hashSplit = currentUrl.split("#"); if(hashSplit.length == 2) { hash = hashSplit[1]; } } else { Intent intent = getIntent(); if(intent != null && intent.getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) { hash = "notification-launch"; } } if(hash.equals("notification-launch")) { bgColor = Color.parseColor("#1abc9c"); } else if(hash.equals("notification-shown")) { bgColor = Color.parseColor("#3498db"); } else if(hash.equals("secret")) { bgColor = Color.parseColor("#34495e"); } else { bgColor = Color.parseColor("#f1c40f"); } preventBGColorFlicker(bgColor); return "file:///android_asset/www/index.html#"+hash; } /** * This is a little bit of trickery to make the background color of the UI * the same as the anticipated UI background color of the web-app. * * @param bgColor */ private void preventBGColorFlicker(int bgColor) { ((ViewGroup) findViewById(R.id.activity_main_container)).setBackgroundColor(bgColor); mWebView.setBackgroundColor(bgColor); // We set the WebViewClient to ensure links are consumed by the WebView rather // than passed to a browser if it can mWebView.setWebViewClient(new WebViewClient()); } }
[ "mattgaunt@google.com" ]
mattgaunt@google.com
8ad944f430e1c128e73dda0b412fefffba056f81
f60d91838cc2471bcad3784a56be2aeece101f71
/spring-framework-4.3.15.RELEASE/spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java
0f7baa3f8195ec8d0aaba40236cacec9b4781252
[ "Apache-2.0" ]
permissive
fisher123456/spring-boot-1.5.11.RELEASE
b3af74913eb1a753a20c3dedecea090de82035dc
d3c27f632101e8be27ea2baeb4b546b5cae69607
refs/heads/master
2023-01-07T04:12:02.625478
2019-01-26T17:44:05
2019-01-26T17:44:05
167,649,054
0
0
Apache-2.0
2022-12-27T14:50:58
2019-01-26T04:21:05
Java
UTF-8
Java
false
false
4,609
java
/* * Copyright 2002-2017 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.springframework.core.convert.converter; import java.util.Comparator; import java.util.Map; import org.springframework.core.convert.ConversionService; import org.springframework.util.Assert; import org.springframework.util.comparator.ComparableComparator; /** * A {@link Comparator} that converts values before they are compared. The specified * {@link Converter} will be used to convert each value before it passed to the underlying * {@code Comparator}. * * @author Phillip Webb * @since 3.2 * @param <S> the source type * @param <T> the target type */ public class ConvertingComparator<S, T> implements Comparator<S> { private final Comparator<T> comparator; private final Converter<S, T> converter; /** * Create a new {@link ConvertingComparator} instance. * @param converter the converter */ @SuppressWarnings("unchecked") public ConvertingComparator(Converter<S, T> converter) { this(ComparableComparator.INSTANCE, converter); } /** * Create a new {@link ConvertingComparator} instance. * @param comparator the underlying comparator used to compare the converted values * @param converter the converter */ public ConvertingComparator(Comparator<T> comparator, Converter<S, T> converter) { Assert.notNull(comparator, "Comparator must not be null"); Assert.notNull(converter, "Converter must not be null"); this.comparator = comparator; this.converter = converter; } /** * Create a new {@link ComparableComparator} instance. * @param comparator the underlying comparator * @param conversionService the conversion service * @param targetType the target type */ public ConvertingComparator( Comparator<T> comparator, ConversionService conversionService, Class<? extends T> targetType) { this(comparator, new ConversionServiceConverter<S, T>(conversionService, targetType)); } @Override public int compare(S o1, S o2) { T c1 = this.converter.convert(o1); T c2 = this.converter.convert(o2); return this.comparator.compare(c1, c2); } /** * Create a new {@link ConvertingComparator} that compares {@link java.util.Map.Entry * map * entries} based on their {@link java.util.Map.Entry#getKey() keys}. * @param comparator the underlying comparator used to compare keys * @return a new {@link ConvertingComparator} instance */ public static <K, V> ConvertingComparator<Map.Entry<K, V>, K> mapEntryKeys(Comparator<K> comparator) { return new ConvertingComparator<Map.Entry<K,V>, K>(comparator, new Converter<Map.Entry<K, V>, K>() { @Override public K convert(Map.Entry<K, V> source) { return source.getKey(); } }); } /** * Create a new {@link ConvertingComparator} that compares {@link java.util.Map.Entry * map entries} based on their {@link java.util.Map.Entry#getValue() values}. * @param comparator the underlying comparator used to compare values * @return a new {@link ConvertingComparator} instance */ public static <K, V> ConvertingComparator<Map.Entry<K, V>, V> mapEntryValues(Comparator<V> comparator) { return new ConvertingComparator<Map.Entry<K,V>, V>(comparator, new Converter<Map.Entry<K, V>, V>() { @Override public V convert(Map.Entry<K, V> source) { return source.getValue(); } }); } /** * Adapts a {@link ConversionService} and <tt>targetType</tt> to a {@link Converter}. */ private static class ConversionServiceConverter<S, T> implements Converter<S, T> { private final ConversionService conversionService; private final Class<? extends T> targetType; public ConversionServiceConverter(ConversionService conversionService, Class<? extends T> targetType) { Assert.notNull(conversionService, "ConversionService must not be null"); Assert.notNull(targetType, "TargetType must not be null"); this.conversionService = conversionService; this.targetType = targetType; } @Override public T convert(S source) { return this.conversionService.convert(source, this.targetType); } } }
[ "171509086@qq.com" ]
171509086@qq.com
ff6318c4fe36f9906b06c91ed27008a864faf1ea
7e5888af9d192d088984663ed2072aa900e6409c
/Spring/Loja_de_Games/src/main/java/com/GameGeneration/Loja_de_Games/controller/ProdutoController.java
5c19a62ef5e3e5f68047fd9af1080ec2a4bb00d8
[]
no_license
MaxNikollasSilvaSouza/GenerationBrasil
ca7a9a2e68acec2977b13a39cc37e5bc235582f4
a5e338fef2ffa06317c5b684d6cb1b5649da30e2
refs/heads/main
2023-07-14T18:23:53.435184
2021-08-23T14:14:38
2021-08-23T14:14:38
382,136,723
1
0
null
null
null
null
UTF-8
Java
false
false
2,041
java
package com.GameGeneration.Loja_de_Games.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.GameGeneration.Loja_de_Games.model.Produto; import com.GameGeneration.Loja_de_Games.repository.ProdutoRepository; @RestController @CrossOrigin(origins = "*", allowedHeaders = "*") @RequestMapping("/produto") public class ProdutoController { @Autowired private ProdutoRepository repository; @GetMapping public ResponseEntity<List<Produto>> getAll() { return ResponseEntity.ok(repository.findAll()); } @GetMapping("/{id}") public ResponseEntity<Produto> getId(@PathVariable Long id) { return repository.findById(id).map(resp -> ResponseEntity.ok(resp)).orElse(ResponseEntity.status(HttpStatus.NOT_FOUND).build()); } @GetMapping("/nome/{nome}") public ResponseEntity<List<Produto>> getByName(@PathVariable String nome) { return ResponseEntity.ok(repository.findAllByNomeContainingIgnoreCase(nome)); } @PostMapping public ResponseEntity<Produto> post (@RequestBody Produto produto) { return ResponseEntity.status(HttpStatus.CREATED).body(repository.save(produto)); } @PutMapping public ResponseEntity<Produto> put (@RequestBody Produto produto) { return ResponseEntity.ok(repository.save(produto)); } @DeleteMapping("/{id}") public void delete(@PathVariable Long id) { repository.deleteById(id); } }
[ "maxnikollas@gmail.com" ]
maxnikollas@gmail.com
e288eb8e10dd765d65181047a522fa7b800e8cf3
53fb227f1e98d7053c3e922ef04d59380f42222d
/src/asincrono/CajeroThread/MainRunnable.java
02847b9428c5e7c39323ee1277919d0b6e9359d6
[]
no_license
leecanon/CajeroAsincrono
5bb1ce0d3c9cfcb836d1a6d559991034cb1d3ec8
51444ec7cab53b7498f858b0726f74245f360eea
refs/heads/master
2022-07-31T22:57:21.834903
2020-05-20T22:37:27
2020-05-20T22:37:27
264,769,489
0
0
null
null
null
null
UTF-8
Java
false
false
1,358
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 asincrono.CajeroThread; import asincrona.CajeroSecuencial.Cliente; import asincrona.CajeroSecuencial.Cajera; import asincrono.CajeroThread.MainRunnable; /** * * @author vilee */ public class MainRunnable implements Runnable { private Cliente cliente; private Cajera cajera; private long initialTime; public MainRunnable (Cliente cliente, Cajera cajera, long initialTime){ this.cajera = cajera; this.cliente = cliente; this.initialTime = initialTime; } public static void main(String[] args) { Cliente cliente1 = new Cliente("Cliente 1", new int[] { 2, 2, 1, 5, 2, 3 }); Cliente cliente2 = new Cliente("Cliente 2", new int[] { 1, 3, 5, 1, 1 }); Cajera cajera1 = new Cajera("Cajera 1"); Cajera cajera2 = new Cajera("Cajera 2"); // Tiempo inicial de referencia long initialTime = System.currentTimeMillis(); Runnable proceso1 = new MainRunnable(cliente1, cajera1, initialTime); Runnable proceso2 = new MainRunnable(cliente2, cajera2, initialTime); new Thread(proceso1).start(); new Thread(proceso2).start(); } @Override public void run() { this.cajera.procesarCompra(this.cliente, this.initialTime); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
ad32842ffb3b45529b7a4b2a045d343246f88275
8a7b1b29366d7256f3e4969df9d58a1989553838
/GameHall/src/cn/zrong/weibobinding/BindingAccount.java
db0dab148f47f566ead51f02721bb227d912e00d
[]
no_license
2006003845/zrlh
395dca4c00cc04b847a3d184fa59cc591f35cb85
7a8947f3783fea684d9fe217acff2f6ea26d2746
refs/heads/master
2021-01-11T09:31:33.492711
2017-02-08T02:46:12
2017-02-08T02:46:12
81,279,113
0
0
null
null
null
null
UTF-8
Java
false
false
7,501
java
package cn.zrong.weibobinding; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import android.database.Cursor; public class BindingAccount implements Serializable { private static final long serialVersionUID = 1254914086267695825L; public static final String TYPE_BINDING_QQ = "_qq"; public static final String TYPE_BINDING_Sina = "_sina"; /** * 授权有效 */ public static final int STATE_AUTHO_EFFECTIVE = 1; /** * 授权失效 */ public static final int STATE_AUTHO_DISABLED = 2; /** * 绑定状态 */ public static final int STATE_BINDING_ON = 1; /** * 非绑定状态 */ public static final int STATE_BINDING_OFF = 2; public String userKeyId;// 连表与社区User public String screen_name; public int ID; public String name; private String userId; private String type;// 微博账户类型 private String typeName;// 微博账户名字 private String typeIconUrl;// 微博账户icon public String getTypeIconUrl() { return typeIconUrl; } public void setTypeIconUrl(String typeIconUrl) { this.typeIconUrl = typeIconUrl; } public String getTypeName() { return typeName; } public void setTypeName(String typeName) { this.typeName = typeName; } private String newKey; private String newSecret; private int authoState;// 授权状态 private int bindingState;// 绑定状态 private String consumerKey; private String consumerSecret; private String oauthNonce; private String oauthTimestamp; private String oauthVerifier; private String oauthVersion; public String getOauthNonce() { return oauthNonce; } public void setOauthNonce(String oauthNonce) { this.oauthNonce = oauthNonce; } public String getOauthTimestamp() { return oauthTimestamp; } public void setOauthTimestamp(String oauthTimestamp) { this.oauthTimestamp = oauthTimestamp; } public String getOauthVerifier() { return oauthVerifier; } public void setOauthVerifier(String oauthVerifier) { this.oauthVerifier = oauthVerifier; } public String getOauthVersion() { return oauthVersion; } public void setOauthVersion(String oauthVersion) { this.oauthVersion = oauthVersion; } public String getConsumerKey() { return consumerKey; } public void setConsumerKey(String consumerKey) { this.consumerKey = consumerKey; } public String getConsumerSecret() { return consumerSecret; } public void setConsumerSecret(String consumerSecret) { this.consumerSecret = consumerSecret; } public int getBindingState() { return bindingState; } public void setBindingState(int bindingState) { this.bindingState = bindingState; } public int getAuthoState() { return authoState; } public void setAuthoState(int authoState) { this.authoState = authoState; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getUserKeyId() { return userKeyId; } public void setUserKeyId(String userKeyId) { this.userKeyId = userKeyId; } public String getNewKey() { return newKey; } public void setNewKey(String newKey) { this.newKey = newKey; } public String getNewSecret() { return newSecret; } public void setNewSecret(String newSecret) { this.newSecret = newSecret; } /** * 用户数据表 * * @author zhouzhilong * */ public static class BindingAccountTable { public static final String TAB_NAME = "bind_account"; // 字段名 public static final String _ID = "_id"; public static final String BINDINGUSER_USERID = "bindinguser_id"; public static final String BINDINGUSER_TYPE = "bindinguser_type"; public static final String BINDINGUSER_TYPE_NAME = "bindinguser_type_name"; public static final String BINDINGUSER_TYPE_IconURL = "bindinguser_type_iconurl"; public static final String BINDINGUSER_NEWKEY = "bindinguser_newkey"; public static final String BINDINGUSER_NEWSECRET = "bindinguser_newsecret"; public static final String BINDINGUSER_USER_KEYID = "bindinguser_user_keyid"; public static final String BINDINGUSER_AUTHO_STATE = "bindinguser_autho_state"; public static final String BINDINGUSER_BINDING_STATE = "bindinguser_binding_state"; public static final String BINDINGUSER_ConsumerKey = "bindinguser_consumerkey"; public static final String BINDINGUSER_ConsumerSecret = "bindinguser_consumersecret"; public static final String BINDINGUSER_OauthNonce = "bindinguser_oauthnonce"; public static final String BINDINGUSER_OauthTimestamp = "bindinguser_oauthtimestamp"; public static final String BINDINGUSER_OauthVerifier = "bindinguser_oauthverifier"; public static final String BINDINGUSER_OauthVersion = "bindinguser_oauthversion"; // 列编号 public static final int BINDINGUSER_USERID_INDEX = 1; public static final int BINDINGUSER_TYPE_INDEX = 2; public static final int BINDINGUSER_TYPE_NAME_INDEX = 3; public static final int BINDINGUSER_TYPE_IconURL_INDEX = 4; public static final int BINDINGUSER_NEWKEY_INDEX = 5; public static final int BINDINGUSER_NEWSECRET_INDEX = 6; public static final int BINDINGUSER_USER_KEYID_INDEX = 7; public static final int BINDINGUSER_AUTHO_STATE_INDEX = 8; public static final int BINDINGUSER_BINDING_STATE_INDEX = 9; public static final int BINDINGUSER_ConsumerKey_INDEX = 10; public static final int BINDINGUSER_ComsumerSecret_INDEX = 11; public static final int BINDINGUSER_OauthNonce_INDEX = 12; public static final int BINDINGUSER_OauthTimestamp_INDEX = 13; public static final int BINDINGUSER_OauthVerifier_INDEX = 14; public static final int BINDINGUSER_OauthVersion_INDEX = 15; public static BindingAccount getBindingUser(Cursor cursor) { if (cursor.getCount() == 0) { cursor.close(); return null; } BindingAccount user = new BindingAccount(); user.userId = cursor.getString(BINDINGUSER_USERID_INDEX); user.type = cursor.getString(BINDINGUSER_TYPE_INDEX); user.typeName = cursor.getString(BINDINGUSER_TYPE_NAME_INDEX); user.typeIconUrl = cursor.getString(BINDINGUSER_TYPE_IconURL_INDEX); user.newKey = cursor.getString(BINDINGUSER_NEWKEY_INDEX); user.newSecret = cursor.getString(BINDINGUSER_NEWSECRET_INDEX); user.userKeyId = cursor.getString(BINDINGUSER_USER_KEYID_INDEX); user.authoState = cursor.getInt(BINDINGUSER_AUTHO_STATE_INDEX); user.bindingState = cursor.getInt(BINDINGUSER_BINDING_STATE_INDEX); user.consumerKey = cursor.getString(BINDINGUSER_ConsumerKey_INDEX); user.consumerSecret = cursor .getString(BINDINGUSER_ComsumerSecret_INDEX); user.oauthNonce = cursor.getString(BINDINGUSER_OauthNonce_INDEX); user.oauthTimestamp = cursor .getString(BINDINGUSER_OauthTimestamp_INDEX); user.oauthVerifier = cursor .getString(BINDINGUSER_OauthVerifier_INDEX); user.oauthVersion = cursor .getString(BINDINGUSER_OauthVersion_INDEX); // cursor.close(); return user; } public static List<BindingAccount> getBindingUserList(Cursor cursor) { cursor.moveToFirst(); int count = cursor.getCount(); ArrayList<BindingAccount> list = new ArrayList<BindingAccount>(); do { if (count == 0) { break; } BindingAccount user = BindingAccount.BindingAccountTable .getBindingUser(cursor); if (user != null) { list.add(user); } } while (cursor.moveToNext()); cursor.close(); return list; } } }
[ "zhilongzhou@creditease.cn" ]
zhilongzhou@creditease.cn
69e080d5478fe95f4e52e7d16727bc14cf456d13
56a4b872e1bd570c737c2ce2cf18db6cae8c34b5
/app/src/test/java/com/hkapps/android/experiencia/ExampleUnitTest.java
6fdaf88547a0300f99210833cc8d07eff018dd5b
[]
no_license
kamalakarrao/ExperienciaFinal
aca03eb974d1a34f8dc15e6107342f59ac521eee
6e6f72f7d50cc1fec2f84a2f0d99b9e0581482af
refs/heads/master
2021-05-12T15:53:12.269005
2018-01-10T18:06:19
2018-01-10T18:06:19
116,992,756
0
0
null
null
null
null
UTF-8
Java
false
false
323
java
package com.hkapps.android.experiencia; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "kamalakar.sambaraj@gmai.com" ]
kamalakar.sambaraj@gmai.com
e5297436bebc651f36c139c12d311fd353bd68f4
fd79b8e9b203910392812e4804a35a0c49187092
/opensrp-reveal/src/test/java/org/smartregister/reveal/fragment/TaskRegisterFragmentTest.java
17e3cc1cbb2ed8941aeaecf8b5b710e80a1f54fa
[ "Apache-2.0" ]
permissive
shakings/opensrp-reveal-nigeria
791e38bfa4c247a90c1b53a1b0c8a56d07572141
b52df171c1528d0e9508b6ca388d43031560a5d3
refs/heads/master
2023-01-23T19:26:24.946336
2020-09-11T04:43:24
2020-09-11T04:43:24
290,245,229
0
0
NOASSERTION
2020-09-09T16:03:21
2020-08-25T14:59:43
Java
UTF-8
Java
false
false
18,450
java
package org.smartregister.reveal.fragment; import android.app.ProgressDialog; import android.content.Intent; import android.location.Location; import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.TextView; import android.widget.Toast; import org.json.JSONObject; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.powermock.reflect.Whitebox; import org.robolectric.Robolectric; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowAlertDialog; import org.robolectric.shadows.ShadowApplication; import org.robolectric.shadows.ShadowProgressDialog; import org.robolectric.shadows.ShadowToast; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.domain.Task; import org.smartregister.reveal.BaseUnitTest; import org.smartregister.reveal.R; import org.smartregister.reveal.activity.RevealJsonFormActivity; import org.smartregister.reveal.adapter.TaskRegisterAdapter; import org.smartregister.reveal.model.TaskDetails; import org.smartregister.reveal.model.TaskFilterParams; import org.smartregister.reveal.presenter.TaskRegisterFragmentPresenter; import org.smartregister.reveal.presenter.ValidateUserLocationPresenter; import org.smartregister.reveal.shadow.DrawerMenuViewShadow; import org.smartregister.reveal.util.Constants; import org.smartregister.reveal.util.LocationUtils; import org.smartregister.reveal.util.RevealJsonFormUtils; import org.smartregister.reveal.util.TestingUtils; import org.smartregister.reveal.view.FamilyProfileActivity; import org.smartregister.reveal.view.FamilyRegisterActivity; import org.smartregister.reveal.view.FilterTasksActivity; import org.smartregister.reveal.view.TaskRegisterActivity; import java.util.ArrayList; import java.util.Collections; import java.util.List; import io.ona.kujaku.utils.Constants.RequestCode; import static android.app.Activity.RESULT_CANCELED; import static android.app.Activity.RESULT_OK; import static android.content.DialogInterface.BUTTON_NEGATIVE; import static android.content.DialogInterface.BUTTON_POSITIVE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.robolectric.Shadows.shadowOf; import static org.smartregister.reveal.util.Constants.DatabaseKeys.FIRST_NAME; import static org.smartregister.reveal.util.Constants.Filter.FILTER_SORT_PARAMS; import static org.smartregister.reveal.util.Constants.Intervention.CASE_CONFIRMATION; import static org.smartregister.reveal.util.Constants.JSON_FORM_PARAM_JSON; import static org.smartregister.reveal.util.Constants.RequestCode.REQUEST_CODE_FILTER_TASKS; /** * Created by samuelgithengi on 1/27/20. */ @Config(shadows = {DrawerMenuViewShadow.class}) public class TaskRegisterFragmentTest extends BaseUnitTest { @Rule public MockitoRule rule = MockitoJUnit.rule(); private TaskRegisterFragment fragment; private TaskRegisterActivity activity; @Mock private TaskRegisterFragmentPresenter presenter; @Mock private TaskRegisterAdapter taskAdapter; @Mock private RevealJsonFormUtils jsonFormUtils; @Mock private LocationUtils locationUtils; @Mock private CaseClassificationFragment caseClassificationFragment; @Mock private ValidateUserLocationPresenter locationPresenter; @Captor private ArgumentCaptor<TaskDetails> taskDetailsArgumentCaptor; @Before public void setUp() { org.smartregister.Context.bindtypes = new ArrayList<>(); fragment = new TaskRegisterFragment(); Whitebox.setInternalState(fragment, "presenter", presenter); activity = Robolectric.buildActivity(TaskRegisterActivity.class).create().start().get(); activity.setContentView(R.layout.activity_base_register); activity.getSupportFragmentManager().beginTransaction().add(0, fragment).commit(); } @Test public void testOnCreate() { assertNotNull(fragment); } @Test public void testGetLayout() { assertEquals(R.layout.fragment_task_register, fragment.getLayout()); } @Test public void testInitializeAdapter() { fragment.initializePresenter(); assertNotNull(Whitebox.getInternalState(fragment, "presenter")); assertNotNull(Whitebox.getInternalState(fragment, "locationUtils")); } @Test public void testFilter() { fragment.filter("Doe", "", "", false); verify(presenter).searchTasks("Doe"); assertEquals(View.VISIBLE, fragment.getSearchCancelView().getVisibility()); } @Test public void testFilterWithEmptyFilter() { fragment.filter("", "", "", false); verify(presenter).searchTasks(""); assertEquals(View.INVISIBLE, fragment.getSearchCancelView().getVisibility()); } @Test public void testStartMapActivity() { TaskFilterParams params = new TaskFilterParams("Doe"); fragment.startMapActivity(params); assertTrue(activity.isFinishing()); } @Test public void testStartMapActivityWithNullParams() { fragment.startMapActivity(null); assertTrue(activity.isFinishing()); } @Test public void testGetLastLocation() { assertNull(fragment.getLastLocation()); Location location = new Location("Test"); Intent intent = new Intent(); intent.putExtra(Constants.TaskRegister.LAST_USER_LOCATION, location); activity.setIntent(intent); assertEquals(location, fragment.getLastLocation()); } @Test public void testSetUniqueID() { fragment.setUniqueID("123"); assertEquals("123", fragment.getSearchView().getText().toString()); } @Test public void testOnViewClicked() { View view = fragment.getView(); TaskDetails details = TestingUtils.getTaskDetails(); details.setTaskCode(Constants.Intervention.REGISTER_FAMILY); view.setTag(R.id.task_details, details); fragment.onViewClicked(view); verify(presenter).onTaskSelected(details, false); } @Test public void testOnViewClickedForTaskReset() { View view = fragment.getView(); TaskDetails details = TestingUtils.getTaskDetails(); details.setTaskStatus(Task.TaskStatus.COMPLETED.name()); details.setTaskCode(CASE_CONFIRMATION); view.setTag(R.id.task_details, details); fragment.onViewClicked(view); AlertDialog alertDialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(alertDialog.isShowing()); TextView tv = alertDialog.findViewById(android.R.id.message); assertEquals(getString(R.string.choose_action), tv.getText()); } @Test public void testSetTotalTasks() { Whitebox.setInternalState(fragment, "taskAdapter", taskAdapter); when(taskAdapter.getItemCount()).thenReturn(16); fragment.setTotalTasks(5); TextView header = fragment.getView().findViewById(R.id.header_text_display); assertEquals("5 structures within 25 m (16 total)", header.getText().toString()); } @Test public void testSetTaskDetails() { Whitebox.setInternalState(fragment, "taskAdapter", taskAdapter); List<TaskDetails> taskDetailsList = Collections.singletonList(TestingUtils.getTaskDetails()); fragment.setTaskDetails(taskDetailsList); verify(taskAdapter).setTaskDetails(taskDetailsList); } @Test public void testDisplayNotification() { fragment.displayNotification(R.string.saving_title, R.string.saving_message); AlertDialog dialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(dialog.isShowing()); assertEquals(activity.getString(R.string.saving_message), ((TextView) dialog.findViewById(android.R.id.message)).getText()); } @Test public void testDisplayError() { fragment.displayNotification(R.string.opening_form_title, R.string.error_unable_to_start_form); AlertDialog dialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(dialog.isShowing()); assertEquals(activity.getString(R.string.error_unable_to_start_form), ((TextView) dialog.findViewById(android.R.id.message)).getText()); } @Test public void testStartForm() { JSONObject form = new JSONObject(); fragment.startForm(form); Intent intent = shadowOf(activity).getNextStartedActivity(); assertEquals(RevealJsonFormActivity.class, shadowOf(intent).getIntentClass()); assertEquals(form.toString(), intent.getStringExtra(JSON_FORM_PARAM_JSON)); } @Test public void testOnDestroy() { fragment.onDestroy(); verify(presenter).onDestroy(); } @Test public void testOnDrawerClosed() { fragment.onDrawerClosed(); verify(presenter).onDrawerClosed(); } @Test public void testGetJsonFormUtils() { assertNull(fragment.getJsonFormUtils()); fragment.setJsonFormUtils(jsonFormUtils); assertEquals(jsonFormUtils, fragment.getJsonFormUtils()); } @Test public void testGetUserCurrentLocation() { Whitebox.setInternalState(fragment, "locationUtils", locationUtils); Location location = new Location("test"); when(locationUtils.getLastLocation()).thenReturn(location); assertEquals(location, fragment.getUserCurrentLocation()); } @Test public void testRequestUserLocation() { Whitebox.setInternalState(fragment, "locationUtils", locationUtils); fragment.requestUserLocation(); verify(locationUtils).checkLocationSettingsAndStartLocationServices(activity, presenter); assertTrue(Whitebox.getInternalState(fragment, "hasRequestedLocation")); } @Test public void testDisplayToast() { fragment.displayToast("Hello"); Toast toast = ShadowToast.getLatestToast(); assertEquals(Toast.LENGTH_LONG, toast.getDuration()); assertEquals("Hello", ShadowToast.getTextOfLatestToast()); } @Test public void testGetLocationUtils() { fragment.initializePresenter(); assertNotNull(fragment.getLocationUtils()); } @Test public void testShowProgressDialog() { fragment.showProgressDialog(R.string.saving_title, R.string.saving_message); ProgressDialog progressDialog = (ProgressDialog) ShadowProgressDialog.getLatestDialog(); assertTrue(progressDialog.isShowing()); assertEquals(activity.getString(R.string.saving_title), ShadowApplication.getInstance().getLatestDialog().getTitle()); } @Test public void testHideProgressDialog() { fragment.showProgressDialog(R.string.saving_title, R.string.saving_message); ProgressDialog progressDialog = (ProgressDialog) ShadowProgressDialog.getLatestDialog(); assertTrue(progressDialog.isShowing()); fragment.hideProgressDialog(); assertFalse(progressDialog.isShowing()); } @Test public void testSetInventionType() { fragment.setInventionType(R.string.irs); assertEquals(activity.getString(R.string.irs), ((TextView) fragment.getView().findViewById(R.id.intervention_type)).getText()); } @Test public void testRegisterFamily() { TaskDetails details = TestingUtils.getTaskDetails(); fragment.registerFamily(details); Intent intent = shadowOf(activity).getNextStartedActivity(); assertEquals(FamilyRegisterActivity.class, shadowOf(intent).getIntentClass()); } @Test public void testOpenFamilyProfile() { TaskDetails details = TestingUtils.getTaskDetails(); CommonPersonObjectClient person = TestingUtils.getCommonPersonObjectClient(); fragment.openFamilyProfile(person, details); Intent intent = shadowOf(activity).getNextStartedActivity(); assertEquals(FamilyProfileActivity.class, shadowOf(intent).getIntentClass()); assertEquals(person.getColumnmaps().get(FIRST_NAME), intent.getStringExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_NAME)); assertEquals(details.getTaskId(), intent.getStringExtra(Constants.Properties.TASK_IDENTIFIER)); assertEquals(details.getBusinessStatus(), intent.getStringExtra(Constants.Properties.TASK_BUSINESS_STATUS)); } @Test public void testDisplayIndexCaseDetails() { Whitebox.setInternalState(activity, "caseClassificationFragment", caseClassificationFragment); JSONObject indexCase = new JSONObject(); fragment.displayIndexCaseDetails(indexCase); verify(caseClassificationFragment).displayIndexCase(indexCase); } @Test public void testSetNumberOfFilters() { fragment.setNumberOfFilters(2); TextView filterTextView = fragment.getView().findViewById(R.id.filter_text_view); assertEquals(activity.getResources().getString(R.string.filters, 2), filterTextView.getText()); assertEquals(activity.getResources().getDimensionPixelSize(R.dimen.filter_toggle_end_margin), filterTextView.getPaddingStart()); } @Test public void testClearFilters() { fragment.clearFilter(); TextView filterTextView = fragment.getView().findViewById(R.id.filter_text_view); assertEquals(activity.getResources().getString(R.string.filter), filterTextView.getText()); assertEquals(activity.getResources().getDimensionPixelSize(R.dimen.filter_toggle_padding), filterTextView.getPaddingStart()); } @Test public void testOpenFilterActivity() { fragment.openFilterActivity(null); Intent intent = shadowOf(activity).getNextStartedActivity(); assertEquals(FilterTasksActivity.class, shadowOf(intent).getIntentClass()); } @Test public void testSetSearchPhrase() { fragment.setSearchPhrase("H"); assertEquals("H", fragment.getSearchView().getText().toString()); } @Test public void testOnActivityResultGetUserLocation() { Whitebox.setInternalState(fragment, "hasRequestedLocation", true); when(presenter.getLocationPresenter()).thenReturn(locationPresenter); Whitebox.setInternalState(fragment, "locationUtils", locationUtils); fragment.onActivityResult(RequestCode.LOCATION_SETTINGS, RESULT_OK, null); verify(locationPresenter).waitForUserLocation(); verify(locationUtils).requestLocationUpdates(presenter); } @Test public void testOnActivityResultGetUserLocationFailed() { Whitebox.setInternalState(fragment, "hasRequestedLocation", true); when(presenter.getLocationPresenter()).thenReturn(locationPresenter); fragment.onActivityResult(RequestCode.LOCATION_SETTINGS, RESULT_CANCELED, null); verify(locationPresenter).onGetUserLocationFailed(); verify(locationUtils, never()).requestLocationUpdates(presenter); } @Test public void testOnActivityResultFilterTasks() { Intent intent = new Intent(); TaskFilterParams params = new TaskFilterParams(""); intent.putExtra(FILTER_SORT_PARAMS, params); fragment.onActivityResult(REQUEST_CODE_FILTER_TASKS, RESULT_OK, intent); verify(presenter).filterTasks(params); } @Test public void testDisplayResetTaskInfoDialog() { TaskDetails taskDetails = TestingUtils.getTaskDetails(); fragment.displayResetTaskInfoDialog(taskDetails); AlertDialog alertDialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(alertDialog.isShowing()); TextView tv = alertDialog.findViewById(android.R.id.message); assertEquals(getString(R.string.undo_task_msg), tv.getText()); Whitebox.setInternalState(fragment, "presenter", presenter); alertDialog.getButton(BUTTON_POSITIVE).performClick(); verify(presenter).resetTaskInfo(taskDetailsArgumentCaptor.capture()); assertEquals(taskDetails.getTaskId(), taskDetailsArgumentCaptor.getValue().getTaskId()); assertFalse(alertDialog.isShowing()); } @Test public void testDisplayTaskActionDialogForEdit() { TaskDetails taskDetails = TestingUtils.getTaskDetails(); fragment.displayTaskActionDialog(taskDetails, mock(View.class)); AlertDialog alertDialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(alertDialog.isShowing()); TextView tv = alertDialog.findViewById(android.R.id.message); assertEquals(getString(R.string.choose_action), tv.getText()); Whitebox.setInternalState(fragment, "presenter", presenter); alertDialog.getButton(BUTTON_POSITIVE).performClick(); verify(presenter).onTaskSelected(taskDetailsArgumentCaptor.capture(), anyBoolean()); assertEquals(taskDetails.getTaskId(), taskDetailsArgumentCaptor.getValue().getTaskId()); assertFalse(alertDialog.isShowing()); } @Test public void testDisplayTaskActionDialogForUndo() { TaskDetails taskDetails = TestingUtils.getTaskDetails(); fragment = spy(fragment); fragment.displayTaskActionDialog(taskDetails, mock(View.class)); AlertDialog alertDialog = (AlertDialog) ShadowAlertDialog.getLatestDialog(); assertTrue(alertDialog.isShowing()); TextView tv = alertDialog.findViewById(android.R.id.message); assertEquals(getString(R.string.choose_action), tv.getText()); Whitebox.setInternalState(fragment, "presenter", presenter); alertDialog.getButton(BUTTON_NEGATIVE).performClick(); verify(fragment).displayResetTaskInfoDialog(taskDetailsArgumentCaptor.capture()); assertEquals(taskDetails.getTaskId(), taskDetailsArgumentCaptor.getValue().getTaskId()); assertFalse(alertDialog.isShowing()); } }
[ "markmngoma@outlook.com" ]
markmngoma@outlook.com
de7a6d7e75d648a3e15b319352bd17a790f4a56b
c76e78581983830158b2a6f56b807e37132f4bba
/CCC/src/CCC_07/J4AnagramChecker.java
5da58c16cd8df73a9798b0f173d071ef9d58b896
[]
no_license
itslinotlie/competitive-programming-solutions
7f72e27bbc53046174a95246598c3c9c2096b965
b639ebe3c060bb3c0b304080152cc9d958e52bfb
refs/heads/master
2021-07-17T17:48:42.639357
2021-05-29T03:07:47
2021-05-29T03:07:47
249,599,291
2
1
null
null
null
null
UTF-8
Java
false
false
1,369
java
// 04/19/2020 //https://dmoj.ca/problem/ccc07j4 package CCC_07; import java.util.*; import java.io.*; public class J4AnagramChecker { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static StringTokenizer st; public static void main (String[] args) throws IOException { String s = readLine(), t = readLine(); s = s.replaceAll(" ", ""); t = t.replaceAll(" ", ""); String arr[] = s.split(""), arr2[] = t.split(""); Arrays.sort(arr); Arrays.sort(arr2); boolean FLAG = true; for (int i=0;i<arr.length && FLAG;i++) { if (!arr[i].equals(arr2[i])) FLAG = false; } System.out.println(FLAG? "Is an anagram. ":"Is not an anagram."); } static String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine().trim()); return st.nextToken(); } static String readLine() throws IOException {return br.readLine().trim();} static int readInt() throws IOException {return Integer.parseInt(next());} static long readLong() throws IOException {return Long.parseLong(next());} static double readDouble() throws IOException {return Double.parseDouble(next());} }
[ "michael.li.web@gmail.com" ]
michael.li.web@gmail.com
5ca5ffb083ecd00c0f992f7209c6d39180c837b3
eddecdad11fea822388952b9326a05bdd8fae2b3
/server/src/main/java/li/yuhang/fogofworld/server/exception/EntityNotFoundException.java
f9dc9d3bda22f970b5d3ad7c8b8f2d5ae8f2ad98
[]
no_license
WilliamYuhangLee/FogOfWorld
19d11e73bedfc2ff5ab3725b490b1bf29a8d8058
c14338f0f426afbff5e6368592a523654641fc2d
refs/heads/master
2020-08-07T05:11:59.570842
2019-11-19T10:30:34
2019-11-19T10:41:35
213,312,169
4
0
null
null
null
null
UTF-8
Java
false
false
210
java
package li.yuhang.fogofworld.server.exception; public class EntityNotFoundException extends CustomExceptions.ApiException { public EntityNotFoundException(String message) { super(message); } }
[ "18326007+WilliamYuhangLee@users.noreply.github.com" ]
18326007+WilliamYuhangLee@users.noreply.github.com
c57ac0e7905e8941f1a0e2d323a7aba4df80be39
ce3563829d303d567d84aaeef189a13c0dc02872
/src/FlowEx17.java
5c5abc133ff92c0ce0d04f84d8ad8c4980841deb
[]
no_license
Ed-Jang/StandardOfJava
fbdf7a68e50f6c5cae5e67c5905bd4277bdc630f
0e3d5200e7d6789454a084c7ae4d7d6a74389ccc
refs/heads/master
2023-05-11T12:18:55.658782
2021-06-04T05:52:56
2021-06-04T05:52:56
352,244,325
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
import java.util.Scanner; class FlowEx17 { public static void main(String[] args) { int num = 0; System.out.print("*을 출력할 라인의 수를 입력하세요"); Scanner scanner = new Scanner(System.in); String tmp = scanner.nextLine();//입력받은 내용을 tmp에 저장 num = Integer.parseInt(tmp);//문자열을 숫자로 변환 for(int i = 0; i<num; i++) { for(int j = 0; j<=i; j++) { System.out.print("*"); } System.out.println(); } } }
[ "boreding@naver.com" ]
boreding@naver.com
812aab9c47be0da202179fcfb311aeb62735cfa5
2e8811b252118b9efb16487205fa581b1a7aab9a
/albedo-boot-common/src/main/java/com/albedo/java/util/domain/Order.java
343ba2d401ebc4b24f64f15f5d19fa0e5ed866e2
[ "Apache-2.0" ]
permissive
somowhere/albedo-boot-1v
e0bf2cfa9ebbc9f92c4994048d39557a216b614b
00c1229e83eb78b980e637694cb37bb446865b80
refs/heads/master
2022-10-06T00:53:54.986633
2019-09-07T01:59:03
2019-09-07T01:59:03
201,226,444
1
0
null
null
null
null
UTF-8
Java
false
false
2,894
java
package com.albedo.java.util.domain; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import java.io.Serializable; public class Order implements Serializable { /** * 默认方向 */ private static final Order.Direction DEFAULT_DIRECTION = Order.Direction.desc; /** * 属性 */ private String property; /** * 方向 */ private Order.Direction direction = DEFAULT_DIRECTION; /** * 构造方法 */ public Order() { } /** * 构造方法 * * @param property 属性 * @param direction 方向 */ public Order(String property, Order.Direction direction) { this.property = property; this.direction = direction; } /** * 返回递增排序 * * @param property 属性 * @return 递增排序 */ public static Order asc(String property) { return new Order(property, Order.Direction.asc); } /** * 返回递减排序 * * @param property 属性 * @return 递减排序 */ public static Order desc(String property) { return new Order(property, Order.Direction.desc); } @Override public String toString() { return property + " " + direction.name(); } /** * 获取属性 * * @return 属性 */ public String getProperty() { return property; } /** * 设置属性 * * @param property 属性 */ public void setProperty(String property) { this.property = property; } /** * 获取方向 * * @return 方向 */ public Order.Direction getDirection() { return direction; } /** * 设置方向 * * @param direction 方向 */ public void setDirection(Order.Direction direction) { this.direction = direction; } /** * 重写equals方法 * * @param obj 对象 * @return 是否相等 */ @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } if (this == obj) { return true; } Order other = (Order) obj; return new EqualsBuilder().append(getProperty(), other.getProperty()).append(getDirection(), other.getDirection()).isEquals(); } /** * 重写hashCode方法 * * @return HashCode */ @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(getProperty()).append(getDirection()).toHashCode(); } /** * 方向 */ public enum Direction { /** * 递增 */ asc, /** * 递减 */ desc } }
[ "somewhere0813@gmail.com" ]
somewhere0813@gmail.com
e1789e637be896bb87b98d84bff657b4ebb04a42
23763f376b95b742a1cb36bca2dad48583569160
/app/src/main/java/com/dj/dianjiao/domain/SendPictureItemClickEvent.java
34b8a923f2ac5aea8c19d4cb81da8082afe0c641
[]
no_license
Find-myWorld/dianjiao-1
e08e554c2027a37ab90209c77c04e9fc35ae602e
ecba423574648207279824117fa6e2c03f564fec
refs/heads/master
2021-01-20T19:56:38.793696
2016-07-30T11:56:21
2016-07-30T11:56:21
63,260,375
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package com.dj.dianjiao.domain; /** * Created by wmxxkj on 2016/6/23. */ public class SendPictureItemClickEvent extends BaseEvent{ private boolean isChecked; public boolean isChecked() { return isChecked; } public void setIsChecked(boolean isChecked) { this.isChecked = isChecked; } public SendPictureItemClickEvent() { } public SendPictureItemClickEvent(boolean isChecked) { this.isChecked = isChecked; } }
[ "894914512@qq.com" ]
894914512@qq.com
2d5774a9e671f16d6ebfd249b46551b41520fc23
3eaa64ce795b7cb8149922c53477e8fc43ef9661
/src/estoque/EstoqueDePratos.java
eeb22c25d133515a4b249b6c5de4d2e1b961575b
[]
no_license
mateusmangueira/prova-laboratorio-ufcg15-2
93b5716a8744e229ba6813597cd34bb5f46b0e5b
94925ed5b641289f7bc0364cb6a1834747b0b358
refs/heads/master
2021-03-28T00:25:14.192893
2016-09-11T18:28:38
2016-09-11T18:28:38
67,457,250
0
0
null
null
null
null
UTF-8
Java
false
false
2,897
java
package estoque; import java.util.ArrayList; import java.util.Collections; import java.util.List; import factory.PratoFactory; import pratos.PratoPersonalizado; public class EstoqueDePratos { List<PratoPersonalizado> estoque; PratoFactory fabricaPratos; public EstoqueDePratos() { this.estoque = new ArrayList<PratoPersonalizado>(); this.fabricaPratos = new PratoFactory(); } public List<PratoPersonalizado> getEstoque() { return estoque; } public void setEstoque(List<PratoPersonalizado> estoque) { this.estoque = estoque; } public PratoFactory getFabricaPratos() { return fabricaPratos; } public void setFabricaPratos(PratoFactory fabricaPratos) { this.fabricaPratos = fabricaPratos; } public PratoPersonalizado criaPratoCircular(double preco, String personalizacao, int raio) { PratoPersonalizado pratoCircular = this.getFabricaPratos().criaPratoCircular(preco, personalizacao, raio); return pratoCircular; } public PratoPersonalizado criaPratoRetangular(double preco, String personalizacao, double base, double altura) { PratoPersonalizado pratoRetangular = this.getFabricaPratos().criaPratoRetangular(preco, personalizacao, base, altura); return pratoRetangular; } public PratoPersonalizado criaPratoTriangular(double preco, String personalizacao, double base, double altura) { PratoPersonalizado pratoRetangular = this.getFabricaPratos().criaPratoTriangular(preco, personalizacao, base, altura); return pratoRetangular; } public boolean adicionaPrato(PratoPersonalizado pratoPersonalizado) { this.getEstoque().add(pratoPersonalizado); return true; } public boolean removePrato(PratoPersonalizado pratoPersonalizado) { if (this.getEstoque().contains(pratoPersonalizado)) { this.getEstoque().remove(pratoPersonalizado); return true; } return false; } public PratoPersonalizado buscaPrato(String personalizacao) { for (PratoPersonalizado prato : this.getEstoque()) { if (prato.getPersonalizacao().equalsIgnoreCase(personalizacao)) { return prato; } } return null; } public boolean consultaPrato(String personalizacao) { for (PratoPersonalizado prato : this.getEstoque()) { if (prato.getPersonalizacao().equalsIgnoreCase(personalizacao)) { return true; } } return false; } public double totalDinheiroEstoque() { double total = 0.0; for (PratoPersonalizado prato : this.getEstoque()) { total += prato.calculaPrecoTotal(); } return total; } public int quantidadePratos() { return this.getEstoque().size(); } public List<PratoPersonalizado> getPratosOrdenadosPorPreco() { Collections.sort(this.getEstoque()); return this.getEstoque(); } public String toString() { String retorno = "=== Estoque de Pratos Personalizados ===\n"; for (PratoPersonalizado prato : this.getEstoque()) { retorno = retorno + "\n" + prato; } return retorno; } }
[ "mateus.mangueira@ccc.ufcg.edu.br" ]
mateus.mangueira@ccc.ufcg.edu.br
37b202f96d9b894e92357cc099fd0c0c98e6ca08
459e5bb796f2509837550f302df030ea3df764b9
/src/modelo/BST.java
09191bec44a6bb9d3c468df5e1509560d1e907e1
[]
no_license
magrelyn/ED1-Modulo7Encontro3
fb99037c11d004ce62e9632c75030d17c88af033
52b4dd3a55eebe568013ce0e758301ee6b392c73
refs/heads/master
2022-12-19T21:09:43.685626
2020-10-08T03:29:27
2020-10-08T03:29:27
300,984,188
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
3,315
java
package modelo; import util.Lista; import util.StringManipulatorStatic; public class BST { private NoAluno raiz; public BST() { } public BST(NoAluno raiz) { this.raiz = raiz; } public void inserir(String info) { if (this.raiz == null) { NoAluno node = new NoAluno(info); this.raiz = node; } else { inserirRec(this.raiz, info); } } // metodo recursivo private void inserirRec(NoAluno no, String dado) { if (StringManipulatorStatic.isLessThan(dado, no.getInfo())) { if (no.getEsq() == null) { NoAluno node = new NoAluno(dado); no.setEsq(node); } else { inserirRec(no.getEsq(), dado); } } else { if (no.getDir() == null) { NoAluno node = new NoAluno(dado); no.setDir(node); } else { inserirRec(no.getDir(), dado); } } } public String posOrdem() { if (this.raiz != null) return posOrdemRec(this.raiz); return "Arvore vazia"; } static StringBuilder s = new StringBuilder(); // metodo recursivo private String posOrdemRec(NoAluno no) { if (no.getEsq() != null) { posOrdemRec(no.getEsq()); } if (no.getDir() != null) { posOrdemRec(no.getDir()); } s.append(no.getInfo() + " "); return s.toString(); } static StringBuilder s2; public String inOrdem() { s2 = new StringBuilder(); if (this.raiz != null) return inOrdemRec(this.raiz); return "Arvore vazia"; } // metodo recursivo private String inOrdemRec(NoAluno no) { if (no.getEsq() != null) { inOrdemRec(no.getEsq()); } s2.append(no.getInfo() + " "); if (no.getDir() != null) { inOrdemRec(no.getDir()); } return s2.toString(); } //private static NoAluno alunos[] = new NoAluno[400]; // static NoAluno alunos[]; private static Lista<NoAluno> alunos; public Lista<NoAluno> busca(String name) { alunos = new Lista<NoAluno>(); if (this.raiz == null) return alunos; else return buscaRec(this.raiz, name); } private Lista<NoAluno> buscaRec(NoAluno no, String name) { if (no.getInfo().equals(name)) { alunos.adiciona(no); } if (!StringManipulatorStatic.isLessThan(name, no.getInfo()) || no.getInfo().equals(name)) { if (no.getDir() != null) buscaRec(no.getDir(), name); } else { if (no.getEsq() != null) buscaRec(no.getEsq(), name); } return alunos; } public NoAluno remover(String nome) { if (this.raiz == null) return null; else if(this.raiz.getInfo().equals(nome)) { this.raiz = null; return null; } else return removerRec(this.raiz, nome); } private NoAluno removerRec(NoAluno no, String nome) { if (StringManipulatorStatic.isLessThan(nome, no.getInfo())) no.setEsq(removerRec(no.getEsq(), nome)); else if (StringManipulatorStatic.isLessThan(no.getInfo(), nome)) no.setDir(removerRec(no.getDir(), nome)); else if (no.getEsq() == null) return no.getDir(); else if (no.getDir() == null) return no.getEsq(); else removerSucessor(no); return no; } private void removerSucessor(NoAluno no) { NoAluno t = no.getDir(); // será o minimo da subarvore direita NoAluno pai = no; // será o pai de t while (t.getEsq() != null) { pai = t; t = t.getEsq(); } if (pai.getEsq() == t) pai.setEsq(t.getDir()); else pai.setDir(t.getDir()); no.setInfo(t.getInfo()); } }
[ "magrelinsan@gmail.com" ]
magrelinsan@gmail.com
f4c5cb666a530afd5fe84c234eed609fed3f2201
c10619851f462d2e3f829363053f697727878f0d
/src/com/gudong/dto/I18nResource.java
8794a77a6743258c81baba05ba4c6a14d4af22cf
[]
no_license
soulwee/i18n_plugin
abf28fed42e1541830be11e3636a4eade55a958e
b76f5087560535bcd13252770f4b2fac6e1e47b6
refs/heads/master
2023-06-29T16:14:19.033828
2021-07-23T02:27:35
2021-07-23T02:27:35
388,310,768
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package com.gudong.dto; import com.gudong.enums.I18nLocalEnum; import java.io.File; import java.util.Map; /** * description * * @author maggie * @date 2021-07-21 15:01 */ public class I18nResource { private I18nLocalEnum i18nLocalEnum; private File file; private Map<String, String> props; public I18nLocalEnum getI18nLocalEnum() { return i18nLocalEnum; } public void setI18nLocalEnum(I18nLocalEnum i18nLocalEnum) { this.i18nLocalEnum = i18nLocalEnum; } public File getFile() { return file; } public void setFile(File file) { this.file = file; } public Map<String, String> getProps() { return props; } public void setProps(Map<String, String> props) { this.props = props; } }
[ "maggie.xu@cyberwidom.net" ]
maggie.xu@cyberwidom.net
a34c998b4057047b392baac7e4a24adffd6fa9c5
f09e549c92dfebe1fb467575916ed56e6a6e327e
/snap/src/main/java/org/snapscript/core/array/IntegerList.java
1ed940105363cecad8c217e28f84dcc69dac3cda
[]
no_license
karino2/FileScripting
10e2ff7f5d688a7a107d01f1b36936c00bc4d6ad
4790830a22c2effacaaff6b109ced57cb6a5a230
refs/heads/master
2021-04-27T19:28:23.138720
2018-05-04T11:09:18
2018-05-04T11:09:18
122,357,523
0
0
null
null
null
null
UTF-8
Java
false
false
3,165
java
package org.snapscript.core.array; import org.snapscript.core.InternalArgumentException; public class IntegerList extends ArrayWrapper<Object> { private final Integer[] array; private final int length; public IntegerList(Integer[] array) { this.length = array.length; this.array = array; } @Override public int size() { return length; } @Override public Object get(int index) { return array[index]; } @Override public Object set(int index, Object value) { Integer previous = array[index]; Class type = value.getClass(); if(type == String.class) { String text = (String)value; array[index] = Integer.parseInt(text); } else { Number number = (Number)value; array[index] = number.intValue(); } return previous; } @Override public Object[] toArray() { Object[] copy = new Integer[length]; for(int i = 0; i < length; i++) { copy[i] = array[i]; } return copy; } @Override public <T> T[] toArray(T[] copy) { Class type = copy.getClass(); int require = copy.length; for(int i = 0; i < length && i < require; i++) { Integer number = array[i]; Object value = number; if(type != Integer[].class) { if(type == Byte[].class) { value = number.byteValue(); } else if(type == Double[].class) { value = number.doubleValue(); } else if(type == Float[].class) { value = number.floatValue(); } else if(type == Long[].class) { value = number.longValue(); } else if(type == Short[].class) { value = number.shortValue(); } else if(type == String[].class) { value = number.toString(); } else if(type == Object[].class) { value = number; } else { throw new InternalArgumentException("Incompatible array type"); } } copy[i] = (T)value; } return copy; } @Override public int indexOf(Object object) { Class type = object.getClass(); for (int i = 0; i < length; i++) { Integer number = array[i]; Object value = number; if(type != Integer.class) { if(type == Float.class) { value = number.floatValue(); } else if(type == Byte.class) { value = number.byteValue(); } else if(type == Double.class) { value = number.doubleValue(); } else if(type == Long.class) { value = number.longValue(); } else if(type == Short.class) { value = number.shortValue(); } else if(type == String.class) { value = number.toString(); } else { throw new InternalArgumentException("Incompatible value type"); } } if (object.equals(value)) { return i; } } return -1; } }
[ "hogeika2@gmailcom" ]
hogeika2@gmailcom
767139e03937e1fba048be10d9e74b9e0a3b10d6
2159e9dbc5b06b8a4a7c43234c8b916831c02a05
/app/src/main/java/ca/algonquinstudents/cst2335_group_project/M4MessageFragment.java
47f6db4af7957b97325940e8ea06876b335696a9
[]
no_license
hotpotguru/Final_Project_CST2355_AC-master
1215debd74c9f60ac24599434d161246f31ef5fa
1487f77414e838a27fb9f260abbda5f239c087c7
refs/heads/master
2020-05-06T13:56:38.653002
2019-04-08T14:20:41
2019-04-08T14:20:41
180,164,369
0
0
null
null
null
null
UTF-8
Java
false
false
18,822
java
package ca.algonquinstudents.cst2335_group_project; import android.app.Activity; import android.app.AlertDialog; import android.app.Fragment; import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.Button; import android.widget.CheckedTextView; import android.widget.ExpandableListView; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import android.util.SparseArray; import android.widget.Toast; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.List; import static ca.algonquinstudents.cst2335_group_project.M4OCDataBaseHelper.KEY_ID; import static ca.algonquinstudents.cst2335_group_project.M4OCDataBaseHelper.ML_TABLE_NAME; import static ca.algonquinstudents.cst2335_group_project.M4OCDataBaseHelper.ROUTE; import static ca.algonquinstudents.cst2335_group_project.M4OCDataBaseHelper.STOP_CODE; import static ca.algonquinstudents.cst2335_group_project.M4OCDataBaseHelper.STOP_NAME; import static ca.algonquinstudents.cst2335_group_project.Member4MainActivity.db; /** * this class defines behaviour for the fragment used to display details of a selected item of My List or search result list */ public class M4MessageFragment extends Fragment { private Activity parent = null; private SparseArray<Group> groups = new SparseArray<Group>(); private View screen; private ProgressBar pBar; private String[] msgs = new String[3]; private long idPassed; private boolean isInternetOk = true; public boolean iAmTablet; public int indexParent = 0; public M4MessageFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Bundle infoToPass = getArguments(); //returns the arguments set before msgs[0] = infoToPass.getString("StationNumber"); msgs[1] = infoToPass.getString("BusLine"); msgs[2] = infoToPass.getString("StationName"); idPassed = infoToPass.getLong("ID"); boolean removable = infoToPass.getBoolean("Removable"); screen = inflater.inflate(R.layout.message_fragment_m4, container, false); TextView msgTV = screen.findViewById(R.id.textViewStationDetails01M4); String passedMessage = "Stop#: " + msgs[0] + " Name: " + msgs[2] + " Bus: " + msgs[1] + "\n(ID = " + idPassed + ")"; msgTV.setText(passedMessage+"\n"+getString(R.string.m4_internet_wait)); Log.i("Passed Message:", passedMessage); pBar = (ProgressBar) screen.findViewById(R.id.ProgressBarM4); //initial add, remove and refresh button and set listener Button btnRemove = (Button) screen.findViewById(R.id.member4Btn1); Button btnAdd = (Button) screen.findViewById(R.id.member4Btn2); Button btnRefresh = (Button) screen.findViewById(R.id.member4Btn3); btnRemove.setEnabled(removable); btnAdd.setEnabled(!removable); btnRefresh.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Query the bus stop details from OC website new OCBusQuery("https://api.octranspo1.com/v1.2/GetNextTripsForStop?appID=223eb5c3&&apiKey=ab27db5b435b8c8819ffb8095328e775&stopNo=" + msgs[0] + "&routeNo=" + msgs[1]); } }); btnRefresh.callOnClick(); btnAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addMessage(idPassed, msgs); if (iAmTablet && indexParent==1) { getActivity().getFragmentManager().popBackStack(); ((Member4MainActivity)parent).refreshMessageCursorAndListView(); } else { Intent intent = new Intent(getActivity(), Member4MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } } }); btnRemove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(R.string.m4_dialog_message); builder.setTitle(R.string.m4_dialog_title); builder.setPositiveButton(R.string.positive_yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { deleteMessage(idPassed, msgs); if (iAmTablet && indexParent==1) { getActivity().getFragmentManager().popBackStack(); ((Member4MainActivity)parent).refreshMessageCursorAndListView(); } else { Intent intent = new Intent(getActivity(), Member4MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } } }); builder.setNegativeButton(R.string.negative_no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); builder.show(); } }); Snackbar.make(screen, R.string.m4_snackbar_message, Snackbar.LENGTH_LONG).show(); return screen; } @Override public void onAttach(Activity context) { super.onAttach(context); if (iAmTablet) { switch(indexParent){ case 1: parent = (Member4MainActivity) context; //find out which activity has the fragment break; case 2: parent = (Member4SearchActivity) context; //find out which activity has the fragment break; default: parent = null; } } } // delete the current item from My List public void deleteMessage(long id, String[] msg){ db.delete(ML_TABLE_NAME, KEY_ID+"=?", new String[]{Long.toString(id)}); } // add the current item to My List public void addMessage(long id, String[] msg){ ContentValues cVals = new ContentValues( ); cVals.put(KEY_ID, Long.toString(id)); cVals.put(STOP_CODE, msg[0]); cVals.put(ROUTE, msg[1]); cVals.put(STOP_NAME, msg[2]); db.insert(ML_TABLE_NAME,"NullColumnName", cVals); } // this class access the internet to query the database on OC website private class OCBusQuery extends AsyncTask<String, Integer, String[]> { public OCBusQuery(String url) { publishProgress(0); execute(url); publishProgress(25); } @Override protected String[] doInBackground(String... urls) { String[] aVs = new String[50]; int iTrip = -6, iDir = -6; boolean isRoute = false; String tagName; try { URL url = new URL(urls[0]); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); InputStream response = urlConnection.getInputStream(); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(false); XmlPullParser xPP = factory.newPullParser(); xPP.setInput(response, "UTF-8"); publishProgress(25); while (xPP.getEventType() != XmlPullParser.END_DOCUMENT) { switch (xPP.getEventType()) { case XmlPullParser.START_TAG: tagName = xPP.getName(); if (tagName.equals("StopNo")) { aVs[0] = xPP.nextText(); isRoute = aVs[0].equals(msgs[0]); if (isRoute) iDir = -1; } if (tagName.equals("StopLabel")) aVs[1] = xPP.nextText(); if (tagName.equals("RouteDirection")) iDir++; if (tagName.equals("RouteNo")) { isRoute &= xPP.nextText().equals(msgs[1]); if (isRoute && iDir >= 0) iTrip = 0; publishProgress((iDir + 2) * 25); } if (isRoute) { if (tagName.equals("RouteLabel")) aVs[iDir + 2] = xPP.nextText(); if (tagName.equals("Direction")) aVs[iDir + 4] = xPP.nextText(); if (tagName.equals("RequestProcessingTime")) aVs[iDir + 6] = xPP.nextText(); if (iTrip < 3) { if (tagName.equals("TripDestination")) aVs[iDir * 3 + iTrip + 8] = xPP.nextText(); if (tagName.equals("TripStartTime")) aVs[iDir * 3 + iTrip + 14] = xPP.nextText(); if (tagName.equals("AdjustedScheduleTime")) aVs[iDir * 3 + iTrip + 20] = xPP.nextText(); if (tagName.equals("AdjustmentAge")) aVs[iDir * 3 + iTrip + 26] = xPP.nextText(); if (tagName.equals("Latitude")) aVs[iDir * 3 + iTrip + 32] = xPP.nextText(); if (tagName.equals("Longitude")) aVs[iDir * 3 + iTrip + 38] = xPP.nextText(); if (tagName.equals("GPSSpeed")) { aVs[iDir * 3 + iTrip + 44] = xPP.nextText(); iTrip++; } } } //Log.i("read XML tag:", tagName); break; } xPP.next(); } isInternetOk = true; } catch (Exception e) { Log.i("Exception", e.getMessage()); isInternetOk = false; } publishProgress(100); return aVs; } @Override protected void onProgressUpdate(Integer... args) { pBar.setVisibility(View.VISIBLE); pBar.setProgress(args[0]); Log.i("Progress:", args[0].toString()); } //deal with the realtime information got from OC database on the website @Override protected void onPostExecute(String[] s) { super.onPostExecute(s); TextView QDetails01 = screen.findViewById(R.id.textViewStationDetails01M4); if(isInternetOk) { for (int i = 0; i < s.length; i++) if (s[i] == null || s[i].isEmpty()) s[i] = "N/A"; QDetails01.setText("StopNo: " + s[0] + " StopLabel: " + s[1]); groups.append(0, new Group("RouteNo: " + msgs[1] + " RouteLabel: " + s[2])); groups.append(1, new Group("Direction: " + s[4])); groups.append(2, new Group("RequestProcessingTime: " + s[6])); for (int i = 0; i < 3; i++) { Group group = new Group("Trip " + (i + 1) + " StartTime: " + s[14 + i] + " Destination: " + s[8 + i]); group.children.add("AdjustedScheduleTime: " + s[20 + i] + " AdjustmentAge: " + s[26 + i]); group.children.add("Latitude: " + s[32 + i] + " Longitude: " + s[38 + i] + " GPSSpeed: " + s[44 + i]); groups.append(i + 3, group); } groups.append(6, new Group("RouteNo: " + msgs[1] + " RouteLabel: " + s[3])); groups.append(7, new Group("Direction: " + s[5])); groups.append(8, new Group("RequestProcessingTime: " + s[7])); for (int i = 0; i < 3; i++) { Group group = new Group("Trip " + (i + 1) + " StartTime: " + s[17 + i] + " Destination: " + s[11 + i]); group.children.add("AdjustedScheduleTime: " + s[23 + i] + " AdjustmentAge: " + s[29 + i]); group.children.add("Latitude: " + s[35 + i] + " Longitude: " + s[41 + i] + " GPSSpeed: " + s[47 + i]); groups.append(i + 9, group); } ExpandableListView detailsView = (ExpandableListView) screen.findViewById(R.id.listViewDetailsExpM4); MyExpandableListAdapter adapter = new MyExpandableListAdapter(getActivity(), groups); detailsView.setAdapter(adapter); } else{ QDetails01.setText(getString(R.string.m4_internet_error)); } pBar.setVisibility(View.INVISIBLE); } } /********************************************************************************************************/ /* Following code (Expandable List View) modified from */ /* Using lists in Android with ListView - Tutorial */ /* Lars Vogel, (c) 2010, 2016 vogella GmbH Version 6.2, 09.11.2016 */ /* http://www.vogella.com/tutorials/AndroidListView/article.html */ /* */ /********************************************************************************************************/ public class Group { public String string; public final List<String> children = new ArrayList<String>(); public Group(String string) { this.string = string; } } public class MyExpandableListAdapter extends BaseExpandableListAdapter { private final SparseArray<Group> groups; public LayoutInflater inflater; public Activity activity; public MyExpandableListAdapter(Activity act, SparseArray<Group> groups) { activity = act; this.groups = groups; inflater = act.getLayoutInflater(); } @Override public Object getChild(int groupPosition, int childPosition) { return groups.get(groupPosition).children.get(childPosition); } @Override public long getChildId(int groupPosition, int childPosition) { return 0; } @Override public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { final String children = (String) getChild(groupPosition, childPosition); TextView text = null; if (childPosition%2 == 0) convertView = inflater.inflate(R.layout.list_row_details1_m4, null); else convertView = inflater.inflate(R.layout.list_row_details2_m4, null); text = (TextView) convertView.findViewById(R.id.textViewRowDetailsM4); text.setText(children); convertView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(activity, children, Toast.LENGTH_SHORT).show(); } }); return convertView; } @Override public int getChildrenCount(int groupPosition) { return groups.get(groupPosition).children.size(); } @Override public Object getGroup(int groupPosition) { return groups.get(groupPosition); } @Override public int getGroupCount() { return groups.size(); } @Override public void onGroupCollapsed(int groupPosition) { super.onGroupCollapsed(groupPosition); } @Override public void onGroupExpanded(int groupPosition) { super.onGroupExpanded(groupPosition); } @Override public long getGroupId(int groupPosition) { return 0; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if ( getChildrenCount( groupPosition ) == 0 ) convertView = inflater.inflate(R.layout.list_row_group_header_m4, null); else { convertView = inflater.inflate(R.layout.list_row_group_m4, null); View ind = convertView.findViewById(R.id.explist_indicator); if( ind != null ) { ImageView indicator = (ImageView) ind; indicator.setVisibility( View.VISIBLE ); indicator.setImageResource( isExpanded ? R.drawable.expander_ic_maximized : R.drawable.expander_ic_minimized ); } } Group group = (Group) getGroup(groupPosition); CheckedTextView text = (CheckedTextView)convertView.findViewById(R.id.textViewRowGroupM4); text.setText(group.string); text.setChecked(isExpanded); return convertView; } @Override public boolean hasStableIds() { return false; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return false; } } }
[ "zhan0571@algonquinlive.com" ]
zhan0571@algonquinlive.com
5cb5f6674a46f58eb7557f1b70d5a34700e19491
b2a0cd714ebcebcc4bfcb378cbd9387eeb3c7bbb
/src/main/java/com/tchokoapps/springboot/springbootpetclinic/model/Vet.java
2d2a5f5b95c3f5b92a1f252a26c05af065a6bd55
[]
no_license
TchokoApps/spring-boot-petclinic
e37020bd44731e2a75cf28632a7e9d29d06171de
1828ceb6cbde03f958f17bfd696ee457b43432bd
refs/heads/master
2020-05-27T14:30:55.668975
2019-09-08T10:02:17
2019-09-08T10:02:17
188,661,012
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package com.tchokoapps.springboot.springbootpetclinic.model; import javax.persistence.*; import java.util.HashSet; import java.util.Set; @Entity public class Vet extends Person { public Vet() { } public Vet(Long id, String firstName, String lastName, Set<Speciality> specialities) { super(id, firstName, lastName); this.specialities = specialities; } @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "vet_speciality", joinColumns = @JoinColumn(name = "vet_id"), inverseJoinColumns = @JoinColumn(name = "speciality_id")) private Set<Speciality> specialities = new HashSet<>(); public Set<Speciality> getSpecialities() { return specialities; } }
[ "tchokoapps@gmail.com" ]
tchokoapps@gmail.com
979903fcaaebc838332d2d0e0468468344e235bc
967d59112f1db4bde57902a34383509e8e7c2c81
/src/main/java/kitchenServlet/brand/buyer/selectBrandServlet.java
ec7d1ab7c4c1c00e8383dd02762f26732d7f612b
[]
no_license
suyilei20000703/KITCHEN
69249f85ae375279df3e43dde0d6e811643ec30f
fd8d4343f922cee8b167c7005e25417270b19421
refs/heads/master
2023-02-11T07:33:55.358183
2020-12-26T07:38:31
2020-12-26T07:38:31
324,507,180
0
0
null
null
null
null
UTF-8
Java
false
false
1,809
java
package kitchenServlet.brand.buyer; import java.io.IOException; import java.sql.ResultSet; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import bean.brand; import dao.brandDao; /** * Servlet implementation class lookSelect */ @WebServlet("/selectBrandServlet2") public class selectBrandServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public selectBrandServlet() { super(); // TODO Auto-generated constructor stub } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try{ brandDao db=new brandDao(); ResultSet rs=db.selectBrand(); HttpSession session=request.getSession(); ArrayList al=new ArrayList(); while(rs.next()){ brand st=new brand(); st.setBRno(rs.getString("BRno")); st.setBRanme(rs.getString("BRanme")); st.setBRfirm(rs.getString("BRfirm")); al.add(st); } session.setAttribute("al", al); rs.close(); response.sendRedirect("kitchen/brand/admin_low/selectS.jsp"); }catch(Exception e){ e.printStackTrace(); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
[ "2402174978@qq.com" ]
2402174978@qq.com
25bd59ceb4a5d106cd90c0f9bbd8794c1b960732
66176b070d32b3b55209edeb8fe0674c6cbeaa4d
/app/src/test/java/com/example/tugasprakmobile06/ExampleUnitTest.java
76ce9f6e94179a89678c380c0a1a92cfad54f18d
[]
no_license
DewiEksanty/Tugas06_1918072_Dewi-Eksanti-Saragih
9e5a1879cdfede5d92064231f5f3e211f55a5067
501e6f9e5cef15401d61f55435e3a6df2be45935
refs/heads/main
2023-09-06T06:29:08.009332
2021-11-28T15:04:41
2021-11-28T15:04:41
432,743,778
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package com.example.tugasprakmobile06; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "eksantysgh@gmail.com" ]
eksantysgh@gmail.com
e608f0aaf69769c9d0d0f9db9445a19919b3d44f
2a204eec5a62506b80d333da990885f4bde664d7
/app/src/main/java/com/bwie/lianxi0927/bean/GetOrders.java
87ac7b38db972a9e428c97e40d6ef54059a0e8d7
[]
no_license
danney7348/MvpDemo
fb1a9186ece4457c431532c82cba43ef65550bb3
09e13f3b55d653adad7065deb42ded5fdd93a1ea
refs/heads/master
2021-07-17T12:29:05.196134
2017-10-24T08:32:02
2017-10-24T08:32:02
105,112,877
0
0
null
null
null
null
UTF-8
Java
false
false
2,946
java
package com.bwie.lianxi0927.bean; import java.util.List; /** * 作者: 张少丹 * 时间: 2017/10/19. * 邮箱:1455456581@qq.com * 类的用途: */ public class GetOrders { /** * msg : 请求成功 * code : 0 * data : [{"createtime":"2017-10-20T21:02:50","orderid":377,"price":48155.79,"status":0,"uid":170},{"createtime":"2017-10-21T15:41:30","orderid":475,"price":18785.9,"status":0,"uid":170},{"createtime":"2017-10-21T15:41:55","orderid":477,"price":12097,"status":0,"uid":170},{"createtime":"2017-10-21T15:42:09","orderid":478,"price":0,"status":0,"uid":170},{"createtime":"2017-10-21T15:42:15","orderid":480,"price":12097,"status":0,"uid":170},{"createtime":"2017-10-21T15:50:29","orderid":484,"price":12119.9,"status":0,"uid":170},{"createtime":"2017-10-21T16:17:42","orderid":509,"price":297,"status":0,"uid":170},{"createtime":"2017-10-21T16:17:42","orderid":510,"price":22,"status":0,"uid":170},{"createtime":"2017-10-21T16:17:49","orderid":511,"price":297,"status":0,"uid":170},{"createtime":"2017-10-21T16:24:44","orderid":515,"price":0,"status":0,"uid":170}] * page : 1 */ private String msg; private String code; private String page; private List<DataBean> data; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getPage() { return page; } public void setPage(String page) { this.page = page; } public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean { /** * createtime : 2017-10-20T21:02:50 * orderid : 377 * price : 48155.79 * status : 0 * uid : 170 */ private String createtime; private int orderid; private double price; private int status; private int uid; public String getCreatetime() { return createtime; } public void setCreatetime(String createtime) { this.createtime = createtime; } public int getOrderid() { return orderid; } public void setOrderid(int orderid) { this.orderid = orderid; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getUid() { return uid; } public void setUid(int uid) { this.uid = uid; } } }
[ "31384817+danney7348@users.noreply.github.com" ]
31384817+danney7348@users.noreply.github.com
d254930bc175093644748bad5c883b9d44b9385b
89e3c56f474f217d68166e635cb659f48934e042
/main/src/offerdiary/test/com/itech/common/test/CommonTestUtil.java
a055a02b5a8fb99387417699b56d71aaae553551
[]
no_license
dadua/offerdiary
a2fa4a78a97ceefa13eb91c3eb91ceb996b60232
08e60ad47107da75ec511fe028623148dda42edb
refs/heads/master
2021-01-21T04:19:13.379849
2016-06-28T06:02:45
2016-06-28T06:02:45
52,001,241
0
0
null
null
null
null
UTF-8
Java
false
false
102
java
package com.itech.common.test; public abstract class CommonTestUtil extends CommonTestBase { }
[ "dadua@b1e6d7df-1d6d-4298-be86-6b87e87bbc09" ]
dadua@b1e6d7df-1d6d-4298-be86-6b87e87bbc09
e9dbee3bb7ff72d7140525503642aaeca8654cd6
9ff969ab75801b2a887527d05225a37a13253aac
/spriteother/PulldownBar.java
cc4333f5beb8fd83e6531ccb353499e13addad10
[]
no_license
t-9/line_shooting
84ee0b94cf2dde12301d3ca3ff60b96ceaf9d3b0
2dcef9240d41b190d270e5a8fb232d759863ab16
refs/heads/master
2022-02-26T17:04:40.776556
2019-08-21T16:45:33
2019-08-21T16:45:33
17,790,265
0
0
null
null
null
null
UTF-8
Java
false
false
2,268
java
package com.example.line_shooting.spriteother; import com.example.line_shooting.Assets; import com.example.line_shooting.Barehand; import com.example.line_shooting.SpriteJiki; import com.example.line_shooting.SpriteOther; import com.example.line_shooting.TimerCount; import com.example.line_shooting.framewark.Graphics; public class PulldownBar extends SpriteOther{ public PulldownBar() { super(0, -112, Assets.pulldownBar.getWidth(), Assets.pulldownBar.getHeight(), 0, 0, Assets.pulldownBar.getWidth(), Assets.pulldownBar.getHeight()); } private void PulldownBarDown() { super.setY((super.getY() + 10 < Assets.StatesBar.getHeight()) ? super.getY() + 10 : Assets.StatesBar.getHeight() ); } private void PulldownBarUp() { super.setY((super.getY() - 10 > - (Assets.pulldownBar.getHeight() - Assets.StatesBar.getHeight())) ? super.getY() - 10 : -(Assets.pulldownBar.getHeight() - Assets.StatesBar.getHeight()) ); } public void DrawPulldownBar(Graphics g) { g.drawPixmap(Assets.pulldownBar, super.getX(), super.getY()); } private void Collision_Jiki_PulldownBar(SpriteJiki _sp_jiki, TimerCount _timerCount) { if (_sp_jiki.getY() <= super.getY() + super.getHitH()){ _sp_jiki.setY(super.getY() + super.getHitH()); if (super.getY() != -112){ _timerCount.setTimeLimitSubtract(30); Assets.hurtIron.play(0.375f); } } } private void Collision_Weapon_PulldownBar(WeaponReport _weaponReport, SpriteJiki _sp_jiki) { // _武器との当たり判定 if (_weaponReport.getY() <= super.getY() + super.getHitH()) { _weaponReport.ReportPosInit(_sp_jiki); if (super.getY() != -112){ Assets.hitNormal.play(0.5f); } } } public void CollisionCheck(TimerCount _timerCount, WeaponReport _weaponReport, SpriteJiki _sp_jiki) { Collision_Jiki_PulldownBar(_sp_jiki, _timerCount); Collision_Weapon_PulldownBar(_weaponReport, _sp_jiki); } public void JikiInPulldownBarRange(SpriteJiki _sp_jiki, Barehand _barehand) { if (_sp_jiki.getY() >= Assets.StatesBar.getHeight() + super.getHitH() - 2) { _barehand.barehandUp(); PulldownBarUp(); } else { if (_barehand.getBarehandX() > 450) _barehand.barehandDown(); else PulldownBarDown(); } } }
[ "ikaruga801@yahoo.co.jp" ]
ikaruga801@yahoo.co.jp
461b79629ca055a38c094d1d1595485dfd16ad10
052cff99fad6400ae598349378e95286e44cacef
/src/main/java/com/duyj2/work/jdk/oom/MemTest.java
062d7568727ef89106b2de5526b943a9a1657a42
[]
no_license
dyj2012/myTest
6c3271c5693fee5d13f7d3fea362572af26036b8
3306ff91305dc23b9a44c96326006b5e1d7a8ff5
refs/heads/master
2022-12-21T06:43:12.659798
2020-12-29T02:24:10
2020-12-29T02:24:10
144,830,501
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package com.duyj2.work.jdk.oom; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; public class MemTest { public static void main(String[] args) throws InterruptedException { Thread.sleep(1000*60); int count = args.length == 1 ? Integer.parseInt(args[0]) : 30; List<List> list = new LinkedList<List>(); long max = Runtime.getRuntime().maxMemory(); long totle = Runtime.getRuntime().totalMemory(); int i = 0; while (true) { list.add(new ArrayList<Integer>(512)); while (i++ < count) { long free = Runtime.getRuntime().freeMemory(); System.out.println("max:" + max / (1<<20) + "m totle:" + totle/(1<<20) + "m free=" + free/1024 + "kb"); i = 0; } } } }
[ "duyj@dcnoahark.com" ]
duyj@dcnoahark.com
8a784bb5658b161c87cb6c882f6595c0c87ebe4d
1ec176244fda25a09c2657e06ca2be785338d79f
/leyou/leyou-goods-web/src/main/java/com/leyou/goods/client/BrandClient.java
3d7dd2f0998378a866a2faef23bc24ef90ad40fc
[]
no_license
chenwei2460769651/leyou
c4ce8c56a3f19f9db2e5839f0219a6fd3acb605f
07a7dc9a9fbe6632bc92b2fbc8fedf7c2957809b
refs/heads/master
2022-12-15T01:25:12.114105
2020-04-17T08:09:09
2020-04-17T08:09:09
255,136,723
4
0
null
2022-12-09T01:32:36
2020-04-12T17:40:07
JavaScript
UTF-8
Java
false
false
308
java
package com.leyou.goods.client; import com.leyou.item.api.BrandApi; import org.springframework.cloud.openfeign.FeignClient; /** * @Classname BrandClient * @Description TODO * @Date 2020/3/26 10:48 * @Created by chenwei */ @FeignClient("item-service") public interface BrandClient extends BrandApi { }
[ "2460769651@qq.com" ]
2460769651@qq.com
b963c848eb7a59bd5db76760c2086a109f88f38f
160663a72233aecbb05714b0aa7d3984e3e44c20
/L9T2_MeteoStatExercise_Solution/src/edu/tum/cs/pse/meteostat/solution/IMeteorologicalStationGUI.java
16a4f14fc9ee44aa46b36a35a0953fea7994bd6f
[]
no_license
amitjoy/software-patterns
d92e192770d9ea914b8e382e1edb813d26f0849c
5db3ef039738295116f6c28bf14058ce594bc805
refs/heads/master
2021-01-10T13:44:31.212972
2015-11-02T06:10:05
2015-11-02T06:10:05
45,375,350
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
package edu.tum.cs.pse.meteostat.solution; public interface IMeteorologicalStationGUI { void displayTemperature(int temperature); void displayWindspeed(int windspeed); void displayHumidity(int humidity); }
[ "admin@amitinside.com" ]
admin@amitinside.com
c1f81b16bd15a8ceff8a60372bcdb399172568b6
8e3f5d40fc5eec2f61213d2c8686bcf7fbc69c45
/src/main/java/com/gcx/community/dto/CommentDTO.java
341833074e663b50918af75bca1fbb5bc8cb823d
[]
no_license
ChenXiangGao/community
13bc303e27e1bb1661f16ed79e458211baf2cf13
ab0a54313393064a4854862b8a1b9ace51c4eb17
refs/heads/main
2023-06-18T03:55:34.458827
2021-07-18T08:44:29
2021-07-18T08:44:29
373,842,537
1
0
null
null
null
null
UTF-8
Java
false
false
178
java
package com.gcx.community.dto; import lombok.Data; @Data public class CommentDTO { private Long parentId; private String content; private Integer type; }
[ "913396660@qq.com" ]
913396660@qq.com
de7ced6bb86a82b2b4e36a48db56cf24e25cbf63
90120134ae36ad0a76498b8c3e3f45520c004bcd
/app/src/test/java/async1/my/com/matkonim/ExampleUnitTest.java
915cf2afe5fb05631070f952978c4d8a7e9e4965
[]
no_license
yossibo/Matkonim
4c1d8b68011df9a846c528a7db358abf225a6994
82e2ecd2aa5460700873073ce2a4827d1226d1db
refs/heads/master
2020-12-03T00:19:18.449224
2016-09-19T09:23:21
2016-09-19T09:23:21
68,590,021
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package async1.my.com.matkonim; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "yossibimbatoknin@gmail.com" ]
yossibimbatoknin@gmail.com
7b2666a399661e390b8cfb307115444d1c35b3f2
56e32ac16401110d68713fae949915f76b511a1c
/src/main/java/by/hotel/bean/User.java
c650c1260fa7469a39f14ca5a997bdfecf169d05
[]
no_license
drafteee/Hotel
3f6ad9184c867ba53c4161b07aaa945ba44d9fa4
429f855f684516289c558097d40b22edffb09475
refs/heads/master
2021-01-17T04:29:55.516428
2017-02-23T20:47:44
2017-02-23T20:47:44
82,968,314
1
0
null
2017-02-23T20:26:36
2017-02-23T20:26:36
null
UTF-8
Java
false
false
86
java
package by.hotel.bean; /** * Created by SK on 16.02.2017. */ public class User { }
[ "alexandrsavchuk.97@gmail.com" ]
alexandrsavchuk.97@gmail.com
ada66cb21b8d13157d369289b66b765b61691003
43fafc604ac2497c0d3bf7b066d27140bd886a4c
/src/main/java/com/cr/campusmicroblog/controller/LoginController.java
58a09a101bbc4ed0861cbc82bb5a8ebf3990eb4a
[]
no_license
a893206/campus-micro-blog
a3dd15b349ae02a894c376c15279ff69b49da98e
be6bb265babc6456a9f7eb281bbb6ccae011d361
refs/heads/master
2023-04-24T18:23:48.984583
2021-05-15T19:36:07
2021-05-15T19:36:07
362,177,601
0
0
null
null
null
null
UTF-8
Java
false
false
2,873
java
package com.cr.campusmicroblog.controller; import com.cr.campusmicroblog.service.UserService; import com.cr.campusmicroblog.util.MicroBlogUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; import java.util.Map; /** * @author cr * @date 2020-11-17 12:03 */ @Slf4j @Controller public class LoginController { @Autowired private UserService userService; @PostMapping("/reg") @ResponseBody public String reg(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam(value = "rember", defaultValue = "0") int rememberme, HttpServletResponse response) { try { Map<String, Object> map = userService.register(username, password); if (map.containsKey("ticket")) { Cookie cookie = new Cookie("ticket", map.get("ticket").toString()); cookie.setPath("/"); if (rememberme > 0) { cookie.setMaxAge(3600 * 24); } response.addCookie(cookie); return MicroBlogUtils.getJSONString(0, "注册成功"); } else { return MicroBlogUtils.getJSONString(1, map); } } catch (Exception e) { log.error("注册异常" + e.getMessage()); return MicroBlogUtils.getJSONString(1, "注册异常"); } } @PostMapping("/login") @ResponseBody public String login(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam(value = "rember", defaultValue = "0") int rememberme, HttpServletResponse response) { try { Map<String, Object> map = userService.login(username, password); if (map.containsKey("ticket")) { Cookie cookie = new Cookie("ticket", map.get("ticket").toString()); cookie.setPath("/"); if (rememberme > 0) { cookie.setMaxAge(3600 * 24); } response.addCookie(cookie); return MicroBlogUtils.getJSONString(0, "登录成功"); } else { return MicroBlogUtils.getJSONString(1, map); } } catch (Exception e) { log.error("登录异常" + e.getMessage()); return MicroBlogUtils.getJSONString(1, "登录异常"); } } }
[ "931009686@qq.com" ]
931009686@qq.com
ed9735ad3f3863f7893ea1bee6d5e96b5e327a5e
a28f84225f61c94e37211241e5ac6a5692fb094d
/src/main/java/com/icinfo/lpsp/wechat/wxsdk/message/resolver/SubscribeEventResolver.java
6447a43d98d748f8c45ae91972e3408511940a5e
[]
no_license
yangshanghang/wechat
125fc28a96bbb2feca37b88b6350c7312d515dac
ff4962948a2f56250ebc6a891cf35199ba4b47aa
refs/heads/master
2021-01-19T18:18:26.781390
2017-08-25T03:28:57
2017-08-25T03:28:57
101,122,417
0
0
null
null
null
null
UTF-8
Java
false
false
219
java
package com.icinfo.lpsp.wechat.wxsdk.message.resolver; /** * 关注事件解析器 * Created by yushunwei on 2016/8/14. */ public abstract class SubscribeEventResolver extends BaseResolver implements IResolver { }
[ "shuyuqiong1986@163.com" ]
shuyuqiong1986@163.com
f36575b3e7d9172fb310345bb7d0724252c14398
94bdbf2d7be66f8f73d52bfce78f11c023e3d5d1
/spring-01-ioc1/src/main/java/com/kuang/service/UserServiceImpl.java
7aed9482e22b9619d201aad79882abdc5e437849
[]
no_license
yueshang-anran/spring-study
15dae2ff49fa58097ffad938e70b45343f21ecac
9694e92ad5e979f4c5f1e34c6978f8dd562571a6
refs/heads/master
2023-04-03T13:02:30.671291
2021-04-07T08:23:48
2021-04-07T08:23:48
355,459,116
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package com.kuang.service; import com.kuang.dao.UserDao; import com.kuang.dao.UserDaoImpl; import com.kuang.dao.UserDaoMysqlImpl; import com.kuang.dao.UserDaoOracleImpl; /** * @author 书 * @date 2021/3/23 - 10:52 */ public class UserServiceImpl implements UserService { // private UserDao userDao = new UserDaoImpl(); // private UserDao userDao = new UserDaoMysqlImpl(); // private UserDao userDao = new UserDaoOracleImpl(); private UserDao userDao; // 利用set进行动态实现值的注入 public void setUserDao(UserDao userDao) { this.userDao = userDao; } public void getUser() { userDao.getUser(); } }
[ "3239255489@qq.com" ]
3239255489@qq.com
62611ae76650c9c2af496242ae22b4eb8adc1bcb
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/android/bluetooth/BluetoothDevicePicker.java
211fd7094aa1d319ca4f2126928ce42d7b3299d4
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
977
java
package android.bluetooth; public interface BluetoothDevicePicker { public static final String ACTION_DEVICE_SELECTED = "android.bluetooth.devicepicker.action.DEVICE_SELECTED"; public static final String ACTION_LAUNCH = "android.bluetooth.devicepicker.action.LAUNCH"; public static final String EXTRA_FILTER_TYPE = "android.bluetooth.devicepicker.extra.FILTER_TYPE"; public static final String EXTRA_LAUNCH_CLASS = "android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"; public static final String EXTRA_LAUNCH_PACKAGE = "android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"; public static final String EXTRA_NEED_AUTH = "android.bluetooth.devicepicker.extra.NEED_AUTH"; public static final int FILTER_TYPE_ALL = 0; public static final int FILTER_TYPE_AUDIO = 1; public static final int FILTER_TYPE_NAP = 4; public static final int FILTER_TYPE_PANU = 3; public static final int FILTER_TYPE_TRANSFER = 2; }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
a46fcd48dc4b6c177c13c2ff3b57b15ec293a0c2
0bd1d05d38a8d01231889eb4b0542f77706b0a12
/src/main/java/org/shiro/demo/vo/UDBPlanVO.java
4be6fb90fe40aaf919bd4864515d3efe2b84b9e3
[]
no_license
Guosmilesmile/yydb
17e5836313e5571a0d38624e5e1caaf358c85429
bdcc2febbbd195152f84e8d6f110d27558fbd7f7
refs/heads/master
2020-06-11T07:49:15.105538
2017-05-02T14:48:08
2017-05-02T14:48:08
75,912,328
0
0
null
null
null
null
UTF-8
Java
false
false
3,156
java
package org.shiro.demo.vo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.shiro.demo.dao.util.Pagination; import org.shiro.demo.entity.DBPlan; public class UDBPlanVO { private Long id; private Integer block;//分区(1:一元区,2:十元区,3:百元区,4:千元区) private Long split;//单次竞标价 private Long startTime;//竞标开始时间 private Long endTime;//竞标结束 private Integer number;//数量 private Double money;//价位 private Long goodsid; public Integer getBlock() { return block; } public void setBlock(Integer block) { this.block = block; } public Long getSplit() { return split; } public void setSplit(Long split) { this.split = split; } public Long getStartTime() { return startTime; } public void setStartTime(Long startTime) { this.startTime = startTime; } public Long getEndTime() { return endTime; } public void setEndTime(Long endTime) { this.endTime = endTime; } public Integer getNumber() { return number; } public void setNumber(Integer number) { this.number = number; } public Double getMoney() { return money; } public void setMoney(Double money) { this.money = money; } public UDBPlanVO() { super(); } public UDBPlanVO(DBPlan dbPlan) { super(); this.id = dbPlan.getDbplanid(); this.block = dbPlan.getBlock(); this.split = dbPlan.getSplit(); this.startTime = dbPlan.getStartTime(); this.endTime = dbPlan.getEndTime(); this.number = dbPlan.getNumber(); this.money = dbPlan.getMoney(); this.goodsid = dbPlan.getGoods().getGoodsid(); } /** * 将实体类转换成显示层实体类 * @param pagination 分页数据 * @return */ public static Map<String, Object> changeDBPlan2DBPlanVO(Pagination<DBPlan> pagination){ List<DBPlan> recordList = pagination.getRecordList(); List<UDBPlanVO> VOList = new ArrayList<UDBPlanVO>(); Map<String, Object> map = new HashMap<String, Object>(); for(DBPlan item : recordList){ VOList.add(new UDBPlanVO(item)); } map.put("rows", VOList); map.put("total", pagination.getRecordCount()); return map; } /** * 将实体类转换成显示层实体类 * @param pagination 分页数据 * @return */ public static List<UDBPlanVO> changeDBPlan2DBPlanVO(List<DBPlan> recordList){ List<UDBPlanVO> roleVOList = new ArrayList<UDBPlanVO>(); Map<String, Object> map = new HashMap<String, Object>(); for(DBPlan item : recordList){ roleVOList.add(new UDBPlanVO(item)); } return roleVOList; } public UDBPlanVO(Long id, Integer block, Long split, Long startTime, Long endTime, Integer number, Double money, Long goodsid) { super(); this.id = id; this.block = block; this.split = split; this.startTime = startTime; this.endTime = endTime; this.number = number; this.money = money; this.goodsid = goodsid; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getGoodsid() { return goodsid; } public void setGoodsid(Long goodsid) { this.goodsid = goodsid; } }
[ "511955993@qq.com" ]
511955993@qq.com
56139909adc11ebf6a432809c748a4660fe6e909
8d16cca111c1e73f70a870677373eb82119a08e9
/src/main/java/com/mybatis/plus/sys/entity/RoleMenu.java
38034b0c978894c59e7c11af6a2e45df46682ce9
[]
no_license
guanxiaohe2017/plus-shiro
bab7b98153018074198a59133efe5b2377d463a7
21c123bf4ecc8000c4f7a070563eeba0add31c31
refs/heads/master
2023-01-24T12:25:22.060447
2020-12-02T02:17:04
2020-12-02T02:17:04
288,133,310
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.mybatis.plus.sys.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 角色与菜单对应关系 * </p> * * @author gch * @since 2020-08-15 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_role_menu") public class RoleMenu implements Serializable { private static final long serialVersionUID=1L; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 角色ID */ private Long roleId; /** * 菜单ID */ private Long menuId; }
[ "1570608034@qq.com" ]
1570608034@qq.com
a6a0d1a98c687c5f1511eb04d87c36f89018e6f3
4be72dee04ebb3f70d6e342aeb01467e7e8b3129
/bin/ext-integration/sap/synchronousOM/sapordermgmtbol/src/de/hybris/platform/sap/sapordermgmtbol/transaction/salesdocument/backend/interf/erp/strategy/IncompletionMapper.java
abd5dc46c9c2c70e1746c5a12f23b24b853ac119
[]
no_license
lun130220/hybris
da00774767ba6246d04cdcbc49d87f0f4b0b1b26
03c074ea76779f96f2db7efcdaa0b0538d1ce917
refs/heads/master
2021-05-14T01:48:42.351698
2018-01-07T07:21:53
2018-01-07T07:21:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
/* * [y] hybris Platform * * Copyright (c) 2000-2015 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.interf.erp.strategy; import de.hybris.platform.sap.sapordermgmtbol.transaction.item.businessobject.interf.ItemList; import com.sap.conn.jco.JCoTable; /** * Handles reading of ERP incompletion log and transferring relevant messages to BOL messages */ public interface IncompletionMapper { /** * Copies the incompletion log to the table of messages which can be processed further on. * * @param incompLog * JCO Table of incompletion messages * @param messages * Standard message table * @param items * Sales document items */ void mapLogToMessage(JCoTable incompLog, JCoTable messages, ItemList items); }
[ "lun130220@gamil.com" ]
lun130220@gamil.com
afbde4ef6a6496113dfd29a1e1e9e68e01197f31
fc15c2633ac3ae21154b435de26535f149905dc4
/src/main/java/com/example/insuranceproject/controller/KaskoController.java
3cd83d5aac9f23cd9ca2021e4ddb1ed61055f273
[]
no_license
melisaBeysumengu/InsuranceProject
7d3a427316e7584391a7450816e4685b4eb0109a
42d0971fa62408facbe836efdc2ef03754b97c14
refs/heads/main
2023-08-18T21:45:07.250341
2021-10-01T14:23:23
2021-10-01T14:23:23
399,881,146
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
package com.example.insuranceproject.controller; import com.example.insuranceproject.dto.AllOffersResponseDTO; import com.example.insuranceproject.model.Kasko; import com.example.insuranceproject.model.Vehicle; import com.example.insuranceproject.service.KaskoService; import com.example.insuranceproject.service.VehicleService; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.List; @AllArgsConstructor @RestController @RequestMapping("/kasko") public class KaskoController { private final KaskoService kaskoService; @GetMapping("/") public Kasko getAll(){return kaskoService.getKaskoByCategory();} @GetMapping("/{id}") public Kasko getKaskoById(@PathVariable("id") Long id){ return kaskoService.getKaskoById(id); } @PostMapping("/") public Kasko createNewOffer(@Valid @RequestBody Kasko kasko){ return kaskoService.createNewKasko(kasko); } @GetMapping("/all") public List<AllOffersResponseDTO> getAllKaskos(){return kaskoService.gelAllKaskos();} }
[ "61505693+melisaBeysumengu@users.noreply.github.com" ]
61505693+melisaBeysumengu@users.noreply.github.com
6c4b08e4940b98c9e704f1bea757f031fee1ea8f
0d2a52f724cfffc6db9733055d765563dafde99c
/src/main/com/github/kmltml/toylang/parsing/PrefixOp.java
1e79971741d3e1a74fbfe87768a7bee25267dba6
[]
no_license
kmltml/toylang
e19b80cc833f369d410156a408c2e7dd833948f0
fe8e6be3d785740847f055072d978f3b72c84c4d
refs/heads/master
2020-04-01T01:50:37.620154
2018-10-14T20:58:21
2018-10-14T20:58:21
152,754,678
1
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package com.github.kmltml.toylang.parsing; import java.util.HashMap; import java.util.Map; /** * A prefix operator. */ public enum PrefixOp { Not("!", 9), BitNegation("~", 9), Negative("-", 6), Positive("+", 6); private final String name; private final int precedence; private static Map<String, PrefixOp> opsByName = new HashMap<>(); static { for (PrefixOp op : values()) { opsByName.put(op.name, op); } } PrefixOp(String name, int precedence) { this.name = name; this.precedence = precedence; } /** * The name of the operator, as it appears in source code. */ public String getName() { return name; } /** * The precedence of this operator, dictating at which precedence the expression following it is parsed. * Higher precedence binds more strongly. */ public int getPrecedence() { return precedence; } /** * Checks if there exists a prefix operator with given name. * @param source The name to check. * @return true, if there exists a prefix operator with given name, false otherwise. */ public static boolean isPrefixOp(String source) { return opsByName.containsKey(source); } /** * Finds a prefix operator, given its name. * @param source The name to find. * @return The prefix operator, null if it doesn't exist. */ public static PrefixOp fromSource(String source) { return opsByName.get(source); } }
[ "kamil.tomala@gmail.com" ]
kamil.tomala@gmail.com
d49c503a4024d5b8f53d2af85abe144957be9086
152e79bcb6ad7e3e0ef808acbd5ae47191cadb76
/rcljava/src/main/java/org/ros2/rcljava/node/ComposableNode.java
ba2ea48679889f87fea1991def5228bb94c7007f
[ "Apache-2.0" ]
permissive
ros2-java/ros2_java
0a000c51e49c54261af6def128adab760905a805
d0e4e952bad1977ce9818d00b520d3ad0aeafd8d
refs/heads/main
2022-09-20T10:41:43.814210
2022-04-13T20:54:15
2022-08-10T15:15:18
52,850,323
121
55
Apache-2.0
2022-10-27T15:46:22
2016-03-01T05:22:50
Java
UTF-8
Java
false
false
709
java
/* Copyright 2017-2018 Esteve Fernandez <esteve@apache.org> * * 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.ros2.rcljava.node; public interface ComposableNode { Node getNode(); }
[ "esteve@apache.org" ]
esteve@apache.org
b344537a8de44ca626dd3baee23a08f8883a40e6
08447f7b3a1ea8ecb0c26b5573d37edb25f1cfc3
/ProjetoConfeccao3fase/src/br/senai/sc/model/persistencia/FerramentaDaoJDBC.java
e16fb9492ee034f0adff698c7c8d66a2b52bfecc
[]
no_license
NathanBettiol/ProjetoConfeccao2013B
e57366e21a797b4cf209403a0f1e7ceed8a7d88c
fc0c9e3ced1ea8c04d8003bbbaf671800974ee29
refs/heads/master
2020-05-18T04:00:34.553294
2013-10-29T17:10:15
2013-10-29T17:10:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,626
java
package br.senai.sc.model.persistencia; import br.senai.sc.model.negocio.Ferramenta; import br.senai.sc.model.negocio.Pessoa; import br.senai.sc.model.negocio.Produto; import br.senai.sc.persistencia.dao.FerramentaDAO; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; public class FerramentaDaoJDBC implements FerramentaDAO{ private final String INSERT = "INSERT INTO produtos(cod_ferramenta, nome, descricao, nm_fabricante, dt_cadastro, status) values (?,?,?,?,?,?)"; private final String UPDATE = "UPDATE produtos SET cod_ferramenta = ?, nome = ?, descricao = ?, nm_fabricante = ?, dt_cadastro = ?, status = ? WHERE cod_produto = ?"; private final String DELETE = "DELETE FROM produtos WHERE cod_produto = ?"; private final String LIST = "SELECT * FROM produto"; private final String LISTBYID = "SELECT * FROM produto WHERE cod_produto = ?"; public boolean insert(Ferramenta f) { Connection conn; try { conn = ConnectionFactory.getConnection(); PreparedStatement pstm = conn.prepareStatement(INSERT); pstm.setInt(1, f.getCodFerramenta()); pstm.setString(2, f.getNome()); pstm.setString(3, f.getDescricao()); pstm.setString(4, f.getNmFabricante()); pstm.setDate(5, new java.sql.Date(f.getDtCadastro().getTime())); pstm.setString(6, f.getStatus()); pstm.execute(); JOptionPane.showMessageDialog(null, "Transação efetuada com sucesso"); ConnectionFactory.closeConnection(conn, pstm); return true; } catch (Exception e) { JOptionPane.showMessageDialog(null, "Não foi possível efetuar a transação" + e.getMessage()); return false; } } public boolean update(Ferramenta f) { Connection conn; try { conn = ConnectionFactory.getConnection(); PreparedStatement pstm = conn.prepareStatement(UPDATE); pstm.setInt(1, f.getCodFerramenta()); pstm.setString(2, f.getNome()); pstm.setString(3, f.getDescricao()); pstm.setString(4, f.getNmFabricante()); pstm.setDate(5, (Date) f.getDtCadastro()); pstm.setString(6, f.getStatus()); pstm.execute(); JOptionPane.showMessageDialog(null, "Transação efetuada com sucesso"); ConnectionFactory.closeConnection(conn, pstm); return true; } catch (Exception e) { JOptionPane.showMessageDialog(null, "Não foi possível efetuar a transação" + e.getMessage()); return false; } } public boolean delete(int codFerramenta) { Connection conn; try { conn = ConnectionFactory.getConnection(); PreparedStatement pstm = conn.prepareStatement(DELETE); pstm.setInt(1, codFerramenta); pstm.execute(); JOptionPane.showMessageDialog(null, "Transação efetuada com sucesso"); ConnectionFactory.closeConnection(conn, pstm); return true; } catch (Exception e) { JOptionPane.showMessageDialog(null, "Não foi possível efetuar a transação" + e.getMessage()); return false; } } public List<Ferramenta> listAll() { Connection conn; List<Ferramenta> ferramentas = new ArrayList<>(); try { conn = ConnectionFactory.getConnection(); PreparedStatement pstm = conn.prepareStatement(LIST); ResultSet rs = pstm.executeQuery(); while (rs.next()) { Ferramenta f = new Ferramenta(); f.setCodFerramenta(rs.getInt("cod_ferramenta")); f.setNome(rs.getString("nome")); f.setDescricao(rs.getString("descricao")); f.setNmFabricante(rs.getString("nm_fabricante")); f.setDtCadastro(rs.getDate("dt_cadastro")); f.setStatus(rs.getString("status")); ferramentas.add(f); } ConnectionFactory.closeConnection(conn, pstm); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Não foi possível efetuar a transação"); } return ferramentas; } @Override public Ferramenta listById(int codFerramenta) { Connection conn; try { conn = ConnectionFactory.getConnection(); PreparedStatement pstm = conn.prepareStatement(LISTBYID); pstm.setInt(1, codFerramenta); ResultSet rs = pstm.executeQuery(); while (rs.next()) { Ferramenta f = new Ferramenta(); f.setCodFerramenta(rs.getInt("cod_ferramenta")); f.setNome(rs.getString("nome")); f.setDescricao(rs.getString("descricao")); f.setNmFabricante(rs.getString("nm_fabricante")); f.setDtCadastro(rs.getDate("dt_cadastro")); f.setStatus(rs.getString("status")); return f; } ConnectionFactory.closeConnection(conn, pstm); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Não foi possível efetuar a transação"); } return null; } }
[ "ariane_souza@10.1.49.220" ]
ariane_souza@10.1.49.220
706bbb38153f94e5d246fe0b3734e3a8b1da7e1b
6650c402ff78f0938235e49a75f841abe582af49
/sample-common-module/sample-services/src/test/java/org/sample/services/AppTest.java
7120aaf4512721f383cc6fa2be136bb99990a014
[]
no_license
prakash31/SampleGitPractice
2dcdb721ba7f071ca525126ec42ab603ba832975
97451eb12f3df8ca81017b5b7eb47a96ea698858
refs/heads/master
2021-07-06T07:50:18.319484
2019-07-10T08:28:29
2019-07-10T08:28:29
196,145,338
0
0
null
2020-10-13T14:29:11
2019-07-10T06:29:19
Java
UTF-8
Java
false
false
685
java
package org.sample.services; 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 ); } }
[ "Prakash KS@INC00387-.Incture.local" ]
Prakash KS@INC00387-.Incture.local
40e548d3787055e9b5263f953d7f7b7f1c925d36
b5983a8de9b690ab563e59198fe07549ef82dad2
/app/src/main/java/com/wxs/scanner/utils/http/OkHttpUtils.java
a38ed2f4ae9c07cfa5ec26c42d0431fddfe6eb68
[]
no_license
zhuchao-octopus/tmgk
6914227074c936b5a2e9df486f3f1abd680f995f
4b1bfd7d9b12db81029f292f334dcb5a50881c3c
refs/heads/master
2020-09-26T11:29:45.436166
2019-12-06T04:28:56
2019-12-06T04:28:56
226,245,645
0
0
null
null
null
null
UTF-8
Java
false
false
3,791
java
package com.wxs.scanner.utils.http; import android.os.Handler; import android.os.Looper; import android.util.Log; import java.io.File; import java.io.IOException; import java.util.Map; import java.util.concurrent.TimeUnit; import okhttp3.Call; import okhttp3.Callback; import okhttp3.FormBody; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; import okio.BufferedSink; /** * Created by ztz on 2017/5/11 0011. */ public class OkHttpUtils { OkHttpClient.Builder mOkHttpClientBuilder =null; Handler mHandler=null; private OkHttpUtils() { mOkHttpClientBuilder = new OkHttpClient.Builder() .readTimeout(30, TimeUnit.SECONDS) .connectTimeout(30, TimeUnit.SECONDS) .writeTimeout(30, TimeUnit.SECONDS); mHandler = new Handler(Looper.getMainLooper()); } public static OkHttpUtils getInstance() { return Holder.okHttpUtils; } public OkHttpClient.Builder getOkHttpClientBuilder() { return mOkHttpClientBuilder; } private static class Holder { private static OkHttpUtils okHttpUtils = new OkHttpUtils(); } public void get(String url, final HttpCallBack httpCallBack) { Request request = new Request.Builder() .url(url) .get() .build(); mOkHttpClientBuilder.build().newCall(request).enqueue(new Callback() { @Override public void onFailure(final Call call, final IOException e) { mHandler.post(new Runnable() { @Override public void run() { httpCallBack.onFailure(e); } }); } @Override public void onResponse(Call call, final Response response) throws IOException { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); final String res = response.body().string(); mHandler.post(new Runnable() { @Override public void run() { httpCallBack.onSuccess(res,response); } }); } }); } public void post(String url, Map<String,String> params, final HttpCallBack httpCallBack) { FormBody.Builder builder = new FormBody.Builder(); for (Map.Entry<String, String> entry : params.entrySet()) { // Log.e("TAG","entry="+entry.getKey()+" params="+entry.getValue()); builder.add(entry.getKey(),entry.getValue().toString()); } Request request = new Request.Builder() .url(url) .post(builder.build()) .build(); mOkHttpClientBuilder.build().newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, final IOException e) { mHandler.post(new Runnable() { @Override public void run() { httpCallBack.onFailure(e); } }); } @Override public void onResponse(Call call, final Response response) throws IOException { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); final String res = response.body().string(); mHandler.post(new Runnable() { @Override public void run() { httpCallBack.onSuccess(res,response); } }); } }); } }
[ "m@1234998.cn" ]
m@1234998.cn
5846e2213083d166c2e93a88f4d9659275c33224
3e7ef835c64992576eb207bc9c876a6e42f3a745
/src/main/java/com/polaris/he/framework/dao/BrandCategoryMappingDao.java
d7d1a396f4d7c485be0bcccc4e56e8abf28c9028
[]
no_license
polarisGitHub/lipstick-cms
606209f961be476219cabb3acfc155b7bccc2edb
fa8c1c25950705ecd85dc751819d7e0ebf04e58e
refs/heads/master
2020-04-22T04:47:03.669147
2019-03-10T13:46:53
2019-03-10T13:46:53
170,135,008
0
0
null
null
null
null
UTF-8
Java
false
false
530
java
package com.polaris.he.framework.dao; import com.polaris.he.framework.dao.object.BrandCategoryMappingDO; import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; /** * User: hexie * Date: 2018-12-22 22:21 * Description: */ public interface BrandCategoryMappingDao extends Dao { /** * * @param type * @param brands * @return */ List<BrandCategoryMappingDO> getCategoryByBrands(@Param("type") String type, @Param("brands") Collection<String> brands); }
[ "polaris1478@gmail.com" ]
polaris1478@gmail.com
d4c52704b8b0d477895516d5ab5b1d3d6913bf75
0489f755baef3d4e0237b3db568fa4af8d930631
/src/main/java/com/cooksys/cuttlefern/ws/domain/location/City.java
86deb1067be6e114d93d513c08371df001650c36
[]
no_license
ValidDark/CuttleFernSpringAngularWebpack
1e858954d74f7dd6484a89affa0c0ba81d037dcc
c1c97aef2d2b723569649a9aa67ab49e37175e11
refs/heads/master
2020-04-10T22:43:43.507019
2016-09-14T21:38:07
2016-09-14T21:38:07
68,245,401
0
0
null
null
null
null
UTF-8
Java
false
false
2,034
java
package com.cooksys.cuttlefern.ws.domain.location; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import com.cooksys.cuttlefern.ws.domain.social.Group; import com.cooksys.cuttlefern.ws.domain.social.Person; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"state_id", "name"})) public class City { @Id @SequenceGenerator(name="city_id_seq", sequenceName="city_id_seq", allocationSize=1) @GeneratedValue(strategy=GenerationType.IDENTITY, generator="city_id_seq") @Column(updatable=false) private Integer id; @Column(nullable=false) private String name; @ManyToOne(optional=false, fetch=FetchType.EAGER) @JoinColumn(name="state_id") //State is not a column type. This is the column that represents a join between entity, not contains the entity private State state; @JsonIgnore @OneToMany(mappedBy="city", fetch=FetchType.LAZY) private Set<Person> people; @JsonIgnore @OneToMany(mappedBy="city", fetch=FetchType.LAZY) private Set<Group> groups; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public State getState() { return state; } public void setState(State state) { this.state = state; } public Set<Person> getPeople() { return people; } public void setPeople(Set<Person> people) { this.people = people; } public Set<Group> getGroups() { return groups; } public void setGroups(Set<Group> groups) { this.groups = groups; } }
[ "dakarl@asu.edu" ]
dakarl@asu.edu
b21e4d3ab3457aa85f7344a8368afe1b6a9c682a
dcf45db1e3f9e83a7eab154cf41f69f3042735e7
/src/main/java/com/doctor/resident/service/ResidentService.java
7220ebb564206b5bf3c6dc6adefaa4cf22488da7
[]
no_license
lizhengchao/DoctorWeb
f88ab3675621a5766388a10412f2140b8864b3fa
c39f6ab72d5c9f155eec45425e867c50025a9d55
refs/heads/master
2020-04-03T09:55:27.435632
2016-06-13T09:52:33
2016-06-13T09:52:33
60,658,430
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package com.doctor.resident.service; import com.doctor.common.Result; import com.doctor.common.Service; import com.doctor.resident.dto.ResidentDTO; import com.doctor.resident.dto.ResidentQuery; /** * Created by lzc on 2016/5/19. */ public interface ResidentService extends Service<ResidentDTO, ResidentQuery>{ public Result findWithVO(ResidentQuery residentQuery); }
[ "291769886@qq.com" ]
291769886@qq.com
7ed0b9227e00dea4507bf49c4021fa71950582f9
b4ac3798ddb38d9d9452d5bd5a99919118c3d79c
/sily-sys-web/src/main/java/com/sily/web/util/HanyuPinyinHelper.java
b9bbe469ab28efc1644529dd55785ffa45a265e0
[]
no_license
Sily-T/sily
799d9d490429b75ad83c7f2a59f6a3bd714d5196
92a54337413215b6be7d740b673376640ad47dd5
refs/heads/master
2021-09-04T11:28:18.320314
2018-01-18T08:50:33
2018-01-18T08:50:33
115,573,320
1
1
null
null
null
null
UTF-8
Java
false
false
7,381
java
package com.sily.web.util; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; /** * @Author: * @Version: V 1.0 * @Description: 中文转拼音工具类 * @Date: Created in 12:08 2018/1/10 * @Modified By: **/ public class HanyuPinyinHelper { /** * 将文字转为汉语拼音 * @param chineselanguage 要转成拼音的中文 */ public String toHanyuPinyin(String chineselanguage){ char[] cl_chars = chineselanguage.trim().toCharArray(); String hanyupinyin = ""; HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); // 输出拼音全部大写 HanyuPinyinCaseType.LOWERCASE全部小写 defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE); // 不带声调 defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); defaultFormat.setVCharType(HanyuPinyinVCharType.WITH_V) ; try { for (int i=0; i<cl_chars.length; i++){ // 如果字符是中文,则将中文转为汉语拼音 matches():告知此字符串是否匹配给定的正则表达式 if (String.valueOf(cl_chars[i]).matches("[\u4e00-\u9fa5]+")){ //PinyinHelper这个类提供了几个实用功能来将中文字符(简体和繁体)转换成各种中文罗马化表示 //toHanyuPinyinStringArray获取单个汉字(简体和繁体)所有的拼音和声调数,返回是个数组,但我们只需要拼音所以加[0],第一个参数时汉字,第二个参数是规则 hanyupinyin += PinyinHelper.toHanyuPinyinStringArray(cl_chars[i], defaultFormat)[0]; } else {// 如果字符不是中文,则不转换 hanyupinyin += cl_chars[i]; } } } catch (BadHanyuPinyinOutputFormatCombination e) { System.out.println("字符不能转成汉语拼音"); } return hanyupinyin; } public static String getFirstLettersUp(String chineselanguage){ return getFirstLetters(chineselanguage ,HanyuPinyinCaseType.UPPERCASE); } public static String getFirstLettersLo(String chineselanguage){ return getFirstLetters(chineselanguage ,HanyuPinyinCaseType.LOWERCASE); } public static String getFirstLetters(String chineselanguage,HanyuPinyinCaseType caseType) { char[] cl_chars = chineselanguage.trim().toCharArray(); String hanyupinyin = ""; HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); // 输出拼音全部大写 defaultFormat.setCaseType(caseType); // 不带声调 defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); try { for (int i = 0; i < cl_chars.length; i++) { String str = String.valueOf(cl_chars[i]); if (str.matches("[\u4e00-\u9fa5]+")) { // 如果字符是中文,则将中文转为汉语拼音,并取第一个字母 hanyupinyin += PinyinHelper.toHanyuPinyinStringArray(cl_chars[i], defaultFormat)[0].substring(0, 1); } else if (str.matches("[0-9]+")) { // 如果字符是数字,取数字 hanyupinyin += cl_chars[i]; } else if (str.matches("[a-zA-Z]+")) { // 如果字符是字母,取字母 hanyupinyin += cl_chars[i]; } else {// 否则不转换 hanyupinyin += cl_chars[i]; //如果是标点符号的话,带着 } } } catch (BadHanyuPinyinOutputFormatCombination e) { System.out.println("字符不能转成汉语拼音"); } return hanyupinyin; } public static String getPinyinString(String chineselanguage){ char[] cl_chars = chineselanguage.trim().toCharArray(); String hanyupinyin = ""; HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); // 输出拼音全部大写 defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); // 不带声调 defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); try { for (int i = 0; i < cl_chars.length; i++) { String str = String.valueOf(cl_chars[i]); if (str.matches("[\u4e00-\u9fa5]+")) { // 如果字符是中文,则将中文转为汉语拼音,并取第一个字母 hanyupinyin += PinyinHelper.toHanyuPinyinStringArray( cl_chars[i], defaultFormat)[0]; } else if (str.matches("[0-9]+")) { // 如果字符是数字,取数字 hanyupinyin += cl_chars[i]; } else if (str.matches("[a-zA-Z]+")) { // 如果字符是字母,取字母 hanyupinyin += cl_chars[i]; } else {// 否则不转换 } } } catch (BadHanyuPinyinOutputFormatCombination e) { System.out.println("字符不能转成汉语拼音"); } return hanyupinyin; } /** * 取第一个汉字的第一个字符 * @Title: getFirstLetter * @Description: TODO * @return String * @throws */ public static String getFirstLetter(String chineselanguage){ char[] cl_chars = chineselanguage.trim().toCharArray(); String hanyupinyin = ""; HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); //输出拼音全部大写 HanyuPinyinCaseType.UPPERCASE //输出拼音全部小写 HanyuPinyinCaseType.LOWERCASE defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE); // 不带声调 defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); try { String str = String.valueOf(cl_chars[0]); // 如果字符是中文,则将中文转为汉语拼音,并取第一个字母 if (str.matches("[\u4e00-\u9fa5]+")) { hanyupinyin = PinyinHelper.toHanyuPinyinStringArray( cl_chars[0], defaultFormat)[0].substring(0, 1); } else if (str.matches("[0-9]+")) { // 如果字符是数字,取数字 hanyupinyin += cl_chars[0]; } else if (str.matches("[a-zA-Z]+")) { // 如果字符是字母,取字母 hanyupinyin += cl_chars[0]; } else { // 否则不转换 } } catch (BadHanyuPinyinOutputFormatCombination e) { System.out.println("字符不能转成汉语拼音"); } return hanyupinyin; } /** * @Description: 测试 * @param args */ public static void main(String[] args) { HanyuPinyinHelper hanyuPinyinHelper = new HanyuPinyinHelper() ; System.out.println(hanyuPinyinHelper.toHanyuPinyin("广东科学技术职业学院")); } }
[ "fakam_choy@foxmail.com" ]
fakam_choy@foxmail.com
517539f4862351d24e7796d4d829f21b9304a730
d3ab8514bc056d6fab2a46fc0b7163ad9e1f6c5e
/code/No264/Solution.java
4df4488bf7f39379e587cdcae7740847a4e70dde
[]
no_license
patricklin2018/LeetCode
00a29e07f889bc415c7bfa6a3afa77619f11d56c
9594477ea3d171b606021a046589a02f43dcb101
refs/heads/master
2020-03-20T08:13:18.326533
2018-10-18T01:53:13
2018-10-18T01:53:13
137,302,268
1
0
null
null
null
null
UTF-8
Java
false
false
703
java
package No264; /** * @Author: patrick-mac * @Date: 2018/9/18 16:48 * @Description: */ public class Solution { public int nthUglyNumber(int n) { if (n < 7) { return n; } int[] ugly = new int[n]; ugly[0] = 1; int t2 = 0, t3 = 0, t5 = 0; for (int i = 1; i < n; ++i) { ugly[i] = Math.min(ugly[t2] * 2, Math.min(ugly[t3] * 3, ugly[t5] * 5)); if (ugly[i] == ugly[t2] * 2) { t2++; } if (ugly[i] == ugly[t3] * 3) { t3++; } if (ugly[i] == ugly[t5] * 5) { t5++; } } return ugly[n - 1]; } }
[ "patricklin1993@163.com" ]
patricklin1993@163.com
cf8c34186c06c074767ef61209107dfad262cf3d
9ebd102b41628539a1a80dffac575ffa2bf82faa
/app/src/main/java/com/misfits/mental/findflix/omdbApiRetrofitService/SavedLoader.java
dcbd3c3c30093ac4cbd23bb8a095a23ee3d4009c
[]
no_license
smitpatl/Findflix
577eb570b77f71ff16128cecf42d08ccb18e499c
8d369c1accb225e381242974bae9fb02afb46813
refs/heads/master
2020-07-20T22:48:27.230009
2019-09-06T06:43:37
2019-09-06T06:43:37
206,721,600
0
0
null
null
null
null
UTF-8
Java
false
false
2,396
java
package com.misfits.mental.findflix.omdbApiRetrofitService; import android.content.Context; import android.support.v4.content.AsyncTaskLoader; import android.util.Log; import java.io.IOException; import java.lang.reflect.Array; import java.util.ArrayList; /** * Created by Mahe on 7/27/2016. */ public class SavedLoader extends AsyncTaskLoader<searchService.ResultWithDetail> { private static final String LOG_TAG = "SavedLoader"; private final ArrayList mTitles; private searchService.ResultWithDetail mData; public SavedLoader(Context context, ArrayList titles) { super(context); mTitles = titles; } @Override public searchService.ResultWithDetail loadInBackground() { // get results from calling API try { searchService.ResultWithDetail resultWithDetail = new searchService.ResultWithDetail(); if(mTitles.size()>0) { for(int i = 0; i<mTitles.size();i++) { resultWithDetail.addToList(searchService.getDetail(mTitles.get(i).toString())); } } return resultWithDetail; } catch(final IOException e) { Log.e(LOG_TAG, "Error from api access", e); } return null; } @Override protected void onStartLoading() { if (mData != null) { // Deliver any previously loaded data immediately. deliverResult(mData); // makes loaderManager call onLoadFinished } else { forceLoad(); // calls the loadInBackground } } @Override protected void onReset() { Log.d(LOG_TAG, "onReset"); super.onReset(); mData = null; } @Override public void deliverResult(searchService.ResultWithDetail data) { if (isReset()) { // The Loader has been reset; ignore the result and invalidate the data. return; } // Hold a reference to the old data so it doesn't get garbage collected. // We must protect it until the new data has been delivered. searchService.ResultWithDetail oldData = mData; mData = data; if (isStarted()) { // If the Loader is in a started state, deliver the results to the // client. The superclass method does this for us. super.deliverResult(data); } } }
[ "smitpatel0510@gmail.com" ]
smitpatel0510@gmail.com
854ae9d09f699da49744ab9a684a72a224ba5d6e
0fa85a1e5b88553d09f1e77d22995fa792ae502a
/src/pbo2/pkg10118080/latihan57/vehicle/PBO210118080Latihan57Vehicle.java
596ddada2f39f8caf7726a336ed2b7cd256ade15
[]
no_license
TaufiqRizky/PBO2-10118080-Latihan57-Vehicle
fa898ded39dd3113ae1ba811e28486b150d970f8
1e776878d63907b149762c407a74661a11a99f11
refs/heads/master
2020-09-06T01:39:14.921602
2019-11-07T15:55:57
2019-11-07T15:55:57
220,275,568
0
0
null
null
null
null
UTF-8
Java
false
false
1,214
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 pbo2.pkg10118080.latihan57.vehicle; /** * * @author USER */ public class PBO210118080Latihan57Vehicle { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Bicycle b = new Bicycle(); b.setMyBrand("Trek Bike"); b.setMyModel("7.4FX"); b.setMyGearCount(23); System.out.println("Brand\t\t: "+b.getMyBrand()); System.out.println("Model\t\t: "+b.getMyModel()); System.out.println("Jumlah Gear\t: "+b.getMyGearCount()); System.out.println(""); Skateboard s = new Skateboard(); s.setMyBoardLength(54.5); s.setMyBrand("Ally Skate"); s.setMyModel("Rocket"); System.out.println("Brand\t: "+s.getMyBrand()); System.out.println("Model\t: "+s.getMyModel()); System.out.println("Panjangnya Board : "+s.getMyBoardLength()); } }
[ "" ]
185bdcbb45e941ef079bfadbb617cdc404fb9c53
25baed098f88fc0fa22d051ccc8027aa1834a52b
/src/main/java/com/ljh/controller/base/VRegPatientBdController.java
44404d3a9b35ea557343993c9c03a842286404a5
[]
no_license
woai555/ljh
a5015444082f2f39d58fb3e38260a6d61a89af9f
17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9
refs/heads/master
2022-07-11T06:52:07.620091
2022-01-05T06:51:27
2022-01-05T06:51:27
132,585,637
0
0
null
2022-06-17T03:29:19
2018-05-08T09:25:32
Java
UTF-8
Java
false
false
321
java
package com.ljh.controller.base; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; /** * <p> * 前端控制器 * </p> * * @author ljh * @since 2020-10-26 */ @Controller @RequestMapping("/vRegPatientBd") public class VRegPatientBdController { }
[ "37681193+woai555@users.noreply.github.com" ]
37681193+woai555@users.noreply.github.com