blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
list
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
list
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
45271cfb7852c7e5d471a82e717a557c934c50fa
11,905,649,355,632
43f5de2d89376699edf517b1afb59eb437b51beb
/achieveit-server/src/main/java/com/achieveit/controller/ProjectController.java
cf52f9dac4e85a4f1260cd8735e9cb4acc995a68
[]
no_license
ceej7/ProjMGT
https://github.com/ceej7/ProjMGT
a5e8fe1ae150e8dbe9720afd5c1859f06a433da1
b2efe6cd827d30c068c1205e6fae7e04d74aaa6c
refs/heads/master
2021-01-14T16:04:39.199000
2020-04-20T06:52:49
2020-04-20T06:52:49
242,672,292
1
0
null
false
2020-07-02T02:22:32
2020-02-24T07:25:06
2020-04-20T06:52:58
2020-07-02T02:22:31
56,632
1
0
2
HTML
false
false
package com.achieveit.controller; import com.achieveit.config.DateUtil; import com.achieveit.config.JwtToken; import com.achieveit.entity.ResponseMsg; import com.achieveit.service.FileService; import com.achieveit.service.MailService; import com.achieveit.service.ProjectService; import io.jsonwebtoken.Claims; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.nio.file.Path; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Map; @RestController @Api(tags = "项目接口", value="以项目为主体的请求") public class ProjectController { Logger logger = LoggerFactory.getLogger(getClass()); JwtToken jwtToken; private final ProjectService projectService; private final MailService mailService; private final FileService fileService; public ProjectController(MailService mailService, FileService fileService,ProjectService projectService, JwtToken jwtToken) { this.mailService = mailService; this.fileService = fileService; this.projectService = projectService; this.jwtToken=jwtToken; } @ResponseBody @GetMapping("/project/getByPid/{pid}") @ApiOperation("根据pid获取项目信息,pid:String(四位年份+四位客户代码+1位研发类型(D/M/S/O)+2位顺序号)") public ResponseMsg getByPid(@PathVariable() String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(pid==null||pid.length()!=11){//四位年份+四位客户代码+1位研发类型(D/M/S/O)+2位顺序号 responseMsg.setStatusAndMessage(208, "参数无效"); } else responseMsg = projectService.getById(pid); return responseMsg; } @ResponseBody @GetMapping("/project/toManage") @ApiOperation("获取工作流管理级别相关的项目(如果尼是sup/Configurer/epg_leader/qa_manager/pm则可以获取), [Authorization, Bearer [token]] 键值对验证用户的token") public ResponseMsg getToManage(@RequestHeader("Authorization") String authHeader){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(authHeader.split("Bearer").length!=2||!authHeader.split("Bearer")[0].equals("")){ msg.setStatusAndMessage(JwtToken.Illegal, "非法的token"); } else{ Claims claims = jwtToken.getClaimByToken(authHeader); if (claims == null ) { msg.setStatusAndMessage(JwtToken.Invalid, "Token无效"); } else if (JwtToken.isTokenExpired(claims.getExpiration())){ msg.setStatusAndMessage(JwtToken.Expired, "Token过期"); } else{ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getProjectToManage(userId); } } return msg; } @ResponseBody @GetMapping("/project/myProject") @ApiOperation("获取和项目成员级别自己相关的Project的具体列表,需要提供[Authorization, Bearer [token]] 键值对验证用户的token\n" + "需要提供[page:数字]和[length:数字]来表示分页位置和每页长度(Page从0开始计数)\n" + "可选提供[name:string]来filter项目名字\n" + "可选提供[status:string]来filter项目的状态,选项为[done,applying,doing],不带此参数则代表不做status的filter\n" + "返回附带page_length来表示最大页数") public ResponseMsg getMyProject(@RequestHeader("Authorization") String authHeader, @RequestParam("page") int page, @RequestParam("length") int length, @RequestParam(value = "name",required =false) String name, @RequestParam(value = "status",required =false) String status){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(authHeader.split("Bearer").length!=2||!authHeader.split("Bearer")[0].equals("")){ msg.setStatusAndMessage(JwtToken.Illegal, "非法的token"); } else{ Claims claims = jwtToken.getClaimByToken(authHeader); if (claims == null ) { msg.setStatusAndMessage(JwtToken.Invalid, "Token无效"); } else if (JwtToken.isTokenExpired(claims.getExpiration())){ msg.setStatusAndMessage(JwtToken.Expired, "Token过期"); } else if(page<0||length<0||(status!=null&&!status.equals("doing")&&!status.equals("done")&&!status.equals("applying"))){ msg.setStatusAndMessage(208, "参数错误"); } else if(name==null&&status==null){ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getPagedProjectByEid(userId,page,length); } else{ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getFilteredPagedProjectByEid(userId,page,length,name,status); } } return msg; } @ResponseBody @PostMapping("/project/new/{pm_eid}") @ApiOperation(value = "项目经理执行新建项目,同时创建工作流。", notes = "{\n" + " \"name\": \"new project\",\n" + " \"startdate\":\"2020-04-08T16:00:00.000Z\",\n" + " \"enddate\":\"2020-05-21T16:00:00.000Z\",\n" + " \"technique\": \"tech\",\n" + " \"domain\": \"domain\",\n" + " \"client\": 1,\n" + " \"configurer_eid\": 7,\n" + " \"epgleader_eid\": 5,\n" + " \"qamanager_eid\": 4\n}\n") ResponseMsg newProject(@PathVariable int pm_eid,@RequestBody Map param){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(!param.containsKey("name") ||!param.containsKey("startdate") ||!param.containsKey("enddate") ||!param.containsKey("technique") ||!param.containsKey("domain") ||!param.containsKey("client") ||!param.containsKey("configurer_eid") ||!param.containsKey("epgleader_eid") ||!param.containsKey("qamanager_eid")){ msg.setStatusAndMessage(208, "参数不足"); return msg; } String name = param.get("name").toString(); Timestamp startdate=null; Timestamp enddate = null; try{ startdate = DateUtil.fromInputUTC2Timestamp(param.get("startdate").toString()); enddate = DateUtil.fromInputUTC2Timestamp(param.get("enddate").toString()); }catch (Exception e){ logger.error(e.getMessage(),e); msg.setStatusAndMessage(210, "时间参数解析错误"); return msg; } String technique = param.get("technique").toString(); String domain = param.get("domain").toString(); int client = Integer.valueOf(param.get("client").toString()); int configurer_eid = Integer.valueOf(param.get("configurer_eid").toString()); int epgleader_eid = Integer.valueOf(param.get("epgleader_eid").toString()); int qamanager_eid = Integer.valueOf(param.get("qamanager_eid").toString()); msg = projectService.newProject(name,startdate,enddate,technique,domain,client,configurer_eid,epgleader_eid,qamanager_eid, pm_eid); return msg; } @ResponseBody @DeleteMapping("/project/member/{epid}") @ApiOperation(value = "从项目中删除某个成员,只能删除epg/rd/qa") ResponseMsg removeEmployeeProject(@PathVariable int epid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(epid<0){ responseMsg.setStatusAndMessage(208, "参数无效"); } else responseMsg = projectService.removeEmployeeProject(epid); return responseMsg; } @ResponseBody @PostMapping("/project/member/{eid}/{pid}") @ApiOperation(value = "提供员工eid和项目pid, 新增成员/或者修改成员的role,只能新增或者修改epg/rd/qa这几个角色",notes="{\"roles\":[\"qa\",\"epg\",\"rd\"]}") ResponseMsg updateEmployeeProjectAndRole(@RequestBody Map param,@PathVariable int eid, @PathVariable String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(eid<0||pid.length()!=11){ responseMsg.setStatusAndMessage(208, "参数无效"); }else if(!param.containsKey("roles")||((ArrayList<String>)param.get("roles")).size()==0){ responseMsg.setStatusAndMessage(210, "没有给足够的roles"); } else responseMsg = projectService.updateEmployeeProjectAndRole((ArrayList<String>)param.get("roles"), eid, pid); return responseMsg; } @ResponseBody @PutMapping("/project/{pid}") @ApiOperation(value="更新项目信息,只能更新name,starttime,endtime,technique,domain,function,以json键值对形式提供,可以同时提供",notes = "时间的输入格式2020-04-08T16:00:00.000Z\n" + "{\n" + "\"name\":\"doge\",\n" + "\"starttime\":\"2020-04-08T16:00:00.000Z\",\n" + "\"endtime\":\"2020-04-09T16:00:00.000Z\",\n" + "\"technique\":\"no tech\",\n" + "\"domain\":\"not again\",\n" + "\"function\":{\"000000\":\"0-1\"}\n" + "}") ResponseMsg updateProject(@RequestBody Map param, @PathVariable String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); responseMsg = projectService.updateProjectInfo(pid, param); return responseMsg; } }
UTF-8
Java
10,305
java
ProjectController.java
Java
[]
null
[]
package com.achieveit.controller; import com.achieveit.config.DateUtil; import com.achieveit.config.JwtToken; import com.achieveit.entity.ResponseMsg; import com.achieveit.service.FileService; import com.achieveit.service.MailService; import com.achieveit.service.ProjectService; import io.jsonwebtoken.Claims; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.nio.file.Path; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Map; @RestController @Api(tags = "项目接口", value="以项目为主体的请求") public class ProjectController { Logger logger = LoggerFactory.getLogger(getClass()); JwtToken jwtToken; private final ProjectService projectService; private final MailService mailService; private final FileService fileService; public ProjectController(MailService mailService, FileService fileService,ProjectService projectService, JwtToken jwtToken) { this.mailService = mailService; this.fileService = fileService; this.projectService = projectService; this.jwtToken=jwtToken; } @ResponseBody @GetMapping("/project/getByPid/{pid}") @ApiOperation("根据pid获取项目信息,pid:String(四位年份+四位客户代码+1位研发类型(D/M/S/O)+2位顺序号)") public ResponseMsg getByPid(@PathVariable() String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(pid==null||pid.length()!=11){//四位年份+四位客户代码+1位研发类型(D/M/S/O)+2位顺序号 responseMsg.setStatusAndMessage(208, "参数无效"); } else responseMsg = projectService.getById(pid); return responseMsg; } @ResponseBody @GetMapping("/project/toManage") @ApiOperation("获取工作流管理级别相关的项目(如果尼是sup/Configurer/epg_leader/qa_manager/pm则可以获取), [Authorization, Bearer [token]] 键值对验证用户的token") public ResponseMsg getToManage(@RequestHeader("Authorization") String authHeader){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(authHeader.split("Bearer").length!=2||!authHeader.split("Bearer")[0].equals("")){ msg.setStatusAndMessage(JwtToken.Illegal, "非法的token"); } else{ Claims claims = jwtToken.getClaimByToken(authHeader); if (claims == null ) { msg.setStatusAndMessage(JwtToken.Invalid, "Token无效"); } else if (JwtToken.isTokenExpired(claims.getExpiration())){ msg.setStatusAndMessage(JwtToken.Expired, "Token过期"); } else{ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getProjectToManage(userId); } } return msg; } @ResponseBody @GetMapping("/project/myProject") @ApiOperation("获取和项目成员级别自己相关的Project的具体列表,需要提供[Authorization, Bearer [token]] 键值对验证用户的token\n" + "需要提供[page:数字]和[length:数字]来表示分页位置和每页长度(Page从0开始计数)\n" + "可选提供[name:string]来filter项目名字\n" + "可选提供[status:string]来filter项目的状态,选项为[done,applying,doing],不带此参数则代表不做status的filter\n" + "返回附带page_length来表示最大页数") public ResponseMsg getMyProject(@RequestHeader("Authorization") String authHeader, @RequestParam("page") int page, @RequestParam("length") int length, @RequestParam(value = "name",required =false) String name, @RequestParam(value = "status",required =false) String status){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(authHeader.split("Bearer").length!=2||!authHeader.split("Bearer")[0].equals("")){ msg.setStatusAndMessage(JwtToken.Illegal, "非法的token"); } else{ Claims claims = jwtToken.getClaimByToken(authHeader); if (claims == null ) { msg.setStatusAndMessage(JwtToken.Invalid, "Token无效"); } else if (JwtToken.isTokenExpired(claims.getExpiration())){ msg.setStatusAndMessage(JwtToken.Expired, "Token过期"); } else if(page<0||length<0||(status!=null&&!status.equals("doing")&&!status.equals("done")&&!status.equals("applying"))){ msg.setStatusAndMessage(208, "参数错误"); } else if(name==null&&status==null){ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getPagedProjectByEid(userId,page,length); } else{ int userId = Integer.valueOf(claims.getSubject()); msg=projectService.getFilteredPagedProjectByEid(userId,page,length,name,status); } } return msg; } @ResponseBody @PostMapping("/project/new/{pm_eid}") @ApiOperation(value = "项目经理执行新建项目,同时创建工作流。", notes = "{\n" + " \"name\": \"new project\",\n" + " \"startdate\":\"2020-04-08T16:00:00.000Z\",\n" + " \"enddate\":\"2020-05-21T16:00:00.000Z\",\n" + " \"technique\": \"tech\",\n" + " \"domain\": \"domain\",\n" + " \"client\": 1,\n" + " \"configurer_eid\": 7,\n" + " \"epgleader_eid\": 5,\n" + " \"qamanager_eid\": 4\n}\n") ResponseMsg newProject(@PathVariable int pm_eid,@RequestBody Map param){ ResponseMsg msg = new ResponseMsg(); msg.setStatusAndMessage(404, "请求异常"); if(!param.containsKey("name") ||!param.containsKey("startdate") ||!param.containsKey("enddate") ||!param.containsKey("technique") ||!param.containsKey("domain") ||!param.containsKey("client") ||!param.containsKey("configurer_eid") ||!param.containsKey("epgleader_eid") ||!param.containsKey("qamanager_eid")){ msg.setStatusAndMessage(208, "参数不足"); return msg; } String name = param.get("name").toString(); Timestamp startdate=null; Timestamp enddate = null; try{ startdate = DateUtil.fromInputUTC2Timestamp(param.get("startdate").toString()); enddate = DateUtil.fromInputUTC2Timestamp(param.get("enddate").toString()); }catch (Exception e){ logger.error(e.getMessage(),e); msg.setStatusAndMessage(210, "时间参数解析错误"); return msg; } String technique = param.get("technique").toString(); String domain = param.get("domain").toString(); int client = Integer.valueOf(param.get("client").toString()); int configurer_eid = Integer.valueOf(param.get("configurer_eid").toString()); int epgleader_eid = Integer.valueOf(param.get("epgleader_eid").toString()); int qamanager_eid = Integer.valueOf(param.get("qamanager_eid").toString()); msg = projectService.newProject(name,startdate,enddate,technique,domain,client,configurer_eid,epgleader_eid,qamanager_eid, pm_eid); return msg; } @ResponseBody @DeleteMapping("/project/member/{epid}") @ApiOperation(value = "从项目中删除某个成员,只能删除epg/rd/qa") ResponseMsg removeEmployeeProject(@PathVariable int epid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(epid<0){ responseMsg.setStatusAndMessage(208, "参数无效"); } else responseMsg = projectService.removeEmployeeProject(epid); return responseMsg; } @ResponseBody @PostMapping("/project/member/{eid}/{pid}") @ApiOperation(value = "提供员工eid和项目pid, 新增成员/或者修改成员的role,只能新增或者修改epg/rd/qa这几个角色",notes="{\"roles\":[\"qa\",\"epg\",\"rd\"]}") ResponseMsg updateEmployeeProjectAndRole(@RequestBody Map param,@PathVariable int eid, @PathVariable String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); if(eid<0||pid.length()!=11){ responseMsg.setStatusAndMessage(208, "参数无效"); }else if(!param.containsKey("roles")||((ArrayList<String>)param.get("roles")).size()==0){ responseMsg.setStatusAndMessage(210, "没有给足够的roles"); } else responseMsg = projectService.updateEmployeeProjectAndRole((ArrayList<String>)param.get("roles"), eid, pid); return responseMsg; } @ResponseBody @PutMapping("/project/{pid}") @ApiOperation(value="更新项目信息,只能更新name,starttime,endtime,technique,domain,function,以json键值对形式提供,可以同时提供",notes = "时间的输入格式2020-04-08T16:00:00.000Z\n" + "{\n" + "\"name\":\"doge\",\n" + "\"starttime\":\"2020-04-08T16:00:00.000Z\",\n" + "\"endtime\":\"2020-04-09T16:00:00.000Z\",\n" + "\"technique\":\"no tech\",\n" + "\"domain\":\"not again\",\n" + "\"function\":{\"000000\":\"0-1\"}\n" + "}") ResponseMsg updateProject(@RequestBody Map param, @PathVariable String pid){ ResponseMsg responseMsg = new ResponseMsg(); responseMsg.setStatusAndMessage(404,"查询发生异常"); responseMsg = projectService.updateProjectInfo(pid, param); return responseMsg; } }
10,305
0.615836
0.598951
215
43.348839
30.585667
151
false
false
0
0
0
0
0
0
0.902326
false
false
2
d155e328754e91974a7b70d8aad5e268aa01a9ef
10,522,669,898,848
345cb6facfa982c755ffffc9df8fd8e0fb991e6b
/AutoTravian/src/com/autotravian/threading/Scheduler.java
5f050c8f17f4fe78ad5d47a8639129691abde55f
[]
no_license
headmo/heawebbot
https://github.com/headmo/heawebbot
2adb752daf87f1b3d9db333c9a17c6d43ca1d7a6
3fe1c6b2c4b30172d9be6a9577ccffffb917d18c
refs/heads/master
2016-09-06T04:45:14.383000
2010-05-11T03:14:33
2010-05-11T03:14:33
32,117,814
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.autotravian.threading; import static java.util.concurrent.TimeUnit.SECONDS; import java.util.Vector; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import com.autotravian.ui.IContentPanel; /** * Scheduler class to the send Task to queue preoidically * * @author heimo * */ public class Scheduler { private long interval; private final ScheduledExecutorService scheduler = Executors .newScheduledThreadPool(1); private ScheduledFuture<?> schedulerHandler = null; private Task t = null; private long delay = 0; public Scheduler(long interval) { this.interval = interval; t = new Task(0); } public Scheduler(long interval, Vector<IContentPanel> observerList,long sleepa,long sleepb) { this.interval = interval; t = new Task(0, observerList,sleepa,sleepb); } public void setInterval(long interval,long sleepa,long sleepb) { if(interval ==0){ interval =1; }else{ this.interval = interval; t.setSleepTime(sleepa,sleepb); } } public void setStart() { schedulerHandler = scheduler.scheduleAtFixedRate(t, 0, (interval * 60)+ (((int)Math.random()* 5+5) *60), SECONDS); } public void setStop() { if (schedulerHandler != null) { scheduler.schedule(new Runnable() { public void run() { schedulerHandler.cancel(true); } }, delay, SECONDS); } } }
UTF-8
Java
1,480
java
Scheduler.java
Java
[ { "context": "e send Task to queue preoidically\r\n * \r\n * @author heimo\r\n * \r\n */\r\npublic class Scheduler {\r\n\tprivate lon", "end": 392, "score": 0.9983956217765808, "start": 387, "tag": "USERNAME", "value": "heimo" } ]
null
[]
package com.autotravian.threading; import static java.util.concurrent.TimeUnit.SECONDS; import java.util.Vector; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import com.autotravian.ui.IContentPanel; /** * Scheduler class to the send Task to queue preoidically * * @author heimo * */ public class Scheduler { private long interval; private final ScheduledExecutorService scheduler = Executors .newScheduledThreadPool(1); private ScheduledFuture<?> schedulerHandler = null; private Task t = null; private long delay = 0; public Scheduler(long interval) { this.interval = interval; t = new Task(0); } public Scheduler(long interval, Vector<IContentPanel> observerList,long sleepa,long sleepb) { this.interval = interval; t = new Task(0, observerList,sleepa,sleepb); } public void setInterval(long interval,long sleepa,long sleepb) { if(interval ==0){ interval =1; }else{ this.interval = interval; t.setSleepTime(sleepa,sleepb); } } public void setStart() { schedulerHandler = scheduler.scheduleAtFixedRate(t, 0, (interval * 60)+ (((int)Math.random()* 5+5) *60), SECONDS); } public void setStop() { if (schedulerHandler != null) { scheduler.schedule(new Runnable() { public void run() { schedulerHandler.cancel(true); } }, delay, SECONDS); } } }
1,480
0.691216
0.682432
58
23.517241
23.232143
106
false
false
0
0
0
0
0
0
1.862069
false
false
2
fd484418fbd9cc4cbdec9d03c72fa93f89f8ec8e
27,711,129,022,612
8a83ec3882a357b46f309bb0a8cb6a9bb68d183d
/ArrayCopyOf/src/ArrayCopyOfTest.java
0cb64d93c89fd1ca2e4477fc41f65f52f77d09c2
[]
no_license
zengj8/java-demo
https://github.com/zengj8/java-demo
60ef4546b8af36d2fd3ae3f95015306fd99da267
dc230a7d98fb291f5fd73801d940c7066a5dd737
refs/heads/master
2020-03-07T04:34:19.208000
2018-03-29T09:37:01
2018-03-29T09:37:01
127,269,889
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Arrays; class Person { Person() {} Person(String name) { this.name = name; } private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } public class ArrayCopyOfTest { public static void main(String[] args) { Person[] persons = new Person[3]; for (int i = 0; i < 3; i ++) { persons[i] = new Person("name_" + i); } Person[] copyPersons = Arrays.copyOf(persons, 3); // persons[0].setName("nb"); copyPersons[0].setName("bnb"); for (int i = 0; i < 3; i ++) { System.out.println(copyPersons[i].getName()); } for (int i = 0; i < 3; i ++) { System.out.println(persons[i].getName()); } } }
UTF-8
Java
846
java
ArrayCopyOfTest.java
Java
[]
null
[]
import java.util.Arrays; class Person { Person() {} Person(String name) { this.name = name; } private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } public class ArrayCopyOfTest { public static void main(String[] args) { Person[] persons = new Person[3]; for (int i = 0; i < 3; i ++) { persons[i] = new Person("name_" + i); } Person[] copyPersons = Arrays.copyOf(persons, 3); // persons[0].setName("nb"); copyPersons[0].setName("bnb"); for (int i = 0; i < 3; i ++) { System.out.println(copyPersons[i].getName()); } for (int i = 0; i < 3; i ++) { System.out.println(persons[i].getName()); } } }
846
0.503546
0.491726
40
20.15
18.346048
57
false
false
0
0
0
0
0
0
0.475
false
false
2
35b68d5f93f9eea6d74f67c61c2c4f6b4b3b7c0c
24,739,011,643,801
f9f1bd15289b971eaebb0161db2e92536947114a
/2FindScience/src/java/Pkg2FindScience/User.java
191568fcf99463b32c8d2c1d83a86c2fc25c2e54
[]
no_license
KyohKatha/2findscience
https://github.com/KyohKatha/2findscience
5356f57c393873183308835fddef905a6e3e718c
8a65f3bcc559f250d5266899952738ab03b211c7
refs/heads/master
2021-01-10T20:04:28.442000
2010-10-14T21:24:46
2010-10-14T21:24:46
32,120,228
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Pkg2FindScience; public class User { private String login; private String password; private String name; private String email; private String page; private int profile; private int upgrade; private int numTrialUpgrade; private boolean haveSubjects; public User() { this.login = null; this.password = null; this.name = null; this.email = null; this.page = null; this.profile = -1; this.upgrade = -1; this.numTrialUpgrade = -1; } public User(String login, String password, String name, String email, String page, int profile, int upgrade, int numTrialUpgrade) { this.login = login; this.password = password; this.name = name; this.email = email; this.page = page; this.profile = profile; this.upgrade = upgrade; this.numTrialUpgrade = numTrialUpgrade; } public void setLogin(String login) { this.login = login; } public void setPassword(String password) { this.password = password; } public void setName(String name) { this.name = name; } public void setEmail(String email) { this.email = email; } public void setPage(String page) { this.page = page; } public void setProfile(int profile) { this.profile = profile; } public void setUpgrade(int upgrade) { this.upgrade = upgrade; } public void setNumTrialUpgrade(int numTrialUpgrade) { this.numTrialUpgrade = numTrialUpgrade; } public String getLogin() { return this.login; } public String getPassword() { return this.password; } public String getName() { return this.name; } public String getEmail() { return this.email; } public String getPage() { return this.page; } public int getProfile() { return this.profile; } public int getUpgrade() { return this.upgrade; } public int getNumTrialUpgrade() { return this.numTrialUpgrade; } public boolean getHaveSubjects() { return haveSubjects; } public void setHaveSubjects(boolean haveSubjects) { this.haveSubjects = haveSubjects; } }
UTF-8
Java
2,443
java
User.java
Java
[ { "context": " this.login = null;\n this.password = null;\n this.name = null;\n this.email = n", "end": 471, "score": 0.9316401481628418, "start": 467, "tag": "PASSWORD", "value": "null" }, { "context": " this.login = login;\n this.password = password;\n this.name = name;\n this.email = e", "end": 857, "score": 0.9987173080444336, "start": 849, "tag": "PASSWORD", "value": "password" }, { "context": "assword(String password) {\n this.password = password;\n }\n\n public void setName(String name) {\n ", "end": 1213, "score": 0.9953855872154236, "start": 1205, "tag": "PASSWORD", "value": "password" } ]
null
[]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Pkg2FindScience; public class User { private String login; private String password; private String name; private String email; private String page; private int profile; private int upgrade; private int numTrialUpgrade; private boolean haveSubjects; public User() { this.login = null; this.password = <PASSWORD>; this.name = null; this.email = null; this.page = null; this.profile = -1; this.upgrade = -1; this.numTrialUpgrade = -1; } public User(String login, String password, String name, String email, String page, int profile, int upgrade, int numTrialUpgrade) { this.login = login; this.password = <PASSWORD>; this.name = name; this.email = email; this.page = page; this.profile = profile; this.upgrade = upgrade; this.numTrialUpgrade = numTrialUpgrade; } public void setLogin(String login) { this.login = login; } public void setPassword(String password) { this.password = <PASSWORD>; } public void setName(String name) { this.name = name; } public void setEmail(String email) { this.email = email; } public void setPage(String page) { this.page = page; } public void setProfile(int profile) { this.profile = profile; } public void setUpgrade(int upgrade) { this.upgrade = upgrade; } public void setNumTrialUpgrade(int numTrialUpgrade) { this.numTrialUpgrade = numTrialUpgrade; } public String getLogin() { return this.login; } public String getPassword() { return this.password; } public String getName() { return this.name; } public String getEmail() { return this.email; } public String getPage() { return this.page; } public int getProfile() { return this.profile; } public int getUpgrade() { return this.upgrade; } public int getNumTrialUpgrade() { return this.numTrialUpgrade; } public boolean getHaveSubjects() { return haveSubjects; } public void setHaveSubjects(boolean haveSubjects) { this.haveSubjects = haveSubjects; } }
2,453
0.598445
0.596807
115
20.217392
17.099598
73
false
false
0
0
0
0
0
0
0.46087
false
false
2
b071f727d4d684f6e0e3259d0aaf783c5a0e7722
7,078,106,131,467
93ae4435560e0002c65118ec8dc4766f48861822
/br.urfpe.advocacia/src/Main/Main.java
7eb8a05da5c0df7965e65ec3f114adb7dd39d9a2
[]
no_license
rodrigoguedes98/sistemaAdvocacia
https://github.com/rodrigoguedes98/sistemaAdvocacia
a8e1d1e964f00036d617d10f54b284fb99f96d71
2a37abca5114638c5ca232c9dac323eca693505a
refs/heads/master
2021-01-21T22:05:18.636000
2017-06-24T00:18:01
2017-06-24T00:18:01
95,156,682
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Main; import br.ufrpe.advocacia.DAO.AdvogadoDAO; import br.urfpe.advocacia.beans.Advogado; import br.urfpe.advocacia.beans.Login; public class Main { public static void main(String args[]){ Advogado teste = new Advogado(); teste.setCpf("06502419"); teste.setNome("Lucas"); teste.setLogin(new Login("lucas","23142")); AdvogadoDAO teste1 = new AdvogadoDAO(); teste1.cadastrarAdvogado(teste); System.out.println(teste); } }
UTF-8
Java
478
java
Main.java
Java
[ { "context": ";\r\n\t\r\n\tteste.setCpf(\"06502419\");\r\n\tteste.setNome(\"Lucas\");\r\n\tteste.setLogin(new Login(\"lucas\",\"23142\"));\r", "end": 301, "score": 0.9997720718383789, "start": 296, "tag": "NAME", "value": "Lucas" }, { "context": "ste.setNome(\"Lucas\");\r\n\tteste.setLogin(new Login(\"lucas\",\"23142\"));\r\n\t\r\n\tAdvogadoDAO teste1 = new Advogad", "end": 338, "score": 0.9924771785736084, "start": 333, "tag": "USERNAME", "value": "lucas" } ]
null
[]
package Main; import br.ufrpe.advocacia.DAO.AdvogadoDAO; import br.urfpe.advocacia.beans.Advogado; import br.urfpe.advocacia.beans.Login; public class Main { public static void main(String args[]){ Advogado teste = new Advogado(); teste.setCpf("06502419"); teste.setNome("Lucas"); teste.setLogin(new Login("lucas","23142")); AdvogadoDAO teste1 = new AdvogadoDAO(); teste1.cadastrarAdvogado(teste); System.out.println(teste); } }
478
0.690377
0.658996
24
18
17.022045
44
false
false
0
0
0
0
0
0
1.25
false
false
2
b322c73117a7ef77b5e8afb88e165dc3a159783a
14,791,867,398,178
16e224f1c198e76b2ad9068157bddad33f0cb1a5
/src/com/jianzhi_offer/Dichotomy_53.java
a42c141e7c34484ad77d204be882b8ec91e6445b
[]
no_license
wangyoulang/algorithm
https://github.com/wangyoulang/algorithm
b83e5eaec151f9e113ab5f1a0b86cf8851938528
cd24c0888a4967c319b8b2ffe657a3498649edc0
refs/heads/master
2023-07-19T05:33:50.345000
2021-09-09T09:18:24
2021-09-09T09:18:24
397,053,484
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jianzhi_offer; /** * 统计一个数字在排序数组中出现的次数。 * 0 <= 数组长度 <= 50000 * */ public class Dichotomy_53 { public int search(int[] nums, int target) { int result = 0; int left = 0; int right = nums.length - 1; int mind = 0; while(left <= right){ mind = left + (right - left)/2; if(nums[mind] < target){ left = mind + 1; } if(nums[mind] >= target){ right = mind; } } while(left < nums.length && nums[left++] == target){ result ++; } return result; } }
UTF-8
Java
682
java
Dichotomy_53.java
Java
[]
null
[]
package com.jianzhi_offer; /** * 统计一个数字在排序数组中出现的次数。 * 0 <= 数组长度 <= 50000 * */ public class Dichotomy_53 { public int search(int[] nums, int target) { int result = 0; int left = 0; int right = nums.length - 1; int mind = 0; while(left <= right){ mind = left + (right - left)/2; if(nums[mind] < target){ left = mind + 1; } if(nums[mind] >= target){ right = mind; } } while(left < nums.length && nums[left++] == target){ result ++; } return result; } }
682
0.438871
0.416928
27
22.629629
14.560596
60
false
false
0
0
0
0
0
0
0.407407
false
false
2
c521acb5306e452f561a650aa41af4834d7a121d
32,581,621,934,415
0a983459d9323bc37912db99868ae28a83584888
/src/test/java/com/ttulka/ecommerce/shipping/delivery/DeliveryInfoTest.java
80d7df4ec38e8e4b7028cf2a6f52fa982c179287
[ "MIT" ]
permissive
elias-repositorio-de-estudo/ddd-example-ecommerce
https://github.com/elias-repositorio-de-estudo/ddd-example-ecommerce
c998bb8dcc8529572814ee6e53dd04e805d68829
221e409be49cc30db63abd7a216b7cb1ab293422
refs/heads/main
2023-08-25T22:28:39.239000
2021-10-29T11:47:26
2021-10-29T11:47:26
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ttulka.ecommerce.shipping.delivery; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertThrows; class DeliveryInfoTest { @Test void delivery_info_values() { DeliveryInfo deliveryInfo = new DeliveryInfo(new DeliveryId(123), new OrderId(456)); assertAll( () -> assertThat(deliveryInfo.id()).isEqualTo(new DeliveryId(123)), () -> assertThat(deliveryInfo.orderId()).isEqualTo(new OrderId(456)) ); } @Test void delivery_info_values_not_null() { assertAll( () -> assertThrows(IllegalArgumentException.class, () -> new DeliveryInfo(null, new OrderId(456))), () -> assertThrows(IllegalArgumentException.class, () -> new DeliveryInfo(new DeliveryId(123), null)) ); } }
UTF-8
Java
957
java
DeliveryInfoTest.java
Java
[]
null
[]
package com.ttulka.ecommerce.shipping.delivery; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertThrows; class DeliveryInfoTest { @Test void delivery_info_values() { DeliveryInfo deliveryInfo = new DeliveryInfo(new DeliveryId(123), new OrderId(456)); assertAll( () -> assertThat(deliveryInfo.id()).isEqualTo(new DeliveryId(123)), () -> assertThat(deliveryInfo.orderId()).isEqualTo(new OrderId(456)) ); } @Test void delivery_info_values_not_null() { assertAll( () -> assertThrows(IllegalArgumentException.class, () -> new DeliveryInfo(null, new OrderId(456))), () -> assertThrows(IllegalArgumentException.class, () -> new DeliveryInfo(new DeliveryId(123), null)) ); } }
957
0.662487
0.643678
27
34.444443
36.128716
117
false
false
0
0
0
0
0
0
0.555556
false
false
2
7dd162dca371859aa9b7635b56293d3d58820faf
7,928,509,669,805
9ed957a33f4ca9733c53d619f57b5f5d4ecc7d98
/repository/src/Readable/ORMLiteFailure/src/capstone/android/application/nalg/abstracted/AbstractSQLiteHelper.java
6d87fa2262ba19fa548ab2f1b206cd3c92887177
[]
no_license
theamazingfedex/nalg
https://github.com/theamazingfedex/nalg
77ba55f79fed289e708d1a7f1ffbfeee94a8a548
bb9b428888bbd0af6e4dfdb86dedff64d3565374
refs/heads/master
2016-08-04T07:34:34.117000
2013-12-13T08:28:09
2013-12-13T08:28:09
33,910,883
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package capstone.android.application.nalg.abstracted; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import capstone.android.application.nalg.helpers.SQLiteEventHelper; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public abstract class AbstractSQLiteHelper extends SQLiteOpenHelper { protected String DATABASE_CREATE; protected String ACTIVE_TABLE; public AbstractSQLiteHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); } public void onCreate(SQLiteDatabase database) { database.execSQL(DATABASE_CREATE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(SQLiteEventHelper.class.getName(), "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS " + ACTIVE_TABLE); onCreate(db); } }
UTF-8
Java
1,128
java
AbstractSQLiteHelper.java
Java
[]
null
[]
package capstone.android.application.nalg.abstracted; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import capstone.android.application.nalg.helpers.SQLiteEventHelper; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public abstract class AbstractSQLiteHelper extends SQLiteOpenHelper { protected String DATABASE_CREATE; protected String ACTIVE_TABLE; public AbstractSQLiteHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); } public void onCreate(SQLiteDatabase database) { database.execSQL(DATABASE_CREATE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(SQLiteEventHelper.class.getName(), "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS " + ACTIVE_TABLE); onCreate(db); } }
1,128
0.757092
0.757092
36
29.333334
24.884176
74
false
false
0
0
0
0
0
0
1.722222
false
false
2
8a21f406287d97eee60a947810506a4648012601
1,941,325,220,285
c688b4a236ea25857462c11e7a7ac25970192d8f
/src/sk/understand/advTopics/UnderstandingSuper.java
bb871c46a8eafd2217ba1210f14ae6d7ddfacc83
[]
no_license
SekharKolli/Understand_AdvanceJava
https://github.com/SekharKolli/Understand_AdvanceJava
7db8e65c3d9bacb995bfb7886716778eff63f007
a79e12e1cc0857c4f8b25b1d8256a663ca0067b9
refs/heads/master
2020-04-17T10:27:10.938000
2019-01-31T04:12:54
2019-01-31T04:12:54
166,501,748
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Purpose : To demo the usage of super keyword and this keyword. also demo a * case where if we miss the super keyword, we'll have an infinite recursion * * Date: 31-December-2018 */ package sk.understand.advTopics; class UseElectricity { boolean mainElectricSwitch; public UseElectricity() { mainElectricSwitch = true; } void reset() { System.out.println("Turned Main Switch OFF..."); mainElectricSwitch = false; System.out.println("Turned Main Switch ON..."); mainElectricSwitch = true; } } // EO SwitchBoard class Stove extends UseElectricity { boolean stoveSwitch; public Stove() { this(true); // using the 'this' to make a call to the constructor with the parameter. } public Stove(boolean stoveSwitch) { super(); // One way to use the super keyword. this calls the constructor of the super class this.stoveSwitch = stoveSwitch; } @Override void reset() { // resetting the stove requires us to reset mainElecticSwitch System.out.println("Resetting the main switch..."); // reset(); // *** Simply putting this line will generate a infinite recursion finally throwing a stack overflow exception super.reset(); // Using the super keyword to call the reset method from the super class, or else there is no way to call it System.out.println("Turning Stove Switch OFF..."); this.stoveSwitch = false; System.out.println("Turning Stove Switch ON..."); this.stoveSwitch = true; } } // EO Stove public class UnderstandingSuper { public static void main(String[] args) { Stove s = new Stove(); s.reset(); } }
UTF-8
Java
1,592
java
UnderstandingSuper.java
Java
[]
null
[]
/** * Purpose : To demo the usage of super keyword and this keyword. also demo a * case where if we miss the super keyword, we'll have an infinite recursion * * Date: 31-December-2018 */ package sk.understand.advTopics; class UseElectricity { boolean mainElectricSwitch; public UseElectricity() { mainElectricSwitch = true; } void reset() { System.out.println("Turned Main Switch OFF..."); mainElectricSwitch = false; System.out.println("Turned Main Switch ON..."); mainElectricSwitch = true; } } // EO SwitchBoard class Stove extends UseElectricity { boolean stoveSwitch; public Stove() { this(true); // using the 'this' to make a call to the constructor with the parameter. } public Stove(boolean stoveSwitch) { super(); // One way to use the super keyword. this calls the constructor of the super class this.stoveSwitch = stoveSwitch; } @Override void reset() { // resetting the stove requires us to reset mainElecticSwitch System.out.println("Resetting the main switch..."); // reset(); // *** Simply putting this line will generate a infinite recursion finally throwing a stack overflow exception super.reset(); // Using the super keyword to call the reset method from the super class, or else there is no way to call it System.out.println("Turning Stove Switch OFF..."); this.stoveSwitch = false; System.out.println("Turning Stove Switch ON..."); this.stoveSwitch = true; } } // EO Stove public class UnderstandingSuper { public static void main(String[] args) { Stove s = new Stove(); s.reset(); } }
1,592
0.705402
0.701633
64
23.875
30.159731
126
false
false
0
0
0
0
0
0
1.25
false
false
2
4295a6245fcc16818850db58d5cd365e31bcf3bd
10,737,418,241,205
5741045375dcbbafcf7288d65a11c44de2e56484
/reddit-decompilada/pl/droidsonroids/gif/GifViewSavedState.java
e03700fe65b9b1dcca7431225ccdf576b34a7cf3
[]
no_license
miarevalo10/ReporteReddit
https://github.com/miarevalo10/ReporteReddit
18dd19bcec46c42ff933bb330ba65280615c281c
a0db5538e85e9a081bf268cb1590f0eeb113ed77
refs/heads/master
2020-03-16T17:42:34.840000
2018-05-11T10:16:04
2018-05-11T10:16:04
132,843,706
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pl.droidsonroids.gif; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import android.view.View.BaseSavedState; class GifViewSavedState extends BaseSavedState { public static final Creator<GifViewSavedState> CREATOR = new C30611(); final long[][] f41196a; static class C30611 implements Creator<GifViewSavedState> { C30611() { } public final /* bridge */ /* synthetic */ Object[] newArray(int i) { return new GifViewSavedState[i]; } public final /* synthetic */ Object createFromParcel(Parcel parcel) { return new GifViewSavedState(parcel); } } GifViewSavedState(Parcelable parcelable, Drawable... drawableArr) { super(parcelable); this.f41196a = new long[2][]; for (int i = 0; i < 2; i++) { Drawable drawable = drawableArr[i]; if (drawable instanceof GifDrawable) { this.f41196a[i] = ((GifDrawable) drawable).f41153f.m43265k(); } else { this.f41196a[i] = null; } } } private GifViewSavedState(Parcel parcel) { super(parcel); this.f41196a = new long[parcel.readInt()][]; for (int i = 0; i < this.f41196a.length; i++) { this.f41196a[i] = parcel.createLongArray(); } } public void writeToParcel(Parcel parcel, int i) { super.writeToParcel(parcel, i); parcel.writeInt(this.f41196a.length); for (long[] writeLongArray : this.f41196a) { parcel.writeLongArray(writeLongArray); } } final void m43272a(Drawable drawable, int i) { if (this.f41196a[i] != null && (drawable instanceof GifDrawable)) { GifDrawable gifDrawable = (GifDrawable) drawable; gifDrawable.m43246a((long) gifDrawable.f41153f.m43252a(this.f41196a[i], gifDrawable.f41152e)); } } }
UTF-8
Java
2,006
java
GifViewSavedState.java
Java
[]
null
[]
package pl.droidsonroids.gif; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import android.view.View.BaseSavedState; class GifViewSavedState extends BaseSavedState { public static final Creator<GifViewSavedState> CREATOR = new C30611(); final long[][] f41196a; static class C30611 implements Creator<GifViewSavedState> { C30611() { } public final /* bridge */ /* synthetic */ Object[] newArray(int i) { return new GifViewSavedState[i]; } public final /* synthetic */ Object createFromParcel(Parcel parcel) { return new GifViewSavedState(parcel); } } GifViewSavedState(Parcelable parcelable, Drawable... drawableArr) { super(parcelable); this.f41196a = new long[2][]; for (int i = 0; i < 2; i++) { Drawable drawable = drawableArr[i]; if (drawable instanceof GifDrawable) { this.f41196a[i] = ((GifDrawable) drawable).f41153f.m43265k(); } else { this.f41196a[i] = null; } } } private GifViewSavedState(Parcel parcel) { super(parcel); this.f41196a = new long[parcel.readInt()][]; for (int i = 0; i < this.f41196a.length; i++) { this.f41196a[i] = parcel.createLongArray(); } } public void writeToParcel(Parcel parcel, int i) { super.writeToParcel(parcel, i); parcel.writeInt(this.f41196a.length); for (long[] writeLongArray : this.f41196a) { parcel.writeLongArray(writeLongArray); } } final void m43272a(Drawable drawable, int i) { if (this.f41196a[i] != null && (drawable instanceof GifDrawable)) { GifDrawable gifDrawable = (GifDrawable) drawable; gifDrawable.m43246a((long) gifDrawable.f41153f.m43252a(this.f41196a[i], gifDrawable.f41152e)); } } }
2,006
0.61316
0.558824
61
31.885246
26.157843
106
false
false
0
0
0
0
0
0
0.52459
false
false
2
fbe86a9ea28f0249f34640edcf3f2f91610ca644
17,729,625,021,042
76cebfcf868ea75889d7a127f82f6a94985efa00
/hmf-common/src/main/java/com/hartwig/hmftools/common/gc/GCMedianReadCount.java
60511a6fbd33ea6e4bf8abf2242753b771024667
[ "MIT" ]
permissive
j-hudecek/hmftools
https://github.com/j-hudecek/hmftools
2a45f2a13c2bd8c0364d2bd073c32c0d374d22a3
f619e02cdb166594e7dd4d7d1dd7fe8592267f2d
refs/heads/master
2020-03-31T08:20:54.511000
2018-10-08T09:39:29
2018-10-08T09:39:29
152,054,013
0
0
MIT
true
2018-10-08T09:34:13
2018-10-08T09:34:12
2018-10-08T09:15:00
2018-10-08T09:14:59
74,348
0
0
0
null
false
null
package com.hartwig.hmftools.common.gc; import org.jetbrains.annotations.NotNull; public interface GCMedianReadCount { int meanReadCount(); int medianReadCount(); int medianReadCount(@NotNull GCBucket bucket); default int medianReadCount(@NotNull GCProfile profile) { return medianReadCount(GCBucket.create(profile)); } }
UTF-8
Java
356
java
GCMedianReadCount.java
Java
[]
null
[]
package com.hartwig.hmftools.common.gc; import org.jetbrains.annotations.NotNull; public interface GCMedianReadCount { int meanReadCount(); int medianReadCount(); int medianReadCount(@NotNull GCBucket bucket); default int medianReadCount(@NotNull GCProfile profile) { return medianReadCount(GCBucket.create(profile)); } }
356
0.741573
0.741573
16
21.25
22.390009
61
false
false
0
0
0
0
0
0
0.375
false
false
2
cfe0b8bbd2e19b4d78a49258e6bc37203b77d22c
28,784,870,823,148
7379998c19561b9eb09b33ac6c1ec6617f97cade
/xiumaijia/src/main/java/org/qiling/adapter/RankItemsAdapter.java
ebe7f3d97f2acdfd1d0581017897775857b16d99
[]
no_license
h417840395/xiumaijia
https://github.com/h417840395/xiumaijia
0d538b383c32215e76c0dcd31e83f7644c09222d
bb70f6cb839c5c75eefd7914a228bb95cb2376c7
refs/heads/master
2018-01-06T19:43:26.774000
2016-10-09T07:29:46
2016-10-09T07:29:50
70,365,955
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.qiling.adapter; /** * 这个是活动的 Adapter * * */ import java.util.ArrayList; import org.qiling.bean.RankItemsBean; import org.qiling.xiumaijia.R; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; public class RankItemsAdapter extends BaseAdapter { class Holder { private EditText mTitle ; //标题 private Button mDelBtn ; //按钮 } private ArrayList<RankItemsBean> mList; private Context mContext; public RankItemsAdapter(ArrayList<RankItemsBean> list, Context context) { mList = list; mContext = context; } public void refresh(ArrayList<RankItemsBean> list) { mList = list; notifyDataSetChanged(); } @Override public int getCount() { return mList.size(); } @Override public Object getItem(int position) { return mList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { Holder holder = null; if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(mContext); convertView = inflater.inflate(R.layout.rank_items, null); holder = new Holder(); //标题 holder.mTitle = (EditText) convertView.findViewById(R.id.rank_items_title); holder.mDelBtn = (Button) convertView.findViewById(R.id.rank_items_del_btn); // 输入了文字自动保存 holder.mTitle.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { try { mList.get(position).setTitle(s.toString()); } catch (Exception e) { } } }); holder.mTitle.setText(mList.get(position ).getTitle()); holder.mDelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //UIHelper.showToast(mList.get((Integer) v.getTag()).getTitle()); //mList.remove(v.getTag()); mList.remove(position); refresh(mList); } }); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); } //设置标题 //holder.mTitle.setText(mList.get(position ).getTitle()); return convertView; } }
UTF-8
Java
2,679
java
RankItemsAdapter.java
Java
[]
null
[]
package org.qiling.adapter; /** * 这个是活动的 Adapter * * */ import java.util.ArrayList; import org.qiling.bean.RankItemsBean; import org.qiling.xiumaijia.R; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; public class RankItemsAdapter extends BaseAdapter { class Holder { private EditText mTitle ; //标题 private Button mDelBtn ; //按钮 } private ArrayList<RankItemsBean> mList; private Context mContext; public RankItemsAdapter(ArrayList<RankItemsBean> list, Context context) { mList = list; mContext = context; } public void refresh(ArrayList<RankItemsBean> list) { mList = list; notifyDataSetChanged(); } @Override public int getCount() { return mList.size(); } @Override public Object getItem(int position) { return mList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { Holder holder = null; if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(mContext); convertView = inflater.inflate(R.layout.rank_items, null); holder = new Holder(); //标题 holder.mTitle = (EditText) convertView.findViewById(R.id.rank_items_title); holder.mDelBtn = (Button) convertView.findViewById(R.id.rank_items_del_btn); // 输入了文字自动保存 holder.mTitle.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { try { mList.get(position).setTitle(s.toString()); } catch (Exception e) { } } }); holder.mTitle.setText(mList.get(position ).getTitle()); holder.mDelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //UIHelper.showToast(mList.get((Integer) v.getTag()).getTitle()); //mList.remove(v.getTag()); mList.remove(position); refresh(mList); } }); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); } //设置标题 //holder.mTitle.setText(mList.get(position ).getTitle()); return convertView; } }
2,679
0.681628
0.681628
136
18.330883
21.301773
81
false
false
0
0
0
0
0
0
2.198529
false
false
2
684136768c48a09d0598e6dbc609891a2261ce16
11,063,835,806,567
595948583114a11b3d33e94235503a3a5abf6108
/Codility/src/com/lti/iteration/PyramidExample.java
05133cb4a9508f60e7c5673a3f679ca69acd9eba
[]
no_license
zubairify/SAGrads
https://github.com/zubairify/SAGrads
eab9a9f2ec3580c5f3e956de1e1fbfe245f86d27
f18515fa91f3de36c4f9d8635c7d2a1fe1b577dd
refs/heads/master
2023-02-27T18:59:14.130000
2021-01-29T13:45:38
2021-01-29T13:45:38
325,563,457
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lti.iteration; public class PyramidExample { public static void main(String[] args) { // Logic to display 5 level pyramid of * } }
UTF-8
Java
152
java
PyramidExample.java
Java
[]
null
[]
package com.lti.iteration; public class PyramidExample { public static void main(String[] args) { // Logic to display 5 level pyramid of * } }
152
0.697368
0.690789
9
15.888889
17.316944
42
false
false
0
0
0
0
0
0
0.777778
false
false
2
2e822fa807f65b0d80f860af02e4ac03480bbe59
17,317,308,172,635
ca49001628332caa600dba42c6dd69c224c90243
/src/main/java/com/edwin/base/domain/example/BaseUserExample.java
f14b760aceb51b8d192c52cb3fb7c10286e04ee1
[]
no_license
yiqihaha/SpringbootKotlinMavenStarter
https://github.com/yiqihaha/SpringbootKotlinMavenStarter
b29f335664b10a3cb1110e6c4de3ec131816753f
ab944b72448159f96113dc8f490e4b785c70617a
refs/heads/master
2018-02-08T05:11:31.442000
2017-08-22T06:33:38
2017-08-22T06:33:38
96,409,015
0
0
null
true
2017-07-06T08:49:08
2017-07-06T08:49:08
2017-07-04T08:35:54
2017-07-05T07:03:10
30
0
0
0
null
null
null
package com.edwin.base.domain.example; import java.util.ArrayList; import java.util.Date; import java.util.List; public class BaseUserExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public BaseUserExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andLoginIsNull() { addCriterion("login is null"); return (Criteria) this; } public Criteria andLoginIsNotNull() { addCriterion("login is not null"); return (Criteria) this; } public Criteria andLoginEqualTo(String value) { addCriterion("login =", value, "login"); return (Criteria) this; } public Criteria andLoginNotEqualTo(String value) { addCriterion("login <>", value, "login"); return (Criteria) this; } public Criteria andLoginGreaterThan(String value) { addCriterion("login >", value, "login"); return (Criteria) this; } public Criteria andLoginGreaterThanOrEqualTo(String value) { addCriterion("login >=", value, "login"); return (Criteria) this; } public Criteria andLoginLessThan(String value) { addCriterion("login <", value, "login"); return (Criteria) this; } public Criteria andLoginLessThanOrEqualTo(String value) { addCriterion("login <=", value, "login"); return (Criteria) this; } public Criteria andLoginLike(String value) { addCriterion("login like", value, "login"); return (Criteria) this; } public Criteria andLoginNotLike(String value) { addCriterion("login not like", value, "login"); return (Criteria) this; } public Criteria andLoginIn(List<String> values) { addCriterion("login in", values, "login"); return (Criteria) this; } public Criteria andLoginNotIn(List<String> values) { addCriterion("login not in", values, "login"); return (Criteria) this; } public Criteria andLoginBetween(String value1, String value2) { addCriterion("login between", value1, value2, "login"); return (Criteria) this; } public Criteria andLoginNotBetween(String value1, String value2) { addCriterion("login not between", value1, value2, "login"); return (Criteria) this; } public Criteria andPasswordHashIsNull() { addCriterion("password_hash is null"); return (Criteria) this; } public Criteria andPasswordHashIsNotNull() { addCriterion("password_hash is not null"); return (Criteria) this; } public Criteria andPasswordHashEqualTo(String value) { addCriterion("password_hash =", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotEqualTo(String value) { addCriterion("password_hash <>", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashGreaterThan(String value) { addCriterion("password_hash >", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashGreaterThanOrEqualTo(String value) { addCriterion("password_hash >=", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLessThan(String value) { addCriterion("password_hash <", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLessThanOrEqualTo(String value) { addCriterion("password_hash <=", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLike(String value) { addCriterion("password_hash like", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotLike(String value) { addCriterion("password_hash not like", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashIn(List<String> values) { addCriterion("password_hash in", values, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotIn(List<String> values) { addCriterion("password_hash not in", values, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashBetween(String value1, String value2) { addCriterion("password_hash between", value1, value2, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotBetween(String value1, String value2) { addCriterion("password_hash not between", value1, value2, "passwordHash"); return (Criteria) this; } public Criteria andFirstNameIsNull() { addCriterion("first_name is null"); return (Criteria) this; } public Criteria andFirstNameIsNotNull() { addCriterion("first_name is not null"); return (Criteria) this; } public Criteria andFirstNameEqualTo(String value) { addCriterion("first_name =", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotEqualTo(String value) { addCriterion("first_name <>", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameGreaterThan(String value) { addCriterion("first_name >", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameGreaterThanOrEqualTo(String value) { addCriterion("first_name >=", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLessThan(String value) { addCriterion("first_name <", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLessThanOrEqualTo(String value) { addCriterion("first_name <=", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLike(String value) { addCriterion("first_name like", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotLike(String value) { addCriterion("first_name not like", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameIn(List<String> values) { addCriterion("first_name in", values, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotIn(List<String> values) { addCriterion("first_name not in", values, "firstName"); return (Criteria) this; } public Criteria andFirstNameBetween(String value1, String value2) { addCriterion("first_name between", value1, value2, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotBetween(String value1, String value2) { addCriterion("first_name not between", value1, value2, "firstName"); return (Criteria) this; } public Criteria andLastNameIsNull() { addCriterion("last_name is null"); return (Criteria) this; } public Criteria andLastNameIsNotNull() { addCriterion("last_name is not null"); return (Criteria) this; } public Criteria andLastNameEqualTo(String value) { addCriterion("last_name =", value, "lastName"); return (Criteria) this; } public Criteria andLastNameNotEqualTo(String value) { addCriterion("last_name <>", value, "lastName"); return (Criteria) this; } public Criteria andLastNameGreaterThan(String value) { addCriterion("last_name >", value, "lastName"); return (Criteria) this; } public Criteria andLastNameGreaterThanOrEqualTo(String value) { addCriterion("last_name >=", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLessThan(String value) { addCriterion("last_name <", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLessThanOrEqualTo(String value) { addCriterion("last_name <=", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLike(String value) { addCriterion("last_name like", value, "lastName"); return (Criteria) this; } public Criteria andLastNameNotLike(String value) { addCriterion("last_name not like", value, "lastName"); return (Criteria) this; } public Criteria andLastNameIn(List<String> values) { addCriterion("last_name in", values, "lastName"); return (Criteria) this; } public Criteria andLastNameNotIn(List<String> values) { addCriterion("last_name not in", values, "lastName"); return (Criteria) this; } public Criteria andLastNameBetween(String value1, String value2) { addCriterion("last_name between", value1, value2, "lastName"); return (Criteria) this; } public Criteria andLastNameNotBetween(String value1, String value2) { addCriterion("last_name not between", value1, value2, "lastName"); return (Criteria) this; } public Criteria andEmailIsNull() { addCriterion("email is null"); return (Criteria) this; } public Criteria andEmailIsNotNull() { addCriterion("email is not null"); return (Criteria) this; } public Criteria andEmailEqualTo(String value) { addCriterion("email =", value, "email"); return (Criteria) this; } public Criteria andEmailNotEqualTo(String value) { addCriterion("email <>", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThan(String value) { addCriterion("email >", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThanOrEqualTo(String value) { addCriterion("email >=", value, "email"); return (Criteria) this; } public Criteria andEmailLessThan(String value) { addCriterion("email <", value, "email"); return (Criteria) this; } public Criteria andEmailLessThanOrEqualTo(String value) { addCriterion("email <=", value, "email"); return (Criteria) this; } public Criteria andEmailLike(String value) { addCriterion("email like", value, "email"); return (Criteria) this; } public Criteria andEmailNotLike(String value) { addCriterion("email not like", value, "email"); return (Criteria) this; } public Criteria andEmailIn(List<String> values) { addCriterion("email in", values, "email"); return (Criteria) this; } public Criteria andEmailNotIn(List<String> values) { addCriterion("email not in", values, "email"); return (Criteria) this; } public Criteria andEmailBetween(String value1, String value2) { addCriterion("email between", value1, value2, "email"); return (Criteria) this; } public Criteria andEmailNotBetween(String value1, String value2) { addCriterion("email not between", value1, value2, "email"); return (Criteria) this; } public Criteria andImageUrlIsNull() { addCriterion("image_url is null"); return (Criteria) this; } public Criteria andImageUrlIsNotNull() { addCriterion("image_url is not null"); return (Criteria) this; } public Criteria andImageUrlEqualTo(String value) { addCriterion("image_url =", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotEqualTo(String value) { addCriterion("image_url <>", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlGreaterThan(String value) { addCriterion("image_url >", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlGreaterThanOrEqualTo(String value) { addCriterion("image_url >=", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLessThan(String value) { addCriterion("image_url <", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLessThanOrEqualTo(String value) { addCriterion("image_url <=", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLike(String value) { addCriterion("image_url like", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotLike(String value) { addCriterion("image_url not like", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlIn(List<String> values) { addCriterion("image_url in", values, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotIn(List<String> values) { addCriterion("image_url not in", values, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlBetween(String value1, String value2) { addCriterion("image_url between", value1, value2, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotBetween(String value1, String value2) { addCriterion("image_url not between", value1, value2, "imageUrl"); return (Criteria) this; } public Criteria andLangKeyIsNull() { addCriterion("lang_key is null"); return (Criteria) this; } public Criteria andLangKeyIsNotNull() { addCriterion("lang_key is not null"); return (Criteria) this; } public Criteria andLangKeyEqualTo(String value) { addCriterion("lang_key =", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotEqualTo(String value) { addCriterion("lang_key <>", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyGreaterThan(String value) { addCriterion("lang_key >", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyGreaterThanOrEqualTo(String value) { addCriterion("lang_key >=", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLessThan(String value) { addCriterion("lang_key <", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLessThanOrEqualTo(String value) { addCriterion("lang_key <=", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLike(String value) { addCriterion("lang_key like", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotLike(String value) { addCriterion("lang_key not like", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyIn(List<String> values) { addCriterion("lang_key in", values, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotIn(List<String> values) { addCriterion("lang_key not in", values, "langKey"); return (Criteria) this; } public Criteria andLangKeyBetween(String value1, String value2) { addCriterion("lang_key between", value1, value2, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotBetween(String value1, String value2) { addCriterion("lang_key not between", value1, value2, "langKey"); return (Criteria) this; } public Criteria andActivationKeyIsNull() { addCriterion("activation_key is null"); return (Criteria) this; } public Criteria andActivationKeyIsNotNull() { addCriterion("activation_key is not null"); return (Criteria) this; } public Criteria andActivationKeyEqualTo(String value) { addCriterion("activation_key =", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotEqualTo(String value) { addCriterion("activation_key <>", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyGreaterThan(String value) { addCriterion("activation_key >", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyGreaterThanOrEqualTo(String value) { addCriterion("activation_key >=", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLessThan(String value) { addCriterion("activation_key <", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLessThanOrEqualTo(String value) { addCriterion("activation_key <=", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLike(String value) { addCriterion("activation_key like", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotLike(String value) { addCriterion("activation_key not like", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyIn(List<String> values) { addCriterion("activation_key in", values, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotIn(List<String> values) { addCriterion("activation_key not in", values, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyBetween(String value1, String value2) { addCriterion("activation_key between", value1, value2, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotBetween(String value1, String value2) { addCriterion("activation_key not between", value1, value2, "activationKey"); return (Criteria) this; } public Criteria andResetKeyIsNull() { addCriterion("reset_key is null"); return (Criteria) this; } public Criteria andResetKeyIsNotNull() { addCriterion("reset_key is not null"); return (Criteria) this; } public Criteria andResetKeyEqualTo(String value) { addCriterion("reset_key =", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotEqualTo(String value) { addCriterion("reset_key <>", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyGreaterThan(String value) { addCriterion("reset_key >", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyGreaterThanOrEqualTo(String value) { addCriterion("reset_key >=", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLessThan(String value) { addCriterion("reset_key <", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLessThanOrEqualTo(String value) { addCriterion("reset_key <=", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLike(String value) { addCriterion("reset_key like", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotLike(String value) { addCriterion("reset_key not like", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyIn(List<String> values) { addCriterion("reset_key in", values, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotIn(List<String> values) { addCriterion("reset_key not in", values, "resetKey"); return (Criteria) this; } public Criteria andResetKeyBetween(String value1, String value2) { addCriterion("reset_key between", value1, value2, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotBetween(String value1, String value2) { addCriterion("reset_key not between", value1, value2, "resetKey"); return (Criteria) this; } public Criteria andCreatedByIsNull() { addCriterion("created_by is null"); return (Criteria) this; } public Criteria andCreatedByIsNotNull() { addCriterion("created_by is not null"); return (Criteria) this; } public Criteria andCreatedByEqualTo(String value) { addCriterion("created_by =", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotEqualTo(String value) { addCriterion("created_by <>", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByGreaterThan(String value) { addCriterion("created_by >", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByGreaterThanOrEqualTo(String value) { addCriterion("created_by >=", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLessThan(String value) { addCriterion("created_by <", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLessThanOrEqualTo(String value) { addCriterion("created_by <=", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLike(String value) { addCriterion("created_by like", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotLike(String value) { addCriterion("created_by not like", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByIn(List<String> values) { addCriterion("created_by in", values, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotIn(List<String> values) { addCriterion("created_by not in", values, "createdBy"); return (Criteria) this; } public Criteria andCreatedByBetween(String value1, String value2) { addCriterion("created_by between", value1, value2, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotBetween(String value1, String value2) { addCriterion("created_by not between", value1, value2, "createdBy"); return (Criteria) this; } public Criteria andCreatedDateIsNull() { addCriterion("created_date is null"); return (Criteria) this; } public Criteria andCreatedDateIsNotNull() { addCriterion("created_date is not null"); return (Criteria) this; } public Criteria andCreatedDateEqualTo(Date value) { addCriterion("created_date =", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotEqualTo(Date value) { addCriterion("created_date <>", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateGreaterThan(Date value) { addCriterion("created_date >", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateGreaterThanOrEqualTo(Date value) { addCriterion("created_date >=", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateLessThan(Date value) { addCriterion("created_date <", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateLessThanOrEqualTo(Date value) { addCriterion("created_date <=", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateIn(List<Date> values) { addCriterion("created_date in", values, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotIn(List<Date> values) { addCriterion("created_date not in", values, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateBetween(Date value1, Date value2) { addCriterion("created_date between", value1, value2, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotBetween(Date value1, Date value2) { addCriterion("created_date not between", value1, value2, "createdDate"); return (Criteria) this; } public Criteria andResetDateIsNull() { addCriterion("reset_date is null"); return (Criteria) this; } public Criteria andResetDateIsNotNull() { addCriterion("reset_date is not null"); return (Criteria) this; } public Criteria andResetDateEqualTo(Date value) { addCriterion("reset_date =", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotEqualTo(Date value) { addCriterion("reset_date <>", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateGreaterThan(Date value) { addCriterion("reset_date >", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateGreaterThanOrEqualTo(Date value) { addCriterion("reset_date >=", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateLessThan(Date value) { addCriterion("reset_date <", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateLessThanOrEqualTo(Date value) { addCriterion("reset_date <=", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateIn(List<Date> values) { addCriterion("reset_date in", values, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotIn(List<Date> values) { addCriterion("reset_date not in", values, "resetDate"); return (Criteria) this; } public Criteria andResetDateBetween(Date value1, Date value2) { addCriterion("reset_date between", value1, value2, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotBetween(Date value1, Date value2) { addCriterion("reset_date not between", value1, value2, "resetDate"); return (Criteria) this; } public Criteria andLastModifiedByIsNull() { addCriterion("last_modified_by is null"); return (Criteria) this; } public Criteria andLastModifiedByIsNotNull() { addCriterion("last_modified_by is not null"); return (Criteria) this; } public Criteria andLastModifiedByEqualTo(String value) { addCriterion("last_modified_by =", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotEqualTo(String value) { addCriterion("last_modified_by <>", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByGreaterThan(String value) { addCriterion("last_modified_by >", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByGreaterThanOrEqualTo(String value) { addCriterion("last_modified_by >=", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLessThan(String value) { addCriterion("last_modified_by <", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLessThanOrEqualTo(String value) { addCriterion("last_modified_by <=", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLike(String value) { addCriterion("last_modified_by like", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotLike(String value) { addCriterion("last_modified_by not like", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByIn(List<String> values) { addCriterion("last_modified_by in", values, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotIn(List<String> values) { addCriterion("last_modified_by not in", values, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByBetween(String value1, String value2) { addCriterion("last_modified_by between", value1, value2, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotBetween(String value1, String value2) { addCriterion("last_modified_by not between", value1, value2, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedDateIsNull() { addCriterion("last_modified_date is null"); return (Criteria) this; } public Criteria andLastModifiedDateIsNotNull() { addCriterion("last_modified_date is not null"); return (Criteria) this; } public Criteria andLastModifiedDateEqualTo(Date value) { addCriterion("last_modified_date =", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotEqualTo(Date value) { addCriterion("last_modified_date <>", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateGreaterThan(Date value) { addCriterion("last_modified_date >", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateGreaterThanOrEqualTo(Date value) { addCriterion("last_modified_date >=", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateLessThan(Date value) { addCriterion("last_modified_date <", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateLessThanOrEqualTo(Date value) { addCriterion("last_modified_date <=", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateIn(List<Date> values) { addCriterion("last_modified_date in", values, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotIn(List<Date> values) { addCriterion("last_modified_date not in", values, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateBetween(Date value1, Date value2) { addCriterion("last_modified_date between", value1, value2, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotBetween(Date value1, Date value2) { addCriterion("last_modified_date not between", value1, value2, "lastModifiedDate"); return (Criteria) this; } public Criteria andActivatedIsNull() { addCriterion("activated is null"); return (Criteria) this; } public Criteria andActivatedIsNotNull() { addCriterion("activated is not null"); return (Criteria) this; } public Criteria andActivatedEqualTo(Boolean value) { addCriterion("activated =", value, "activated"); return (Criteria) this; } public Criteria andActivatedNotEqualTo(Boolean value) { addCriterion("activated <>", value, "activated"); return (Criteria) this; } public Criteria andActivatedGreaterThan(Boolean value) { addCriterion("activated >", value, "activated"); return (Criteria) this; } public Criteria andActivatedGreaterThanOrEqualTo(Boolean value) { addCriterion("activated >=", value, "activated"); return (Criteria) this; } public Criteria andActivatedLessThan(Boolean value) { addCriterion("activated <", value, "activated"); return (Criteria) this; } public Criteria andActivatedLessThanOrEqualTo(Boolean value) { addCriterion("activated <=", value, "activated"); return (Criteria) this; } public Criteria andActivatedIn(List<Boolean> values) { addCriterion("activated in", values, "activated"); return (Criteria) this; } public Criteria andActivatedNotIn(List<Boolean> values) { addCriterion("activated not in", values, "activated"); return (Criteria) this; } public Criteria andActivatedBetween(Boolean value1, Boolean value2) { addCriterion("activated between", value1, value2, "activated"); return (Criteria) this; } public Criteria andActivatedNotBetween(Boolean value1, Boolean value2) { addCriterion("activated not between", value1, value2, "activated"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
UTF-8
Java
42,422
java
BaseUserExample.java
Java
[]
null
[]
package com.edwin.base.domain.example; import java.util.ArrayList; import java.util.Date; import java.util.List; public class BaseUserExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public BaseUserExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andLoginIsNull() { addCriterion("login is null"); return (Criteria) this; } public Criteria andLoginIsNotNull() { addCriterion("login is not null"); return (Criteria) this; } public Criteria andLoginEqualTo(String value) { addCriterion("login =", value, "login"); return (Criteria) this; } public Criteria andLoginNotEqualTo(String value) { addCriterion("login <>", value, "login"); return (Criteria) this; } public Criteria andLoginGreaterThan(String value) { addCriterion("login >", value, "login"); return (Criteria) this; } public Criteria andLoginGreaterThanOrEqualTo(String value) { addCriterion("login >=", value, "login"); return (Criteria) this; } public Criteria andLoginLessThan(String value) { addCriterion("login <", value, "login"); return (Criteria) this; } public Criteria andLoginLessThanOrEqualTo(String value) { addCriterion("login <=", value, "login"); return (Criteria) this; } public Criteria andLoginLike(String value) { addCriterion("login like", value, "login"); return (Criteria) this; } public Criteria andLoginNotLike(String value) { addCriterion("login not like", value, "login"); return (Criteria) this; } public Criteria andLoginIn(List<String> values) { addCriterion("login in", values, "login"); return (Criteria) this; } public Criteria andLoginNotIn(List<String> values) { addCriterion("login not in", values, "login"); return (Criteria) this; } public Criteria andLoginBetween(String value1, String value2) { addCriterion("login between", value1, value2, "login"); return (Criteria) this; } public Criteria andLoginNotBetween(String value1, String value2) { addCriterion("login not between", value1, value2, "login"); return (Criteria) this; } public Criteria andPasswordHashIsNull() { addCriterion("password_hash is null"); return (Criteria) this; } public Criteria andPasswordHashIsNotNull() { addCriterion("password_hash is not null"); return (Criteria) this; } public Criteria andPasswordHashEqualTo(String value) { addCriterion("password_hash =", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotEqualTo(String value) { addCriterion("password_hash <>", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashGreaterThan(String value) { addCriterion("password_hash >", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashGreaterThanOrEqualTo(String value) { addCriterion("password_hash >=", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLessThan(String value) { addCriterion("password_hash <", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLessThanOrEqualTo(String value) { addCriterion("password_hash <=", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashLike(String value) { addCriterion("password_hash like", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotLike(String value) { addCriterion("password_hash not like", value, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashIn(List<String> values) { addCriterion("password_hash in", values, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotIn(List<String> values) { addCriterion("password_hash not in", values, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashBetween(String value1, String value2) { addCriterion("password_hash between", value1, value2, "passwordHash"); return (Criteria) this; } public Criteria andPasswordHashNotBetween(String value1, String value2) { addCriterion("password_hash not between", value1, value2, "passwordHash"); return (Criteria) this; } public Criteria andFirstNameIsNull() { addCriterion("first_name is null"); return (Criteria) this; } public Criteria andFirstNameIsNotNull() { addCriterion("first_name is not null"); return (Criteria) this; } public Criteria andFirstNameEqualTo(String value) { addCriterion("first_name =", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotEqualTo(String value) { addCriterion("first_name <>", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameGreaterThan(String value) { addCriterion("first_name >", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameGreaterThanOrEqualTo(String value) { addCriterion("first_name >=", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLessThan(String value) { addCriterion("first_name <", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLessThanOrEqualTo(String value) { addCriterion("first_name <=", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameLike(String value) { addCriterion("first_name like", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotLike(String value) { addCriterion("first_name not like", value, "firstName"); return (Criteria) this; } public Criteria andFirstNameIn(List<String> values) { addCriterion("first_name in", values, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotIn(List<String> values) { addCriterion("first_name not in", values, "firstName"); return (Criteria) this; } public Criteria andFirstNameBetween(String value1, String value2) { addCriterion("first_name between", value1, value2, "firstName"); return (Criteria) this; } public Criteria andFirstNameNotBetween(String value1, String value2) { addCriterion("first_name not between", value1, value2, "firstName"); return (Criteria) this; } public Criteria andLastNameIsNull() { addCriterion("last_name is null"); return (Criteria) this; } public Criteria andLastNameIsNotNull() { addCriterion("last_name is not null"); return (Criteria) this; } public Criteria andLastNameEqualTo(String value) { addCriterion("last_name =", value, "lastName"); return (Criteria) this; } public Criteria andLastNameNotEqualTo(String value) { addCriterion("last_name <>", value, "lastName"); return (Criteria) this; } public Criteria andLastNameGreaterThan(String value) { addCriterion("last_name >", value, "lastName"); return (Criteria) this; } public Criteria andLastNameGreaterThanOrEqualTo(String value) { addCriterion("last_name >=", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLessThan(String value) { addCriterion("last_name <", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLessThanOrEqualTo(String value) { addCriterion("last_name <=", value, "lastName"); return (Criteria) this; } public Criteria andLastNameLike(String value) { addCriterion("last_name like", value, "lastName"); return (Criteria) this; } public Criteria andLastNameNotLike(String value) { addCriterion("last_name not like", value, "lastName"); return (Criteria) this; } public Criteria andLastNameIn(List<String> values) { addCriterion("last_name in", values, "lastName"); return (Criteria) this; } public Criteria andLastNameNotIn(List<String> values) { addCriterion("last_name not in", values, "lastName"); return (Criteria) this; } public Criteria andLastNameBetween(String value1, String value2) { addCriterion("last_name between", value1, value2, "lastName"); return (Criteria) this; } public Criteria andLastNameNotBetween(String value1, String value2) { addCriterion("last_name not between", value1, value2, "lastName"); return (Criteria) this; } public Criteria andEmailIsNull() { addCriterion("email is null"); return (Criteria) this; } public Criteria andEmailIsNotNull() { addCriterion("email is not null"); return (Criteria) this; } public Criteria andEmailEqualTo(String value) { addCriterion("email =", value, "email"); return (Criteria) this; } public Criteria andEmailNotEqualTo(String value) { addCriterion("email <>", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThan(String value) { addCriterion("email >", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThanOrEqualTo(String value) { addCriterion("email >=", value, "email"); return (Criteria) this; } public Criteria andEmailLessThan(String value) { addCriterion("email <", value, "email"); return (Criteria) this; } public Criteria andEmailLessThanOrEqualTo(String value) { addCriterion("email <=", value, "email"); return (Criteria) this; } public Criteria andEmailLike(String value) { addCriterion("email like", value, "email"); return (Criteria) this; } public Criteria andEmailNotLike(String value) { addCriterion("email not like", value, "email"); return (Criteria) this; } public Criteria andEmailIn(List<String> values) { addCriterion("email in", values, "email"); return (Criteria) this; } public Criteria andEmailNotIn(List<String> values) { addCriterion("email not in", values, "email"); return (Criteria) this; } public Criteria andEmailBetween(String value1, String value2) { addCriterion("email between", value1, value2, "email"); return (Criteria) this; } public Criteria andEmailNotBetween(String value1, String value2) { addCriterion("email not between", value1, value2, "email"); return (Criteria) this; } public Criteria andImageUrlIsNull() { addCriterion("image_url is null"); return (Criteria) this; } public Criteria andImageUrlIsNotNull() { addCriterion("image_url is not null"); return (Criteria) this; } public Criteria andImageUrlEqualTo(String value) { addCriterion("image_url =", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotEqualTo(String value) { addCriterion("image_url <>", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlGreaterThan(String value) { addCriterion("image_url >", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlGreaterThanOrEqualTo(String value) { addCriterion("image_url >=", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLessThan(String value) { addCriterion("image_url <", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLessThanOrEqualTo(String value) { addCriterion("image_url <=", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlLike(String value) { addCriterion("image_url like", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotLike(String value) { addCriterion("image_url not like", value, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlIn(List<String> values) { addCriterion("image_url in", values, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotIn(List<String> values) { addCriterion("image_url not in", values, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlBetween(String value1, String value2) { addCriterion("image_url between", value1, value2, "imageUrl"); return (Criteria) this; } public Criteria andImageUrlNotBetween(String value1, String value2) { addCriterion("image_url not between", value1, value2, "imageUrl"); return (Criteria) this; } public Criteria andLangKeyIsNull() { addCriterion("lang_key is null"); return (Criteria) this; } public Criteria andLangKeyIsNotNull() { addCriterion("lang_key is not null"); return (Criteria) this; } public Criteria andLangKeyEqualTo(String value) { addCriterion("lang_key =", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotEqualTo(String value) { addCriterion("lang_key <>", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyGreaterThan(String value) { addCriterion("lang_key >", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyGreaterThanOrEqualTo(String value) { addCriterion("lang_key >=", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLessThan(String value) { addCriterion("lang_key <", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLessThanOrEqualTo(String value) { addCriterion("lang_key <=", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyLike(String value) { addCriterion("lang_key like", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotLike(String value) { addCriterion("lang_key not like", value, "langKey"); return (Criteria) this; } public Criteria andLangKeyIn(List<String> values) { addCriterion("lang_key in", values, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotIn(List<String> values) { addCriterion("lang_key not in", values, "langKey"); return (Criteria) this; } public Criteria andLangKeyBetween(String value1, String value2) { addCriterion("lang_key between", value1, value2, "langKey"); return (Criteria) this; } public Criteria andLangKeyNotBetween(String value1, String value2) { addCriterion("lang_key not between", value1, value2, "langKey"); return (Criteria) this; } public Criteria andActivationKeyIsNull() { addCriterion("activation_key is null"); return (Criteria) this; } public Criteria andActivationKeyIsNotNull() { addCriterion("activation_key is not null"); return (Criteria) this; } public Criteria andActivationKeyEqualTo(String value) { addCriterion("activation_key =", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotEqualTo(String value) { addCriterion("activation_key <>", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyGreaterThan(String value) { addCriterion("activation_key >", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyGreaterThanOrEqualTo(String value) { addCriterion("activation_key >=", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLessThan(String value) { addCriterion("activation_key <", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLessThanOrEqualTo(String value) { addCriterion("activation_key <=", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyLike(String value) { addCriterion("activation_key like", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotLike(String value) { addCriterion("activation_key not like", value, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyIn(List<String> values) { addCriterion("activation_key in", values, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotIn(List<String> values) { addCriterion("activation_key not in", values, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyBetween(String value1, String value2) { addCriterion("activation_key between", value1, value2, "activationKey"); return (Criteria) this; } public Criteria andActivationKeyNotBetween(String value1, String value2) { addCriterion("activation_key not between", value1, value2, "activationKey"); return (Criteria) this; } public Criteria andResetKeyIsNull() { addCriterion("reset_key is null"); return (Criteria) this; } public Criteria andResetKeyIsNotNull() { addCriterion("reset_key is not null"); return (Criteria) this; } public Criteria andResetKeyEqualTo(String value) { addCriterion("reset_key =", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotEqualTo(String value) { addCriterion("reset_key <>", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyGreaterThan(String value) { addCriterion("reset_key >", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyGreaterThanOrEqualTo(String value) { addCriterion("reset_key >=", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLessThan(String value) { addCriterion("reset_key <", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLessThanOrEqualTo(String value) { addCriterion("reset_key <=", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyLike(String value) { addCriterion("reset_key like", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotLike(String value) { addCriterion("reset_key not like", value, "resetKey"); return (Criteria) this; } public Criteria andResetKeyIn(List<String> values) { addCriterion("reset_key in", values, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotIn(List<String> values) { addCriterion("reset_key not in", values, "resetKey"); return (Criteria) this; } public Criteria andResetKeyBetween(String value1, String value2) { addCriterion("reset_key between", value1, value2, "resetKey"); return (Criteria) this; } public Criteria andResetKeyNotBetween(String value1, String value2) { addCriterion("reset_key not between", value1, value2, "resetKey"); return (Criteria) this; } public Criteria andCreatedByIsNull() { addCriterion("created_by is null"); return (Criteria) this; } public Criteria andCreatedByIsNotNull() { addCriterion("created_by is not null"); return (Criteria) this; } public Criteria andCreatedByEqualTo(String value) { addCriterion("created_by =", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotEqualTo(String value) { addCriterion("created_by <>", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByGreaterThan(String value) { addCriterion("created_by >", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByGreaterThanOrEqualTo(String value) { addCriterion("created_by >=", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLessThan(String value) { addCriterion("created_by <", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLessThanOrEqualTo(String value) { addCriterion("created_by <=", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByLike(String value) { addCriterion("created_by like", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotLike(String value) { addCriterion("created_by not like", value, "createdBy"); return (Criteria) this; } public Criteria andCreatedByIn(List<String> values) { addCriterion("created_by in", values, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotIn(List<String> values) { addCriterion("created_by not in", values, "createdBy"); return (Criteria) this; } public Criteria andCreatedByBetween(String value1, String value2) { addCriterion("created_by between", value1, value2, "createdBy"); return (Criteria) this; } public Criteria andCreatedByNotBetween(String value1, String value2) { addCriterion("created_by not between", value1, value2, "createdBy"); return (Criteria) this; } public Criteria andCreatedDateIsNull() { addCriterion("created_date is null"); return (Criteria) this; } public Criteria andCreatedDateIsNotNull() { addCriterion("created_date is not null"); return (Criteria) this; } public Criteria andCreatedDateEqualTo(Date value) { addCriterion("created_date =", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotEqualTo(Date value) { addCriterion("created_date <>", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateGreaterThan(Date value) { addCriterion("created_date >", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateGreaterThanOrEqualTo(Date value) { addCriterion("created_date >=", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateLessThan(Date value) { addCriterion("created_date <", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateLessThanOrEqualTo(Date value) { addCriterion("created_date <=", value, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateIn(List<Date> values) { addCriterion("created_date in", values, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotIn(List<Date> values) { addCriterion("created_date not in", values, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateBetween(Date value1, Date value2) { addCriterion("created_date between", value1, value2, "createdDate"); return (Criteria) this; } public Criteria andCreatedDateNotBetween(Date value1, Date value2) { addCriterion("created_date not between", value1, value2, "createdDate"); return (Criteria) this; } public Criteria andResetDateIsNull() { addCriterion("reset_date is null"); return (Criteria) this; } public Criteria andResetDateIsNotNull() { addCriterion("reset_date is not null"); return (Criteria) this; } public Criteria andResetDateEqualTo(Date value) { addCriterion("reset_date =", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotEqualTo(Date value) { addCriterion("reset_date <>", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateGreaterThan(Date value) { addCriterion("reset_date >", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateGreaterThanOrEqualTo(Date value) { addCriterion("reset_date >=", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateLessThan(Date value) { addCriterion("reset_date <", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateLessThanOrEqualTo(Date value) { addCriterion("reset_date <=", value, "resetDate"); return (Criteria) this; } public Criteria andResetDateIn(List<Date> values) { addCriterion("reset_date in", values, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotIn(List<Date> values) { addCriterion("reset_date not in", values, "resetDate"); return (Criteria) this; } public Criteria andResetDateBetween(Date value1, Date value2) { addCriterion("reset_date between", value1, value2, "resetDate"); return (Criteria) this; } public Criteria andResetDateNotBetween(Date value1, Date value2) { addCriterion("reset_date not between", value1, value2, "resetDate"); return (Criteria) this; } public Criteria andLastModifiedByIsNull() { addCriterion("last_modified_by is null"); return (Criteria) this; } public Criteria andLastModifiedByIsNotNull() { addCriterion("last_modified_by is not null"); return (Criteria) this; } public Criteria andLastModifiedByEqualTo(String value) { addCriterion("last_modified_by =", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotEqualTo(String value) { addCriterion("last_modified_by <>", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByGreaterThan(String value) { addCriterion("last_modified_by >", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByGreaterThanOrEqualTo(String value) { addCriterion("last_modified_by >=", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLessThan(String value) { addCriterion("last_modified_by <", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLessThanOrEqualTo(String value) { addCriterion("last_modified_by <=", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByLike(String value) { addCriterion("last_modified_by like", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotLike(String value) { addCriterion("last_modified_by not like", value, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByIn(List<String> values) { addCriterion("last_modified_by in", values, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotIn(List<String> values) { addCriterion("last_modified_by not in", values, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByBetween(String value1, String value2) { addCriterion("last_modified_by between", value1, value2, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedByNotBetween(String value1, String value2) { addCriterion("last_modified_by not between", value1, value2, "lastModifiedBy"); return (Criteria) this; } public Criteria andLastModifiedDateIsNull() { addCriterion("last_modified_date is null"); return (Criteria) this; } public Criteria andLastModifiedDateIsNotNull() { addCriterion("last_modified_date is not null"); return (Criteria) this; } public Criteria andLastModifiedDateEqualTo(Date value) { addCriterion("last_modified_date =", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotEqualTo(Date value) { addCriterion("last_modified_date <>", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateGreaterThan(Date value) { addCriterion("last_modified_date >", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateGreaterThanOrEqualTo(Date value) { addCriterion("last_modified_date >=", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateLessThan(Date value) { addCriterion("last_modified_date <", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateLessThanOrEqualTo(Date value) { addCriterion("last_modified_date <=", value, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateIn(List<Date> values) { addCriterion("last_modified_date in", values, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotIn(List<Date> values) { addCriterion("last_modified_date not in", values, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateBetween(Date value1, Date value2) { addCriterion("last_modified_date between", value1, value2, "lastModifiedDate"); return (Criteria) this; } public Criteria andLastModifiedDateNotBetween(Date value1, Date value2) { addCriterion("last_modified_date not between", value1, value2, "lastModifiedDate"); return (Criteria) this; } public Criteria andActivatedIsNull() { addCriterion("activated is null"); return (Criteria) this; } public Criteria andActivatedIsNotNull() { addCriterion("activated is not null"); return (Criteria) this; } public Criteria andActivatedEqualTo(Boolean value) { addCriterion("activated =", value, "activated"); return (Criteria) this; } public Criteria andActivatedNotEqualTo(Boolean value) { addCriterion("activated <>", value, "activated"); return (Criteria) this; } public Criteria andActivatedGreaterThan(Boolean value) { addCriterion("activated >", value, "activated"); return (Criteria) this; } public Criteria andActivatedGreaterThanOrEqualTo(Boolean value) { addCriterion("activated >=", value, "activated"); return (Criteria) this; } public Criteria andActivatedLessThan(Boolean value) { addCriterion("activated <", value, "activated"); return (Criteria) this; } public Criteria andActivatedLessThanOrEqualTo(Boolean value) { addCriterion("activated <=", value, "activated"); return (Criteria) this; } public Criteria andActivatedIn(List<Boolean> values) { addCriterion("activated in", values, "activated"); return (Criteria) this; } public Criteria andActivatedNotIn(List<Boolean> values) { addCriterion("activated not in", values, "activated"); return (Criteria) this; } public Criteria andActivatedBetween(Boolean value1, Boolean value2) { addCriterion("activated between", value1, value2, "activated"); return (Criteria) this; } public Criteria andActivatedNotBetween(Boolean value1, Boolean value2) { addCriterion("activated not between", value1, value2, "activated"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
42,422
0.585239
0.582033
1,271
32.377655
26.472359
102
false
false
0
0
0
0
0
0
0.74823
false
false
2
aafdceeb5679a487092d49a10dd4d33a7d00b62a
1,640,677,515,082
1ef497fef3ca2bd5981ff2a6d3b5df32a845ce85
/jadx-decompile/com/baidu/tts/client/model/ModelFileInfo.java
9b88a8158b4c688623a07742b85891c0dc687742
[]
no_license
gmtandi/droneapp
https://github.com/gmtandi/droneapp
624eeb8a77bbb6cbe3160d79d0c9b46e827e8f4f
bfacef0ef2cc43aded3e03c012debcee868706c5
refs/heads/master
2019-07-22T10:11:35.423000
2017-06-01T00:38:41
2017-06-01T00:38:41
92,822,587
5
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.baidu.tts.client.model; import android.content.Context; import com.baidu.tts.f.g; import com.baidu.tts.tools.ResourceTools; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; public class ModelFileInfo { private String a; private String b; private String c; private String d; private String e; private String f; public void generateAbsPath(Context context) { this.e = ResourceTools.getModelFileAbsName(context, this.d); } public String getAbsPath() { return this.e; } public String getLength() { return this.b; } public String getMd5() { return this.c; } public String getName() { return this.d; } public String getServerid() { return this.a; } public String getUrl() { return this.f; } public void parseJson(JSONObject jSONObject) { this.a = jSONObject.optString(g.ID.b()); this.b = jSONObject.optString(g.LENGTH.b()); this.c = jSONObject.optString(g.MD5.b()); this.d = jSONObject.optString(g.NAME.b()); this.f = jSONObject.optString(g.URL.b()); } public void setAbsPath(String str) { this.e = str; } public void setLength(String str) { this.b = str; } public void setMap(Map<String, String> map) { if (map != null && !map.isEmpty()) { this.a = (String) map.get(g.ID.b()); this.b = (String) map.get(g.LENGTH.b()); this.c = (String) map.get(g.MD5.b()); this.d = (String) map.get(g.NAME.b()); this.e = (String) map.get(g.ABS_PATH.b()); } } public void setMd5(String str) { this.c = str; } public void setName(String str) { this.d = str; } public void setServerid(String str) { this.a = str; } public void setUrl(String str) { this.f = str; } public JSONObject toJson() { JSONObject jSONObject = new JSONObject(); try { jSONObject.putOpt(g.ID.b(), this.a); jSONObject.putOpt(g.LENGTH.b(), this.b); jSONObject.putOpt(g.MD5.b(), this.c); jSONObject.putOpt(g.NAME.b(), this.d); jSONObject.putOpt(g.ABS_PATH.b(), this.e); } catch (JSONException e) { e.printStackTrace(); } return jSONObject; } }
UTF-8
Java
2,434
java
ModelFileInfo.java
Java
[]
null
[]
package com.baidu.tts.client.model; import android.content.Context; import com.baidu.tts.f.g; import com.baidu.tts.tools.ResourceTools; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; public class ModelFileInfo { private String a; private String b; private String c; private String d; private String e; private String f; public void generateAbsPath(Context context) { this.e = ResourceTools.getModelFileAbsName(context, this.d); } public String getAbsPath() { return this.e; } public String getLength() { return this.b; } public String getMd5() { return this.c; } public String getName() { return this.d; } public String getServerid() { return this.a; } public String getUrl() { return this.f; } public void parseJson(JSONObject jSONObject) { this.a = jSONObject.optString(g.ID.b()); this.b = jSONObject.optString(g.LENGTH.b()); this.c = jSONObject.optString(g.MD5.b()); this.d = jSONObject.optString(g.NAME.b()); this.f = jSONObject.optString(g.URL.b()); } public void setAbsPath(String str) { this.e = str; } public void setLength(String str) { this.b = str; } public void setMap(Map<String, String> map) { if (map != null && !map.isEmpty()) { this.a = (String) map.get(g.ID.b()); this.b = (String) map.get(g.LENGTH.b()); this.c = (String) map.get(g.MD5.b()); this.d = (String) map.get(g.NAME.b()); this.e = (String) map.get(g.ABS_PATH.b()); } } public void setMd5(String str) { this.c = str; } public void setName(String str) { this.d = str; } public void setServerid(String str) { this.a = str; } public void setUrl(String str) { this.f = str; } public JSONObject toJson() { JSONObject jSONObject = new JSONObject(); try { jSONObject.putOpt(g.ID.b(), this.a); jSONObject.putOpt(g.LENGTH.b(), this.b); jSONObject.putOpt(g.MD5.b(), this.c); jSONObject.putOpt(g.NAME.b(), this.d); jSONObject.putOpt(g.ABS_PATH.b(), this.e); } catch (JSONException e) { e.printStackTrace(); } return jSONObject; } }
2,434
0.564092
0.562038
101
23.09901
18.589098
68
false
false
0
0
0
0
0
0
0.504951
false
false
2
da2d87a12f886937745abc5df3b05870e98dfdeb
9,775,345,574,503
40cd4da5514eb920e6a6889e82590e48720c3d38
/desktop/applis/apps/gui/gui_games/pokemongui/src/main/java/aiki/gui/listeners/MoveEvent.java
755af97c42bc89393432985c7e751644e4a3bb38
[]
no_license
Cardman/projects
https://github.com/Cardman/projects
02704237e81868f8cb614abb37468cebb4ef4b31
23a9477dd736795c3af10bccccb3cdfa10c8123c
refs/heads/master
2023-08-17T11:27:41.999000
2023-08-15T07:09:28
2023-08-15T07:09:28
34,724,613
4
0
null
false
2020-10-13T08:08:38
2015-04-28T10:39:03
2020-10-12T21:02:20
2020-10-13T08:08:37
44,842
1
0
0
Java
false
false
package aiki.gui.listeners; import aiki.gui.components.fight.Battle; import code.gui.AbsCtrlKeyState; import code.gui.AbsMouseButtons; import code.gui.AbsMouseLocation; import code.gui.events.AbsMouseListenerIntRel; public class MoveEvent implements AbsMouseListenerIntRel { private Battle battle; private String move; public MoveEvent(Battle _battle, String _move) { battle = _battle; move = _move; } @Override public void mouseReleased(AbsMouseLocation _location, AbsCtrlKeyState _keyState, AbsMouseButtons _buttons) { battle.changeMove(move); } }
UTF-8
Java
608
java
MoveEvent.java
Java
[]
null
[]
package aiki.gui.listeners; import aiki.gui.components.fight.Battle; import code.gui.AbsCtrlKeyState; import code.gui.AbsMouseButtons; import code.gui.AbsMouseLocation; import code.gui.events.AbsMouseListenerIntRel; public class MoveEvent implements AbsMouseListenerIntRel { private Battle battle; private String move; public MoveEvent(Battle _battle, String _move) { battle = _battle; move = _move; } @Override public void mouseReleased(AbsMouseLocation _location, AbsCtrlKeyState _keyState, AbsMouseButtons _buttons) { battle.changeMove(move); } }
608
0.736842
0.736842
24
24.333334
25.450388
112
false
false
0
0
0
0
0
0
0.583333
false
false
2
eff3dc2b53ba69991a34b6250131f1e2af2c458f
22,651,657,528,338
83adfc38cd85c66974ba6b1490f16192f814def8
/Java_JDBC_Student_Project/src/com/extrimityindia/app/daoimp/StudentdaoImpl.java
02fe75c9b692a36936d2bf68521d9037e05dcbe2
[]
no_license
rahulmoundekar/Core-Java
https://github.com/rahulmoundekar/Core-Java
8d4a4f31725b7a0bfa1a0b3593fa0e3d75b897cb
2373d30bc38f0d68154e29de0205d46c54c4f1e7
refs/heads/master
2021-01-10T04:53:25.779000
2016-03-29T08:52:13
2016-03-29T08:52:13
54,958,850
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.extrimityindia.app.daoimp; import com.extrimityindia.app.*; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import com.extrimityindia.app.dao.StudentDao; import com.extrimityindia.app.model.Batch; import com.extrimityindia.app.model.Course; import com.extrimityindia.app.model.Faculty; import com.extrimityindia.app.model.Student; import com.extrimityindia.app.server.Inputdata; import com.extrimityindia.app.util.*; public class StudentdaoImpl implements StudentDao { Connection con; PreparedStatement ps = null; ResultSet rs; ArrayList corslist = new ArrayList(); ArrayList faclist = new ArrayList(); ArrayList batlist = new ArrayList(); ArrayList studlist = new ArrayList(); // Inputdata i=new Inputdata(); // ===================================Course Dao // Methods============================= @Override public void insertcoursedata(Course course) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into course values(?,?)"); ps.setInt(1, course.getCorId()); ps.setString(2, course.getCor()); ps.execute(); System.out.println("Course Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public ArrayList retrievecoursedata() { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select * from course"); rs = ps.executeQuery(); while (rs.next()) { Course coss = new Course(); coss.setCorId(rs.getInt(1)); coss.setCor(rs.getString(2)); corslist.add(coss); // System.out.println("retrive coss data"+coss); } // corslist.add(coss); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return corslist; } // ................................update dao // implementatopn................................. @Override public void updatecoursedata(Course course_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE course SET coursename =? WHERE courseid=?"); ps.setInt(2, course_update.getUpdatecorid()); // System.out.println(); ps.setString(1, course_update.getUpdatecorname()); // ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletecoursedata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from course where courseid=?"); ps.setInt(1, delete); // ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchcoursedata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from course where courseid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out.println("========================="); System.out.println(" COURSE_ID\tCOURSE NAME"); System.out.println("========================="); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); System.out.println("-------------------------"); } System.out.println(" Data Searched successfully\n\n"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // ===========================Faculty dao // Methods==================================== @Override public void insertfacultydata(Faculty fac_insert) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into facultyinfo values(?,?,?)"); ps.setInt(1, fac_insert.getFid()); ps.setString(2, fac_insert.getFname()); ps.setLong(3, fac_insert.getCors().getCorId()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Faculty Data copied successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // .................................Retreive faculty // data.......................... public ArrayList retrievefacultydata() throws ClassNotFoundException { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from facultyinfo f,course c where c.courseid=f.courseid"); rs = ps.executeQuery(); while (rs.next()) { Faculty fac = new Faculty(); fac.setFid(rs.getInt(1)); fac.setFname(rs.getString(2)); Course cos = new Course(); cos.setCorId(rs.getInt(3)); cos.setCor(rs.getString(5)); fac.setCors(cos); faclist.add(fac); } } catch (SQLException e) { e.printStackTrace(); } return faclist; } @Override public void updatefacultydata(Faculty fac_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE facultyinfo SET facultyname =? WHERE facultyid=?"); ps.setInt(2, fac_update.getFid()); ps.setString(1, fac_update.getFname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data updated successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletefacultydata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from facultyinfo where facultyid=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Faculty Data Deleted successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchfacultydata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from facultyinfo where facultyid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out.println("Faculty ID\t" + "Faculty Name"); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); } System.out.println("Faculty Data Searched successfully\n\n"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void insertbatchdata(Batch bat_insert) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into batchinfo values(?,?,?)"); ps.setInt(1, bat_insert.getBid()); ps.setString(2, bat_insert.getBname()); ps.setLong(3, bat_insert.getFac().getFid()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Batch Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public ArrayList retrievebatchdata() throws ClassNotFoundException { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from batchinfo b,facultyinfo f,course c where b.facultyid=f.facultyid and f.courseid=c.courseid"); rs = ps.executeQuery(); while (rs.next()) { Batch bat = new Batch(); bat.setBid(rs.getInt(1)); bat.setBname(rs.getString(2)); Faculty fac = new Faculty(); fac.setFid(rs.getInt(4)); fac.setFname(rs.getString(5)); bat.setFac(fac); Course cos = new Course(); cos.setCorId(rs.getInt(7)); cos.setCor(rs.getString(8)); fac.setCors(cos); batlist.add(bat); } } catch (SQLException e) { e.printStackTrace(); } return batlist; } @Override public void updatebatchdata(Batch bat_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE batchinfo SET batchname =? WHERE batchid=?"); ps.setInt(2, bat_update.getBid()); ps.setString(1, bat_update.getBname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Batch Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletebatchdata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from batchinfo where batchid=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Batch Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchbatchdata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select * from batchinfo where batchid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out .println("==================================================="); System.out.println("Batch ID\t" + "Batch Name"); System.out .println("==================================================="); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); System.out .println("-----------------------------------------------"); } System.out.println("Faculty Data Searched successfully"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // //===============================Student dao // Implemetation============================= public void insertstudentdata(Student stud_insert) { // TODO Auto-generated method stub // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into studentinfo values(?,?,?,?)"); ps.setInt(1, stud_insert.getRollno()); ps.setString(2, stud_insert.getSname()); ps.setString(3, stud_insert.getScity()); ps.setLong(4, stud_insert.getBat().getBid()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Student Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void updatestudentdata(Student stud_update) { try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE studentinfo SET studentname =? WHERE studentid=?"); ps.setInt(2, stud_update.getRollno()); ps.setString(1, stud_update.getSname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Student Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletestudentdata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from studentinfo where rollno=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Student Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchstudentdata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from studentinfo where rollno=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out .println("Roll No\t" + "Student Name" + "Student Address"); while (rs.next()) { System.out.println("\t" + rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3)); } System.out.println("Student Data Searched successfully"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public ArrayList retrievestudentdata() throws ClassNotFoundException { try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from studentinfo s, batchinfo b,facultyinfo f,course c where s.batchid=b.batchid and b.facultyid=f.facultyid and c.courseid=f.courseid "); rs = ps.executeQuery(); while (rs.next()) { Student studentobj = new Student(); studentobj.setRollno(rs.getInt(1)); studentobj.setSname(rs.getString(2)); studentobj.setScity(rs.getString(3)); Batch bat = new Batch(); bat.setBid(rs.getInt(5)); bat.setBname(rs.getString(6)); studentobj.setBat(bat); Faculty fac = new Faculty(); fac.setFid(rs.getInt(8)); fac.setFname(rs.getString(9)); bat.setFac(fac); Course cos = new Course(); cos.setCorId(rs.getInt(11)); cos.setCor(rs.getString(12)); fac.setCors(cos); studlist.add(studentobj); } } catch (SQLException e) { e.printStackTrace(); } // return batlist; return studlist; // TODO Auto-generated method stub } }
UTF-8
Java
16,051
java
StudentdaoImpl.java
Java
[]
null
[]
package com.extrimityindia.app.daoimp; import com.extrimityindia.app.*; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import com.extrimityindia.app.dao.StudentDao; import com.extrimityindia.app.model.Batch; import com.extrimityindia.app.model.Course; import com.extrimityindia.app.model.Faculty; import com.extrimityindia.app.model.Student; import com.extrimityindia.app.server.Inputdata; import com.extrimityindia.app.util.*; public class StudentdaoImpl implements StudentDao { Connection con; PreparedStatement ps = null; ResultSet rs; ArrayList corslist = new ArrayList(); ArrayList faclist = new ArrayList(); ArrayList batlist = new ArrayList(); ArrayList studlist = new ArrayList(); // Inputdata i=new Inputdata(); // ===================================Course Dao // Methods============================= @Override public void insertcoursedata(Course course) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into course values(?,?)"); ps.setInt(1, course.getCorId()); ps.setString(2, course.getCor()); ps.execute(); System.out.println("Course Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public ArrayList retrievecoursedata() { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select * from course"); rs = ps.executeQuery(); while (rs.next()) { Course coss = new Course(); coss.setCorId(rs.getInt(1)); coss.setCor(rs.getString(2)); corslist.add(coss); // System.out.println("retrive coss data"+coss); } // corslist.add(coss); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return corslist; } // ................................update dao // implementatopn................................. @Override public void updatecoursedata(Course course_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE course SET coursename =? WHERE courseid=?"); ps.setInt(2, course_update.getUpdatecorid()); // System.out.println(); ps.setString(1, course_update.getUpdatecorname()); // ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletecoursedata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from course where courseid=?"); ps.setInt(1, delete); // ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchcoursedata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from course where courseid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out.println("========================="); System.out.println(" COURSE_ID\tCOURSE NAME"); System.out.println("========================="); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); System.out.println("-------------------------"); } System.out.println(" Data Searched successfully\n\n"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // ===========================Faculty dao // Methods==================================== @Override public void insertfacultydata(Faculty fac_insert) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into facultyinfo values(?,?,?)"); ps.setInt(1, fac_insert.getFid()); ps.setString(2, fac_insert.getFname()); ps.setLong(3, fac_insert.getCors().getCorId()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Faculty Data copied successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // .................................Retreive faculty // data.......................... public ArrayList retrievefacultydata() throws ClassNotFoundException { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from facultyinfo f,course c where c.courseid=f.courseid"); rs = ps.executeQuery(); while (rs.next()) { Faculty fac = new Faculty(); fac.setFid(rs.getInt(1)); fac.setFname(rs.getString(2)); Course cos = new Course(); cos.setCorId(rs.getInt(3)); cos.setCor(rs.getString(5)); fac.setCors(cos); faclist.add(fac); } } catch (SQLException e) { e.printStackTrace(); } return faclist; } @Override public void updatefacultydata(Faculty fac_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE facultyinfo SET facultyname =? WHERE facultyid=?"); ps.setInt(2, fac_update.getFid()); ps.setString(1, fac_update.getFname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Data updated successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletefacultydata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from facultyinfo where facultyid=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Faculty Data Deleted successffully\n\n"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchfacultydata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from facultyinfo where facultyid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out.println("Faculty ID\t" + "Faculty Name"); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); } System.out.println("Faculty Data Searched successfully\n\n"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void insertbatchdata(Batch bat_insert) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into batchinfo values(?,?,?)"); ps.setInt(1, bat_insert.getBid()); ps.setString(2, bat_insert.getBname()); ps.setLong(3, bat_insert.getFac().getFid()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Batch Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public ArrayList retrievebatchdata() throws ClassNotFoundException { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from batchinfo b,facultyinfo f,course c where b.facultyid=f.facultyid and f.courseid=c.courseid"); rs = ps.executeQuery(); while (rs.next()) { Batch bat = new Batch(); bat.setBid(rs.getInt(1)); bat.setBname(rs.getString(2)); Faculty fac = new Faculty(); fac.setFid(rs.getInt(4)); fac.setFname(rs.getString(5)); bat.setFac(fac); Course cos = new Course(); cos.setCorId(rs.getInt(7)); cos.setCor(rs.getString(8)); fac.setCors(cos); batlist.add(bat); } } catch (SQLException e) { e.printStackTrace(); } return batlist; } @Override public void updatebatchdata(Batch bat_update) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE batchinfo SET batchname =? WHERE batchid=?"); ps.setInt(2, bat_update.getBid()); ps.setString(1, bat_update.getBname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Batch Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletebatchdata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from batchinfo where batchid=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Batch Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchbatchdata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select * from batchinfo where batchid=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out .println("==================================================="); System.out.println("Batch ID\t" + "Batch Name"); System.out .println("==================================================="); while (rs.next()) { System.out .println("\t" + rs.getInt(1) + "\t" + rs.getString(2)); System.out .println("-----------------------------------------------"); } System.out.println("Faculty Data Searched successfully"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // //===============================Student dao // Implemetation============================= public void insertstudentdata(Student stud_insert) { // TODO Auto-generated method stub // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Insert into studentinfo values(?,?,?,?)"); ps.setInt(1, stud_insert.getRollno()); ps.setString(2, stud_insert.getSname()); ps.setString(3, stud_insert.getScity()); ps.setLong(4, stud_insert.getBat().getBid()); // ps.setString(4, fac_insert.getCors().getCor()); ps.execute(); System.out.println("Student Data copied successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void updatestudentdata(Student stud_update) { try { con = Conprovider.getConnection(); ps = con.prepareStatement("UPDATE studentinfo SET studentname =? WHERE studentid=?"); ps.setInt(2, stud_update.getRollno()); ps.setString(1, stud_update.getSname()); ps.execute(); int i = ps.executeUpdate(); System.out.println(i + " Student Data updated successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void deletestudentdata(int delete) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Delete from studentinfo where rollno=?"); ps.setInt(1, delete); int i = ps.executeUpdate(); System.out.println(i + "Student Data Deleted successffully"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void searchstudentdata(int search) { // TODO Auto-generated method stub try { con = Conprovider.getConnection(); ps = con.prepareStatement("Select* from studentinfo where rollno=?"); ps.setInt(1, search); // ps.execute(); rs = ps.executeQuery(); System.out .println("Roll No\t" + "Student Name" + "Student Address"); while (rs.next()) { System.out.println("\t" + rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3)); } System.out.println("Student Data Searched successfully"); // System.out.println(rs.); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public ArrayList retrievestudentdata() throws ClassNotFoundException { try { con = Conprovider.getConnection(); ps = con.prepareStatement("select * from studentinfo s, batchinfo b,facultyinfo f,course c where s.batchid=b.batchid and b.facultyid=f.facultyid and c.courseid=f.courseid "); rs = ps.executeQuery(); while (rs.next()) { Student studentobj = new Student(); studentobj.setRollno(rs.getInt(1)); studentobj.setSname(rs.getString(2)); studentobj.setScity(rs.getString(3)); Batch bat = new Batch(); bat.setBid(rs.getInt(5)); bat.setBname(rs.getString(6)); studentobj.setBat(bat); Faculty fac = new Faculty(); fac.setFid(rs.getInt(8)); fac.setFname(rs.getString(9)); bat.setFac(fac); Course cos = new Course(); cos.setCorId(rs.getInt(11)); cos.setCor(rs.getString(12)); fac.setCors(cos); studlist.add(studentobj); } } catch (SQLException e) { e.printStackTrace(); } // return batlist; return studlist; // TODO Auto-generated method stub } }
16,051
0.61479
0.610865
691
21.228655
21.92864
179
false
false
0
0
0
0
0
0
2.153401
false
false
2
4e3485c594c414bd8cebed52aa67d6bc683fb3ca
25,804,163,520,477
5ae087f4aa2d3fec8abbb6b4a0988d8db2164ce8
/src/main/java/com/course/online/util/CourseStatus.java
3751c3294e5b5d7cc8892b7e6da8433283d8ef54
[]
no_license
Supriya15595/Online-Course
https://github.com/Supriya15595/Online-Course
22efd4d29ffedd16c0dc2b6b25591ccc3fc97fec
f77b0ec1f622c51f841fcb08e6c9c9cc81174ea5
refs/heads/master
2020-03-27T08:35:43.940000
2018-09-17T12:05:50
2018-09-17T12:05:50
146,269,689
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.course.online.util; public enum CourseStatus { New, Active, Terminated }
UTF-8
Java
87
java
CourseStatus.java
Java
[]
null
[]
package com.course.online.util; public enum CourseStatus { New, Active, Terminated }
87
0.770115
0.770115
5
16.4
13.18484
31
false
false
0
0
0
0
0
0
0.8
false
false
2
5bbf0c37cd2b6c02df7f4008e5462dd412fe2cff
1,941,325,228,958
aa63f9cdcc02071a79322dacfc43f605c20e3392
/OOP, TASKS 4 OF 6/src/Main.java
5f13f1550ea372aa0e953f010d566a249e4b8483
[]
no_license
nomer900986/OOP
https://github.com/nomer900986/OOP
d81516fbbbb41c1754a9aec5995c22f0e3690c38
fb5d51373d563016c719c58a740f8758ed97a9c9
refs/heads/master
2023-02-04T16:30:42.492000
2020-12-22T03:53:50
2020-12-22T03:53:50
299,830,551
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { bessieMain(); splitMain(); casesMain(); overTimeMain(); bmiMain(); buggerMain(); toStarShorthandMain(); doesRhymeMain(); troubleMain(); countUniqueBooksMain(); } public static void bessieMain() { Scanner sc = new Scanner(System.in); Scanner scS = new Scanner(System.in); System.out.println("@Task 1@"); System.out.println("Enter the number of words"); int numWords = sc.nextInt(); System.out.println("Enter the number of characters"); int numChars = sc.nextInt(); System.out.println("Enter the string"); String s = scS.nextLine(); System.out.println(bessie(numWords, numChars, s)); } public static String bessie(int numWords, int numChars, String s) { String[] arrS = s.split(" "); s = ""; String resS = ""; for (int i = 0; i < numWords; i++) { if (s.length() + arrS[i].length() > numChars) { resS = resS.trim() + "\r\n" + arrS[i] + " "; s = arrS[i]; } else { resS += arrS[i] + " "; s += arrS[i]; } } return resS; } public static void splitMain(){ System.out.println(); System.out.println("@Task 2@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the string"); String s = sc.nextLine(); System.out.println(split(s)); } public static String split(String s){ String resS = ""; ArrayList<String> listS = new ArrayList<String>(); int counter = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '(') counter++; else counter--; resS += s.charAt(i); if (counter == 0) { listS.add(resS); resS = ""; } } return listS.toString(); } public static void casesMain(){ System.out.println(); System.out.println("@Task 3@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the snake_case string"); String camelS = sc.nextLine(); System.out.println("Enter the camelCase string"); String snakeS = sc.nextLine(); System.out.println("Result of function toCamelCase: " + toCamelCase(camelS)); System.out.println("Result of function toSnakeCase: " +toSnakeCase(snakeS)); } public static String toCamelCase(String camelS){ String [] arrS = camelS.split("_"); camelS = arrS[0]; for (int i = 1; i < arrS.length; i++) camelS += Character.toUpperCase(arrS[i].charAt(0)) + arrS[i].substring(1,arrS[i].length()); return camelS; } public static String toSnakeCase(String snakeS){ int prevIndex = 0; String resS = ""; for (int i = 0; i < snakeS.length(); i++){ if (Character.isUpperCase(snakeS.charAt(i))) { resS = snakeS.substring(prevIndex, i) + "_" + snakeS.charAt(i); prevIndex = i; } else resS += snakeS.charAt(i); } return resS.toLowerCase(); } public static void overTimeMain(){ System.out.println(); System.out.println("@Task 4@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the data in the line separated by a space"); String s = sc.nextLine(); System.out.println("$"+String.format("%.2f",overTime(s))); } public static double overTime(String s){ String [] arrS = s.split(" "); double [] sDouble = new double[arrS.length]; double sum = 0; for (int i = 0; i < arrS.length; i++) sDouble[i] = Double.parseDouble(arrS[i]); if (sDouble[1] <=17) sum = (sDouble[1] - sDouble[0])*sDouble[2]; else sum = (sDouble[1] - 17)*sDouble[2]*sDouble[3] + (17 - sDouble[0])*sDouble[2]; return sum; } public static void bmiMain(){ System.out.println(); System.out.println("@Task 5@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the weight"); String weight = sc.nextLine(); System.out.println("Enter the height"); String height = sc.nextLine(); System.out.println(bmi(weight, height)); } public static String bmi(String weight, String height){ double weightD = Double.parseDouble(weight.split(" ")[0]); double heightD = Double.parseDouble(height.split(" ")[0]); String res = ""; if (weight.contains("pounds")) weightD *= 0.45; if (height.contains("inches")) heightD *= 0.0254; double bmi = Math.round((weightD / (heightD * heightD)) * 10.0) / 10.0; if (bmi < 18.5) res = bmi + " Underweight"; if (bmi >= 18.5 && bmi <= 24.9) res = bmi + " Normal weight"; if (bmi > 25) res = bmi + " Overweight"; return res; } public static void buggerMain(){ System.out.println(); System.out.println("@Task 6@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the number"); int num = sc.nextInt(); System.out.println(bugger(num)); } public static int bugger(int num){ int count = 0; int number = num; while (number > 9) { int chnum = 1; while (number > 0) { chnum *= number % 10; number /= 10; } number = chnum; count++; } return count; } public static void toStarShorthandMain(){ System.out.println(); System.out.println("@Task 7@"); Scanner in = new Scanner(System.in); System.out.println("Enter the string"); // Ввод s String s = in.nextLine(); System.out.println(toStarShorthand(s)); } public static String toStarShorthand(String s){ String res_s = ""; int counter = 0; s += "0"; while (counter + 1 != s.length()){ int count = 1; for (int j = counter + 1; j<s.length(); j++){ if (s.charAt(counter) == s.charAt(j)){ count++; if (s.charAt(j+1) != '0') { if (s.charAt(j) != s.charAt(j + 1)) { res_s += s.charAt(counter) + "*" + count; counter += count; break; } } else { res_s += s.charAt(counter) + "*" + count; counter += count; break; } } else { res_s += s.charAt(counter); counter++; break; } } } return res_s; } public static void doesRhymeMain(){ System.out.println(); System.out.println("@Task 8@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the first string"); String s1 = sc.nextLine(); System.out.println("Enter the second string"); String s2 = sc.nextLine(); System.out.println(doesRhyme(s1,s2)); } public static boolean doesRhyme(String s1, String s2){ s1 = s1.substring(s1.lastIndexOf(" ") + 1).toLowerCase(); s2 = s2.substring(s2.lastIndexOf(" ") + 1).toLowerCase(); String let = "aeiouy"; String res1 = "", res2 = ""; for (int i = 0; i < s1.length(); i++) { if (let.indexOf(s1.charAt(i)) != -1) res1 += s1.charAt(i); } for (int i = 0; i < s2.length(); i++) { if (let.indexOf(s2.charAt(i)) != -1) res2 += s2.charAt(i); } return res1.equals(res2); } public static void troubleMain(){ System.out.println(); System.out.println("@Task 9@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the first number"); String num1 = sc.nextLine(); System.out.println("Enter the second number"); String num2 = sc.nextLine(); System.out.println(trouble(num1,num2)); } public static boolean trouble(String num1, String num2){ int num = 0; for (int i = 2; i < num1.length(); i++) { if (num1.charAt(i) == num1.charAt(i - 1) && num1.charAt(i) == num1.charAt(i - 2)) num = num1.charAt(i); } for (int i = 0; i < num2.length(); i++) { if (num2.charAt(i) == num && num2.charAt(i + 1) == num) return true; } return false; } public static void countUniqueBooksMain(){ System.out.println(); System.out.println("@Task 10@"); Scanner in = new Scanner(System.in); System.out.println("Enter the stringSequence"); // Ввод s String s = in.nextLine(); System.out.println(); System.out.println("Enter the bookEnd"); // Ввод s String ch = in.nextLine(); System.out.println(); System.out.println(countUniqueBooks(s,ch)); } public static int countUniqueBooks(String s, String ch){ String new_s = ""; int counter = 0; int index = 0; for (int i = 0; i<s.length(); i++) if (s.charAt(i) == ch.charAt(0)) counter++; for (int i = 0; i<counter/2; i++) { index = s.indexOf(ch, index); int nextIndex = s.indexOf(ch, index + 1); new_s += s.substring(index+1, nextIndex); index = s.indexOf(ch, nextIndex + 1); } counter = 0; boolean[] isItThere = new boolean[Character.MAX_VALUE]; for (int i = 0; i < new_s.length(); i++) { isItThere[new_s.charAt(i)] = true; } for (int i = 0; i < isItThere.length; i++) { if (isItThere[i]){ counter++; } } return counter; } }
UTF-8
Java
10,485
java
Main.java
Java
[]
null
[]
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { bessieMain(); splitMain(); casesMain(); overTimeMain(); bmiMain(); buggerMain(); toStarShorthandMain(); doesRhymeMain(); troubleMain(); countUniqueBooksMain(); } public static void bessieMain() { Scanner sc = new Scanner(System.in); Scanner scS = new Scanner(System.in); System.out.println("@Task 1@"); System.out.println("Enter the number of words"); int numWords = sc.nextInt(); System.out.println("Enter the number of characters"); int numChars = sc.nextInt(); System.out.println("Enter the string"); String s = scS.nextLine(); System.out.println(bessie(numWords, numChars, s)); } public static String bessie(int numWords, int numChars, String s) { String[] arrS = s.split(" "); s = ""; String resS = ""; for (int i = 0; i < numWords; i++) { if (s.length() + arrS[i].length() > numChars) { resS = resS.trim() + "\r\n" + arrS[i] + " "; s = arrS[i]; } else { resS += arrS[i] + " "; s += arrS[i]; } } return resS; } public static void splitMain(){ System.out.println(); System.out.println("@Task 2@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the string"); String s = sc.nextLine(); System.out.println(split(s)); } public static String split(String s){ String resS = ""; ArrayList<String> listS = new ArrayList<String>(); int counter = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '(') counter++; else counter--; resS += s.charAt(i); if (counter == 0) { listS.add(resS); resS = ""; } } return listS.toString(); } public static void casesMain(){ System.out.println(); System.out.println("@Task 3@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the snake_case string"); String camelS = sc.nextLine(); System.out.println("Enter the camelCase string"); String snakeS = sc.nextLine(); System.out.println("Result of function toCamelCase: " + toCamelCase(camelS)); System.out.println("Result of function toSnakeCase: " +toSnakeCase(snakeS)); } public static String toCamelCase(String camelS){ String [] arrS = camelS.split("_"); camelS = arrS[0]; for (int i = 1; i < arrS.length; i++) camelS += Character.toUpperCase(arrS[i].charAt(0)) + arrS[i].substring(1,arrS[i].length()); return camelS; } public static String toSnakeCase(String snakeS){ int prevIndex = 0; String resS = ""; for (int i = 0; i < snakeS.length(); i++){ if (Character.isUpperCase(snakeS.charAt(i))) { resS = snakeS.substring(prevIndex, i) + "_" + snakeS.charAt(i); prevIndex = i; } else resS += snakeS.charAt(i); } return resS.toLowerCase(); } public static void overTimeMain(){ System.out.println(); System.out.println("@Task 4@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the data in the line separated by a space"); String s = sc.nextLine(); System.out.println("$"+String.format("%.2f",overTime(s))); } public static double overTime(String s){ String [] arrS = s.split(" "); double [] sDouble = new double[arrS.length]; double sum = 0; for (int i = 0; i < arrS.length; i++) sDouble[i] = Double.parseDouble(arrS[i]); if (sDouble[1] <=17) sum = (sDouble[1] - sDouble[0])*sDouble[2]; else sum = (sDouble[1] - 17)*sDouble[2]*sDouble[3] + (17 - sDouble[0])*sDouble[2]; return sum; } public static void bmiMain(){ System.out.println(); System.out.println("@Task 5@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the weight"); String weight = sc.nextLine(); System.out.println("Enter the height"); String height = sc.nextLine(); System.out.println(bmi(weight, height)); } public static String bmi(String weight, String height){ double weightD = Double.parseDouble(weight.split(" ")[0]); double heightD = Double.parseDouble(height.split(" ")[0]); String res = ""; if (weight.contains("pounds")) weightD *= 0.45; if (height.contains("inches")) heightD *= 0.0254; double bmi = Math.round((weightD / (heightD * heightD)) * 10.0) / 10.0; if (bmi < 18.5) res = bmi + " Underweight"; if (bmi >= 18.5 && bmi <= 24.9) res = bmi + " Normal weight"; if (bmi > 25) res = bmi + " Overweight"; return res; } public static void buggerMain(){ System.out.println(); System.out.println("@Task 6@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the number"); int num = sc.nextInt(); System.out.println(bugger(num)); } public static int bugger(int num){ int count = 0; int number = num; while (number > 9) { int chnum = 1; while (number > 0) { chnum *= number % 10; number /= 10; } number = chnum; count++; } return count; } public static void toStarShorthandMain(){ System.out.println(); System.out.println("@Task 7@"); Scanner in = new Scanner(System.in); System.out.println("Enter the string"); // Ввод s String s = in.nextLine(); System.out.println(toStarShorthand(s)); } public static String toStarShorthand(String s){ String res_s = ""; int counter = 0; s += "0"; while (counter + 1 != s.length()){ int count = 1; for (int j = counter + 1; j<s.length(); j++){ if (s.charAt(counter) == s.charAt(j)){ count++; if (s.charAt(j+1) != '0') { if (s.charAt(j) != s.charAt(j + 1)) { res_s += s.charAt(counter) + "*" + count; counter += count; break; } } else { res_s += s.charAt(counter) + "*" + count; counter += count; break; } } else { res_s += s.charAt(counter); counter++; break; } } } return res_s; } public static void doesRhymeMain(){ System.out.println(); System.out.println("@Task 8@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the first string"); String s1 = sc.nextLine(); System.out.println("Enter the second string"); String s2 = sc.nextLine(); System.out.println(doesRhyme(s1,s2)); } public static boolean doesRhyme(String s1, String s2){ s1 = s1.substring(s1.lastIndexOf(" ") + 1).toLowerCase(); s2 = s2.substring(s2.lastIndexOf(" ") + 1).toLowerCase(); String let = "aeiouy"; String res1 = "", res2 = ""; for (int i = 0; i < s1.length(); i++) { if (let.indexOf(s1.charAt(i)) != -1) res1 += s1.charAt(i); } for (int i = 0; i < s2.length(); i++) { if (let.indexOf(s2.charAt(i)) != -1) res2 += s2.charAt(i); } return res1.equals(res2); } public static void troubleMain(){ System.out.println(); System.out.println("@Task 9@"); Scanner sc = new Scanner(System.in); System.out.println("Enter the first number"); String num1 = sc.nextLine(); System.out.println("Enter the second number"); String num2 = sc.nextLine(); System.out.println(trouble(num1,num2)); } public static boolean trouble(String num1, String num2){ int num = 0; for (int i = 2; i < num1.length(); i++) { if (num1.charAt(i) == num1.charAt(i - 1) && num1.charAt(i) == num1.charAt(i - 2)) num = num1.charAt(i); } for (int i = 0; i < num2.length(); i++) { if (num2.charAt(i) == num && num2.charAt(i + 1) == num) return true; } return false; } public static void countUniqueBooksMain(){ System.out.println(); System.out.println("@Task 10@"); Scanner in = new Scanner(System.in); System.out.println("Enter the stringSequence"); // Ввод s String s = in.nextLine(); System.out.println(); System.out.println("Enter the bookEnd"); // Ввод s String ch = in.nextLine(); System.out.println(); System.out.println(countUniqueBooks(s,ch)); } public static int countUniqueBooks(String s, String ch){ String new_s = ""; int counter = 0; int index = 0; for (int i = 0; i<s.length(); i++) if (s.charAt(i) == ch.charAt(0)) counter++; for (int i = 0; i<counter/2; i++) { index = s.indexOf(ch, index); int nextIndex = s.indexOf(ch, index + 1); new_s += s.substring(index+1, nextIndex); index = s.indexOf(ch, nextIndex + 1); } counter = 0; boolean[] isItThere = new boolean[Character.MAX_VALUE]; for (int i = 0; i < new_s.length(); i++) { isItThere[new_s.charAt(i)] = true; } for (int i = 0; i < isItThere.length; i++) { if (isItThere[i]){ counter++; } } return counter; } }
10,485
0.492314
0.478468
315
32.250793
19.830166
103
false
false
0
0
0
0
0
0
0.72381
false
false
2
a2ab4ee1eeb32c1089975d428ed180c1c645b1a7
1,941,325,230,294
a9165e1208afa221f1bfbf809d4b55b5da6df86f
/src/org/rcorp/swords/vo/Player.java
f5be5f20a345c56bd7598a2c03129150571db675
[]
no_license
aerinon/SwordHunt
https://github.com/aerinon/SwordHunt
454baa38a4fa891571ba97e6c370c6de57361041
7f44963b17c454aeec665719721913bde1822952
refs/heads/master
2019-06-15T21:40:30.840000
2011-05-05T18:02:52
2011-05-05T18:02:52
1,643,819
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.rcorp.swords.vo; import org.hibernate.annotations.ForeignKey; import org.rcorp.swords.util.Align; import org.rcorp.swords.util.Weapon; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; 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 java.util.Set; /** * 3/14/11 * @author randall */ @Entity @Table(name=Player.DB_TABLE) @SequenceGenerator(name = Player.DB_SEQ, sequenceName = Player.DB_SEQ) public class Player extends AbstractEntity<Integer> { public static final String DB_TABLE = "player"; public static final String DB_SEQ = DB_TABLE + "_seq"; public static final String DB_ID = DB_TABLE + "_id"; private Integer id; private GameState game; private String name; private Weapon weapon; private Align align; private boolean alive; private boolean abilityAvail; private boolean unarmAttackAvail; private boolean possesAvail; private boolean voteAvail; private boolean protection; private Set<Vote> votes; private Round death; private Player abilityTarget; @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = DB_SEQ) @Column(name=DB_ID, nullable=false) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @ManyToOne @JoinColumn(name=GameState.DB_ID, nullable=false) @ForeignKey(name="player_game_fk") public GameState getGame() { return game; } public void setGame(GameState game) { this.game = game; } @Column(name="name", nullable=false) public String getName() { return name; } public void setName(String name) { this.name = name; } @Enumerated(value = EnumType.STRING) @Column(name="role", nullable=false) public Weapon getWeapon() { return weapon; } public void setWeapon(Weapon weapon) { this.weapon = weapon; } @Enumerated(value = EnumType.STRING) @Column(name="align", nullable=false) public Align getAlign() { return align; } public void setAlign(Align align) { this.align = align; } @Column(name="alive", nullable=false) public boolean isAlive() { return alive; } public void setAlive(boolean alive) { this.alive = alive; } @Column(name="protection", nullable=false) public boolean isProtection() { return protection; } public void setProtection(boolean protection) { this.protection = protection; } @Column(name="ability", nullable=false) public boolean isAbilityAvail() { return abilityAvail; } public void setAbilityAvail(boolean abilityAvail) { this.abilityAvail = abilityAvail; } @Column(name="unarmed", nullable=false) public boolean isUnarmAttackAvail() { return unarmAttackAvail; } public void setUnarmAttackAvail(boolean unarmAttackAvail) { this.unarmAttackAvail = unarmAttackAvail; } @Column(name="posses", nullable=false) public boolean isPossesAvail() { return possesAvail; } public void setPossesAvail(boolean possesAvail) { this.possesAvail = possesAvail; } @Column(name="canVote", nullable=false) public boolean isVoteAvail() { return voteAvail; } public void setVoteAvail(boolean voteAvail) { this.voteAvail = voteAvail; } @OneToMany(mappedBy="voter") public Set<Vote> getVotes() { return votes; } public void setVotes(Set<Vote> votes) { this.votes = votes; } @Embedded @AttributeOverrides({@AttributeOverride(name="phase", column = @Column(name="phase", nullable=true)), @AttributeOverride(name="day", column = @Column(name="day", nullable=true))}) public Round getDeath() { return death; } public void setDeath(Round death) { this.death = death; } @ManyToOne @JoinColumn(name ="ability_"+DB_ID) @ForeignKey(name="ability_target_fk") public Player getAbilityTarget() { return abilityTarget; } public void setAbilityTarget(Player abilityTarget) { this.abilityTarget = abilityTarget; } public String toString() { return name+':'+weapon+':'+align; } }
UTF-8
Java
4,907
java
Player.java
Java
[ { "context": ";\nimport java.util.Set;\n\n/**\n * 3/14/11\n * @author randall\n */\n@Entity\n@Table(name=Player.DB_TABLE)\n@Sequenc", "end": 763, "score": 0.9990524053573608, "start": 756, "tag": "USERNAME", "value": "randall" } ]
null
[]
package org.rcorp.swords.vo; import org.hibernate.annotations.ForeignKey; import org.rcorp.swords.util.Align; import org.rcorp.swords.util.Weapon; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; 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 java.util.Set; /** * 3/14/11 * @author randall */ @Entity @Table(name=Player.DB_TABLE) @SequenceGenerator(name = Player.DB_SEQ, sequenceName = Player.DB_SEQ) public class Player extends AbstractEntity<Integer> { public static final String DB_TABLE = "player"; public static final String DB_SEQ = DB_TABLE + "_seq"; public static final String DB_ID = DB_TABLE + "_id"; private Integer id; private GameState game; private String name; private Weapon weapon; private Align align; private boolean alive; private boolean abilityAvail; private boolean unarmAttackAvail; private boolean possesAvail; private boolean voteAvail; private boolean protection; private Set<Vote> votes; private Round death; private Player abilityTarget; @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = DB_SEQ) @Column(name=DB_ID, nullable=false) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @ManyToOne @JoinColumn(name=GameState.DB_ID, nullable=false) @ForeignKey(name="player_game_fk") public GameState getGame() { return game; } public void setGame(GameState game) { this.game = game; } @Column(name="name", nullable=false) public String getName() { return name; } public void setName(String name) { this.name = name; } @Enumerated(value = EnumType.STRING) @Column(name="role", nullable=false) public Weapon getWeapon() { return weapon; } public void setWeapon(Weapon weapon) { this.weapon = weapon; } @Enumerated(value = EnumType.STRING) @Column(name="align", nullable=false) public Align getAlign() { return align; } public void setAlign(Align align) { this.align = align; } @Column(name="alive", nullable=false) public boolean isAlive() { return alive; } public void setAlive(boolean alive) { this.alive = alive; } @Column(name="protection", nullable=false) public boolean isProtection() { return protection; } public void setProtection(boolean protection) { this.protection = protection; } @Column(name="ability", nullable=false) public boolean isAbilityAvail() { return abilityAvail; } public void setAbilityAvail(boolean abilityAvail) { this.abilityAvail = abilityAvail; } @Column(name="unarmed", nullable=false) public boolean isUnarmAttackAvail() { return unarmAttackAvail; } public void setUnarmAttackAvail(boolean unarmAttackAvail) { this.unarmAttackAvail = unarmAttackAvail; } @Column(name="posses", nullable=false) public boolean isPossesAvail() { return possesAvail; } public void setPossesAvail(boolean possesAvail) { this.possesAvail = possesAvail; } @Column(name="canVote", nullable=false) public boolean isVoteAvail() { return voteAvail; } public void setVoteAvail(boolean voteAvail) { this.voteAvail = voteAvail; } @OneToMany(mappedBy="voter") public Set<Vote> getVotes() { return votes; } public void setVotes(Set<Vote> votes) { this.votes = votes; } @Embedded @AttributeOverrides({@AttributeOverride(name="phase", column = @Column(name="phase", nullable=true)), @AttributeOverride(name="day", column = @Column(name="day", nullable=true))}) public Round getDeath() { return death; } public void setDeath(Round death) { this.death = death; } @ManyToOne @JoinColumn(name ="ability_"+DB_ID) @ForeignKey(name="ability_target_fk") public Player getAbilityTarget() { return abilityTarget; } public void setAbilityTarget(Player abilityTarget) { this.abilityTarget = abilityTarget; } public String toString() { return name+':'+weapon+':'+align; } }
4,907
0.649888
0.648869
225
20.808889
19.225075
105
false
false
0
0
0
0
0
0
0.373333
false
false
2
07031099a66daa2d72259a4e661e1e74a6f7383b
1,640,677,516,702
67426890ea34d070f7aded1ecbb51484b19a5fb5
/src/main/java/com/viettel/demo/repository/CompanyRepository.java
f3199318f0cb0f164d319d6ee7a43f37dfb17eef
[]
no_license
chungquach96/spring
https://github.com/chungquach96/spring
ed16901d02be34d67d58ea69f3c0a0b954cba861
bd8641c2664d3a63a1ca31a60442b3eae9c58165
refs/heads/master
2022-12-31T18:44:27.473000
2020-10-29T03:12:59
2020-10-29T03:12:59
307,632,666
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.viettel.demo.repository; import com.viettel.demo.models.Company; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface CompanyRepository extends PagingAndSortingRepository<Company,Long> { // List<Company> Find(Pageable pageable); }
UTF-8
Java
540
java
CompanyRepository.java
Java
[]
null
[]
package com.viettel.demo.repository; import com.viettel.demo.models.Company; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface CompanyRepository extends PagingAndSortingRepository<Company,Long> { // List<Company> Find(Pageable pageable); }
540
0.842593
0.842593
16
32.75
27.514769
85
false
false
0
0
0
0
0
0
0.625
false
false
2
e01f71efd98cee3a9cc36476c29f75d2e235da0d
2,817,498,559,814
5c0e923aa0621ad3d84d11d2439ebb85f35c4979
/biz.aQute.osgi.jna.support.test/src/main/java/biz/aQute/osgi/jna/support/test/a/Hello.java
dab6ba9950cb590abf24d9f4c41ed32985fa4215
[ "Apache-2.0" ]
permissive
amitjoy/biz.aQute.osgi.util
https://github.com/amitjoy/biz.aQute.osgi.util
1a164c8b111c266e1afa14c7aa66bb61dcb35f48
720ff1b9a8a1a1b9c4ce7a12f520575496222a26
refs/heads/master
2023-01-22T10:31:33.195000
2020-12-01T08:31:21
2020-12-01T08:31:21
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package biz.aQute.osgi.jna.support.test.a; import com.sun.jna.Library; public interface Hello extends Library{ void hello(); }
UTF-8
Java
132
java
Hello.java
Java
[]
null
[]
package biz.aQute.osgi.jna.support.test.a; import com.sun.jna.Library; public interface Hello extends Library{ void hello(); }
132
0.75
0.75
9
13.666667
16.766369
42
false
false
0
0
0
0
0
0
0.444444
false
false
2
859df529d4ef011f2fa5d3618ad3537ebadf790b
33,526,514,719,667
1836dadcc9047fdd18b37995eeee3713a905022e
/src/main/java/com/dhl/g05/model/LeagueConstant.java
d6e781dea06c0d21d74047647c162d719e76a772
[]
no_license
jeyanthkishore/csci-5308-NHL_game
https://github.com/jeyanthkishore/csci-5308-NHL_game
c4abcb9539d3f4670fc4ac9ae2f35795fa1f4dae
4bf9723550bd996b337e23c2b5de1cc9b81e37d9
refs/heads/master
2023-03-17T17:31:41.095000
2020-12-01T03:13:05
2020-12-01T03:13:05
341,323,839
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.dhl.g05.model; public enum LeagueConstant { Success("success"), Failure("fails"), LeagueNameEmpty("League Name Is Empty"), ConferenceListEmpty("Conference List Is Empty"), NoEvenConferenceCount("Conference Count Must Be Even"), FreeAgentsNotValid("Free Agent List Is Not Valid"), FreeAgentAttributeEmpty("Free Agent Attribue Is Empty"), ImproperPlayerPosition("Position Of The Player Cannot Be Different"), LeagueExists("League Already Present"), CoachListEmpty("Coach List is Empty"), ManagerListEmpty("Manager List is Empty"); private String value; LeagueConstant(String value) { this.value = value; } public String getValue() { return value; } }
UTF-8
Java
688
java
LeagueConstant.java
Java
[]
null
[]
package com.dhl.g05.model; public enum LeagueConstant { Success("success"), Failure("fails"), LeagueNameEmpty("League Name Is Empty"), ConferenceListEmpty("Conference List Is Empty"), NoEvenConferenceCount("Conference Count Must Be Even"), FreeAgentsNotValid("Free Agent List Is Not Valid"), FreeAgentAttributeEmpty("Free Agent Attribue Is Empty"), ImproperPlayerPosition("Position Of The Player Cannot Be Different"), LeagueExists("League Already Present"), CoachListEmpty("Coach List is Empty"), ManagerListEmpty("Manager List is Empty"); private String value; LeagueConstant(String value) { this.value = value; } public String getValue() { return value; } }
688
0.75436
0.751453
27
24.481482
21.026211
70
false
false
0
0
0
0
0
0
1.296296
false
false
2
d62ebee0d3db018c9e2ba91cc42a886536f6c41f
27,736,898,806,137
1ec81837dac9ef8ab9b880c5988d2143d617feea
/src/main/java/com/hotplace25/controller/SpotController.java
b4d108137a22dcd3e7597d444be6bd80eef39fdd
[]
no_license
kihoon76/hotplace25_v1
https://github.com/kihoon76/hotplace25_v1
d8be01351589460a62bf15ffd00eea02e2b64d38
af325bf99d61716c88c23a83947335689a837092
refs/heads/master
2022-12-23T23:44:39.129000
2019-09-18T04:44:48
2019-09-18T04:44:48
147,181,177
1
0
null
false
2022-12-16T11:23:01
2018-09-03T09:19:40
2020-07-30T12:57:23
2022-12-16T11:22:57
22,787
0
0
22
JavaScript
false
false
package com.hotplace25.controller; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.hotplace25.domain.AjaxVO; import com.hotplace25.domain.Consulting; import com.hotplace25.domain.FileBucket; import com.hotplace25.domain.GwansimMulgeon; import com.hotplace25.domain.Maemul; import com.hotplace25.service.SearchService; import com.hotplace25.service.SpotService; import com.hotplace25.types.GwansimGrade; import com.hotplace25.types.MulgeonType; import com.hotplace25.util.SessionUtil; @RequestMapping("/spot") @Controller public class SpotController { @Resource(name="spotService") SpotService spotService; @Resource(name="searchService") SearchService searchService; @GetMapping("/tojiDefaultInfo") @ResponseBody public AjaxVO<Map<String, String>> getTojiDefaultInfo(@RequestParam("pnu") String pnu) { AjaxVO<Map<String, String>> vo = new AjaxVO<Map<String, String>>(); try { Map<String, String> info = spotService.getTojiDefaultInfo(pnu); if(info != null) { Map<String, String> luris = searchService.getLurisDrawing(pnu); if(luris != null) { info.put("image", luris.get("image")); } } vo.setSuccess(true); vo.addObject(info); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("/reg/maemulNoPic") @ResponseBody public AjaxVO uploadRegMaemulNoPic(@RequestBody Maemul maemul) throws JsonGenerationException, JsonMappingException, IOException { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); maemul.setAccountId(SessionUtil.getSessionUserId()); try { doRegisted = spotService.doRegistedMaemul(maemul); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { try { boolean r = spotService.regMaemulNoPic(maemul); if(r) { vo.setSuccess(true); } else { vo.setSuccess(false); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/reg/maemul") @ResponseBody public AjaxVO uploadRegMaemul( @RequestParam("file") MultipartFile[] files, @RequestParam("pnu") String pnu, @RequestParam("addressJibeon") String addressJibeon, @RequestParam("description") String description, @RequestParam("phone") String phone, @RequestParam("register") String register, @RequestParam("lng") float lng, @RequestParam("lat") float lat) { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); Maemul maemul = new Maemul(); maemul.setAccountId(SessionUtil.getSessionUserId()); maemul.setAddressJibeon(addressJibeon); maemul.setDescription(description); maemul.setPnu(pnu); maemul.setPhone(phone); maemul.setRegister(register); maemul.setLat(lat); maemul.setLng(lng); try { doRegisted = spotService.doRegistedMaemul(maemul); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { vo.setSuccess(true); try { List<FileBucket> fbList = new ArrayList<>(); for(MultipartFile file: files) { String fName = file.getOriginalFilename(); FileBucket fb = new FileBucket(); fb.setImageName(fName); fb.setExt(fName.substring(fName.lastIndexOf(".") + 1)); fb.setImage(file.getBytes()); fbList.add(fb); } maemul.setFiles(fbList); spotService.regMaemul(maemul); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/reg/consulting") @ResponseBody public AjaxVO regConsulting(@RequestBody Consulting consulting) { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); consulting.setAccountId(SessionUtil.getSessionUserId()); try { doRegisted = spotService.doRegistedConsulting(consulting); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { vo.setSuccess(true); try { spotService.regConsulting(consulting); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/check/gwansim") @ResponseBody public AjaxVO<GwansimMulgeon> checkGwansimMulgeon(@RequestBody GwansimMulgeon gwansimMulgeon) { GwansimMulgeon rGwansimMulgeon = null; AjaxVO<GwansimMulgeon> vo = new AjaxVO<GwansimMulgeon>(); gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); try { rGwansimMulgeon = spotService.doRegistedGwansimMulgeon(gwansimMulgeon); if(rGwansimMulgeon != null) { vo.setSuccess(false); vo.addObject(rGwansimMulgeon); vo.setErrCode("DUP"); } else { vo.setSuccess(true); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("/reg/gwansim") @ResponseBody public AjaxVO regGwansimMulgeon(@RequestBody GwansimMulgeon gwansimMulgeon) { // GwansimMulgeon rGwansimMulgeon = null; AjaxVO vo = new AjaxVO(); gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); // // gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); // try { // rGwansimMulgeon = spotService.doRegistedGwansimMulgeon(gwansimMulgeon); // if(rGwansimMulgeon != null) { // vo.setSuccess(false); // vo.setErrCode("DUP"); // } // } // catch(Exception e) { // vo.setSuccess(false); // vo.setErrMsg(e.getMessage()); // // return vo; // } //if(rGwansimMulgeon == null) { vo.setSuccess(true); try { String mulgeonType = gwansimMulgeon.getMulgeonType(); String grade = gwansimMulgeon.getGrade(); //등급타입이 유효하지 않으면 exception 발생 GwansimGrade g = GwansimGrade.getType(grade); if(!"".equals(mulgeonType)) { //물건타입이 유효하지 않으면 exception 발생 MulgeonType.getType(mulgeonType); } spotService.regGwansimMulgeon(gwansimMulgeon); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } //} return vo; } @GetMapping("del/gwansim") @ResponseBody public AjaxVO removeMyGwansimMulgeon(@RequestParam("gwansimNum") String gwansimNum) { AjaxVO vo = new AjaxVO(); vo.setSuccess(false); String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(gwansimNum); try { boolean isValid = spotService.removeMyGwansimMulgeon(gm); if(isValid) { vo.setSuccess(true); vo.addObject(gwansimNum); } } catch(Exception e) { vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("mod/gwansim") @ResponseBody public AjaxVO modifyMyGwansimMulgeon(@RequestBody Map<String, String> param) { AjaxVO vo = new AjaxVO(); vo.setSuccess(false); String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(param.get("gwansimNum")); gm.setMemo(param.get("memo")); gm.setGrade(param.get("grade")); try { boolean r = spotService.modifyMyGwansimMulgeon(gm); if(r) { vo.setSuccess(true); } } catch(Exception e) { vo.setErrMsg(e.getMessage()); } return vo; } @GetMapping("my/gwansim") public String getMyGwansim(@RequestParam("gwansimNum") String gwansimNum, ModelMap m) { String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(gwansimNum); gm = spotService.getMyGwansim(gm); gm.setAccountId(""); m.addAttribute("gwansim", gm); return "mypage/mypageGwansimForm"; } }
UTF-8
Java
8,816
java
SpotController.java
Java
[]
null
[]
package com.hotplace25.controller; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.hotplace25.domain.AjaxVO; import com.hotplace25.domain.Consulting; import com.hotplace25.domain.FileBucket; import com.hotplace25.domain.GwansimMulgeon; import com.hotplace25.domain.Maemul; import com.hotplace25.service.SearchService; import com.hotplace25.service.SpotService; import com.hotplace25.types.GwansimGrade; import com.hotplace25.types.MulgeonType; import com.hotplace25.util.SessionUtil; @RequestMapping("/spot") @Controller public class SpotController { @Resource(name="spotService") SpotService spotService; @Resource(name="searchService") SearchService searchService; @GetMapping("/tojiDefaultInfo") @ResponseBody public AjaxVO<Map<String, String>> getTojiDefaultInfo(@RequestParam("pnu") String pnu) { AjaxVO<Map<String, String>> vo = new AjaxVO<Map<String, String>>(); try { Map<String, String> info = spotService.getTojiDefaultInfo(pnu); if(info != null) { Map<String, String> luris = searchService.getLurisDrawing(pnu); if(luris != null) { info.put("image", luris.get("image")); } } vo.setSuccess(true); vo.addObject(info); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("/reg/maemulNoPic") @ResponseBody public AjaxVO uploadRegMaemulNoPic(@RequestBody Maemul maemul) throws JsonGenerationException, JsonMappingException, IOException { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); maemul.setAccountId(SessionUtil.getSessionUserId()); try { doRegisted = spotService.doRegistedMaemul(maemul); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { try { boolean r = spotService.regMaemulNoPic(maemul); if(r) { vo.setSuccess(true); } else { vo.setSuccess(false); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/reg/maemul") @ResponseBody public AjaxVO uploadRegMaemul( @RequestParam("file") MultipartFile[] files, @RequestParam("pnu") String pnu, @RequestParam("addressJibeon") String addressJibeon, @RequestParam("description") String description, @RequestParam("phone") String phone, @RequestParam("register") String register, @RequestParam("lng") float lng, @RequestParam("lat") float lat) { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); Maemul maemul = new Maemul(); maemul.setAccountId(SessionUtil.getSessionUserId()); maemul.setAddressJibeon(addressJibeon); maemul.setDescription(description); maemul.setPnu(pnu); maemul.setPhone(phone); maemul.setRegister(register); maemul.setLat(lat); maemul.setLng(lng); try { doRegisted = spotService.doRegistedMaemul(maemul); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { vo.setSuccess(true); try { List<FileBucket> fbList = new ArrayList<>(); for(MultipartFile file: files) { String fName = file.getOriginalFilename(); FileBucket fb = new FileBucket(); fb.setImageName(fName); fb.setExt(fName.substring(fName.lastIndexOf(".") + 1)); fb.setImage(file.getBytes()); fbList.add(fb); } maemul.setFiles(fbList); spotService.regMaemul(maemul); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/reg/consulting") @ResponseBody public AjaxVO regConsulting(@RequestBody Consulting consulting) { boolean doRegisted = false; AjaxVO vo = new AjaxVO(); consulting.setAccountId(SessionUtil.getSessionUserId()); try { doRegisted = spotService.doRegistedConsulting(consulting); if(doRegisted) { vo.setSuccess(false); vo.setErrCode("DUP"); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } if(!doRegisted) { vo.setSuccess(true); try { spotService.regConsulting(consulting); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } } return vo; } @PostMapping("/check/gwansim") @ResponseBody public AjaxVO<GwansimMulgeon> checkGwansimMulgeon(@RequestBody GwansimMulgeon gwansimMulgeon) { GwansimMulgeon rGwansimMulgeon = null; AjaxVO<GwansimMulgeon> vo = new AjaxVO<GwansimMulgeon>(); gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); try { rGwansimMulgeon = spotService.doRegistedGwansimMulgeon(gwansimMulgeon); if(rGwansimMulgeon != null) { vo.setSuccess(false); vo.addObject(rGwansimMulgeon); vo.setErrCode("DUP"); } else { vo.setSuccess(true); } } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("/reg/gwansim") @ResponseBody public AjaxVO regGwansimMulgeon(@RequestBody GwansimMulgeon gwansimMulgeon) { // GwansimMulgeon rGwansimMulgeon = null; AjaxVO vo = new AjaxVO(); gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); // // gwansimMulgeon.setAccountId(SessionUtil.getSessionUserId()); // try { // rGwansimMulgeon = spotService.doRegistedGwansimMulgeon(gwansimMulgeon); // if(rGwansimMulgeon != null) { // vo.setSuccess(false); // vo.setErrCode("DUP"); // } // } // catch(Exception e) { // vo.setSuccess(false); // vo.setErrMsg(e.getMessage()); // // return vo; // } //if(rGwansimMulgeon == null) { vo.setSuccess(true); try { String mulgeonType = gwansimMulgeon.getMulgeonType(); String grade = gwansimMulgeon.getGrade(); //등급타입이 유효하지 않으면 exception 발생 GwansimGrade g = GwansimGrade.getType(grade); if(!"".equals(mulgeonType)) { //물건타입이 유효하지 않으면 exception 발생 MulgeonType.getType(mulgeonType); } spotService.regGwansimMulgeon(gwansimMulgeon); } catch(Exception e) { vo.setSuccess(false); vo.setErrMsg(e.getMessage()); } //} return vo; } @GetMapping("del/gwansim") @ResponseBody public AjaxVO removeMyGwansimMulgeon(@RequestParam("gwansimNum") String gwansimNum) { AjaxVO vo = new AjaxVO(); vo.setSuccess(false); String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(gwansimNum); try { boolean isValid = spotService.removeMyGwansimMulgeon(gm); if(isValid) { vo.setSuccess(true); vo.addObject(gwansimNum); } } catch(Exception e) { vo.setErrMsg(e.getMessage()); } return vo; } @PostMapping("mod/gwansim") @ResponseBody public AjaxVO modifyMyGwansimMulgeon(@RequestBody Map<String, String> param) { AjaxVO vo = new AjaxVO(); vo.setSuccess(false); String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(param.get("gwansimNum")); gm.setMemo(param.get("memo")); gm.setGrade(param.get("grade")); try { boolean r = spotService.modifyMyGwansimMulgeon(gm); if(r) { vo.setSuccess(true); } } catch(Exception e) { vo.setErrMsg(e.getMessage()); } return vo; } @GetMapping("my/gwansim") public String getMyGwansim(@RequestParam("gwansimNum") String gwansimNum, ModelMap m) { String currentId = SessionUtil.getSessionUserId(); GwansimMulgeon gm = new GwansimMulgeon(); gm.setAccountId(currentId); gm.setGwansimMulgeonNum(gwansimNum); gm = spotService.getMyGwansim(gm); gm.setAccountId(""); m.addAttribute("gwansim", gm); return "mypage/mypageGwansimForm"; } }
8,816
0.701142
0.698516
359
23.401114
20.83803
131
false
false
0
0
0
0
0
0
2.707521
false
false
2
941c205b4b9cc51fe5916e27c178d0b19b04a201
22,823,456,222,972
004fcdffa0f6dbba260893258d301e374ee241d9
/Swando/src/com/lardigsvenska/android/activity/PopupCategory.java
a79cca38446e1ed37f3aa1f14b30c3ef9baca106
[]
no_license
erhanux/Swando
https://github.com/erhanux/Swando
c59f5860741b50e4fd462a057d11e21f8fd24c7f
f7aba0b53e7a2cef31ea01a75abc37bcf6385e20
refs/heads/master
2016-09-05T16:54:16.935000
2011-09-16T14:27:04
2011-09-16T14:27:04
2,120,675
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lardigsvenska.android.activity; import java.util.List; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.Spinner; import android.widget.Toast; import com.lardigsvenska.android.R; import com.lardigsvenska.android.adapter.CategoryAdapter; import com.lardigsvenska.android.database.ImagesDbAdapter; import com.lardigsvenska.android.database.TagsDbAdapter; import com.lardigsvenska.android.pojo.CategoryD; public class PopupCategory extends Activity { String [] categoriesArray = { "Djur", "Grönsaker" }; Spinner categorySpinner; TagsDbAdapter tagsDb; ImagesDbAdapter imgDb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tagsDb = new TagsDbAdapter(getBaseContext()); tagsDb.open(); imgDb = new ImagesDbAdapter(getBaseContext()); imgDb.open(); List<CategoryD> categories = tagsDb.getAllCategories(); imgDb.setSampleImages(categories); tagsDb.close(); imgDb.close(); Dialog viewDialog = new Dialog(this); viewDialog.getWindow().setFlags( WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); viewDialog.setTitle("Select Category"); LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View dialogView = li.inflate(R.layout.select_category, null); viewDialog.setContentView(dialogView); viewDialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); viewDialog.show(); categorySpinner = (Spinner) dialogView.findViewById(R.id.category_list); //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categoriesArray); CategoryAdapter adapter = new CategoryAdapter(getBaseContext(), R.layout.select_category, android.R.layout.simple_spinner_item, categories); adapter.setActivity(this); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); categorySpinner.setAdapter(adapter); } @Override protected void onStart() { super.onStart(); categorySpinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { CategoryD cat = (CategoryD) parent.getItemAtPosition(pos); Toast.makeText( getApplicationContext(), "The category is " + cat, Toast.LENGTH_SHORT).show(); if (cat != null && cat.getId() >= 0) { QuizApplication.getInstance().setCategory(cat.getId()); Intent myIntent = new Intent(getApplicationContext(), ImageQuiz.class); myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); myIntent.putExtra("RESET",true); getApplicationContext().startActivity(myIntent); } } public void onNothingSelected(AdapterView parent) { Toast.makeText( getApplicationContext(), "Nothing is selected", Toast.LENGTH_SHORT).show(); } } }
ISO-8859-2
Java
3,417
java
PopupCategory.java
Java
[]
null
[]
package com.lardigsvenska.android.activity; import java.util.List; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.Spinner; import android.widget.Toast; import com.lardigsvenska.android.R; import com.lardigsvenska.android.adapter.CategoryAdapter; import com.lardigsvenska.android.database.ImagesDbAdapter; import com.lardigsvenska.android.database.TagsDbAdapter; import com.lardigsvenska.android.pojo.CategoryD; public class PopupCategory extends Activity { String [] categoriesArray = { "Djur", "Grönsaker" }; Spinner categorySpinner; TagsDbAdapter tagsDb; ImagesDbAdapter imgDb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tagsDb = new TagsDbAdapter(getBaseContext()); tagsDb.open(); imgDb = new ImagesDbAdapter(getBaseContext()); imgDb.open(); List<CategoryD> categories = tagsDb.getAllCategories(); imgDb.setSampleImages(categories); tagsDb.close(); imgDb.close(); Dialog viewDialog = new Dialog(this); viewDialog.getWindow().setFlags( WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); viewDialog.setTitle("Select Category"); LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View dialogView = li.inflate(R.layout.select_category, null); viewDialog.setContentView(dialogView); viewDialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); viewDialog.show(); categorySpinner = (Spinner) dialogView.findViewById(R.id.category_list); //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categoriesArray); CategoryAdapter adapter = new CategoryAdapter(getBaseContext(), R.layout.select_category, android.R.layout.simple_spinner_item, categories); adapter.setActivity(this); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); categorySpinner.setAdapter(adapter); } @Override protected void onStart() { super.onStart(); categorySpinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { CategoryD cat = (CategoryD) parent.getItemAtPosition(pos); Toast.makeText( getApplicationContext(), "The category is " + cat, Toast.LENGTH_SHORT).show(); if (cat != null && cat.getId() >= 0) { QuizApplication.getInstance().setCategory(cat.getId()); Intent myIntent = new Intent(getApplicationContext(), ImageQuiz.class); myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); myIntent.putExtra("RESET",true); getApplicationContext().startActivity(myIntent); } } public void onNothingSelected(AdapterView parent) { Toast.makeText( getApplicationContext(), "Nothing is selected", Toast.LENGTH_SHORT).show(); } } }
3,417
0.748829
0.748536
99
32.505051
27.621677
142
false
false
0
0
0
0
0
0
2.282828
false
false
2
207672438c19f3cd56534ab13e8c2ff9cd9b8f22
17,111,149,722,102
2e86308a3a72c42b59552f130f2e282a242f69b8
/ObdCar/src/com/xtrd/obdcar/entity/GPSInfo.java
f975604b3131cd44f3a60ef2ee3fd35a18ef5f71
[]
no_license
anquanweishi/mobercar
https://github.com/anquanweishi/mobercar
99688054e70847b921e522fa961bb5d5cf8daa71
5ff260f7f2277278aaaa96718741f95749c99365
refs/heads/master
2021-01-23T08:56:26.507000
2015-03-18T16:42:56
2015-03-18T16:42:56
32,471,426
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.xtrd.obdcar.entity; import org.json.JSONException; import org.json.JSONObject; import android.os.Parcel; import android.os.Parcelable; public class GPSInfo implements Parcelable { private int dataId; private int vehicleId; private int tripId; private double longitude; private double latitude; private int altitude; private int orientation; private int velocity; private String status; private String gpsTime; public GPSInfo() { } public GPSInfo(Parcel in) { dataId = in.readInt(); vehicleId = in.readInt(); tripId = in.readInt(); longitude = in.readDouble(); latitude = in.readDouble(); altitude = in.readInt(); orientation = in.readInt(); velocity = in.readInt(); status = in.readString(); gpsTime = in.readString(); } public static final Parcelable.Creator<GPSInfo> CREATOR = new Creator<GPSInfo>() { @Override public GPSInfo[] newArray(int size) { return new GPSInfo[size]; } @Override public GPSInfo createFromParcel(Parcel source) { return new GPSInfo(source); } }; @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(dataId); dest.writeInt(vehicleId); dest.writeInt(tripId); dest.writeDouble(longitude); dest.writeDouble(latitude); dest.writeInt(altitude); dest.writeInt(orientation); dest.writeInt(velocity); dest.writeString(status); dest.writeString(gpsTime); } @Override public int describeContents() { return 0; } public int getDataId() { return dataId; } public void setDataId(int dataId) { this.dataId = dataId; } public int getVehicleId() { return vehicleId; } public void setVehicleId(int vehicleId) { this.vehicleId = vehicleId; } public int getTripId() { return tripId; } public void setTripId(int tripId) { this.tripId = tripId; } public double getLongitude() { return longitude; } public void setLongitude(double longitude) { this.longitude = longitude; } public double getLatitude() { return latitude; } public void setLatitude(double latitude) { this.latitude = latitude; } public int getAltitude() { return altitude; } public void setAltitude(int altitude) { this.altitude = altitude; } public int getOrientation() { return orientation; } public void setOrientation(int orientation) { this.orientation = orientation; } public int getVelocity() { return velocity; } public void setVelocity(int velocity) { this.velocity = velocity; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getGpsTime() { return gpsTime; } public void setGpsTime(String gpsTime) { this.gpsTime = gpsTime; } public void parser(JSONObject opt) throws JSONException { if(opt!=null) { if(opt.has("dataId")) { setDataId(opt.getInt("dataId")); } if(opt.has("gpsDataId")) { setDataId(opt.getInt("gpsDataId")); } if(opt.has("vehicleId")) { setVehicleId(opt.getInt("vehicleId")); } // if(opt.has("tripId")) { // setTripId(opt.getInt("tripId")); // } if(opt.has("longitude")) { setLongitude(opt.getDouble("longitude")); } if(opt.has("latitude")) { setLatitude(opt.getDouble("latitude")); } if(opt.has("altitude")) { setAltitude(opt.getInt("altitude")); } if(opt.has("orientation")) { setOrientation(opt.getInt("orientation")); } if(opt.has("velocity")) { setVelocity(opt.getInt("velocity")); } if(opt.has("status")) { setStatus(opt.getString("status")); } if(opt.has("gpsTime")) { setGpsTime(opt.getString("gpsTime")); } } } }
UTF-8
Java
3,825
java
GPSInfo.java
Java
[]
null
[]
package com.xtrd.obdcar.entity; import org.json.JSONException; import org.json.JSONObject; import android.os.Parcel; import android.os.Parcelable; public class GPSInfo implements Parcelable { private int dataId; private int vehicleId; private int tripId; private double longitude; private double latitude; private int altitude; private int orientation; private int velocity; private String status; private String gpsTime; public GPSInfo() { } public GPSInfo(Parcel in) { dataId = in.readInt(); vehicleId = in.readInt(); tripId = in.readInt(); longitude = in.readDouble(); latitude = in.readDouble(); altitude = in.readInt(); orientation = in.readInt(); velocity = in.readInt(); status = in.readString(); gpsTime = in.readString(); } public static final Parcelable.Creator<GPSInfo> CREATOR = new Creator<GPSInfo>() { @Override public GPSInfo[] newArray(int size) { return new GPSInfo[size]; } @Override public GPSInfo createFromParcel(Parcel source) { return new GPSInfo(source); } }; @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(dataId); dest.writeInt(vehicleId); dest.writeInt(tripId); dest.writeDouble(longitude); dest.writeDouble(latitude); dest.writeInt(altitude); dest.writeInt(orientation); dest.writeInt(velocity); dest.writeString(status); dest.writeString(gpsTime); } @Override public int describeContents() { return 0; } public int getDataId() { return dataId; } public void setDataId(int dataId) { this.dataId = dataId; } public int getVehicleId() { return vehicleId; } public void setVehicleId(int vehicleId) { this.vehicleId = vehicleId; } public int getTripId() { return tripId; } public void setTripId(int tripId) { this.tripId = tripId; } public double getLongitude() { return longitude; } public void setLongitude(double longitude) { this.longitude = longitude; } public double getLatitude() { return latitude; } public void setLatitude(double latitude) { this.latitude = latitude; } public int getAltitude() { return altitude; } public void setAltitude(int altitude) { this.altitude = altitude; } public int getOrientation() { return orientation; } public void setOrientation(int orientation) { this.orientation = orientation; } public int getVelocity() { return velocity; } public void setVelocity(int velocity) { this.velocity = velocity; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getGpsTime() { return gpsTime; } public void setGpsTime(String gpsTime) { this.gpsTime = gpsTime; } public void parser(JSONObject opt) throws JSONException { if(opt!=null) { if(opt.has("dataId")) { setDataId(opt.getInt("dataId")); } if(opt.has("gpsDataId")) { setDataId(opt.getInt("gpsDataId")); } if(opt.has("vehicleId")) { setVehicleId(opt.getInt("vehicleId")); } // if(opt.has("tripId")) { // setTripId(opt.getInt("tripId")); // } if(opt.has("longitude")) { setLongitude(opt.getDouble("longitude")); } if(opt.has("latitude")) { setLatitude(opt.getDouble("latitude")); } if(opt.has("altitude")) { setAltitude(opt.getInt("altitude")); } if(opt.has("orientation")) { setOrientation(opt.getInt("orientation")); } if(opt.has("velocity")) { setVelocity(opt.getInt("velocity")); } if(opt.has("status")) { setStatus(opt.getString("status")); } if(opt.has("gpsTime")) { setGpsTime(opt.getString("gpsTime")); } } } }
3,825
0.646536
0.646275
188
18.345745
15.782856
83
false
false
0
0
0
0
0
0
1.882979
false
false
2
1c8e54a8bfb75e1a257933ac6ee5e34c30fe793f
15,599,321,233,769
e1aa4eecacea7cda9843b4541e453cf73b30e584
/ehcache-replicated/src/main/java/io/github/celebes/ehcache/test/samples/replicated/App.java
4232122099bd7f1683c764be8a7c42e9593d1bf5
[]
no_license
thanhvc/ehcache-test-samples
https://github.com/thanhvc/ehcache-test-samples
6442445dc43e64b55288466822b1bbb07c99cfb5
ef33df08b1d91bff1783451f5db827e0a8b2940c
refs/heads/master
2021-01-17T05:16:41.719000
2015-03-16T21:23:01
2015-03-16T21:23:01
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.github.celebes.ehcache.test.samples.replicated; import io.github.celebes.ehcache.test.samples.replicated.model.Foo; import net.sf.ehcache.Ehcache; import net.sf.ehcache.Element; public class App { public static void main(String[] args) throws InterruptedException { String cacheNumber = args[0]; int number = Integer.valueOf(cacheNumber); CacheUtil.initializeCacheManager(number); if(number == 1) { Ehcache cache = CacheUtil.getCache(); int i=0; System.out.println("Nadawca"); while(true) { Foo foo = new Foo(); foo.setId(i); foo.setFooName("Foo_" + i); Element e = new Element(foo.getFooName(), foo); cache.put(e); i++; Thread.sleep(1000); } } else { System.out.println("Odbiorca"); while(true) { Thread.sleep(100); } } } }
UTF-8
Java
825
java
App.java
Java
[ { "context": "package io.github.celebes.ehcache.test.samples.replicated;\n\nimport io.githu", "end": 25, "score": 0.9781978130340576, "start": 18, "tag": "USERNAME", "value": "celebes" }, { "context": "hcache.test.samples.replicated;\n\nimport io.github.celebes.ehcache.test.samples.replicated.model.Foo;\nimport", "end": 84, "score": 0.989313542842865, "start": 77, "tag": "USERNAME", "value": "celebes" } ]
null
[]
package io.github.celebes.ehcache.test.samples.replicated; import io.github.celebes.ehcache.test.samples.replicated.model.Foo; import net.sf.ehcache.Ehcache; import net.sf.ehcache.Element; public class App { public static void main(String[] args) throws InterruptedException { String cacheNumber = args[0]; int number = Integer.valueOf(cacheNumber); CacheUtil.initializeCacheManager(number); if(number == 1) { Ehcache cache = CacheUtil.getCache(); int i=0; System.out.println("Nadawca"); while(true) { Foo foo = new Foo(); foo.setId(i); foo.setFooName("Foo_" + i); Element e = new Element(foo.getFooName(), foo); cache.put(e); i++; Thread.sleep(1000); } } else { System.out.println("Odbiorca"); while(true) { Thread.sleep(100); } } } }
825
0.658182
0.646061
37
21.324324
19.081694
69
false
false
0
0
0
0
0
0
2.783784
false
false
2
67d090e1631e1238abeca000f710efa5707251f4
15,599,321,235,222
cecba0e63df62a65add1bd6907c7cc40a66eeb88
/bkc-api/src/main/java/cn/bitflash/vip/trade/controller/ConfirmTrade.java
7d11d68ac155fac690b8d362e7bc57c54a4edb52
[ "Apache-2.0" ]
permissive
mrchen210282/Mid-Autumn-Festival
https://github.com/mrchen210282/Mid-Autumn-Festival
8c6f5e48f1cd81ae5723e5597cd9db67c94391e5
27e1bfafbc0ee527014a4ca00a7cac1a9b55c5fb
refs/heads/master
2020-03-29T08:31:55.041000
2019-02-18T04:18:03
2019-02-18T04:18:03
149,715,363
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.bitflash.vip.trade.controller;//package cn.bitflash.vip.trade.controller; import cn.bitflash.annotation.Login; import cn.bitflash.entity.*; import cn.bitflash.utils.R; import cn.bitflash.vip.trade.feign.TradeCommon; import cn.bitflash.vip.trade.feign.TradeFeign; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.Date; @RestController @RequestMapping("trade") @Api(value = "查询列表数据") public class ConfirmTrade { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private TradeFeign tradeFeign; @Login @PostMapping("purchase") @ApiOperation(value = "确认购买") public R purchase(@RequestAttribute("uid") String uid, @ApiParam @RequestParam String orderId, @ApiParam @RequestParam String payPwd) { /** * 1.对比交易密码 * 2.查看订单是否存在 * 3.查询购买人信息 * 4.系统手续费增加 * 5.更新买家收益 * 6.删除手续费表记录 * 7.添加交易记录 */ UserSecretEntity userPayPwd = tradeFeign.selectUserSecretById(uid); if (userPayPwd.getPayPassword().equals(payPwd)) { // 查询订单状态为待确认(state:6) UserMarketTradeEntity trade = tradeFeign.selectTradeByIdAndState(orderId, TradeCommon.STATE_CONFIRM); if (null != trade) { // 卖出数量 BigDecimal quantity = trade.getQuantity(); TradePoundageEntity tradePoundageEntity = tradeFeign.selectTradePoundageById(orderId); if(null != tradePoundageEntity) { //手续费累加 Integer id = 1; UserBrokerageEntity userBrokerageEntity = tradeFeign.selectUserBrokerageById(id); BigDecimal poundage = tradePoundageEntity.getPoundage(); BigDecimal multiplyB = userBrokerageEntity.getSellBrokerage().add(poundage); userBrokerageEntity.setSellBrokerage(multiplyB); tradeFeign.updateUserBrokerage(userBrokerageEntity); UserMarketTradeEntity entity = tradeFeign.selectUserMarketTradeById(trade.getId()); if (null != entity) { BigDecimal availableAssets = entity.getQuantity(); //查询出购买人 UserAssetsNpcEntity userAssetsNpcEntity = tradeFeign.selectUserAssetsNpcById(entity.getPurchaseUid()); if (null != userAssetsNpcEntity) { BigDecimal purchaseAvailable = userAssetsNpcEntity.getAvailableAssets().add(availableAssets); userAssetsNpcEntity.setAvailableAssets(purchaseAvailable); tradeFeign.updateUserAssetsNpc(userAssetsNpcEntity); //删除手续费 tradeFeign.deleteTradePoundageById(orderId); //删除交易记录 tradeFeign.deleteUserMarketTradeById(orderId); //添加历史记录 UserMarketTradeHistoryEntity userMarketTradeHistoryEntity = new UserMarketTradeHistoryEntity(); userMarketTradeHistoryEntity.setUserTradeId(orderId); userMarketTradeHistoryEntity.setSellUid(trade.getUid()); userMarketTradeHistoryEntity.setPurchaseUid(entity.getPurchaseUid()); userMarketTradeHistoryEntity.setPrice(entity.getPrice()); userMarketTradeHistoryEntity.setQuantity(trade.getQuantity()); userMarketTradeHistoryEntity.setOrderState(TradeCommon.STATE_PAY); userMarketTradeHistoryEntity.setFinishTime(new Date()); userMarketTradeHistoryEntity.setCreateTime(new Date()); tradeFeign.insertUserMarketTradeHistory(userMarketTradeHistoryEntity); } else { logger.info("购买人id:" + entity.getPurchaseUid() + "不存在!"); } } else { logger.info("订单号:" + entity.getId() + "不存在!"); } } else { logger.info("订单号:" + orderId + "手续费不存在!"); } } else { logger.info("订单号:" + orderId + "不存在!"); } logger.info("购买人:" + uid + ",订单号:" + orderId); return R.ok(); } return R.error("交易密码错误"); } }
UTF-8
Java
5,115
java
ConfirmTrade.java
Java
[]
null
[]
package cn.bitflash.vip.trade.controller;//package cn.bitflash.vip.trade.controller; import cn.bitflash.annotation.Login; import cn.bitflash.entity.*; import cn.bitflash.utils.R; import cn.bitflash.vip.trade.feign.TradeCommon; import cn.bitflash.vip.trade.feign.TradeFeign; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.Date; @RestController @RequestMapping("trade") @Api(value = "查询列表数据") public class ConfirmTrade { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private TradeFeign tradeFeign; @Login @PostMapping("purchase") @ApiOperation(value = "确认购买") public R purchase(@RequestAttribute("uid") String uid, @ApiParam @RequestParam String orderId, @ApiParam @RequestParam String payPwd) { /** * 1.对比交易密码 * 2.查看订单是否存在 * 3.查询购买人信息 * 4.系统手续费增加 * 5.更新买家收益 * 6.删除手续费表记录 * 7.添加交易记录 */ UserSecretEntity userPayPwd = tradeFeign.selectUserSecretById(uid); if (userPayPwd.getPayPassword().equals(payPwd)) { // 查询订单状态为待确认(state:6) UserMarketTradeEntity trade = tradeFeign.selectTradeByIdAndState(orderId, TradeCommon.STATE_CONFIRM); if (null != trade) { // 卖出数量 BigDecimal quantity = trade.getQuantity(); TradePoundageEntity tradePoundageEntity = tradeFeign.selectTradePoundageById(orderId); if(null != tradePoundageEntity) { //手续费累加 Integer id = 1; UserBrokerageEntity userBrokerageEntity = tradeFeign.selectUserBrokerageById(id); BigDecimal poundage = tradePoundageEntity.getPoundage(); BigDecimal multiplyB = userBrokerageEntity.getSellBrokerage().add(poundage); userBrokerageEntity.setSellBrokerage(multiplyB); tradeFeign.updateUserBrokerage(userBrokerageEntity); UserMarketTradeEntity entity = tradeFeign.selectUserMarketTradeById(trade.getId()); if (null != entity) { BigDecimal availableAssets = entity.getQuantity(); //查询出购买人 UserAssetsNpcEntity userAssetsNpcEntity = tradeFeign.selectUserAssetsNpcById(entity.getPurchaseUid()); if (null != userAssetsNpcEntity) { BigDecimal purchaseAvailable = userAssetsNpcEntity.getAvailableAssets().add(availableAssets); userAssetsNpcEntity.setAvailableAssets(purchaseAvailable); tradeFeign.updateUserAssetsNpc(userAssetsNpcEntity); //删除手续费 tradeFeign.deleteTradePoundageById(orderId); //删除交易记录 tradeFeign.deleteUserMarketTradeById(orderId); //添加历史记录 UserMarketTradeHistoryEntity userMarketTradeHistoryEntity = new UserMarketTradeHistoryEntity(); userMarketTradeHistoryEntity.setUserTradeId(orderId); userMarketTradeHistoryEntity.setSellUid(trade.getUid()); userMarketTradeHistoryEntity.setPurchaseUid(entity.getPurchaseUid()); userMarketTradeHistoryEntity.setPrice(entity.getPrice()); userMarketTradeHistoryEntity.setQuantity(trade.getQuantity()); userMarketTradeHistoryEntity.setOrderState(TradeCommon.STATE_PAY); userMarketTradeHistoryEntity.setFinishTime(new Date()); userMarketTradeHistoryEntity.setCreateTime(new Date()); tradeFeign.insertUserMarketTradeHistory(userMarketTradeHistoryEntity); } else { logger.info("购买人id:" + entity.getPurchaseUid() + "不存在!"); } } else { logger.info("订单号:" + entity.getId() + "不存在!"); } } else { logger.info("订单号:" + orderId + "手续费不存在!"); } } else { logger.info("订单号:" + orderId + "不存在!"); } logger.info("购买人:" + uid + ",订单号:" + orderId); return R.ok(); } return R.error("交易密码错误"); } }
5,115
0.590391
0.588113
113
41.725662
35.009289
139
false
false
0
0
0
0
0
0
0.513274
false
false
2
97f549b00d57f3616abb6c7f0a6d7c0ff289a792
4,578,435,154,400
76a5dc986f857be5b6f5712b76d23de23a35050b
/src/main/java/com/globalids/logics/udf/PermutationUtil.java
a82b39ea8ba6b230b8c30214a5ae8241c3b382e8
[]
no_license
dbshspaul/hiveudf
https://github.com/dbshspaul/hiveudf
c3e619a0044fec43e853551ff414e5c37ee90bd1
3fd444fcb62b82753ea86862eae7eafc4229f33d
refs/heads/master
2020-03-28T03:44:51.019000
2018-09-26T07:43:53
2018-09-26T07:43:53
147,668,318
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.globalids.logics.udf; import org.apache.log4j.Logger; import org.apache.log4j.xml.DOMConfigurator; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; /** * Created by debasish paul on 05-09-2018. */ public class PermutationUtil { public static <T> Collection<List<T>> permutations(List<Collection<T>> collections) { if (collections == null || collections.isEmpty()) { return Collections.emptyList(); } else { Collection<List<T>> res = new ArrayList<List<T>>(); permutationsImpl(collections, res, 0, new ArrayList<T>()); return res; } } private static <T> void permutationsImpl(List<Collection<T>> ori, Collection<List<T>> res, int d, ArrayList<T> current) { if (d == ori.size()) { res.add((ArrayList<T>) current.clone()); return; } Collection<T> currentCollection = ori.get(d); if (currentCollection != null) { for (T element : currentCollection) { ArrayList<T> copy = (ArrayList<T>) current.clone(); copy.add(element); permutationsImpl(ori, res, d + 1, copy); } } } public static void main(String[] args) throws Exception { PermutationUtil util = new PermutationUtil(); // Collection<List<String>> permutations = util.permutations(Arrays.asList(Arrays.asList("Guest Services Associate", "VIC/DSG-01"), // Arrays.asList("Texas", "TX"), // Arrays.asList("Hello", "World"), // Arrays.asList(""))); List<String> data = new ArrayList<String>(); data.add("Guest Services Associate"); data.add("VIC/DSG-01"); List<Collection<String>> collections = new ArrayList<Collection<String>>(); collections.add(data); Collection<List<String>> permutations = util.permutations(collections); DOMConfigurator.configure("src/main/resources/loggerConfig.xml"); Logger logger = Logger.getLogger(PermutationUtil.class); for (List<String> permutation : permutations) { logger.info(permutation); } logger.error("test exception"); } }
UTF-8
Java
2,284
java
PermutationUtil.java
Java
[ { "context": "ections;\nimport java.util.List;\n\n/**\n * Created by debasish paul on 05-09-2018.\n */\npublic class PermutationUtil {", "end": 256, "score": 0.9994834065437317, "start": 243, "tag": "NAME", "value": "debasish paul" } ]
null
[]
package com.globalids.logics.udf; import org.apache.log4j.Logger; import org.apache.log4j.xml.DOMConfigurator; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; /** * Created by <NAME> on 05-09-2018. */ public class PermutationUtil { public static <T> Collection<List<T>> permutations(List<Collection<T>> collections) { if (collections == null || collections.isEmpty()) { return Collections.emptyList(); } else { Collection<List<T>> res = new ArrayList<List<T>>(); permutationsImpl(collections, res, 0, new ArrayList<T>()); return res; } } private static <T> void permutationsImpl(List<Collection<T>> ori, Collection<List<T>> res, int d, ArrayList<T> current) { if (d == ori.size()) { res.add((ArrayList<T>) current.clone()); return; } Collection<T> currentCollection = ori.get(d); if (currentCollection != null) { for (T element : currentCollection) { ArrayList<T> copy = (ArrayList<T>) current.clone(); copy.add(element); permutationsImpl(ori, res, d + 1, copy); } } } public static void main(String[] args) throws Exception { PermutationUtil util = new PermutationUtil(); // Collection<List<String>> permutations = util.permutations(Arrays.asList(Arrays.asList("Guest Services Associate", "VIC/DSG-01"), // Arrays.asList("Texas", "TX"), // Arrays.asList("Hello", "World"), // Arrays.asList(""))); List<String> data = new ArrayList<String>(); data.add("Guest Services Associate"); data.add("VIC/DSG-01"); List<Collection<String>> collections = new ArrayList<Collection<String>>(); collections.add(data); Collection<List<String>> permutations = util.permutations(collections); DOMConfigurator.configure("src/main/resources/loggerConfig.xml"); Logger logger = Logger.getLogger(PermutationUtil.class); for (List<String> permutation : permutations) { logger.info(permutation); } logger.error("test exception"); } }
2,277
0.608144
0.601138
64
34.6875
30.088865
138
false
false
0
0
0
0
0
0
0.71875
false
false
2
7d669e2be62cba552d43c21f383a4d150bdb1fd2
8,967,891,730,365
9e674ecb96cb91bf10819692681c29b5ac6b4a02
/src/com/winterbe/demo/ITR.java
e69ceee4b59bdb072beb78185d2dad6a3f3b3956
[ "MIT" ]
permissive
dineshzadge99/java8-tutorial
https://github.com/dineshzadge99/java8-tutorial
ec6f0927f70082502186d8fe137eabd61ebda866
22c75fbc4223c431eda78804349a7538568ea067
refs/heads/master
2023-05-02T02:26:02.295000
2021-05-22T08:09:43
2021-05-22T08:09:43
369,715,796
0
0
MIT
false
2021-05-22T08:09:44
2021-05-22T04:40:30
2021-05-22T07:23:33
2021-05-22T08:09:43
114
0
0
0
Java
false
false
package com.winterbe.demo; public class ITR { public void add() { System.out.println("hello"); } }
UTF-8
Java
121
java
ITR.java
Java
[]
null
[]
package com.winterbe.demo; public class ITR { public void add() { System.out.println("hello"); } }
121
0.578512
0.578512
9
12.444445
12.446428
36
false
false
0
0
0
0
0
0
0.222222
false
false
2
cd72bc50aa7b7dfa6d47c0d3dcd6217dff80759a
7,198,365,206,228
4f8c81af34497c6e62bce543d688c317da0b7131
/app/src/main/java/com/future/portcitytake/release/adapter/SelectImageAdapter.java
6339f8aedbee847eae206e31e0e4162f97f8ae79
[]
no_license
j-Niu/PortCityTake
https://github.com/j-Niu/PortCityTake
c870e4b41b4d4b5b62959f016d1c5518d232107b
f659ebe901409e24cf9260a7b198cc8377697d39
refs/heads/master
2018-02-08T17:51:39.247000
2017-10-26T06:42:56
2017-10-26T06:42:56
95,064,147
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.future.portcitytake.release.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.future.portcitytake.R; import com.future.portcitytake.discovor.other.OnItemClickListener; import com.zhy.autolayout.utils.AutoUtils; import java.util.ArrayList; import java.util.List; /** * Created by JX on 2017/7/26. */ public class SelectImageAdapter extends RecyclerView.Adapter<SelectImageAdapter.ViewHolder> { private Context context; private LayoutInflater inflater; private List<String> data; private OnSelectClickListener onSelectClickListener; private OnItemClickListener onItemClickListener; public interface OnSelectClickListener { void onSelectClickListener(View v, int position); } public void setOnItemClickListener(OnItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } public void setOnSelectClickListener(OnSelectClickListener onSelectClickListener) { this.onSelectClickListener = onSelectClickListener; } public SelectImageAdapter(Context context) { this.context = context; inflater = LayoutInflater.from(context); data = new ArrayList<>(); } public void clearData() { data.clear(); notifyDataSetChanged(); } public void addData(String path) { data.add(path); notifyDataSetChanged(); } public void deleteData(int position) { data.remove(position); notifyDataSetChanged(); } @Override public SelectImageAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new ViewHolder(inflater.inflate(R.layout.item_select_image, parent, false)); } @Override public void onBindViewHolder(SelectImageAdapter.ViewHolder holder, final int position) { if (position == data.size()) { if (data.size() == 9) { holder.iv_delete.setVisibility(View.GONE); holder.iv_image.setVisibility(View.GONE); return; } holder.iv_delete.setVisibility(View.GONE); holder.iv_image.setImageResource(R.drawable.icon_yjzp); holder.iv_image.setScaleType(ImageView.ScaleType.FIT_CENTER); holder.iv_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (onSelectClickListener != null) { onSelectClickListener.onSelectClickListener(v, position); } } }); } else { holder.iv_delete.setVisibility(View.VISIBLE); Glide.with(context).load(data.get(position)).placeholder(R.drawable.bg_cs_lbqs).dontAnimate().into(holder.iv_image); holder.iv_image.setScaleType(ImageView.ScaleType.CENTER_CROP); holder.iv_delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { deleteData(position); } }); holder.iv_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (onItemClickListener != null) { onItemClickListener.onClick(v, position); } } }); } } @Override public int getItemCount() { return data.size() + 1; } public int getImageSize() { return data.size(); } public List<String> getImages() { return data; } class ViewHolder extends RecyclerView.ViewHolder { private ImageView iv_delete; private ImageView iv_image; public ViewHolder(View itemView) { super(itemView); AutoUtils.autoSize(itemView); iv_delete = (ImageView) itemView.findViewById(R.id.iv_delete); iv_image = (ImageView) itemView.findViewById(R.id.iv_image); } } }
UTF-8
Java
4,280
java
SelectImageAdapter.java
Java
[ { "context": "rayList;\nimport java.util.List;\n\n/**\n * Created by JX on 2017/7/26.\n */\n\npublic class SelectImageAdapte", "end": 506, "score": 0.9991350173950195, "start": 504, "tag": "USERNAME", "value": "JX" } ]
null
[]
package com.future.portcitytake.release.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.future.portcitytake.R; import com.future.portcitytake.discovor.other.OnItemClickListener; import com.zhy.autolayout.utils.AutoUtils; import java.util.ArrayList; import java.util.List; /** * Created by JX on 2017/7/26. */ public class SelectImageAdapter extends RecyclerView.Adapter<SelectImageAdapter.ViewHolder> { private Context context; private LayoutInflater inflater; private List<String> data; private OnSelectClickListener onSelectClickListener; private OnItemClickListener onItemClickListener; public interface OnSelectClickListener { void onSelectClickListener(View v, int position); } public void setOnItemClickListener(OnItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } public void setOnSelectClickListener(OnSelectClickListener onSelectClickListener) { this.onSelectClickListener = onSelectClickListener; } public SelectImageAdapter(Context context) { this.context = context; inflater = LayoutInflater.from(context); data = new ArrayList<>(); } public void clearData() { data.clear(); notifyDataSetChanged(); } public void addData(String path) { data.add(path); notifyDataSetChanged(); } public void deleteData(int position) { data.remove(position); notifyDataSetChanged(); } @Override public SelectImageAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new ViewHolder(inflater.inflate(R.layout.item_select_image, parent, false)); } @Override public void onBindViewHolder(SelectImageAdapter.ViewHolder holder, final int position) { if (position == data.size()) { if (data.size() == 9) { holder.iv_delete.setVisibility(View.GONE); holder.iv_image.setVisibility(View.GONE); return; } holder.iv_delete.setVisibility(View.GONE); holder.iv_image.setImageResource(R.drawable.icon_yjzp); holder.iv_image.setScaleType(ImageView.ScaleType.FIT_CENTER); holder.iv_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (onSelectClickListener != null) { onSelectClickListener.onSelectClickListener(v, position); } } }); } else { holder.iv_delete.setVisibility(View.VISIBLE); Glide.with(context).load(data.get(position)).placeholder(R.drawable.bg_cs_lbqs).dontAnimate().into(holder.iv_image); holder.iv_image.setScaleType(ImageView.ScaleType.CENTER_CROP); holder.iv_delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { deleteData(position); } }); holder.iv_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (onItemClickListener != null) { onItemClickListener.onClick(v, position); } } }); } } @Override public int getItemCount() { return data.size() + 1; } public int getImageSize() { return data.size(); } public List<String> getImages() { return data; } class ViewHolder extends RecyclerView.ViewHolder { private ImageView iv_delete; private ImageView iv_image; public ViewHolder(View itemView) { super(itemView); AutoUtils.autoSize(itemView); iv_delete = (ImageView) itemView.findViewById(R.id.iv_delete); iv_image = (ImageView) itemView.findViewById(R.id.iv_image); } } }
4,280
0.629907
0.62757
139
29.791367
26.95546
128
false
false
0
0
0
0
0
0
0.446043
false
false
2
565adce49919ae9fbdbf153134da923b57255ac8
38,397,007,632,414
fb181b3ea8026d5eb943cb152f50357ff018d755
/src/application/Act.java
54a3e20a3686d928554c752d1e7319756b625076
[]
no_license
TehanovAnton/javalab3
https://github.com/TehanovAnton/javalab3
dc8271444769f35e53f516ee7a4c401df13e49d8
b04cab24961fb50bea88a97b9488f3458cf8a934
refs/heads/master
2023-04-16T04:52:30.655000
2021-04-27T09:14:46
2021-04-27T09:14:46
362,051,029
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package application; public enum Act { AddClient, AskAdmin, ShowInfo, Stop, Pay, TopupBalanc, Block, ViewBalance }
UTF-8
Java
120
java
Act.java
Java
[]
null
[]
package application; public enum Act { AddClient, AskAdmin, ShowInfo, Stop, Pay, TopupBalanc, Block, ViewBalance }
120
0.75
0.75
5
23
28.192198
77
false
false
0
0
0
0
0
0
1.6
false
false
2
206814b7127c0f6342d1bafd0c44be2e6b9b29f4
3,779,571,287,843
a98e94839cf0207d45a61dd2c40e8d0fc7db972c
/conference/src/main/java/ru/waveaccess/conference/aspect/MailAspect.java
a311ce87bf9b14a5f62dec8ab799152ae0393f36
[]
no_license
doggipes/conference_task
https://github.com/doggipes/conference_task
3e0fc68cc2714f3a88ea5d02c2a4dc4f2bed26b3
d2f48d575ef1339d1f85811c3fafa7d939aeaaa7
refs/heads/main
2023-03-27T19:19:21.880000
2021-03-31T08:53:18
2021-03-31T08:53:18
351,794,942
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.waveaccess.conference.aspect; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import ru.waveaccess.conference.model.entity.VerificationToken; import ru.waveaccess.conference.service.interfaces.MailService; @Aspect @Component public class MailAspect { private final MailService mailService; public MailAspect(MailService mailService) { this.mailService = mailService; } @AfterReturning(pointcut = "execution(* ru.waveaccess.conference.service.impl.TokenServiceImpl.createToken(..))", returning = "verificationToken") public void sendEmail(VerificationToken verificationToken) { mailService.sendEmail(verificationToken.getUser().getEmail(), verificationToken.getToken()); } }
UTF-8
Java
824
java
MailAspect.java
Java
[]
null
[]
package ru.waveaccess.conference.aspect; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import ru.waveaccess.conference.model.entity.VerificationToken; import ru.waveaccess.conference.service.interfaces.MailService; @Aspect @Component public class MailAspect { private final MailService mailService; public MailAspect(MailService mailService) { this.mailService = mailService; } @AfterReturning(pointcut = "execution(* ru.waveaccess.conference.service.impl.TokenServiceImpl.createToken(..))", returning = "verificationToken") public void sendEmail(VerificationToken verificationToken) { mailService.sendEmail(verificationToken.getUser().getEmail(), verificationToken.getToken()); } }
824
0.790049
0.790049
22
36.454544
36.853184
150
false
false
0
0
0
0
0
0
0.5
false
false
2
36c046f610874b1993ee002ba8f13f875e8e24c8
34,918,084,149,557
020b9ad0eb107503d8a7ededa41fa9a953081aae
/src/org/dyndns/fules/grkey/PointF.java
32fa50647af26b21cb324e9d32c8b49e9973f04f
[]
no_license
gsimon75-android/GRKeyboard
https://github.com/gsimon75-android/GRKeyboard
2372034514092c54e639db48f5fcf66647f35c6c
4da45f8f301d26ec73754a2972800bad7233f7ab
refs/heads/master
2020-06-17T16:32:04.563000
2018-03-08T14:21:46
2018-03-08T14:21:46
195,977,697
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.dyndns.fules.grkey; class PointF { public static final float PI = (float)Math.PI; float x, y; PointF() { this(0, 0); } PointF(float x, float y) { this.x = x; this.y = y; } PointF(PointF other) { x = other.x; y = other.y; } public final String toString() { return "(" + x + ", " + y + ")"; } public float abs2() { return x*x + y*y; } public void add(PointF other) { x += other.x; y += other.y; } public void subtract(PointF other) { x -= other.x; y -= other.y; } public void multiply(float r) { x *= r; y *= r; } public void normalise() { float l = (float)Math.sqrt(abs2()); if (l != 0) { x /= l; y /= l; } } public void makeLength(float r) { float l = (float)Math.sqrt(abs2()); if (l != 0) { x = x * r / l; y = y * r / l; } } public float dist2(PointF other) { return (float)Math.hypot(x-other.x, y-other.y); } } // vim: set ts=4 sw=4 noet:
UTF-8
Java
944
java
PointF.java
Java
[]
null
[]
package org.dyndns.fules.grkey; class PointF { public static final float PI = (float)Math.PI; float x, y; PointF() { this(0, 0); } PointF(float x, float y) { this.x = x; this.y = y; } PointF(PointF other) { x = other.x; y = other.y; } public final String toString() { return "(" + x + ", " + y + ")"; } public float abs2() { return x*x + y*y; } public void add(PointF other) { x += other.x; y += other.y; } public void subtract(PointF other) { x -= other.x; y -= other.y; } public void multiply(float r) { x *= r; y *= r; } public void normalise() { float l = (float)Math.sqrt(abs2()); if (l != 0) { x /= l; y /= l; } } public void makeLength(float r) { float l = (float)Math.sqrt(abs2()); if (l != 0) { x = x * r / l; y = y * r / l; } } public float dist2(PointF other) { return (float)Math.hypot(x-other.x, y-other.y); } } // vim: set ts=4 sw=4 noet:
944
0.537076
0.526483
67
13.089552
13.435008
49
false
false
0
0
0
0
0
0
1.552239
false
false
2
88f66696b35b24b94d4a0a62850a1d1a2544a1b8
36,636,071,052,439
cd6076d3bec398533916c66e0b42d2a2f1de7120
/app/src/main/java/jokesbook/app/Adapters/CategoryListAdapter.java
642610ab0dcb1b00e2c49998a16309d9c1c34909
[]
no_license
shahrob/Testing
https://github.com/shahrob/Testing
d7f768e572544d4ec8dfad778d9fd38e57e9f1ad
cfb8e7ac7fcc773eb9311e7ab6a60396773900c0
refs/heads/master
2023-01-23T00:55:54.764000
2020-11-20T04:50:33
2020-11-20T04:50:33
314,244,320
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package jokesbook.app.Adapters; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import jokesbook.app.Activity.SelectFromSearchActivity; import jokesbook.app.Fragments.RandomFeedFragment; import jokesbook.app.Models.FeedListModel.CategoriesList; import jokesbook.app.R; import java.util.ArrayList; public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder>{ private Context mContext; private ArrayList<CategoriesList> cate_Arr; // private ArrayList<String> category_history_array; // private ArrayList<String> category_id_array; private SharedPreferences sp; private int a; public CategoryListAdapter(Context mContext, ArrayList<CategoriesList> cate_Arr) { this.cate_Arr = cate_Arr; this.mContext = mContext; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.category_list, parent, false); return new MyViewHolder(itemView); } @Override public void onBindViewHolder(MyViewHolder holder, final int position) { // category_history_array = RandomFeedFragment.category_history_array; // category_id_array = RandomFeedFragment.category_id_history; if (RandomFeedFragment.category_history_array == null){ // category_history_array = new ArrayList<>(); // category_id_array = new ArrayList<>(); // RandomFeedFragment.category_history_array = category_history_array; // RandomFeedFragment.category_id_history = category_id_array; RandomFeedFragment.category_history_array = new ArrayList<>(); RandomFeedFragment.category_id_history = new ArrayList<>(); } if (!RandomFeedFragment.category_history_array.isEmpty()) { String last_category_name = RandomFeedFragment.category_history_array.get(RandomFeedFragment.category_history_array.size() - 1); String cate_id = cate_Arr.get(position).getCate_title(); if (cate_id.equals(last_category_name)) { holder.hidden_layout.setVisibility(View.VISIBLE); holder.main_layout.setVisibility(View.GONE); holder.feed_category_list_text_hidden.setText(cate_Arr.get(position).getCate_title()); } else { holder.hidden_layout.setVisibility(View.GONE); holder.main_layout.setVisibility(View.VISIBLE); holder.feed_category_list_text.setText(cate_Arr.get(position).getCate_title()); } }else { holder.feed_category_list_text.setText(cate_Arr.get(position).getCate_title()); } holder.main_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { RandomFeedFragment.category_history_array.add(cate_Arr.get(position).getCate_title()); RandomFeedFragment.category_id_history.add(cate_Arr.get(position).getCate_id()); Intent intt = new Intent(mContext, SelectFromSearchActivity.class); intt.putExtra("CAT_ID",cate_Arr.get(position).getCate_id()); intt.putExtra("CAT_NAME",cate_Arr.get(position).getCate_title()); mContext.startActivity(intt); if (RandomFeedFragment.category_history_array.size() != 1) { ((Activity) mContext).finish(); } } }); } @Override public int getItemCount() { return cate_Arr.size(); } public class MyViewHolder extends RecyclerView.ViewHolder{ TextView feed_category_list_text, feed_category_list_text_hidden; LinearLayout hidden_layout, main_layout; public MyViewHolder(View itemView) { super(itemView); feed_category_list_text = itemView.findViewById(R.id.feed_category_list_text); hidden_layout = itemView.findViewById(R.id.hidden_layout); feed_category_list_text_hidden = itemView.findViewById(R.id.feed_category_list_text_hidden); main_layout = itemView.findViewById(R.id.main_layout); } } }
UTF-8
Java
4,614
java
CategoryListAdapter.java
Java
[]
null
[]
package jokesbook.app.Adapters; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import jokesbook.app.Activity.SelectFromSearchActivity; import jokesbook.app.Fragments.RandomFeedFragment; import jokesbook.app.Models.FeedListModel.CategoriesList; import jokesbook.app.R; import java.util.ArrayList; public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder>{ private Context mContext; private ArrayList<CategoriesList> cate_Arr; // private ArrayList<String> category_history_array; // private ArrayList<String> category_id_array; private SharedPreferences sp; private int a; public CategoryListAdapter(Context mContext, ArrayList<CategoriesList> cate_Arr) { this.cate_Arr = cate_Arr; this.mContext = mContext; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.category_list, parent, false); return new MyViewHolder(itemView); } @Override public void onBindViewHolder(MyViewHolder holder, final int position) { // category_history_array = RandomFeedFragment.category_history_array; // category_id_array = RandomFeedFragment.category_id_history; if (RandomFeedFragment.category_history_array == null){ // category_history_array = new ArrayList<>(); // category_id_array = new ArrayList<>(); // RandomFeedFragment.category_history_array = category_history_array; // RandomFeedFragment.category_id_history = category_id_array; RandomFeedFragment.category_history_array = new ArrayList<>(); RandomFeedFragment.category_id_history = new ArrayList<>(); } if (!RandomFeedFragment.category_history_array.isEmpty()) { String last_category_name = RandomFeedFragment.category_history_array.get(RandomFeedFragment.category_history_array.size() - 1); String cate_id = cate_Arr.get(position).getCate_title(); if (cate_id.equals(last_category_name)) { holder.hidden_layout.setVisibility(View.VISIBLE); holder.main_layout.setVisibility(View.GONE); holder.feed_category_list_text_hidden.setText(cate_Arr.get(position).getCate_title()); } else { holder.hidden_layout.setVisibility(View.GONE); holder.main_layout.setVisibility(View.VISIBLE); holder.feed_category_list_text.setText(cate_Arr.get(position).getCate_title()); } }else { holder.feed_category_list_text.setText(cate_Arr.get(position).getCate_title()); } holder.main_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { RandomFeedFragment.category_history_array.add(cate_Arr.get(position).getCate_title()); RandomFeedFragment.category_id_history.add(cate_Arr.get(position).getCate_id()); Intent intt = new Intent(mContext, SelectFromSearchActivity.class); intt.putExtra("CAT_ID",cate_Arr.get(position).getCate_id()); intt.putExtra("CAT_NAME",cate_Arr.get(position).getCate_title()); mContext.startActivity(intt); if (RandomFeedFragment.category_history_array.size() != 1) { ((Activity) mContext).finish(); } } }); } @Override public int getItemCount() { return cate_Arr.size(); } public class MyViewHolder extends RecyclerView.ViewHolder{ TextView feed_category_list_text, feed_category_list_text_hidden; LinearLayout hidden_layout, main_layout; public MyViewHolder(View itemView) { super(itemView); feed_category_list_text = itemView.findViewById(R.id.feed_category_list_text); hidden_layout = itemView.findViewById(R.id.hidden_layout); feed_category_list_text_hidden = itemView.findViewById(R.id.feed_category_list_text_hidden); main_layout = itemView.findViewById(R.id.main_layout); } } }
4,614
0.660381
0.659731
122
36.819672
33.226498
144
false
false
0
0
0
0
0
0
0.565574
false
false
2
9def6fedf837967567a6cd8c8a4eb62f493039c4
36,636,071,052,796
1a0c2425029af29933df2f00b626dfcc7aeaf8c6
/domain/src/main/java/com/eurder/domain/dto/ReportDto.java
92c0db69e79e1793d76879af6e05147853fc144a
[]
no_license
boddz/eurder
https://github.com/boddz/eurder
7ee62766fa57a3c27a5bc7708dd88bc5a6d3ae65
2eec34cb7d421834ff16b716019c86fbdd329add
refs/heads/master
2021-05-19T09:29:40.279000
2020-04-10T16:20:39
2020-04-10T16:20:39
251,630,476
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.eurder.domain.dto; import com.eurder.domain.classes.Price; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class ReportDto { private List<OrderDto> orderReportList; private Price totalpriceOfOrders; public ReportDto() { this.orderReportList = new ArrayList<>(); this.totalpriceOfOrders = calculateTotal(); } public void addOrder(OrderDto order) { orderReportList.add(order); setTotalpriceOfOrders(); } public List<OrderDto> getOrderReportList() { return orderReportList; } public void setOrderReportList(List<OrderDto> orderReportList) { this.orderReportList = orderReportList; } public Price getTotalpriceOfOrders() { return totalpriceOfOrders; } public void setTotalpriceOfOrders(Price totalpriceOfOrders) { this.totalpriceOfOrders = totalpriceOfOrders; } Price calculateTotal() { int prijs = 0; for (OrderDto order : orderReportList) { prijs += order.getTotalPrice().getPrice(); } return new Price(prijs, "eur"); } public void setTotalpriceOfOrders() { this.totalpriceOfOrders = calculateTotal(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportDto reportDto = (ReportDto) o; return Objects.equals(orderReportList, reportDto.orderReportList) && Objects.equals(totalpriceOfOrders, reportDto.totalpriceOfOrders); } @Override public int hashCode() { return Objects.hash(orderReportList, totalpriceOfOrders); } @Override public String toString() { return "ReportDto{" + "orderReportList=" + orderReportList + ", totalpriceOfOrders=" + totalpriceOfOrders + '}'; } }
UTF-8
Java
1,955
java
ReportDto.java
Java
[]
null
[]
package com.eurder.domain.dto; import com.eurder.domain.classes.Price; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class ReportDto { private List<OrderDto> orderReportList; private Price totalpriceOfOrders; public ReportDto() { this.orderReportList = new ArrayList<>(); this.totalpriceOfOrders = calculateTotal(); } public void addOrder(OrderDto order) { orderReportList.add(order); setTotalpriceOfOrders(); } public List<OrderDto> getOrderReportList() { return orderReportList; } public void setOrderReportList(List<OrderDto> orderReportList) { this.orderReportList = orderReportList; } public Price getTotalpriceOfOrders() { return totalpriceOfOrders; } public void setTotalpriceOfOrders(Price totalpriceOfOrders) { this.totalpriceOfOrders = totalpriceOfOrders; } Price calculateTotal() { int prijs = 0; for (OrderDto order : orderReportList) { prijs += order.getTotalPrice().getPrice(); } return new Price(prijs, "eur"); } public void setTotalpriceOfOrders() { this.totalpriceOfOrders = calculateTotal(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportDto reportDto = (ReportDto) o; return Objects.equals(orderReportList, reportDto.orderReportList) && Objects.equals(totalpriceOfOrders, reportDto.totalpriceOfOrders); } @Override public int hashCode() { return Objects.hash(orderReportList, totalpriceOfOrders); } @Override public String toString() { return "ReportDto{" + "orderReportList=" + orderReportList + ", totalpriceOfOrders=" + totalpriceOfOrders + '}'; } }
1,955
0.639386
0.638875
74
25.418919
22.695402
81
false
false
0
0
0
0
0
0
0.432432
false
false
2
eb8860a18202fb079f3739a12ade1ecf77704103
266,288,025,641
30b52e3a56ad2c2fcfd9636fe4dfc8936f602f77
/ProjetoCalculadora/src/br/projetocalculadora/controllers/IController.java
f0ff0c999ddedf23db46c39cfb51e3c489b2f729
[]
no_license
brenofelixsousa/projetoCalculadora
https://github.com/brenofelixsousa/projetoCalculadora
fcc3e6492a887a5f7ec0473692e3ba5484fb9552
792c8f2c024d5d3f64d426e4b22b1dfaba4d850f
refs/heads/master
2021-08-31T08:20:27.667000
2017-12-20T19:07:13
2017-12-20T19:07:13
114,912,399
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.projetocalculadora.controllers; public interface IController { public float callOperation(float a, float b); }
UTF-8
Java
127
java
IController.java
Java
[]
null
[]
package br.projetocalculadora.controllers; public interface IController { public float callOperation(float a, float b); }
127
0.787402
0.787402
5
23.799999
19.74234
46
false
false
0
0
0
0
0
0
0.8
false
false
2
904891077f6d45afab98c0b457b84f9454ab580a
34,187,939,711,695
60676b2356a6f186a752d91690a1629bb6f923e1
/HopOnCMU/app/src/main/java/pt/ulisboa/tecnico/cmov/hoponcmu/communication/response/RankingResponse.java
510db713a694b565b6b5d5bba876026eb3165f8a
[]
no_license
jtf16/HopOnCMU
https://github.com/jtf16/HopOnCMU
adfc046660b7d243847f1f855722a9d7025a9729
75f355f3f7fa1e78a9559c26217c4ed6ef0c2521
refs/heads/master
2021-04-07T13:03:34.312000
2018-05-18T22:42:09
2018-05-18T22:42:09
125,291,053
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pt.ulisboa.tecnico.cmov.hoponcmu.communication.response; import pt.ulisboa.tecnico.cmov.hoponcmu.data.objects.User; public class RankingResponse implements Response { private static final long serialVersionUID = 734457624276534179L; private User[] users; public RankingResponse(User[] users) { this.users = users; } public User[] getUsers() { return users; } }
UTF-8
Java
414
java
RankingResponse.java
Java
[]
null
[]
package pt.ulisboa.tecnico.cmov.hoponcmu.communication.response; import pt.ulisboa.tecnico.cmov.hoponcmu.data.objects.User; public class RankingResponse implements Response { private static final long serialVersionUID = 734457624276534179L; private User[] users; public RankingResponse(User[] users) { this.users = users; } public User[] getUsers() { return users; } }
414
0.71256
0.669082
17
23.352942
24.204865
69
false
false
0
0
0
0
0
0
0.352941
false
false
2
2e851e22a8c3b88f610f7f0f3a9729fb418da64f
11,854,109,800,300
05a5ff657f39845696d9b41b37ff186d51f56d7b
/app/src/main/java/gvillani/it/pinnedlistdemo/Contact.java
ffdd52b525168744d1b4055376ab0f2a817a1518
[ "Apache-2.0" ]
permissive
kekullc/PinnedList-Android
https://github.com/kekullc/PinnedList-Android
e2539a9de04cff3a34cd3f9cd5ae65307548761e
0fef42d524d917bdb817a2ca758c84c181e2f4eb
refs/heads/master
2021-04-15T10:37:40.390000
2018-05-15T13:48:56
2018-05-15T13:48:56
126,846,344
1
0
Apache-2.0
true
2018-05-15T13:48:57
2018-03-26T15:03:34
2018-05-15T13:48:42
2018-05-15T13:48:56
456
1
0
0
Java
false
null
package gvillani.it.pinnedlistdemo; import com.gvillani.pinnedlist.GroupListWrapper; /** * Created by Giuseppe on 09/04/2016. */ public class Contact implements GroupListWrapper.Selector{ private String name; private String surname; private Integer photo; public Contact(String name, String surname, Integer photo) { this.name = name; this.surname = surname; this.photo = photo; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getPhoto() { return photo; } public void setPhoto(Integer photo) { this.photo = photo; } @Override public String toString() { return "Contact{" + "name='" + name + '\'' + ", surname='" + surname + '\'' + ", photo=" + photo + '}'; } @Override public String select() { return getName()+getSurname(); } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } }
UTF-8
Java
1,221
java
Contact.java
Java
[ { "context": "pinnedlist.GroupListWrapper;\r\n\r\n/**\r\n * Created by Giuseppe on 09/04/2016.\r\n */\r\npublic class Contact impleme", "end": 118, "score": 0.977746844291687, "start": 110, "tag": "NAME", "value": "Giuseppe" } ]
null
[]
package gvillani.it.pinnedlistdemo; import com.gvillani.pinnedlist.GroupListWrapper; /** * Created by Giuseppe on 09/04/2016. */ public class Contact implements GroupListWrapper.Selector{ private String name; private String surname; private Integer photo; public Contact(String name, String surname, Integer photo) { this.name = name; this.surname = surname; this.photo = photo; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getPhoto() { return photo; } public void setPhoto(Integer photo) { this.photo = photo; } @Override public String toString() { return "Contact{" + "name='" + name + '\'' + ", surname='" + surname + '\'' + ", photo=" + photo + '}'; } @Override public String select() { return getName()+getSurname(); } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } }
1,221
0.534808
0.528256
56
19.803572
17.062302
64
false
false
0
0
0
0
0
0
0.357143
false
false
2
e7efac40dd90d988a32d4f9408db90a8016899f3
35,158,602,322,481
757092330bee4428a7cbfe66af1ab633a6f79b2e
/src/main/java/sdm/examproject/dots_and_boxes/IOManager.java
7335c3d86cfa0b0106e229009a3a459c89381e2c
[]
no_license
Ivan-Zennaro/dots_and_boxes
https://github.com/Ivan-Zennaro/dots_and_boxes
6009d4bd4bdba9d3410604789854c32fd8851256
49d83f0be4db270e1f39634ded3913c6b7c8a7d7
refs/heads/main
2023-02-18T18:01:04.763000
2021-01-23T10:38:56
2021-01-23T10:38:56
323,631,989
0
0
null
false
2021-01-19T16:17:43
2020-12-22T13:21:32
2021-01-19T11:30:40
2021-01-19T16:17:43
5,831
0
0
0
Java
false
false
package sdm.examproject.dots_and_boxes; public abstract class IOManager { public abstract Move readMove(); public abstract void updateMove(Move move, Player p); public abstract void updateCompletedBox(Move move, Player p); public abstract void updateGameInfo(Player currentPlayer); public abstract void showWinner(); public abstract void errorHandler(String msg, boolean fatalError); protected final Player player1; protected final Player player2; protected final int mappedRows; protected final int mappedCols; protected boolean backPress = false; protected IOManager (int boardRows, int boardCols, Player p1, Player p2){ this.player1 = p1; this.player2 = p2; this.mappedRows = boardRows * 2 + 1; this.mappedCols = boardCols + 1; } public boolean getBackPress() { return backPress; } protected static int getMappedY(Move move) { return move.getSide() == Side.RIGHT ? move.getY() + 1 : move.getY(); } protected static int getMappedX(Move move) { int tempX = move.getX() * 2 + 1; if (move.getSide() == Side.UP) return tempX - 1; if (move.getSide() == Side.DOWN) return tempX + 1; else return tempX; } protected boolean isValidPositionInMatrix(int indexRow, int indexCol) { return isAHorizontalValidLineInMatrix(indexRow, indexCol) || isAVerticalValidLineInMatrix(indexRow, indexCol); } private boolean isAHorizontalValidLineInMatrix(int indexRow, int indexCol) { return indexRow % 2 == 0 && indexCol < mappedCols - 1; } private boolean isAVerticalValidLineInMatrix(int indexRow, int indexCol) { return indexRow % 2 != 0 && indexCol < mappedCols; } }
UTF-8
Java
1,794
java
IOManager.java
Java
[]
null
[]
package sdm.examproject.dots_and_boxes; public abstract class IOManager { public abstract Move readMove(); public abstract void updateMove(Move move, Player p); public abstract void updateCompletedBox(Move move, Player p); public abstract void updateGameInfo(Player currentPlayer); public abstract void showWinner(); public abstract void errorHandler(String msg, boolean fatalError); protected final Player player1; protected final Player player2; protected final int mappedRows; protected final int mappedCols; protected boolean backPress = false; protected IOManager (int boardRows, int boardCols, Player p1, Player p2){ this.player1 = p1; this.player2 = p2; this.mappedRows = boardRows * 2 + 1; this.mappedCols = boardCols + 1; } public boolean getBackPress() { return backPress; } protected static int getMappedY(Move move) { return move.getSide() == Side.RIGHT ? move.getY() + 1 : move.getY(); } protected static int getMappedX(Move move) { int tempX = move.getX() * 2 + 1; if (move.getSide() == Side.UP) return tempX - 1; if (move.getSide() == Side.DOWN) return tempX + 1; else return tempX; } protected boolean isValidPositionInMatrix(int indexRow, int indexCol) { return isAHorizontalValidLineInMatrix(indexRow, indexCol) || isAVerticalValidLineInMatrix(indexRow, indexCol); } private boolean isAHorizontalValidLineInMatrix(int indexRow, int indexCol) { return indexRow % 2 == 0 && indexCol < mappedCols - 1; } private boolean isAVerticalValidLineInMatrix(int indexRow, int indexCol) { return indexRow % 2 != 0 && indexCol < mappedCols; } }
1,794
0.666109
0.654404
60
28.9
28.114468
118
false
false
0
0
0
0
0
0
0.633333
false
false
2
ab3209d3f6b1ee75a0d56f026c451c0a86fa8201
34,737,695,530,743
3b30b51a7f797af215781bbc79980cd76e44c26a
/decompiled-procyon/a/a/a/c.java
dc1f1e99dbcb0b466d6ddf77b7b18d04d5ea4a85
[]
no_license
Wenaly/alien-deobf-source
https://github.com/Wenaly/alien-deobf-source
d785cc179d2f73124e7b6fad78dbf23ef1cdd815
3f552c577d6ef0fa16d041f05119ffd21cc7c9fa
refs/heads/main
2023-06-01T03:30:40.286000
2021-06-16T22:26:49
2021-06-16T22:26:49
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package a.a.a; import java.util.*; import a.a.c.*; import a.*; public final class c { public final x a; public final z b; c(final x a, final z b) { super(); this.a = a; this.b = b; } public static boolean a(final z z, final x x) { switch (z.c) { default: { return false; } case 302: case 307: { if (z.decrypt_str("Expires") == null && z.b().e == -1 && !z.b().g && !z.b().f) { return false; } return !z.b().d && !x.b().d; } case 200: case 203: case 204: case 300: case 301: case 308: case 404: case 405: case 410: case 414: case 501: { return !z.b().d && !x.b().d; } } } public static final class a { final long a; final x b; final z c; Date d; String e; Date f; String g; Date h; long i; long j; String k; int l; public a(final long a, final x b, final z c) { super(); this.l = -1; this.a = a; this.b = b; this.c = c; if (c != null) { this.i = c.k; this.j = c.l; final q f = c.f; for (int i = 0; i < f.a.length / 2; ++i) { final String a2 = f.a(i); final String b2 = f.b(i); if ("Date".equalsIgnoreCase(a2)) { this.d = d.a(b2); this.e = b2; } else if ("Expires".equalsIgnoreCase(a2)) { this.h = d.a(b2); } else if ("Last-Modified".equalsIgnoreCase(a2)) { this.f = d.a(b2); this.g = b2; } else if ("ETag".equalsIgnoreCase(a2)) { this.k = b2; } else if ("Age".equalsIgnoreCase(a2)) { this.l = e.b(b2, -1); } } } } } }
UTF-8
Java
2,406
java
c.java
Java
[]
null
[]
package a.a.a; import java.util.*; import a.a.c.*; import a.*; public final class c { public final x a; public final z b; c(final x a, final z b) { super(); this.a = a; this.b = b; } public static boolean a(final z z, final x x) { switch (z.c) { default: { return false; } case 302: case 307: { if (z.decrypt_str("Expires") == null && z.b().e == -1 && !z.b().g && !z.b().f) { return false; } return !z.b().d && !x.b().d; } case 200: case 203: case 204: case 300: case 301: case 308: case 404: case 405: case 410: case 414: case 501: { return !z.b().d && !x.b().d; } } } public static final class a { final long a; final x b; final z c; Date d; String e; Date f; String g; Date h; long i; long j; String k; int l; public a(final long a, final x b, final z c) { super(); this.l = -1; this.a = a; this.b = b; this.c = c; if (c != null) { this.i = c.k; this.j = c.l; final q f = c.f; for (int i = 0; i < f.a.length / 2; ++i) { final String a2 = f.a(i); final String b2 = f.b(i); if ("Date".equalsIgnoreCase(a2)) { this.d = d.a(b2); this.e = b2; } else if ("Expires".equalsIgnoreCase(a2)) { this.h = d.a(b2); } else if ("Last-Modified".equalsIgnoreCase(a2)) { this.f = d.a(b2); this.g = b2; } else if ("ETag".equalsIgnoreCase(a2)) { this.k = b2; } else if ("Age".equalsIgnoreCase(a2)) { this.l = e.b(b2, -1); } } } } } }
2,406
0.322943
0.298836
95
24.326315
16.518852
96
false
false
0
0
0
0
0
0
0.515789
false
false
2
ce4f42ed56e9890974ceea78d76cdac613b38797
34,737,695,531,419
48be08b9dba1db35c6b9d9af5dd24e9718eb4246
/cli/src/main/java/com/guilherme/cli/cadastro/telasdecadastro/cliente/TelaDeCadastroDeCliente.java
b6a48ef18500913fcc1b424096d783786f1ea96e
[ "MIT" ]
permissive
GuilhermeEsdras/Projeto-Banco-POO
https://github.com/GuilhermeEsdras/Projeto-Banco-POO
22464c116c2cc069c9a6351c941e8902ed7de72b
722b1f912d48a96f5f50f75b5f757d573bd94995
refs/heads/master
2022-06-05T21:53:49.146000
2019-11-12T03:03:37
2019-11-12T03:03:37
217,706,184
0
0
MIT
false
2022-05-20T21:14:30
2019-10-26T12:33:39
2019-11-12T03:03:54
2022-05-20T21:14:30
1,008
0
0
2
Java
false
false
package com.guilherme.cli.cadastro.telasdecadastro.cliente; import com.guilherme.cli.Tela; public class TelaDeCadastroDeCliente extends Tela { public TelaDeCadastroDeCliente(String titulo) { super(titulo); } @Override public void exibirTela() { MenuTelaDeCadastroDeCliente menuTelaDeCadastroDeCliente = new MenuTelaDeCadastroDeCliente(); menuTelaDeCadastroDeCliente.exibirMenu("Qual tipo de cliente deseja cadastrar?", "Digite a opção: "); menuTelaDeCadastroDeCliente.capturaOpção(); menuTelaDeCadastroDeCliente.executa(); } }
UTF-8
Java
595
java
TelaDeCadastroDeCliente.java
Java
[]
null
[]
package com.guilherme.cli.cadastro.telasdecadastro.cliente; import com.guilherme.cli.Tela; public class TelaDeCadastroDeCliente extends Tela { public TelaDeCadastroDeCliente(String titulo) { super(titulo); } @Override public void exibirTela() { MenuTelaDeCadastroDeCliente menuTelaDeCadastroDeCliente = new MenuTelaDeCadastroDeCliente(); menuTelaDeCadastroDeCliente.exibirMenu("Qual tipo de cliente deseja cadastrar?", "Digite a opção: "); menuTelaDeCadastroDeCliente.capturaOpção(); menuTelaDeCadastroDeCliente.executa(); } }
595
0.744501
0.744501
18
31.833334
32.951565
109
false
false
0
0
0
0
0
0
0.444444
false
false
2
80af7be66b90065a084a3aab90e778059a48690c
34,737,695,529,902
7e3e4be2ec6a1b241053273e0046558744e92acc
/Java/hashTable/MyHashSet.java
1a1314725915a9adb202b91277ffd60237e18c4a
[]
no_license
wtzhou74/algorithm
https://github.com/wtzhou74/algorithm
a23e0c42957ef2664e8a0e1d93d84fdc9be5d009
f0a7b4f9ed0e3bb81fe925fc3b77d097d8247a63
refs/heads/master
2021-06-24T09:34:46.870000
2021-01-27T17:48:18
2021-01-27T17:48:18
155,147,084
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hashTable; /** * All values will be in the range of [0, 1000000]. * The number of operations will be in the range of [1, 10000]. * Please do not use the built-in HashSet library. * */ public class MyHashSet { private int buckets = 1000; private int itemsPerBucket = 1001; private boolean[][] table; /** Initialize your data structure here. */ public MyHashSet() { table = new boolean[buckets][];// initialize 2D array } // HASH FUNCTION public int hash(int key) { return key % buckets; } // position of the bucket of the element // NEEDED because of the value range [1, 1000000], otherwise, table[hashKey][key] might cause IndexOutofBound public int pos (int key) { return key / buckets; } public void add(int key) { int hashKey = hash(key);//bucket number if (table[hashKey] == null) { table[hashKey] = new boolean[itemsPerBucket]; // put key into the bucket with 1001 items } table[hashKey][pos(key)] = true; } public void remove(int key) { int hashKey = hash(key); if (table[hashKey] != null) table[hashKey][pos(key)] = false; } /** Returns true if this set contains the specified element */ public boolean contains(int key) { int hashKey = hash(key); if (table[hashKey] != null && table[hashKey][pos(key)]) return true; else return false; } } /** * Your MyHashSet object will be instantiated and called as such: * MyHashSet obj = new MyHashSet(); * obj.add(key); * obj.remove(key); * boolean param_3 = obj.contains(key); */
UTF-8
Java
1,667
java
MyHashSet.java
Java
[]
null
[]
package hashTable; /** * All values will be in the range of [0, 1000000]. * The number of operations will be in the range of [1, 10000]. * Please do not use the built-in HashSet library. * */ public class MyHashSet { private int buckets = 1000; private int itemsPerBucket = 1001; private boolean[][] table; /** Initialize your data structure here. */ public MyHashSet() { table = new boolean[buckets][];// initialize 2D array } // HASH FUNCTION public int hash(int key) { return key % buckets; } // position of the bucket of the element // NEEDED because of the value range [1, 1000000], otherwise, table[hashKey][key] might cause IndexOutofBound public int pos (int key) { return key / buckets; } public void add(int key) { int hashKey = hash(key);//bucket number if (table[hashKey] == null) { table[hashKey] = new boolean[itemsPerBucket]; // put key into the bucket with 1001 items } table[hashKey][pos(key)] = true; } public void remove(int key) { int hashKey = hash(key); if (table[hashKey] != null) table[hashKey][pos(key)] = false; } /** Returns true if this set contains the specified element */ public boolean contains(int key) { int hashKey = hash(key); if (table[hashKey] != null && table[hashKey][pos(key)]) return true; else return false; } } /** * Your MyHashSet object will be instantiated and called as such: * MyHashSet obj = new MyHashSet(); * obj.add(key); * obj.remove(key); * boolean param_3 = obj.contains(key); */
1,667
0.609478
0.587882
56
28.767857
24.845947
113
false
false
0
0
0
0
0
0
0.446429
false
false
2
ea2c31a5d2de774880ead133f6a98a3f0f132d5a
19,825,569,090,206
bfed0d992f925ee137eb94026f0283724eba17fa
/V3.0/ZSPR/src/nl/zeesoft/zspr/test/ZSPR.java
17bcdb9f2cb8e9af3686630d09dde7d85b9d63f9
[]
no_license
DyzLecticus/Zeesoft
https://github.com/DyzLecticus/Zeesoft
c17c469b000f15301ff2be6c19671b12bba25f99
b5053b762627762ffeaa2de4f779d6e1524a936d
refs/heads/master
2023-04-15T01:42:36.260000
2023-04-10T06:50:40
2023-04-10T06:50:40
28,697,832
7
2
null
false
2023-02-27T16:30:37
2015-01-01T22:57:39
2022-11-03T20:10:13
2023-02-27T16:30:36
269,090
7
0
15
Java
false
false
package nl.zeesoft.zspr.test; import java.util.List; import nl.zeesoft.zdk.test.LibraryObject; import nl.zeesoft.zdk.test.TestObject; import nl.zeesoft.zdk.test.Tester; import nl.zeesoft.zdk.test.impl.ZDK; import nl.zeesoft.zspr.pattern.PatternManager; public class ZSPR extends LibraryObject { public ZSPR(Tester tester) { super(tester); setNameAbbreviated("ZSPR"); setNameFull("Zeesoft Symbolic Pattern Recognition"); setBaseProjectUrl("https://github.com/DyzLecticus/Zeesoft/tree/master/V3.0/ZSPR/"); setBaseReleaseUrl("https://github.com/DyzLecticus/Zeesoft/raw/master/V3.0/ZSPR/releases/"); setBaseSrcUrl("https://github.com/DyzLecticus/Zeesoft/blob/master/V3.0/ZSPR/"); getDependencies().add(new ZDK(null)); } public static void main(String[] args) { (new ZSPR(new Tester())).describeAndTest(args); } @Override public void describe() { System.out.println("Zeesoft Symbolic Pattern Recognition"); System.out.println("===================================="); System.out.println("Zeesoft Symbolic Pattern Recognition (ZSPR) is an open source library for Java application development."); System.out.println("It provides support for sequential symbolic pattern recognition."); describeDependencies(); System.out.println(); describeRelease(); System.out.println(); describeTesting(ZSPR.class); System.out.println(); System.out.println("Symbolic Pattern Recognition"); System.out.println("----------------------------"); System.out.println("When parsing symbolic sequences to discern meaning, certain patterns may be easily translated into primary objects like numbers, dates and duration."); System.out.println("This library provides an extendable, thread safe " + getTester().getLinkForClass(PatternManager.class) + " to do just that."); System.out.println("Please note that initializing the default *PatternManager* might take a few seconds and that it requires quite a lot of memory."); System.out.println(); } @Override public void addTests(List<TestObject> tests) { tests.add(new TestPatternManager(getTester())); tests.add(new TestPatternManagerTranslate(getTester())); } }
UTF-8
Java
2,147
java
ZSPR.java
Java
[ { "context": "nition\");\n\t\tsetBaseProjectUrl(\"https://github.com/DyzLecticus/Zeesoft/tree/master/V3.0/ZSPR/\");\n\t\tsetBaseReleas", "end": 481, "score": 0.9943475723266602, "start": 470, "tag": "USERNAME", "value": "DyzLecticus" }, { "context": "/ZSPR/\");\n\t\tsetBaseReleaseUrl(\"https://github.com/DyzLecticus/Zeesoft/raw/master/V3.0/ZSPR/releases/\");\n\t\tsetBa", "end": 567, "score": 0.9972107410430908, "start": 556, "tag": "USERNAME", "value": "DyzLecticus" }, { "context": "/releases/\");\n\t\tsetBaseSrcUrl(\"https://github.com/DyzLecticus/Zeesoft/blob/master/V3.0/ZSPR/\");\n\t\tgetDependenci", "end": 657, "score": 0.9944608807563782, "start": 646, "tag": "USERNAME", "value": "DyzLecticus" } ]
null
[]
package nl.zeesoft.zspr.test; import java.util.List; import nl.zeesoft.zdk.test.LibraryObject; import nl.zeesoft.zdk.test.TestObject; import nl.zeesoft.zdk.test.Tester; import nl.zeesoft.zdk.test.impl.ZDK; import nl.zeesoft.zspr.pattern.PatternManager; public class ZSPR extends LibraryObject { public ZSPR(Tester tester) { super(tester); setNameAbbreviated("ZSPR"); setNameFull("Zeesoft Symbolic Pattern Recognition"); setBaseProjectUrl("https://github.com/DyzLecticus/Zeesoft/tree/master/V3.0/ZSPR/"); setBaseReleaseUrl("https://github.com/DyzLecticus/Zeesoft/raw/master/V3.0/ZSPR/releases/"); setBaseSrcUrl("https://github.com/DyzLecticus/Zeesoft/blob/master/V3.0/ZSPR/"); getDependencies().add(new ZDK(null)); } public static void main(String[] args) { (new ZSPR(new Tester())).describeAndTest(args); } @Override public void describe() { System.out.println("Zeesoft Symbolic Pattern Recognition"); System.out.println("===================================="); System.out.println("Zeesoft Symbolic Pattern Recognition (ZSPR) is an open source library for Java application development."); System.out.println("It provides support for sequential symbolic pattern recognition."); describeDependencies(); System.out.println(); describeRelease(); System.out.println(); describeTesting(ZSPR.class); System.out.println(); System.out.println("Symbolic Pattern Recognition"); System.out.println("----------------------------"); System.out.println("When parsing symbolic sequences to discern meaning, certain patterns may be easily translated into primary objects like numbers, dates and duration."); System.out.println("This library provides an extendable, thread safe " + getTester().getLinkForClass(PatternManager.class) + " to do just that."); System.out.println("Please note that initializing the default *PatternManager* might take a few seconds and that it requires quite a lot of memory."); System.out.println(); } @Override public void addTests(List<TestObject> tests) { tests.add(new TestPatternManager(getTester())); tests.add(new TestPatternManagerTranslate(getTester())); } }
2,147
0.737774
0.734979
51
41.098038
40.246426
173
false
false
0
0
0
0
0
0
1.921569
false
false
2
261edc7076b966f6a973ab96b9f1a3e19562d431
27,041,114,137,883
b63d4619c73d7aba40f8243cb5926da12f7c9157
/webcrud-springboot/src/main/java/com/djoshi/crud/repos/CustomerRepository.java
482d906bd3c6a039dc5d5055858c196158a56983
[]
no_license
dhaval0129/Spring-Web-Crud
https://github.com/dhaval0129/Spring-Web-Crud
479ef0abd975efc8521fe12f2a1323f047da5383
9e73a2722143221153dd881df7e36f3ed7aa6233
refs/heads/master
2023-05-09T06:43:35.898000
2021-05-29T07:13:05
2021-05-29T07:13:05
371,905,893
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.djoshi.crud.repos; import org.springframework.data.repository.CrudRepository; import com.djoshi.crud.entity.Customer; public interface CustomerRepository extends CrudRepository<Customer, Integer> { }
UTF-8
Java
217
java
CustomerRepository.java
Java
[]
null
[]
package com.djoshi.crud.repos; import org.springframework.data.repository.CrudRepository; import com.djoshi.crud.entity.Customer; public interface CustomerRepository extends CrudRepository<Customer, Integer> { }
217
0.824885
0.824885
10
20.700001
27.824629
79
false
false
0
0
0
0
0
0
0.4
false
false
2
813a3a20e8d1e33df1308bfa86d7e4b983cab236
25,417,616,468,894
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/ss/sls/brsup/ds/SS_S_TASLM_BNSITEMINOUTDataSet.java
b6c4fd0568d2c471f4acbcdb2be4b89be681ee84
[]
no_license
nosmoon/misdevteam
https://github.com/nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480000
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/*************************************************************************************************** * 파일명 : .java * 기능 : 통합정보지원시스템 판촉물재고현황 상세조회 * 작성일자 :2009/05/01 * 작성자 : 김용욱 ***************************************************************************************************/ package chosun.ciis.ss.sls.brsup.ds; import java.sql.*; import java.util.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.ss.sls.brsup.dm.*; import chosun.ciis.ss.sls.brsup.rec.*; /** * 통합정보지원시스템 판촉물재고현황 상세조회 */ public class SS_S_TASLM_BNSITEMINOUTDataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{ public ArrayList detailinout = new ArrayList(); public String errcode; public String errmsg; public SS_S_TASLM_BNSITEMINOUTDataSet(){} public SS_S_TASLM_BNSITEMINOUTDataSet(String errcode, String errmsg){ this.errcode = errcode; this.errmsg = errmsg; } public void setErrcode(String errcode){ this.errcode = errcode; } public void setErrmsg(String errmsg){ this.errmsg = errmsg; } public String getErrcode(){ return this.errcode; } public String getErrmsg(){ return this.errmsg; } public void getValues(CallableStatement cstmt) throws SQLException{ this.errcode = Util.checkString(cstmt.getString(1)); this.errmsg = Util.checkString(cstmt.getString(2)); if(!"".equals(this.errcode)){ return; } ResultSet rset0 = (ResultSet) cstmt.getObject(15); while(rset0.next()){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = new SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord(); rec.itemcd = Util.checkString(rset0.getString("itemcd")); rec.bns_itemcd = Util.checkString(rset0.getString("bns_itemcd")); rec.itemnm = Util.checkString(rset0.getString("itemnm")); rec.inoutdt = Util.checkString(rset0.getString("inoutdt")); rec.aftdivnclsf = Util.checkString(rset0.getString("aftdivnclsf")); rec.aftdivnclsfnm = Util.checkString(rset0.getString("aftdivnclsfnm")); rec.unit = Util.checkString(rset0.getString("unit")); rec.uprc = rset0.getInt("uprc"); rec.qunt = rset0.getDouble("qunt"); rec.team = Util.checkString(rset0.getString("team")); rec.part = Util.checkString(rset0.getString("part")); rec.area = Util.checkString(rset0.getString("area")); rec.bo = Util.checkString(rset0.getString("bo")); rec.bonm = Util.checkString(rset0.getString("bonm")); rec.dept_nm = Util.checkString(rset0.getString("dept_nm")); rec.part_nm = Util.checkString(rset0.getString("part_nm")); rec.area_nm = Util.checkString(rset0.getString("area_nm")); rec.no_valqunt = rset0.getDouble("no_valqunt"); rec.valqunt = rset0.getDouble("valqunt"); rec.mainware = Util.checkString(rset0.getString("mainware")); rec.pyungware = Util.checkString(rset0.getString("pyungware")); rec.sungware = Util.checkString(rset0.getString("sungware")); rec.remk = Util.checkString(rset0.getString("remk")); rec.seq = rset0.getInt("seq"); rec.cmpycd = Util.checkString(rset0.getString("cmpycd")); rec.incmgpers = Util.checkString(rset0.getString("incmgpers")); rec.chgpers = Util.checkString(rset0.getString("chgpers")); rec.whcd = Util.checkString(rset0.getString("whcd")); this.detailinout.add(rec); } } public String detailinoutOptHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<option value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" selected "); } sb.append(">"); sb.append(name); sb.append("</option>"); } return sb.toString(); } public String detailinoutChkHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<input name=\""); sb.append("itemcd"); sb.append("\" type=\"checkbox\" value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" checked "); } sb.append(">"); sb.append(name); sb.append("</input>"); } return sb.toString(); } public String detailinoutRdoHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<input name=\""); sb.append("itemcd"); sb.append("\" type=\"radio\" value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" checked "); } sb.append(">"); sb.append(name); sb.append("</input>"); } return sb.toString(); } }/*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오. <% SS_S_TASLM_BNSITEMINOUTDataSet ds = (SS_S_TASLM_BNSITEMINOUTDataSet)request.getAttribute("ds"); %> Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오. <% for(int i=0; i<ds.detailinout.size(); i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord detailinoutRec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)ds.detailinout.get(i);%> HTML 코드들.... <%}%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오. <%= ds.getErrcode()%> <%= ds.getErrmsg()%> <%= ds.getDetailinout()%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오. <%= detailinoutRec.itemcd%> <%= detailinoutRec.bns_itemcd%> <%= detailinoutRec.itemnm%> <%= detailinoutRec.inoutdt%> <%= detailinoutRec.aftdivnclsf%> <%= detailinoutRec.aftdivnclsfnm%> <%= detailinoutRec.unit%> <%= detailinoutRec.uprc%> <%= detailinoutRec.qunt%> <%= detailinoutRec.team%> <%= detailinoutRec.part%> <%= detailinoutRec.area%> <%= detailinoutRec.bo%> <%= detailinoutRec.bonm%> <%= detailinoutRec.dept_nm%> <%= detailinoutRec.part_nm%> <%= detailinoutRec.area_nm%> <%= detailinoutRec.no_valqunt%> <%= detailinoutRec.valqunt%> <%= detailinoutRec.mainware%> <%= detailinoutRec.pyungware%> <%= detailinoutRec.sungware%> <%= detailinoutRec.remk%> <%= detailinoutRec.seq%> <%= detailinoutRec.cmpycd%> <%= detailinoutRec.incmgpers%> <%= detailinoutRec.chgpers%> <%= detailinoutRec.whcd%> ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Thu Jul 02 09:53:09 PDT 2009 */
UHC
Java
7,542
java
SS_S_TASLM_BNSITEMINOUTDataSet.java
Java
[ { "context": "합정보지원시스템 판촉물재고현황 상세조회\r\n* 작성일자 :2009/05/01\r\n* 작성자 : 김용욱\r\n************************************************", "end": 179, "score": 0.9990845322608948, "start": 176, "tag": "NAME", "value": "김용욱" } ]
null
[]
/*************************************************************************************************** * 파일명 : .java * 기능 : 통합정보지원시스템 판촉물재고현황 상세조회 * 작성일자 :2009/05/01 * 작성자 : 김용욱 ***************************************************************************************************/ package chosun.ciis.ss.sls.brsup.ds; import java.sql.*; import java.util.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.ss.sls.brsup.dm.*; import chosun.ciis.ss.sls.brsup.rec.*; /** * 통합정보지원시스템 판촉물재고현황 상세조회 */ public class SS_S_TASLM_BNSITEMINOUTDataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{ public ArrayList detailinout = new ArrayList(); public String errcode; public String errmsg; public SS_S_TASLM_BNSITEMINOUTDataSet(){} public SS_S_TASLM_BNSITEMINOUTDataSet(String errcode, String errmsg){ this.errcode = errcode; this.errmsg = errmsg; } public void setErrcode(String errcode){ this.errcode = errcode; } public void setErrmsg(String errmsg){ this.errmsg = errmsg; } public String getErrcode(){ return this.errcode; } public String getErrmsg(){ return this.errmsg; } public void getValues(CallableStatement cstmt) throws SQLException{ this.errcode = Util.checkString(cstmt.getString(1)); this.errmsg = Util.checkString(cstmt.getString(2)); if(!"".equals(this.errcode)){ return; } ResultSet rset0 = (ResultSet) cstmt.getObject(15); while(rset0.next()){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = new SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord(); rec.itemcd = Util.checkString(rset0.getString("itemcd")); rec.bns_itemcd = Util.checkString(rset0.getString("bns_itemcd")); rec.itemnm = Util.checkString(rset0.getString("itemnm")); rec.inoutdt = Util.checkString(rset0.getString("inoutdt")); rec.aftdivnclsf = Util.checkString(rset0.getString("aftdivnclsf")); rec.aftdivnclsfnm = Util.checkString(rset0.getString("aftdivnclsfnm")); rec.unit = Util.checkString(rset0.getString("unit")); rec.uprc = rset0.getInt("uprc"); rec.qunt = rset0.getDouble("qunt"); rec.team = Util.checkString(rset0.getString("team")); rec.part = Util.checkString(rset0.getString("part")); rec.area = Util.checkString(rset0.getString("area")); rec.bo = Util.checkString(rset0.getString("bo")); rec.bonm = Util.checkString(rset0.getString("bonm")); rec.dept_nm = Util.checkString(rset0.getString("dept_nm")); rec.part_nm = Util.checkString(rset0.getString("part_nm")); rec.area_nm = Util.checkString(rset0.getString("area_nm")); rec.no_valqunt = rset0.getDouble("no_valqunt"); rec.valqunt = rset0.getDouble("valqunt"); rec.mainware = Util.checkString(rset0.getString("mainware")); rec.pyungware = Util.checkString(rset0.getString("pyungware")); rec.sungware = Util.checkString(rset0.getString("sungware")); rec.remk = Util.checkString(rset0.getString("remk")); rec.seq = rset0.getInt("seq"); rec.cmpycd = Util.checkString(rset0.getString("cmpycd")); rec.incmgpers = Util.checkString(rset0.getString("incmgpers")); rec.chgpers = Util.checkString(rset0.getString("chgpers")); rec.whcd = Util.checkString(rset0.getString("whcd")); this.detailinout.add(rec); } } public String detailinoutOptHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<option value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" selected "); } sb.append(">"); sb.append(name); sb.append("</option>"); } return sb.toString(); } public String detailinoutChkHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<input name=\""); sb.append("itemcd"); sb.append("\" type=\"checkbox\" value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" checked "); } sb.append(">"); sb.append(name); sb.append("</input>"); } return sb.toString(); } public String detailinoutRdoHtml(String selected){ StringBuffer sb = new StringBuffer(""); int size = detailinout.size(); for(int i=0; i<size; i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord rec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)detailinout.get(i); String code = rec.itemcd; String name = rec.bns_itemcd; sb.append("<input name=\""); sb.append("itemcd"); sb.append("\" type=\"radio\" value=\""); sb.append(code); sb.append("\""); if(code.equals(selected)){ sb.append(" checked "); } sb.append(">"); sb.append(name); sb.append("</input>"); } return sb.toString(); } }/*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오. <% SS_S_TASLM_BNSITEMINOUTDataSet ds = (SS_S_TASLM_BNSITEMINOUTDataSet)request.getAttribute("ds"); %> Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오. <% for(int i=0; i<ds.detailinout.size(); i++){ SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord detailinoutRec = (SS_S_TASLM_BNSITEMINOUTDETAILINOUTRecord)ds.detailinout.get(i);%> HTML 코드들.... <%}%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오. <%= ds.getErrcode()%> <%= ds.getErrmsg()%> <%= ds.getDetailinout()%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오. <%= detailinoutRec.itemcd%> <%= detailinoutRec.bns_itemcd%> <%= detailinoutRec.itemnm%> <%= detailinoutRec.inoutdt%> <%= detailinoutRec.aftdivnclsf%> <%= detailinoutRec.aftdivnclsfnm%> <%= detailinoutRec.unit%> <%= detailinoutRec.uprc%> <%= detailinoutRec.qunt%> <%= detailinoutRec.team%> <%= detailinoutRec.part%> <%= detailinoutRec.area%> <%= detailinoutRec.bo%> <%= detailinoutRec.bonm%> <%= detailinoutRec.dept_nm%> <%= detailinoutRec.part_nm%> <%= detailinoutRec.area_nm%> <%= detailinoutRec.no_valqunt%> <%= detailinoutRec.valqunt%> <%= detailinoutRec.mainware%> <%= detailinoutRec.pyungware%> <%= detailinoutRec.sungware%> <%= detailinoutRec.remk%> <%= detailinoutRec.seq%> <%= detailinoutRec.cmpycd%> <%= detailinoutRec.incmgpers%> <%= detailinoutRec.chgpers%> <%= detailinoutRec.whcd%> ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Thu Jul 02 09:53:09 PDT 2009 */
7,542
0.59076
0.582808
216
31.777779
27.507687
126
false
false
0
0
0
0
0
0
1.990741
false
false
2
a4e583aa0c6710ab35e38654915aed8c6fb81a8c
5,909,875,035,557
882e77219bce59ae57cbad7e9606507b34eebfcf
/mi2s_securitycenter_miui12/src/main/java/com/miui/gamebooster/m/la.java
133d09faf18aa8ea16f3e6e41860292456ea711e
[]
no_license
CrackerCat/XiaomiFramework
https://github.com/CrackerCat/XiaomiFramework
17a12c1752296fa1a52f61b83ecf165f328f4523
0b7952df317dac02ebd1feea7507afb789cef2e3
refs/heads/master
2022-06-12T03:30:33.285000
2020-05-06T11:30:54
2020-05-06T11:30:54
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.miui.gamebooster.m; import android.text.TextUtils; import java.util.concurrent.ConcurrentHashMap; public class la { /* renamed from: a reason: collision with root package name */ private static volatile la f4500a; /* renamed from: b reason: collision with root package name */ private ConcurrentHashMap<String, a> f4501b = new ConcurrentHashMap<>(); /* renamed from: c reason: collision with root package name */ private ConcurrentHashMap<String, String> f4502c = new ConcurrentHashMap<>(); public static class a { /* renamed from: a reason: collision with root package name */ private String f4503a; /* renamed from: b reason: collision with root package name */ private int f4504b; /* renamed from: c reason: collision with root package name */ private boolean f4505c; private a(String str, int i, boolean z) { this.f4503a = str; this.f4504b = i; this.f4505c = z; } } private la() { } public static la a() { if (f4500a == null) { synchronized (la.class) { if (f4500a == null) { f4500a = new la(); } } } return f4500a; } public void a(String str, String str2, int i, boolean z) { if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) { if (!str.startsWith("http")) { str = ha.a(str); } this.f4502c.put(str2, str); this.f4501b.put(str, new a(str2, i, z)); } } }
UTF-8
Java
1,632
java
la.java
Java
[]
null
[]
package com.miui.gamebooster.m; import android.text.TextUtils; import java.util.concurrent.ConcurrentHashMap; public class la { /* renamed from: a reason: collision with root package name */ private static volatile la f4500a; /* renamed from: b reason: collision with root package name */ private ConcurrentHashMap<String, a> f4501b = new ConcurrentHashMap<>(); /* renamed from: c reason: collision with root package name */ private ConcurrentHashMap<String, String> f4502c = new ConcurrentHashMap<>(); public static class a { /* renamed from: a reason: collision with root package name */ private String f4503a; /* renamed from: b reason: collision with root package name */ private int f4504b; /* renamed from: c reason: collision with root package name */ private boolean f4505c; private a(String str, int i, boolean z) { this.f4503a = str; this.f4504b = i; this.f4505c = z; } } private la() { } public static la a() { if (f4500a == null) { synchronized (la.class) { if (f4500a == null) { f4500a = new la(); } } } return f4500a; } public void a(String str, String str2, int i, boolean z) { if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) { if (!str.startsWith("http")) { str = ha.a(str); } this.f4502c.put(str2, str); this.f4501b.put(str, new a(str2, i, z)); } } }
1,632
0.560049
0.520833
58
27.137932
24.495213
81
false
false
0
0
0
0
0
0
0.482759
false
false
2
52837594ecddd661be05ed23ce82aaabd681499f
11,879,879,566,274
620c1be20f997361130a7fac037790e754ba120e
/app/src/main/java/com/example/administrator/bank/Aty_Xb_Residue.java
cf9688b6ad7ed593c433630c8a30ffacd39402c2
[]
no_license
xb204628104/Bank_deleteAndadd
https://github.com/xb204628104/Bank_deleteAndadd
486b7b774157a6acf00062f24d668aff309938ea
5ff95af69c531d9b1510ae960983c66ea896f30b
refs/heads/master
2020-12-30T10:37:43.699000
2017-07-31T08:52:15
2017-07-31T08:52:15
98,852,935
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.administrator.bank; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.LinearLayout; /** * Created by Administrator on 2017/7/31. */ public class Aty_Xb_Residue extends Activity implements View.OnClickListener { //提现的控件 private LinearLayout llresidue_xb_tixian; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.aty_xb_residue); init(); event(); } private void init(){ llresidue_xb_tixian=findViewById(R.id.llresidue_xb_tixian); } private void event(){ llresidue_xb_tixian.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.llresidue_xb_tixian: startActivity(new Intent(Aty_Xb_Residue.this,Aty_Xb_Deposit.class)); break; } } }
UTF-8
Java
1,030
java
Aty_Xb_Residue.java
Java
[]
null
[]
package com.example.administrator.bank; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.LinearLayout; /** * Created by Administrator on 2017/7/31. */ public class Aty_Xb_Residue extends Activity implements View.OnClickListener { //提现的控件 private LinearLayout llresidue_xb_tixian; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.aty_xb_residue); init(); event(); } private void init(){ llresidue_xb_tixian=findViewById(R.id.llresidue_xb_tixian); } private void event(){ llresidue_xb_tixian.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.llresidue_xb_tixian: startActivity(new Intent(Aty_Xb_Residue.this,Aty_Xb_Deposit.class)); break; } } }
1,030
0.659804
0.652941
40
24.5
22.297981
84
false
false
0
0
0
0
0
0
0.4
false
false
2
9f0ff5eea5022d885c604618d03b065dd8f3425c
16,003,048,189,587
5ec52a54e3deae3543725642d42503a14de4124e
/src/main/java/kr/pe/swf/webframework/view/ViewLoader.java
d87fd8e758012652b64dbb139dfcccb84697e9a8
[]
no_license
sp10773p/swf
https://github.com/sp10773p/swf
e6024a934e54f5f02f570d99d554f5c90ed15813
8ab305844a970d30546728cbae009601ef69bff9
refs/heads/master
2020-12-25T14:33:51.831000
2016-11-20T08:27:18
2016-11-20T08:27:18
67,453,970
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package kr.pe.swf.webframework.view; import kr.pe.swf.webframework.util.DOMUtil; import kr.pe.swf.webframework.util.FileUtil; import kr.pe.swf.webframework.util.StringUtils; import kr.pe.swf.webframework.view.entry.*; import org.apache.commons.beanutils.BeanUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by seongdonghun on 2016. 9. 21.. */ public class ViewLoader { static final Logger LOGGER = LoggerFactory.getLogger(ViewLoader.class); private final String SEARCHS_ID = "SEARCHS"; private final String DETAILS_ID = "DETAILS"; private final String LISTS_ID = "LISTS"; private final String DEFAULT_LIST_ROWNUM = "10"; private final String DEFAULT_LIST_ROWLIST = "10,30,50"; private String viewPath; private ViewInfoFactory viewInfoFactory; public ViewLoader() { } public ViewLoader(ViewInfoFactory viewInfoFactory) { this.viewInfoFactory = viewInfoFactory; } public void initViewLoader(ViewInfoFactory viewInfoFactory, String viewPath, String searchType, String detailType, String gridType) { this.viewPath = viewPath; this.viewInfoFactory = viewInfoFactory; this.viewInfoFactory.setSearchType(searchType); this.viewInfoFactory.setDetailType(detailType); this.viewInfoFactory.setGridType(gridType); } public void load() throws RuntimeException { LOGGER.info("### Seong`s Webframework View load Start..."); if(viewPath.startsWith("classpath:")){ viewPath = Thread.currentThread().getContextClassLoader().getResource(viewPath.replace("classpath:", "")).getPath(); } File f = new File(viewPath); if(!f.exists()){ throw new RuntimeException("::: Seong`s Webframework View Path를 확인하세요."); } String[] filenames = FileUtil.filenameFilesInDirectory(f); for(String filename : filenames){ try{ buildViewInfo(filename); }catch (Exception e){ e.printStackTrace(); throw new RuntimeException("::: View 파일 파싱중 에러가 발생 하였습니다. - " + e.getMessage()); } } } void buildViewInfo(String filename) throws Exception { Document viewDoc = DOMUtil.parse(filename); Element root = viewDoc.getDocumentElement(); String viewId = DOMUtil.getAttribute(root, "id"); String viewType = DOMUtil.getAttribute(root, "type"); String viewTitle = DOMUtil.getAttribute(root, "title"); // 화면 정보 LOGGER.info("### View Building - {}", viewId); ViewEntry viewEntry = new ViewEntry(viewId, viewType, viewTitle); //조회 정보 viewEntry.setSearchsFactory(buildSearchInfo(root)); //SCRIPT String script = DOMUtil.getElementTextByPath(root, "script"); viewEntry.setScript(script); //그리드 정보 viewEntry.setListsFactory(buildListInfo(root, viewEntry.getSearchsFactory())); //상세 정보 viewEntry.setDetailsFactory(buildDetailInfo(root)); //버튼정보 viewEntry.setButtonsFactory(buildButtonInfo(root)); viewInfoFactory.setViewEntryMap(viewId, viewEntry); viewInfoFactory.setViewLoadManage(viewId, filename); } private List<ButtonsFactory> buildButtonInfo(Element root) { List<ButtonsFactory> buttonsFactories = new ArrayList<ButtonsFactory>(); List<Element> buttonList = DOMUtil.getChildrenByPath(root, "button"); for(Element buttonEle : buttonList){ ButtonsFactory buttonsFactory = new ButtonsFactory(); // id String idAtt = DOMUtil.getAttribute(buttonEle, "id"); buttonsFactory.setId(idAtt); // function String functionAtt = DOMUtil.getAttribute(buttonEle, "function"); buttonsFactory.setFunction(functionAtt); // 버튼명 String btnName = DOMUtil.getElementText(buttonEle); buttonsFactory.setBtnName(btnName); buttonsFactories.add(buttonsFactory); } return buttonsFactories; } private List<DetailsFactory> buildDetailInfo(Element root) throws IllegalAccessException, SQLException, InvocationTargetException { List<DetailsFactory> detailsFactories = new ArrayList<DetailsFactory>(); List<Element> detailsList = DOMUtil.getChildrenByPath(root, "details"); int idx = 0; for(Element detailsEle : detailsList){ DetailsFactory detailsFactory = new DetailsFactory(); // details id detailsFactory.setId(DETAILS_ID + (++idx)); // title String titleAtt = DOMUtil.getAttribute(detailsEle, "title"); if(StringUtils.isNotEmpty(titleAtt)) { detailsFactory.setTitle(titleAtt); } // 로드시 조회 쿼리키 String qKeyAtt = DOMUtil.getAttribute(detailsEle, "qKey"); if(StringUtils.isNotEmpty(qKeyAtt)) { detailsFactory.setqKey(qKeyAtt); } // detail column size String colSizeAtt = DOMUtil.getAttribute(detailsEle, "colSize"); if(StringUtils.isNotEmpty(colSizeAtt)){ detailsFactory.setColSize(Integer.parseInt(colSizeAtt)); } List<Element> detailChildList = DOMUtil.getChildren(detailsEle); DetailEntry detailEntry = null; for (Element ele : detailChildList) { detailEntry = new DetailEntry(); if(ele.getTagName().equals("title")){ String title = ele.getTextContent(); String colspan = DOMUtil.getAttribute(ele, "colspan"); String rowspan = DOMUtil.getAttribute(ele, "rowspan"); detailEntry.setTitle(title); detailEntry.setColspan(colspan); detailEntry.setRowspan(rowspan); detailsFactory.addDetail(detailEntry); }else if(ele.getTagName().equals("hidden")){ String id = DOMUtil.getAttribute(ele, "id"); String value = DOMUtil.getAttribute(ele, "value"); detailEntry.setId(id); detailEntry.setValue(value); detailEntry.setType("hidden"); detailsFactory.addDetail(detailEntry); }else if(ele.getTagName().equals("detail")){ String rowspan = DOMUtil.getAttribute(ele, "rowspan"); String colspan = DOMUtil.getAttribute(ele, "colspan"); detailEntry.setRowspan(rowspan); detailEntry.setColspan(colspan); // 필수여부 boolean isMand = false; List<Element> compList = DOMUtil.getChildren(ele, "comp"); for(Element compEle : compList){ CompEntry compEntry = new CompEntry(); Map map = getAttributeElementToMap(compEle); BeanUtils.populate(compEntry, map); if(!isMand) { isMand = compEntry.isMand(); } // event 저장 List<EventEntry> eventEntryList = getEventElement(compEle); compEntry.setEventEntries(eventEntryList); // style 저장 compEntry.setStyle(DOMUtil.getElementTextByPath(compEle, "style")); String type = StringUtils.trimStr(compEntry.getType()); // type에 따른 유형 처리 if("select".equals(type) || "checkbox".equals(type) || "radio".equals(type) || "autocomplete".equals(type)){ List list = getItemList(compEle); if(list == null){ return null; } String selectQKey = DOMUtil.getElementTextByPath(compEle, "selectQKey"); if(StringUtils.isNotEmpty(selectQKey)){ compEntry.setSelectQKey(selectQKey.trim()); } compEntry.setList(list); } detailEntry.addCompEntry(compEntry); } // comp 중에 필수인 comp가 있으면 이전 태그인 th에 mandatory 표시 if(isMand){ List<DetailEntry> tmpList = detailsFactory.getDetails(); for(int i = (tmpList.size()-1); i >= 0; i--){ DetailEntry tmpDetailEntry = tmpList.get(i); if(StringUtils.isNotEmpty(tmpDetailEntry.getTitle())){ tmpDetailEntry.setMand(isMand); break; } } } detailsFactory.addDetail(detailEntry); } } detailsFactories.add(detailsFactory); LOGGER.info("### Append Detail Infomation - {}", detailsFactory.getId()); } return detailsFactories; } private List<SearchsFactory> buildSearchInfo(Element root) throws Exception { List<SearchsFactory> searchsFactories = new ArrayList<SearchsFactory>(); List<Element> searchsList = DOMUtil.getChildrenByPath(root, "searchs"); int idx = 0; for(Element searchsEle : searchsList){ SearchsFactory searchsFactory = new SearchsFactory(); // searchs id searchsFactory.setId(SEARCHS_ID + (++idx)); //[필수 속성]select Query key String qKeyAtt = DOMUtil.getAttribute(searchsEle, "qKey"); if(StringUtils.isEmpty(qKeyAtt)){ String viewId = DOMUtil.getAttribute(root, "id"); throw new Exception("::: <searchs> Tag의 qKey는 필수 속성입니다. [" + viewId +"]"); } searchsFactory.setqKey(qKeyAtt); // search column size String colSizeAtt = DOMUtil.getAttribute(searchsEle, "colSize"); if(StringUtils.isNotEmpty(colSizeAtt)){ searchsFactory.setColSize(Integer.parseInt(colSizeAtt)); } // function String functionAtt = DOMUtil.getAttribute(searchsEle, "function"); if(StringUtils.isNotEmpty(functionAtt)){ searchsFactory.setFunction(functionAtt); } List<Element> searchList = DOMUtil.getChildrenByPath(searchsEle, "search"); // 조회조건 영역 파싱 for(int i=0; i<searchList.size(); i++){ Element searchEle = searchList.get(i); // 필수값 체크 if (!validMandantary(searchEle)) continue; SearchEntry searchEntry = getSearchEntry(searchEle); if (searchEntry == null) continue; searchsFactory.addSearch(searchEntry); } searchsFactories.add(searchsFactory); LOGGER.info("### Append Search Infomation - {}", searchsFactory.getId()); } return searchsFactories; } private List<ListsFactory> buildListInfo(Element root, List<SearchsFactory> searchsFactories) throws InvocationTargetException, IllegalAccessException { List<ListsFactory> retListsFactory = new ArrayList<ListsFactory>(); List<Element> listsList = DOMUtil.getChildrenByPath(root, "lists"); int idx = 0; for(Element listEle : listsList) { ListsFactory listsFactory = new ListsFactory(); // lists id listsFactory.setId(LISTS_ID + (++idx)); String rowNumAtt = DOMUtil.getAttribute(listEle, "rowNum"); if(StringUtils.isEmpty(rowNumAtt)){ rowNumAtt = DEFAULT_LIST_ROWNUM; } listsFactory.setRowNum(rowNumAtt); String rowListAtt = DOMUtil.getAttribute(listEle, "rowList"); if(StringUtils.isEmpty(rowListAtt)){ rowListAtt = DEFAULT_LIST_ROWLIST; } listsFactory.setRowList("["+rowListAtt+"]"); // 디폴트 소팅 컬럼 String sortname = DOMUtil.getAttribute(listEle, "sortname"); if(StringUtils.isEmpty(sortname)) { sortname = ""; } listsFactory.setSortname(sortname); // 디폴트 소팅 타입 String sortorder = DOMUtil.getAttribute(listEle, "sortorder"); if(StringUtils.isEmpty(sortorder)){ sortorder = ""; } listsFactory.setSortorder(sortorder); // 조회 쿼리 String qKey = DOMUtil.getAttribute(listEle, "qKey"); if(StringUtils.isEmpty(qKey)){ // 쿼리키가 없을때 같은 차수의 조회영역 쿼리키를 셋팅한다.(조회버튼으로 조회시 대상인 리스트임) if(searchsFactories.size() >= idx){ SearchsFactory searchsFactory = searchsFactories.get(idx-1); qKey = searchsFactory.getqKey(); } } listsFactory.setqKey(qKey); // 화면로드시 조회할지 여부 String isFirstLoad = DOMUtil.getAttribute(listEle, "isFirstLoad"); if(StringUtils.isNotEmpty(isFirstLoad)){ listsFactory.setFirstLoad(("Y".equals(isFirstLoad.toUpperCase()) ? true : false)); } // 화면로드시 조회할지 여부 String layout = DOMUtil.getAttribute(listEle, "layout"); if(StringUtils.isNotEmpty(layout)){ listsFactory.setLayout(layout); } // 컬럼정보 셋팅 String colModel = DOMUtil.getElementTextByPath(listEle, "colModel"); listsFactory.setList(makeColumnEntryList(colModel)); // 컬럼정보 문자열로 저장 listsFactory.setColModel(colModel.replaceAll("&#44;", ",").replaceAll("&#59;", ";").replaceAll("&#39;", "'")); // event 저장 List<Element> eventList = DOMUtil.getChildrenByPath(listEle, "event"); for(Element eventEle : eventList){ String name = DOMUtil.getAttribute(eventEle, "name"); String fnName = DOMUtil.getElementText(eventEle); EventEntry eventEntry = new EventEntry(); eventEntry.setName(name); eventEntry.setFnName(fnName); listsFactory.addEventEntry(eventEntry); } retListsFactory.add(listsFactory); LOGGER.info("### Append List Infomation - {}", listsFactory.getId()); } return retListsFactory; } private SearchEntry getSearchEntry(Element searchEle) throws InvocationTargetException, IllegalAccessException, SQLException { SearchEntry searchEntry = new SearchEntry(); //속성 저장 BeanUtils.populate(searchEntry, getAttributeElementToMap(searchEle)); // event 저장 searchEntry.setEventEntries(getEventElement(searchEle)); // style 저장 searchEntry.setStyle(DOMUtil.getElementTextByPath(searchEle, "style")); String type = StringUtils.trimStr(searchEntry.getType()); // type에 따른 유형 처리 if("select".equals(type) || "checkbox".equals(type) || "radio".equals(type) || "autocomplete".equals(type)){ List list = getItemList(searchEle); if(list == null){ return null; } String selectQKey = DOMUtil.getElementTextByPath(searchEle, "selectQKey"); if(StringUtils.isNotEmpty(selectQKey)){ searchEntry.setSelectQKey(selectQKey.trim()); } searchEntry.setList(list); } return searchEntry; } private Map getAttributeElementToMap(Element element){ String[] attArr = {"id","type","title","isMand","isMult","length","from","to","default","value"}; Map<String, Object> retMap = new HashMap(); for(String arrId : attArr){ String Key = arrId; if("from".equals(arrId) || "to".equals(arrId) || "default".equals(arrId)){ Key += "Date"; }else if("isMand".equals(arrId) || "isMult".equals(arrId)){ Key = arrId.replace("is", "").toLowerCase(); } retMap.put(Key, DOMUtil.getAttribute(element, arrId)); } retMap.put("style", DOMUtil.getElementTextByPath(element, "style")); return retMap; } private List<EventEntry> getEventElement(Element element){ List<EventEntry> eventEntries = new ArrayList<EventEntry>(); List<Element> eventList = DOMUtil.getChildrenByPath(element, "event"); for(Element eventEle : eventList){ String name = DOMUtil.getAttribute(eventEle, "name"); String fnName = DOMUtil.getElementText(eventEle); EventEntry eventEntry = new EventEntry(); eventEntry.setName(name); eventEntry.setFnName(fnName); eventEntries.add(eventEntry); } return eventEntries; } private List<Map<String, String>> getItemList(Element element) throws SQLException { String selectQKey = DOMUtil.getElementTextByPath(element, "selectQKey"); List<Element> itemList = DOMUtil.getChildrenByPath(element, "list/item"); if(itemList == null && StringUtils.isEmpty(selectQKey)){ LOGGER.error("::: type 이 select/checkbox/radio/autocomplete 일때 '<list>' 나 '<selectQKey>' Tag정의가 있어야 합니다."); return null; } List<Map<String, String>> list = new ArrayList<Map<String, String>>(); if(StringUtils.isNotEmpty(selectQKey)){ selectQKey = selectQKey.trim(); list = this.viewInfoFactory.getSqlMapClient().queryForList(selectQKey, null); }else{ for(Element ele : itemList){ String code = DOMUtil.getAttribute(ele, "code"); String selected = DOMUtil.getAttribute(ele, "selected"); String checked = DOMUtil.getAttribute(ele, "checked"); String label = DOMUtil.getElementText(ele); Map<String, String> map = new HashMap<String, String>(); map.put("code" , code); map.put("label" , label); map.put("selected", selected); map.put("checked" , checked); list.add(map); } } return list; } private boolean validMandantary(Element ele) { //필수값 체크 boolean bool = true; StringBuffer attStr = new StringBuffer(); for(MANDATORY mand : MANDATORY.values()){ String att = DOMUtil.getAttribute(ele, mand.toString()); if(att == null || att.length() == 0){ bool = false; } attStr.append(mand.toString()+","); } if(!bool){ LOGGER.error(":::필수 속성이 존재 하지 않습니다. [{}]", attStr.substring(0, attStr.length() - 1)); } return bool; } private List<ColumnEntry> makeColumnEntryList(String s) throws InvocationTargetException, IllegalAccessException { List<ColumnEntry> columnEntries = new ArrayList<ColumnEntry>(); StringBuffer colModel = new StringBuffer(s.trim().replaceAll("\\[", "").replaceAll("]", "")); while(colModel.indexOf("{") > -1){ ColumnEntry columnEntry = new ColumnEntry(); int colStartIdx = colModel.indexOf("{"); int colEndIdx = colModel.indexOf("}")+1; String column = colModel.substring(colStartIdx, colEndIdx).toString(); column = column.replaceAll("\\{", "").replaceAll("}", ""); // &#44;(쉼표), &#59;(세미콜론), &#39;(작은따옴표) String[] arr = column.split(","); Map<String, Object> option = new HashMap(); for(String op : arr){ String key = op.split(":")[0].trim(); String val = op.split(":")[1].trim().replaceAll("'", ""); val = val.replaceAll("&#44;", ",").replaceAll("&#59;", ";").replaceAll("&#39;", "'"); option.put(key, val); } BeanUtils.populate(columnEntry, option); colModel.delete(0, colEndIdx); LOGGER.debug("LIsts Column Entry Load : {}", columnEntry.toString()); columnEntries.add(columnEntry); } return columnEntries; } // 필수 속성 enum MANDATORY{ id,type } enum TARGET { SEARCHS1("LISTS1"), SEARCHS2("LISTS2"), SEARCHS3("LISTS3"), SEARCHS4("LISTS4"), SEARCHS5("LISTS5"); private String key; private TARGET(String key){ this.key = key; } public String getTarget(){ return this.key; } } }
UTF-8
Java
21,791
java
ViewLoader.java
Java
[ { "context": "til.List;\nimport java.util.Map;\n\n/**\n * Created by seongdonghun on 2016. 9. 21..\n */\npublic class ViewLoader {\n ", "end": 614, "score": 0.9993561506271362, "start": 602, "tag": "USERNAME", "value": "seongdonghun" }, { "context": "r(String arrId : attArr){\n String Key = arrId;\n if(\"from\".equals(arrId) || \"to\".equa", "end": 16399, "score": 0.8405560255050659, "start": 16394, "tag": "KEY", "value": "arrId" }, { "context": " || \"isMult\".equals(arrId)){\n Key = arrId.replace(\"is\", \"\").toLowerCase();\n }\n\n ", "end": 16619, "score": 0.8117541074752808, "start": 16614, "tag": "KEY", "value": "arrId" }, { "context": "Mult\".equals(arrId)){\n Key = arrId.replace(\"is\", \"\").toLowerCase();\n }\n\n ", "end": 16627, "score": 0.6634995937347412, "start": 16620, "tag": "KEY", "value": "replace" }, { "context": "als(arrId)){\n Key = arrId.replace(\"is\", \"\").toLowerCase();\n }\n\n retMap.put(Key, DOMUti", "end": 16652, "score": 0.7222021222114563, "start": 16629, "tag": "KEY", "value": "is\", \"\").toLowerCase();" } ]
null
[]
package kr.pe.swf.webframework.view; import kr.pe.swf.webframework.util.DOMUtil; import kr.pe.swf.webframework.util.FileUtil; import kr.pe.swf.webframework.util.StringUtils; import kr.pe.swf.webframework.view.entry.*; import org.apache.commons.beanutils.BeanUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by seongdonghun on 2016. 9. 21.. */ public class ViewLoader { static final Logger LOGGER = LoggerFactory.getLogger(ViewLoader.class); private final String SEARCHS_ID = "SEARCHS"; private final String DETAILS_ID = "DETAILS"; private final String LISTS_ID = "LISTS"; private final String DEFAULT_LIST_ROWNUM = "10"; private final String DEFAULT_LIST_ROWLIST = "10,30,50"; private String viewPath; private ViewInfoFactory viewInfoFactory; public ViewLoader() { } public ViewLoader(ViewInfoFactory viewInfoFactory) { this.viewInfoFactory = viewInfoFactory; } public void initViewLoader(ViewInfoFactory viewInfoFactory, String viewPath, String searchType, String detailType, String gridType) { this.viewPath = viewPath; this.viewInfoFactory = viewInfoFactory; this.viewInfoFactory.setSearchType(searchType); this.viewInfoFactory.setDetailType(detailType); this.viewInfoFactory.setGridType(gridType); } public void load() throws RuntimeException { LOGGER.info("### Seong`s Webframework View load Start..."); if(viewPath.startsWith("classpath:")){ viewPath = Thread.currentThread().getContextClassLoader().getResource(viewPath.replace("classpath:", "")).getPath(); } File f = new File(viewPath); if(!f.exists()){ throw new RuntimeException("::: Seong`s Webframework View Path를 확인하세요."); } String[] filenames = FileUtil.filenameFilesInDirectory(f); for(String filename : filenames){ try{ buildViewInfo(filename); }catch (Exception e){ e.printStackTrace(); throw new RuntimeException("::: View 파일 파싱중 에러가 발생 하였습니다. - " + e.getMessage()); } } } void buildViewInfo(String filename) throws Exception { Document viewDoc = DOMUtil.parse(filename); Element root = viewDoc.getDocumentElement(); String viewId = DOMUtil.getAttribute(root, "id"); String viewType = DOMUtil.getAttribute(root, "type"); String viewTitle = DOMUtil.getAttribute(root, "title"); // 화면 정보 LOGGER.info("### View Building - {}", viewId); ViewEntry viewEntry = new ViewEntry(viewId, viewType, viewTitle); //조회 정보 viewEntry.setSearchsFactory(buildSearchInfo(root)); //SCRIPT String script = DOMUtil.getElementTextByPath(root, "script"); viewEntry.setScript(script); //그리드 정보 viewEntry.setListsFactory(buildListInfo(root, viewEntry.getSearchsFactory())); //상세 정보 viewEntry.setDetailsFactory(buildDetailInfo(root)); //버튼정보 viewEntry.setButtonsFactory(buildButtonInfo(root)); viewInfoFactory.setViewEntryMap(viewId, viewEntry); viewInfoFactory.setViewLoadManage(viewId, filename); } private List<ButtonsFactory> buildButtonInfo(Element root) { List<ButtonsFactory> buttonsFactories = new ArrayList<ButtonsFactory>(); List<Element> buttonList = DOMUtil.getChildrenByPath(root, "button"); for(Element buttonEle : buttonList){ ButtonsFactory buttonsFactory = new ButtonsFactory(); // id String idAtt = DOMUtil.getAttribute(buttonEle, "id"); buttonsFactory.setId(idAtt); // function String functionAtt = DOMUtil.getAttribute(buttonEle, "function"); buttonsFactory.setFunction(functionAtt); // 버튼명 String btnName = DOMUtil.getElementText(buttonEle); buttonsFactory.setBtnName(btnName); buttonsFactories.add(buttonsFactory); } return buttonsFactories; } private List<DetailsFactory> buildDetailInfo(Element root) throws IllegalAccessException, SQLException, InvocationTargetException { List<DetailsFactory> detailsFactories = new ArrayList<DetailsFactory>(); List<Element> detailsList = DOMUtil.getChildrenByPath(root, "details"); int idx = 0; for(Element detailsEle : detailsList){ DetailsFactory detailsFactory = new DetailsFactory(); // details id detailsFactory.setId(DETAILS_ID + (++idx)); // title String titleAtt = DOMUtil.getAttribute(detailsEle, "title"); if(StringUtils.isNotEmpty(titleAtt)) { detailsFactory.setTitle(titleAtt); } // 로드시 조회 쿼리키 String qKeyAtt = DOMUtil.getAttribute(detailsEle, "qKey"); if(StringUtils.isNotEmpty(qKeyAtt)) { detailsFactory.setqKey(qKeyAtt); } // detail column size String colSizeAtt = DOMUtil.getAttribute(detailsEle, "colSize"); if(StringUtils.isNotEmpty(colSizeAtt)){ detailsFactory.setColSize(Integer.parseInt(colSizeAtt)); } List<Element> detailChildList = DOMUtil.getChildren(detailsEle); DetailEntry detailEntry = null; for (Element ele : detailChildList) { detailEntry = new DetailEntry(); if(ele.getTagName().equals("title")){ String title = ele.getTextContent(); String colspan = DOMUtil.getAttribute(ele, "colspan"); String rowspan = DOMUtil.getAttribute(ele, "rowspan"); detailEntry.setTitle(title); detailEntry.setColspan(colspan); detailEntry.setRowspan(rowspan); detailsFactory.addDetail(detailEntry); }else if(ele.getTagName().equals("hidden")){ String id = DOMUtil.getAttribute(ele, "id"); String value = DOMUtil.getAttribute(ele, "value"); detailEntry.setId(id); detailEntry.setValue(value); detailEntry.setType("hidden"); detailsFactory.addDetail(detailEntry); }else if(ele.getTagName().equals("detail")){ String rowspan = DOMUtil.getAttribute(ele, "rowspan"); String colspan = DOMUtil.getAttribute(ele, "colspan"); detailEntry.setRowspan(rowspan); detailEntry.setColspan(colspan); // 필수여부 boolean isMand = false; List<Element> compList = DOMUtil.getChildren(ele, "comp"); for(Element compEle : compList){ CompEntry compEntry = new CompEntry(); Map map = getAttributeElementToMap(compEle); BeanUtils.populate(compEntry, map); if(!isMand) { isMand = compEntry.isMand(); } // event 저장 List<EventEntry> eventEntryList = getEventElement(compEle); compEntry.setEventEntries(eventEntryList); // style 저장 compEntry.setStyle(DOMUtil.getElementTextByPath(compEle, "style")); String type = StringUtils.trimStr(compEntry.getType()); // type에 따른 유형 처리 if("select".equals(type) || "checkbox".equals(type) || "radio".equals(type) || "autocomplete".equals(type)){ List list = getItemList(compEle); if(list == null){ return null; } String selectQKey = DOMUtil.getElementTextByPath(compEle, "selectQKey"); if(StringUtils.isNotEmpty(selectQKey)){ compEntry.setSelectQKey(selectQKey.trim()); } compEntry.setList(list); } detailEntry.addCompEntry(compEntry); } // comp 중에 필수인 comp가 있으면 이전 태그인 th에 mandatory 표시 if(isMand){ List<DetailEntry> tmpList = detailsFactory.getDetails(); for(int i = (tmpList.size()-1); i >= 0; i--){ DetailEntry tmpDetailEntry = tmpList.get(i); if(StringUtils.isNotEmpty(tmpDetailEntry.getTitle())){ tmpDetailEntry.setMand(isMand); break; } } } detailsFactory.addDetail(detailEntry); } } detailsFactories.add(detailsFactory); LOGGER.info("### Append Detail Infomation - {}", detailsFactory.getId()); } return detailsFactories; } private List<SearchsFactory> buildSearchInfo(Element root) throws Exception { List<SearchsFactory> searchsFactories = new ArrayList<SearchsFactory>(); List<Element> searchsList = DOMUtil.getChildrenByPath(root, "searchs"); int idx = 0; for(Element searchsEle : searchsList){ SearchsFactory searchsFactory = new SearchsFactory(); // searchs id searchsFactory.setId(SEARCHS_ID + (++idx)); //[필수 속성]select Query key String qKeyAtt = DOMUtil.getAttribute(searchsEle, "qKey"); if(StringUtils.isEmpty(qKeyAtt)){ String viewId = DOMUtil.getAttribute(root, "id"); throw new Exception("::: <searchs> Tag의 qKey는 필수 속성입니다. [" + viewId +"]"); } searchsFactory.setqKey(qKeyAtt); // search column size String colSizeAtt = DOMUtil.getAttribute(searchsEle, "colSize"); if(StringUtils.isNotEmpty(colSizeAtt)){ searchsFactory.setColSize(Integer.parseInt(colSizeAtt)); } // function String functionAtt = DOMUtil.getAttribute(searchsEle, "function"); if(StringUtils.isNotEmpty(functionAtt)){ searchsFactory.setFunction(functionAtt); } List<Element> searchList = DOMUtil.getChildrenByPath(searchsEle, "search"); // 조회조건 영역 파싱 for(int i=0; i<searchList.size(); i++){ Element searchEle = searchList.get(i); // 필수값 체크 if (!validMandantary(searchEle)) continue; SearchEntry searchEntry = getSearchEntry(searchEle); if (searchEntry == null) continue; searchsFactory.addSearch(searchEntry); } searchsFactories.add(searchsFactory); LOGGER.info("### Append Search Infomation - {}", searchsFactory.getId()); } return searchsFactories; } private List<ListsFactory> buildListInfo(Element root, List<SearchsFactory> searchsFactories) throws InvocationTargetException, IllegalAccessException { List<ListsFactory> retListsFactory = new ArrayList<ListsFactory>(); List<Element> listsList = DOMUtil.getChildrenByPath(root, "lists"); int idx = 0; for(Element listEle : listsList) { ListsFactory listsFactory = new ListsFactory(); // lists id listsFactory.setId(LISTS_ID + (++idx)); String rowNumAtt = DOMUtil.getAttribute(listEle, "rowNum"); if(StringUtils.isEmpty(rowNumAtt)){ rowNumAtt = DEFAULT_LIST_ROWNUM; } listsFactory.setRowNum(rowNumAtt); String rowListAtt = DOMUtil.getAttribute(listEle, "rowList"); if(StringUtils.isEmpty(rowListAtt)){ rowListAtt = DEFAULT_LIST_ROWLIST; } listsFactory.setRowList("["+rowListAtt+"]"); // 디폴트 소팅 컬럼 String sortname = DOMUtil.getAttribute(listEle, "sortname"); if(StringUtils.isEmpty(sortname)) { sortname = ""; } listsFactory.setSortname(sortname); // 디폴트 소팅 타입 String sortorder = DOMUtil.getAttribute(listEle, "sortorder"); if(StringUtils.isEmpty(sortorder)){ sortorder = ""; } listsFactory.setSortorder(sortorder); // 조회 쿼리 String qKey = DOMUtil.getAttribute(listEle, "qKey"); if(StringUtils.isEmpty(qKey)){ // 쿼리키가 없을때 같은 차수의 조회영역 쿼리키를 셋팅한다.(조회버튼으로 조회시 대상인 리스트임) if(searchsFactories.size() >= idx){ SearchsFactory searchsFactory = searchsFactories.get(idx-1); qKey = searchsFactory.getqKey(); } } listsFactory.setqKey(qKey); // 화면로드시 조회할지 여부 String isFirstLoad = DOMUtil.getAttribute(listEle, "isFirstLoad"); if(StringUtils.isNotEmpty(isFirstLoad)){ listsFactory.setFirstLoad(("Y".equals(isFirstLoad.toUpperCase()) ? true : false)); } // 화면로드시 조회할지 여부 String layout = DOMUtil.getAttribute(listEle, "layout"); if(StringUtils.isNotEmpty(layout)){ listsFactory.setLayout(layout); } // 컬럼정보 셋팅 String colModel = DOMUtil.getElementTextByPath(listEle, "colModel"); listsFactory.setList(makeColumnEntryList(colModel)); // 컬럼정보 문자열로 저장 listsFactory.setColModel(colModel.replaceAll("&#44;", ",").replaceAll("&#59;", ";").replaceAll("&#39;", "'")); // event 저장 List<Element> eventList = DOMUtil.getChildrenByPath(listEle, "event"); for(Element eventEle : eventList){ String name = DOMUtil.getAttribute(eventEle, "name"); String fnName = DOMUtil.getElementText(eventEle); EventEntry eventEntry = new EventEntry(); eventEntry.setName(name); eventEntry.setFnName(fnName); listsFactory.addEventEntry(eventEntry); } retListsFactory.add(listsFactory); LOGGER.info("### Append List Infomation - {}", listsFactory.getId()); } return retListsFactory; } private SearchEntry getSearchEntry(Element searchEle) throws InvocationTargetException, IllegalAccessException, SQLException { SearchEntry searchEntry = new SearchEntry(); //속성 저장 BeanUtils.populate(searchEntry, getAttributeElementToMap(searchEle)); // event 저장 searchEntry.setEventEntries(getEventElement(searchEle)); // style 저장 searchEntry.setStyle(DOMUtil.getElementTextByPath(searchEle, "style")); String type = StringUtils.trimStr(searchEntry.getType()); // type에 따른 유형 처리 if("select".equals(type) || "checkbox".equals(type) || "radio".equals(type) || "autocomplete".equals(type)){ List list = getItemList(searchEle); if(list == null){ return null; } String selectQKey = DOMUtil.getElementTextByPath(searchEle, "selectQKey"); if(StringUtils.isNotEmpty(selectQKey)){ searchEntry.setSelectQKey(selectQKey.trim()); } searchEntry.setList(list); } return searchEntry; } private Map getAttributeElementToMap(Element element){ String[] attArr = {"id","type","title","isMand","isMult","length","from","to","default","value"}; Map<String, Object> retMap = new HashMap(); for(String arrId : attArr){ String Key = arrId; if("from".equals(arrId) || "to".equals(arrId) || "default".equals(arrId)){ Key += "Date"; }else if("isMand".equals(arrId) || "isMult".equals(arrId)){ Key = arrId.replace("is", "").toLowerCase(); } retMap.put(Key, DOMUtil.getAttribute(element, arrId)); } retMap.put("style", DOMUtil.getElementTextByPath(element, "style")); return retMap; } private List<EventEntry> getEventElement(Element element){ List<EventEntry> eventEntries = new ArrayList<EventEntry>(); List<Element> eventList = DOMUtil.getChildrenByPath(element, "event"); for(Element eventEle : eventList){ String name = DOMUtil.getAttribute(eventEle, "name"); String fnName = DOMUtil.getElementText(eventEle); EventEntry eventEntry = new EventEntry(); eventEntry.setName(name); eventEntry.setFnName(fnName); eventEntries.add(eventEntry); } return eventEntries; } private List<Map<String, String>> getItemList(Element element) throws SQLException { String selectQKey = DOMUtil.getElementTextByPath(element, "selectQKey"); List<Element> itemList = DOMUtil.getChildrenByPath(element, "list/item"); if(itemList == null && StringUtils.isEmpty(selectQKey)){ LOGGER.error("::: type 이 select/checkbox/radio/autocomplete 일때 '<list>' 나 '<selectQKey>' Tag정의가 있어야 합니다."); return null; } List<Map<String, String>> list = new ArrayList<Map<String, String>>(); if(StringUtils.isNotEmpty(selectQKey)){ selectQKey = selectQKey.trim(); list = this.viewInfoFactory.getSqlMapClient().queryForList(selectQKey, null); }else{ for(Element ele : itemList){ String code = DOMUtil.getAttribute(ele, "code"); String selected = DOMUtil.getAttribute(ele, "selected"); String checked = DOMUtil.getAttribute(ele, "checked"); String label = DOMUtil.getElementText(ele); Map<String, String> map = new HashMap<String, String>(); map.put("code" , code); map.put("label" , label); map.put("selected", selected); map.put("checked" , checked); list.add(map); } } return list; } private boolean validMandantary(Element ele) { //필수값 체크 boolean bool = true; StringBuffer attStr = new StringBuffer(); for(MANDATORY mand : MANDATORY.values()){ String att = DOMUtil.getAttribute(ele, mand.toString()); if(att == null || att.length() == 0){ bool = false; } attStr.append(mand.toString()+","); } if(!bool){ LOGGER.error(":::필수 속성이 존재 하지 않습니다. [{}]", attStr.substring(0, attStr.length() - 1)); } return bool; } private List<ColumnEntry> makeColumnEntryList(String s) throws InvocationTargetException, IllegalAccessException { List<ColumnEntry> columnEntries = new ArrayList<ColumnEntry>(); StringBuffer colModel = new StringBuffer(s.trim().replaceAll("\\[", "").replaceAll("]", "")); while(colModel.indexOf("{") > -1){ ColumnEntry columnEntry = new ColumnEntry(); int colStartIdx = colModel.indexOf("{"); int colEndIdx = colModel.indexOf("}")+1; String column = colModel.substring(colStartIdx, colEndIdx).toString(); column = column.replaceAll("\\{", "").replaceAll("}", ""); // &#44;(쉼표), &#59;(세미콜론), &#39;(작은따옴표) String[] arr = column.split(","); Map<String, Object> option = new HashMap(); for(String op : arr){ String key = op.split(":")[0].trim(); String val = op.split(":")[1].trim().replaceAll("'", ""); val = val.replaceAll("&#44;", ",").replaceAll("&#59;", ";").replaceAll("&#39;", "'"); option.put(key, val); } BeanUtils.populate(columnEntry, option); colModel.delete(0, colEndIdx); LOGGER.debug("LIsts Column Entry Load : {}", columnEntry.toString()); columnEntries.add(columnEntry); } return columnEntries; } // 필수 속성 enum MANDATORY{ id,type } enum TARGET { SEARCHS1("LISTS1"), SEARCHS2("LISTS2"), SEARCHS3("LISTS3"), SEARCHS4("LISTS4"), SEARCHS5("LISTS5"); private String key; private TARGET(String key){ this.key = key; } public String getTarget(){ return this.key; } } }
21,791
0.570044
0.567126
579
35.702934
30.556747
156
false
false
0
0
0
0
0
0
0.720207
false
false
2
10219364836348a718a4f89c6c2a3608b9c72305
26,259,430,072,639
c55891ddc58dfc344685f48b0048242573a1cdf3
/app/src/main/java/com/weshape3d/mvpdemo/mycollection/CustomHashMap.java
9dd2ea22f930111c898ee2a0c2a5291730945ccc
[]
no_license
drummor/mysenior
https://github.com/drummor/mysenior
024f6530b5fafe06cfb23f2d815570d95272d576
43fae2e3f4e9edb06aa437962933e5551423ceaa
refs/heads/master
2021-05-16T07:55:22.973000
2018-01-09T06:57:47
2018-01-09T06:57:47
103,926,021
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.weshape3d.mvpdemo.mycollection; /** * Created by WESHAPE-DEV02 on 2017/11/24. */ public class CustomHashMap { }
UTF-8
Java
129
java
CustomHashMap.java
Java
[ { "context": "weshape3d.mvpdemo.mycollection;\n\n/**\n * Created by WESHAPE-DEV02 on 2017/11/24.\n */\n\npublic class CustomHashMap {\n", "end": 76, "score": 0.999657928943634, "start": 63, "tag": "USERNAME", "value": "WESHAPE-DEV02" } ]
null
[]
package com.weshape3d.mvpdemo.mycollection; /** * Created by WESHAPE-DEV02 on 2017/11/24. */ public class CustomHashMap { }
129
0.72093
0.635659
9
13.333333
17.688665
43
false
false
0
0
0
0
0
0
0.111111
false
false
2
c4cd69ce62c3873185a7f283e60b08f3158bd918
35,270,271,442,657
a3fec9c1c370f9ccacf8e7e42767cc2ab5e5b149
/src/com/waterfall/EJB/interfaces/LocalUser.java
b891b13e25b9a73a100bfbf7c343be91a2a5c76a
[]
no_license
linisa/waterfall
https://github.com/linisa/waterfall
dd1d682b0538c843550284a81f4bfb05b370dffd
3f1e330bbe9c9befb382df0bb4e8c2ec27574c29
refs/heads/master
2021-01-20T15:10:10.675000
2017-05-09T09:29:02
2017-05-09T09:29:02
90,726,591
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.waterfall.EJB.interfaces; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.util.List; import javax.ejb.Local; import com.waterfall.models.ContactListModel; import com.waterfall.models.UserModel; @Local public interface LocalUser { boolean storeUser(UserModel userModel); List<UserModel> getAllUsers(); UserModel validateLogin(String username, String typedPassword) throws NoSuchAlgorithmException, InvalidKeySpecException; UserModel getUserById(Long userId); UserModel getUserFromSession(String sessionKey); UserModel getUserByUsername(String username); void setUserInSession(String sessionKey, UserModel userModel); void removeUserFromSession(String sessionKey); void deleteUser(UserModel user); String validateUserContactList(ContactListModel contactListModel, String username); }
UTF-8
Java
885
java
LocalUser.java
Java
[]
null
[]
package com.waterfall.EJB.interfaces; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.util.List; import javax.ejb.Local; import com.waterfall.models.ContactListModel; import com.waterfall.models.UserModel; @Local public interface LocalUser { boolean storeUser(UserModel userModel); List<UserModel> getAllUsers(); UserModel validateLogin(String username, String typedPassword) throws NoSuchAlgorithmException, InvalidKeySpecException; UserModel getUserById(Long userId); UserModel getUserFromSession(String sessionKey); UserModel getUserByUsername(String username); void setUserInSession(String sessionKey, UserModel userModel); void removeUserFromSession(String sessionKey); void deleteUser(UserModel user); String validateUserContactList(ContactListModel contactListModel, String username); }
885
0.829379
0.829379
35
24.285715
28.277777
121
false
false
0
0
0
0
0
0
1
false
false
2
8e17e28bd564416cce188dcae564a4adfacc41e0
14,250,701,516,243
de083b447c448f3ba1bd1fd86bed49a1bbccb3c9
/src/DFS.java
4a6aeaa4f236b2964bde7605b1a7c4678e4029b8
[]
no_license
codingpersonal/Graphs
https://github.com/codingpersonal/Graphs
460e3850643c4a8272fed451a5b819fa0ec06b6c
f1d2e5430d28d5f9479b52fec9d07b6c56098570
refs/heads/master
2021-01-10T13:11:51.312000
2016-02-20T00:53:46
2016-02-20T00:53:46
50,131,005
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; class DFS { Graph g; HashSet<String> visitedNodes = new HashSet<>(); List<String> topoOrder = new LinkedList<>(); public DFS() { g = new Graph(); } public void printTopo(String src) { if (visitedNodes.contains(src)) { return; } visitedNodes.add(src); List<String> child = g.outgoingNode.get(src); for (int i = 0; i < child.size(); i++) { printTopo(child.get(i)); } // insert at zero topoOrder.add(0, src); } public void printTopoMain() { // you call topo on every node so that nothing is left alone Iterator it = g.outgoingNode.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); printTopo((String) pair.getKey()); } } public void findDFS(String src) { if (visitedNodes.contains(src)) { // do nothing. dont print it } else { System.out.print(src + " "); visitedNodes.add(src); ArrayList<String> child; child = g.outgoingNode.get(src); for (int i = 0; i < child.size(); i++) { findDFS(child.get(i)); } } } public static void main(String args[]) { DFS dfs = new DFS(); dfs.findDFS("A"); } }
UTF-8
Java
1,272
java
DFS.java
Java
[]
null
[]
import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; class DFS { Graph g; HashSet<String> visitedNodes = new HashSet<>(); List<String> topoOrder = new LinkedList<>(); public DFS() { g = new Graph(); } public void printTopo(String src) { if (visitedNodes.contains(src)) { return; } visitedNodes.add(src); List<String> child = g.outgoingNode.get(src); for (int i = 0; i < child.size(); i++) { printTopo(child.get(i)); } // insert at zero topoOrder.add(0, src); } public void printTopoMain() { // you call topo on every node so that nothing is left alone Iterator it = g.outgoingNode.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); printTopo((String) pair.getKey()); } } public void findDFS(String src) { if (visitedNodes.contains(src)) { // do nothing. dont print it } else { System.out.print(src + " "); visitedNodes.add(src); ArrayList<String> child; child = g.outgoingNode.get(src); for (int i = 0; i < child.size(); i++) { findDFS(child.get(i)); } } } public static void main(String args[]) { DFS dfs = new DFS(); dfs.findDFS("A"); } }
1,272
0.640723
0.638365
60
20.216667
16.583216
62
false
false
0
0
0
0
0
0
1.933333
false
false
2
5ca231b7a2fecc8b428a87d43a04e0b046ebf539
29,841,432,819,479
e916cca9ec54fa239238ad23e4513d2a07abd7b4
/Projeto02/src/visao/produto/FormularioAlterarProduto.java
c747afdbe824f949fec90b1442951b98e47106e6
[]
no_license
dev-andremonteiro/CEJavaPrograms
https://github.com/dev-andremonteiro/CEJavaPrograms
a8a1957c98a27d537288e9cdff7dffdbbebef4d3
d1864d992d2f10c3f40a038a95ca4b433173ce1d
refs/heads/master
2021-01-12T09:05:09.686000
2018-03-23T17:54:08
2018-03-23T17:54:08
76,751,902
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package visao.produto; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.swing.DefaultComboBoxModel; import javax.swing.JDialog; import javax.swing.JOptionPane; import negocio.NegocioException; import negocio.ManutencaoGrupoProduto; import negocio.ManutencaoProduto; public class FormularioAlterarProduto extends JDialog { private int codigoProduto; private ManutencaoProduto manutencaoProduto; private ManutencaoGrupoProduto grupoProduto; public FormularioAlterarProduto(int codigo) { this.codigoProduto = codigo; initComponents(); this.grupoProduto = new ManutencaoGrupoProduto(); this.manutencaoProduto = new ManutencaoProduto(); this.preecheCampos(); } private void confirmaOperacao() { int codigo = 0; String nome = null; float compra = 0; float margem = 0; float promocao = 0; String sGrupo = ""; int grupo = 0; try { codigo = Integer.parseInt(campoCodigo.getText()); nome = this.campoNome.getText(); compra = Float.parseFloat(this.campoCompra.getText()); margem = Float.parseFloat(this.campoMargem.getText()); promocao = Float.parseFloat(this.campoPercentualPromocao.getText()); sGrupo = (String) this.comboGrupoProduto.getSelectedItem(); grupo = Integer.parseInt(sGrupo.substring(0, sGrupo.indexOf("-"))); } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Digitacao inconscistente"); return; } try { manutencaoProduto.alterar(codigo, nome, compra, margem, promocao, grupo); JOptionPane.showMessageDialog(this, "Alteração realizada com sucesso"); } catch (NegocioException ex) { JOptionPane.showMessageDialog(this, ex.getMessage()); } } private void preecheCampos() { try { int codigoGrupo = 0; int posicaoSelecao = 0; ResultSet rsProduto = manutencaoProduto.porCodigo(codigoProduto); if (rsProduto.next()) { this.campoCodigo.setText(rsProduto.getString("codigo")); this.campoNome.setText(rsProduto.getString("nome").trim()); this.campoCompra.setText(rsProduto.getString("valorCompra")); this.campoMargem.setText(rsProduto.getString("margemLucro")); this.campoPercentualPromocao.setText(rsProduto.getString("promocao")); codigoGrupo = rsProduto.getInt("grupo"); } ResultSet rs = this.grupoProduto.porFiltroNome(""); List listaGrupo = new ArrayList(); int codigo; String nome; while (rs.next()) { codigo = rs.getInt("codigo"); nome = rs.getString("nome"); listaGrupo.add(codigo + "-" + nome); if (codigoGrupo == codigo) { posicaoSelecao = listaGrupo.size() - 1; } } this.comboGrupoProduto.setModel(new DefaultComboBoxModel(listaGrupo.toArray())); this.comboGrupoProduto.setSelectedIndex(posicaoSelecao); } catch (SQLException ex) { JOptionPane.showMessageDialog(this, "Erro ao manipular dados de produto" + ex.toString()); } catch (NegocioException ex) { JOptionPane.showMessageDialog(this, "Erro ao recuperar dados de produtos \n" + ex.toString()); } } // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); botaoConfirma = new javax.swing.JButton(); botaoCancelar = new javax.swing.JButton(); campoMargem = new javax.swing.JTextField(); campoNome = new javax.swing.JTextField(); campoCompra = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); campoCodigo = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); comboGrupoProduto = new javax.swing.JComboBox(); jLabel7 = new javax.swing.JLabel(); campoPercentualPromocao = new javax.swing.JTextField(); setTitle("Alteração de Produtos"); setBackground(new java.awt.Color(204, 204, 204)); setModal(true); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); getContentPane().setLayout(null); jLabel1.setText("Nome"); getContentPane().add(jLabel1); jLabel1.setBounds(30, 60, 60, 20); jLabel3.setText("Valor Compra"); getContentPane().add(jLabel3); jLabel3.setBounds(30, 90, 100, 20); jLabel4.setText("% Margem Lucro"); getContentPane().add(jLabel4); jLabel4.setBounds(30, 120, 130, 20); botaoConfirma.setText("Confirmar"); botaoConfirma.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botaoConfirmaActionPerformed(evt); } }); getContentPane().add(botaoConfirma); botaoConfirma.setBounds(60, 240, 110, 30); botaoCancelar.setText("Cancelar"); botaoCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botaoCancelarActionPerformed(evt); } }); getContentPane().add(botaoCancelar); botaoCancelar.setBounds(350, 240, 110, 30); getContentPane().add(campoMargem); campoMargem.setBounds(170, 120, 100, 20); getContentPane().add(campoNome); campoNome.setBounds(170, 60, 320, 20); getContentPane().add(campoCompra); campoCompra.setBounds(170, 90, 100, 20); jLabel5.setText("Código"); getContentPane().add(jLabel5); jLabel5.setBounds(30, 30, 60, 20); campoCodigo.setEditable(false); getContentPane().add(campoCodigo); campoCodigo.setBounds(170, 30, 100, 20); jLabel6.setText("Grupo"); getContentPane().add(jLabel6); jLabel6.setBounds(30, 180, 90, 20); getContentPane().add(comboGrupoProduto); comboGrupoProduto.setBounds(170, 180, 230, 27); jLabel7.setText("% Promocao"); getContentPane().add(jLabel7); jLabel7.setBounds(30, 150, 90, 20); getContentPane().add(campoPercentualPromocao); campoPercentualPromocao.setBounds(170, 150, 100, 20); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-522)/2, (screenSize.height-312)/2, 522, 312); }// </editor-fold>//GEN-END:initComponents private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog setVisible(false); dispose(); }//GEN-LAST:event_closeDialog private void botaoConfirmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoConfirmaActionPerformed this.confirmaOperacao(); this.closeDialog(null); }//GEN-LAST:event_botaoConfirmaActionPerformed private void botaoCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoCancelarActionPerformed this.closeDialog(null); }//GEN-LAST:event_botaoCancelarActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton botaoCancelar; private javax.swing.JButton botaoConfirma; private javax.swing.JTextField campoCodigo; private javax.swing.JTextField campoCompra; private javax.swing.JTextField campoMargem; private javax.swing.JTextField campoNome; private javax.swing.JTextField campoPercentualPromocao; private javax.swing.JComboBox comboGrupoProduto; private javax.swing.JLabel jLabel1; 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; // End of variables declaration//GEN-END:variables }
UTF-8
Java
8,490
java
FormularioAlterarProduto.java
Java
[ { "context": "unds(30, 90, 100, 20);\n\n jLabel4.setText(\"% Margem Lucro\");\n getContentPane().add(jLabel4);\n ", "end": 5087, "score": 0.8603860139846802, "start": 5075, "tag": "NAME", "value": "Margem Lucro" } ]
null
[]
package visao.produto; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.swing.DefaultComboBoxModel; import javax.swing.JDialog; import javax.swing.JOptionPane; import negocio.NegocioException; import negocio.ManutencaoGrupoProduto; import negocio.ManutencaoProduto; public class FormularioAlterarProduto extends JDialog { private int codigoProduto; private ManutencaoProduto manutencaoProduto; private ManutencaoGrupoProduto grupoProduto; public FormularioAlterarProduto(int codigo) { this.codigoProduto = codigo; initComponents(); this.grupoProduto = new ManutencaoGrupoProduto(); this.manutencaoProduto = new ManutencaoProduto(); this.preecheCampos(); } private void confirmaOperacao() { int codigo = 0; String nome = null; float compra = 0; float margem = 0; float promocao = 0; String sGrupo = ""; int grupo = 0; try { codigo = Integer.parseInt(campoCodigo.getText()); nome = this.campoNome.getText(); compra = Float.parseFloat(this.campoCompra.getText()); margem = Float.parseFloat(this.campoMargem.getText()); promocao = Float.parseFloat(this.campoPercentualPromocao.getText()); sGrupo = (String) this.comboGrupoProduto.getSelectedItem(); grupo = Integer.parseInt(sGrupo.substring(0, sGrupo.indexOf("-"))); } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Digitacao inconscistente"); return; } try { manutencaoProduto.alterar(codigo, nome, compra, margem, promocao, grupo); JOptionPane.showMessageDialog(this, "Alteração realizada com sucesso"); } catch (NegocioException ex) { JOptionPane.showMessageDialog(this, ex.getMessage()); } } private void preecheCampos() { try { int codigoGrupo = 0; int posicaoSelecao = 0; ResultSet rsProduto = manutencaoProduto.porCodigo(codigoProduto); if (rsProduto.next()) { this.campoCodigo.setText(rsProduto.getString("codigo")); this.campoNome.setText(rsProduto.getString("nome").trim()); this.campoCompra.setText(rsProduto.getString("valorCompra")); this.campoMargem.setText(rsProduto.getString("margemLucro")); this.campoPercentualPromocao.setText(rsProduto.getString("promocao")); codigoGrupo = rsProduto.getInt("grupo"); } ResultSet rs = this.grupoProduto.porFiltroNome(""); List listaGrupo = new ArrayList(); int codigo; String nome; while (rs.next()) { codigo = rs.getInt("codigo"); nome = rs.getString("nome"); listaGrupo.add(codigo + "-" + nome); if (codigoGrupo == codigo) { posicaoSelecao = listaGrupo.size() - 1; } } this.comboGrupoProduto.setModel(new DefaultComboBoxModel(listaGrupo.toArray())); this.comboGrupoProduto.setSelectedIndex(posicaoSelecao); } catch (SQLException ex) { JOptionPane.showMessageDialog(this, "Erro ao manipular dados de produto" + ex.toString()); } catch (NegocioException ex) { JOptionPane.showMessageDialog(this, "Erro ao recuperar dados de produtos \n" + ex.toString()); } } // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); botaoConfirma = new javax.swing.JButton(); botaoCancelar = new javax.swing.JButton(); campoMargem = new javax.swing.JTextField(); campoNome = new javax.swing.JTextField(); campoCompra = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); campoCodigo = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); comboGrupoProduto = new javax.swing.JComboBox(); jLabel7 = new javax.swing.JLabel(); campoPercentualPromocao = new javax.swing.JTextField(); setTitle("Alteração de Produtos"); setBackground(new java.awt.Color(204, 204, 204)); setModal(true); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); getContentPane().setLayout(null); jLabel1.setText("Nome"); getContentPane().add(jLabel1); jLabel1.setBounds(30, 60, 60, 20); jLabel3.setText("Valor Compra"); getContentPane().add(jLabel3); jLabel3.setBounds(30, 90, 100, 20); jLabel4.setText("% <NAME>"); getContentPane().add(jLabel4); jLabel4.setBounds(30, 120, 130, 20); botaoConfirma.setText("Confirmar"); botaoConfirma.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botaoConfirmaActionPerformed(evt); } }); getContentPane().add(botaoConfirma); botaoConfirma.setBounds(60, 240, 110, 30); botaoCancelar.setText("Cancelar"); botaoCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { botaoCancelarActionPerformed(evt); } }); getContentPane().add(botaoCancelar); botaoCancelar.setBounds(350, 240, 110, 30); getContentPane().add(campoMargem); campoMargem.setBounds(170, 120, 100, 20); getContentPane().add(campoNome); campoNome.setBounds(170, 60, 320, 20); getContentPane().add(campoCompra); campoCompra.setBounds(170, 90, 100, 20); jLabel5.setText("Código"); getContentPane().add(jLabel5); jLabel5.setBounds(30, 30, 60, 20); campoCodigo.setEditable(false); getContentPane().add(campoCodigo); campoCodigo.setBounds(170, 30, 100, 20); jLabel6.setText("Grupo"); getContentPane().add(jLabel6); jLabel6.setBounds(30, 180, 90, 20); getContentPane().add(comboGrupoProduto); comboGrupoProduto.setBounds(170, 180, 230, 27); jLabel7.setText("% Promocao"); getContentPane().add(jLabel7); jLabel7.setBounds(30, 150, 90, 20); getContentPane().add(campoPercentualPromocao); campoPercentualPromocao.setBounds(170, 150, 100, 20); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-522)/2, (screenSize.height-312)/2, 522, 312); }// </editor-fold>//GEN-END:initComponents private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog setVisible(false); dispose(); }//GEN-LAST:event_closeDialog private void botaoConfirmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoConfirmaActionPerformed this.confirmaOperacao(); this.closeDialog(null); }//GEN-LAST:event_botaoConfirmaActionPerformed private void botaoCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoCancelarActionPerformed this.closeDialog(null); }//GEN-LAST:event_botaoCancelarActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton botaoCancelar; private javax.swing.JButton botaoConfirma; private javax.swing.JTextField campoCodigo; private javax.swing.JTextField campoCompra; private javax.swing.JTextField campoMargem; private javax.swing.JTextField campoNome; private javax.swing.JTextField campoPercentualPromocao; private javax.swing.JComboBox comboGrupoProduto; private javax.swing.JLabel jLabel1; 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; // End of variables declaration//GEN-END:variables }
8,484
0.647378
0.623925
217
38.101383
25.519106
121
false
false
0
0
0
0
0
0
0.921659
false
false
2
312b6ff0b9d10ac93563ff1f7207844802052fe4
26,087,631,385,701
638f4b12b6c562ed3a05f40c8019232c2e962648
/BowlingAlleyGame/src/com/praveen/game/bowling/alley/impl/GameImpl.java
df02eb6aa118300be21da37a815a76761c32f804
[]
no_license
praveensingh0107/practice
https://github.com/praveensingh0107/practice
cf2cb15b09e73d9681aa30c019bde3141ceeca41
5ab299cc35e3d4e71c3ef2d9e2a3ddca9910e930
refs/heads/master
2021-12-23T22:18:58.688000
2021-12-19T03:32:47
2021-12-19T03:32:47
190,347,081
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.praveen.game.bowling.alley.impl; import com.praveen.game.bowling.alley.Game; import com.praveen.game.bowling.alley.Lane; import java.util.List; public class GameImpl implements Game { private List<Lane> lanes; public GameImpl(List<Lane> lanes) { this.lanes = lanes; } @Override public Lane getLane(int index) { return lanes.get(index); } }
UTF-8
Java
393
java
GameImpl.java
Java
[]
null
[]
package com.praveen.game.bowling.alley.impl; import com.praveen.game.bowling.alley.Game; import com.praveen.game.bowling.alley.Lane; import java.util.List; public class GameImpl implements Game { private List<Lane> lanes; public GameImpl(List<Lane> lanes) { this.lanes = lanes; } @Override public Lane getLane(int index) { return lanes.get(index); } }
393
0.694656
0.694656
18
20.833334
18.421757
46
false
false
0
0
0
0
0
0
0.388889
false
false
2
8e32d3132b5b723fac8c11780f2aea77f9466b10
8,375,186,291,165
492f70728f8c91ae724c688fc3c6a9e2e302c63a
/Book/src/main/java/com.hgo.book/service/Impl/BookServiceImpl.java
1b320bfbf59c9529256edd8d32136d2321560cbf
[]
no_license
zuozhiwei/BookShareApp
https://github.com/zuozhiwei/BookShareApp
fe735aaed2415099f4b51d0457d27af996227087
edd1c86910b69baef5bacf2b958fd52ae1ef7dac
refs/heads/master
2021-07-19T10:06:34.305000
2018-08-20T13:58:46
2018-08-20T13:58:46
135,733,771
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hgo.book.service.Impl; import com.hgo.book.dao.IBookDao; import com.hgo.book.dao.IUserDao; import com.hgo.book.service.IBookService; import org.springframework.stereotype.Service; import org.springframework.util.DigestUtils; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; @Service("bookService") public class BookServiceImpl implements IBookService { @Resource private IBookDao bookDao; @Override public HashMap<String, Object> getBookInfoByBookID(String bookID) { HashMap<String,Object> param = new HashMap<String,Object>(); param.put("bookID",bookID); HashMap<String,Object> bookInfo = this.bookDao.getBookInfoByBookID(param); return bookInfo; } }
UTF-8
Java
754
java
BookServiceImpl.java
Java
[]
null
[]
package com.hgo.book.service.Impl; import com.hgo.book.dao.IBookDao; import com.hgo.book.dao.IUserDao; import com.hgo.book.service.IBookService; import org.springframework.stereotype.Service; import org.springframework.util.DigestUtils; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; @Service("bookService") public class BookServiceImpl implements IBookService { @Resource private IBookDao bookDao; @Override public HashMap<String, Object> getBookInfoByBookID(String bookID) { HashMap<String,Object> param = new HashMap<String,Object>(); param.put("bookID",bookID); HashMap<String,Object> bookInfo = this.bookDao.getBookInfoByBookID(param); return bookInfo; } }
754
0.751989
0.751989
26
28.038462
22.925432
82
false
false
0
0
0
0
0
0
0.730769
false
false
2
523532133ea9e01204a236aaae802a0697317721
22,256,520,589,007
9ffa742b0950a9cf8f8421d177ab85d902f87a51
/micro-boot/src/main/java/cn/mldn/config/ErrorPageConfig.java
d7f649a9c47cd9cd510813df44048f3a9960afa5
[]
no_license
HH1125/micro
https://github.com/HH1125/micro
6c498b59a4e5d9e1654a1b5cc6d9dda17d599901
3075555431cc0192386cb638836d083943d408af
refs/heads/master
2020-03-26T22:50:08.082000
2018-07-09T10:26:56
2018-07-09T10:26:56
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.mldn.config; import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.ErrorPageRegistrar; import org.springframework.boot.web.server.ErrorPageRegistry; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; @Configuration public class ErrorPageConfig { @Bean public ErrorPageRegistrar errorPageRegistrar() { return new ErrorPageRegistrar() { @Override public void registerErrorPages(ErrorPageRegistry registry) { ErrorPage errorPage404 = new ErrorPage(HttpStatus.NOT_FOUND, "/error-404.html"); ErrorPage errorPage500 = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error-500.html"); registry.addErrorPages(errorPage404, errorPage500); } }; } }
UTF-8
Java
854
java
ErrorPageConfig.java
Java
[]
null
[]
package cn.mldn.config; import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.ErrorPageRegistrar; import org.springframework.boot.web.server.ErrorPageRegistry; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; @Configuration public class ErrorPageConfig { @Bean public ErrorPageRegistrar errorPageRegistrar() { return new ErrorPageRegistrar() { @Override public void registerErrorPages(ErrorPageRegistry registry) { ErrorPage errorPage404 = new ErrorPage(HttpStatus.NOT_FOUND, "/error-404.html"); ErrorPage errorPage500 = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error-500.html"); registry.addErrorPages(errorPage404, errorPage500); } }; } }
854
0.779859
0.758782
23
35.130436
28.569221
96
false
false
0
0
0
0
0
0
1.826087
false
false
2
ad20de1f000651bd49cee4b5505cb5ccd64f1aef
25,572,235,305,961
47005e3429a1d4175bb3717599fec493c8882542
/app/src/main/java/com/atfotiad/starwarsapi/model/SwapiResponse.java
84750a39c45339f980bf3a87adae7b59b0fe28cc
[]
no_license
atfotiad/StarWarsApi
https://github.com/atfotiad/StarWarsApi
0a4b110cce7607f4402938c962f0bb2c77f09ce9
e00b7d06393cc3c042a25507b55b2e9514b3fccd
refs/heads/master
2022-12-04T08:09:40.673000
2020-08-25T21:18:24
2020-08-25T21:18:24
290,429,327
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.atfotiad.starwarsapi.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class SwapiResponse { @SerializedName("results") @Expose private List<People> people = null; public List<People> getPeople() { return people; } }
UTF-8
Java
345
java
SwapiResponse.java
Java
[]
null
[]
package com.atfotiad.starwarsapi.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class SwapiResponse { @SerializedName("results") @Expose private List<People> people = null; public List<People> getPeople() { return people; } }
345
0.715942
0.715942
19
17.157894
17.592651
50
false
false
0
0
0
0
0
0
0.315789
false
false
2
7764495e73bb4cf1fae32e9550f2f98e799907fe
32,959,579,091,038
7fe7b95c553f437066081e7367052d365f0e47e6
/MissingNuminArray.java
45922dd35385d4097fe83101874ba887c9c811c9
[]
no_license
sarangithub2468/My-Java-Programs
https://github.com/sarangithub2468/My-Java-Programs
73c1288d046e682afbb793cf56baf38ee3ae24bb
9d29386992863bc390d578ae5a6b3ebe75f565a0
refs/heads/master
2022-12-27T08:29:42.454000
2020-10-03T19:48:25
2020-10-03T19:48:25
300,962,198
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package myJavaPrograms; public class MissingNuminArray { public static void main(String[] args) { /* //logic fidn sum of elemtns in array find sum of elemtns from min to max numents in araneg of wlwmernts subtract bith we will get missing number*/ // int[] a = {1,4,3,5}; int sum1=0; //find sum of elemrnt s in array for (int i = 0; i < a.length; i++) { sum1=sum1+a[i]; } System.out.println(sum1); //sum of rnage of elements int sum2=0; for (int i = 1; i <=5; i++) { sum2 =sum2+i; } System.out.println(sum2); int missingnum = sum2-sum1; System.out.println(missingnum); } }
UTF-8
Java
604
java
MissingNuminArray.java
Java
[]
null
[]
package myJavaPrograms; public class MissingNuminArray { public static void main(String[] args) { /* //logic fidn sum of elemtns in array find sum of elemtns from min to max numents in araneg of wlwmernts subtract bith we will get missing number*/ // int[] a = {1,4,3,5}; int sum1=0; //find sum of elemrnt s in array for (int i = 0; i < a.length; i++) { sum1=sum1+a[i]; } System.out.println(sum1); //sum of rnage of elements int sum2=0; for (int i = 1; i <=5; i++) { sum2 =sum2+i; } System.out.println(sum2); int missingnum = sum2-sum1; System.out.println(missingnum); } }
604
0.657285
0.625828
40
14.1
15.514187
67
false
false
0
0
0
0
0
0
0.85
false
false
2
0c37d5fd0ee971d57b22749ece0f48583d62a2d7
4,415,226,441,059
a56101426d8faf250a7b9ba7cd24819cf5ab6d9d
/src/main/java/learning_selenium/TestaCadastroFacebook.java
d33f759bd10300815d466971fccda749df8e4a72
[]
no_license
jeffersonmello8/selenium-webdriver
https://github.com/jeffersonmello8/selenium-webdriver
2db28e623e38c84b128a4c31297213dd317c868e
fd6d5bead01957215656a8295ee7839329b4fc5e
refs/heads/master
2022-04-09T11:23:31.852000
2020-03-12T01:23:29
2020-03-12T01:23:29
241,912,728
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package learning_selenium; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class TestaCadastroFacebook { private static CadastroFacebookPage facebook; private static WebDriver driver; @BeforeClass public static void preCondicao() { System.setProperty("webdriver.chrome.driver", "C:\\tools\\selenium\\chromedriver.exe"); driver = new ChromeDriver(); driver.get("https://www.facebook.com/"); driver.manage().window().maximize(); facebook = new CadastroFacebookPage(driver); } @Test public void preencheDadosUsuario() { facebook.preencheNome("Jefferson"); facebook.preencheSobremome("Sousa"); facebook.preencheEmail("jefferson.melo@eu.com.br"); facebook.confirmaEmail("jefferson.melo@eu.com.br"); facebook.preencheSenha("123456"); facebook.selecionaDiaNascimento("6"); facebook.selecionaMesNascimento("Mar"); facebook.selecionaAnoNascimento("1995"); facebook.selecionaSexoMasculino(); } @After public void fecharNavegador() { driver.quit(); } }
UTF-8
Java
1,115
java
TestaCadastroFacebook.java
Java
[ { "context": "preencheDadosUsuario() {\n\t\tfacebook.preencheNome(\"Jefferson\");\n\t\tfacebook.preencheSobremome(\"Sousa\");\n\t\tfaceb", "end": 698, "score": 0.9998396039009094, "start": 689, "tag": "NAME", "value": "Jefferson" }, { "context": "eNome(\"Jefferson\");\n\t\tfacebook.preencheSobremome(\"Sousa\");\n\t\tfacebook.preencheEmail(\"jefferson.melo@eu.co", "end": 737, "score": 0.9998526573181152, "start": 732, "tag": "NAME", "value": "Sousa" }, { "context": "ncheSobremome(\"Sousa\");\n\t\tfacebook.preencheEmail(\"jefferson.melo@eu.com.br\");\n\t\tfacebook.confirmaEmail(\"jefferson.melo@eu.co", "end": 791, "score": 0.9999286532402039, "start": 767, "tag": "EMAIL", "value": "jefferson.melo@eu.com.br" }, { "context": "erson.melo@eu.com.br\");\n\t\tfacebook.confirmaEmail(\"jefferson.melo@eu.com.br\");\n\t\tfacebook.preencheSenha(\"123456\");\n\t\tfacebook", "end": 845, "score": 0.9999296069145203, "start": 821, "tag": "EMAIL", "value": "jefferson.melo@eu.com.br" }, { "context": "erson.melo@eu.com.br\");\n\t\tfacebook.preencheSenha(\"123456\");\n\t\tfacebook.selecionaDiaNascimento(\"6\");\n\t\tface", "end": 881, "score": 0.9985200762748718, "start": 875, "tag": "PASSWORD", "value": "123456" } ]
null
[]
package learning_selenium; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class TestaCadastroFacebook { private static CadastroFacebookPage facebook; private static WebDriver driver; @BeforeClass public static void preCondicao() { System.setProperty("webdriver.chrome.driver", "C:\\tools\\selenium\\chromedriver.exe"); driver = new ChromeDriver(); driver.get("https://www.facebook.com/"); driver.manage().window().maximize(); facebook = new CadastroFacebookPage(driver); } @Test public void preencheDadosUsuario() { facebook.preencheNome("Jefferson"); facebook.preencheSobremome("Sousa"); facebook.preencheEmail("<EMAIL>"); facebook.confirmaEmail("<EMAIL>"); facebook.preencheSenha("<PASSWORD>"); facebook.selecionaDiaNascimento("6"); facebook.selecionaMesNascimento("Mar"); facebook.selecionaAnoNascimento("1995"); facebook.selecionaSexoMasculino(); } @After public void fecharNavegador() { driver.quit(); } }
1,085
0.758744
0.748879
40
26.875
19.953932
89
false
false
0
0
0
0
0
0
1.725
false
false
2
13d8e25e3c834c8cb71e212b40f9c7852dc05d00
10,015,863,755,110
b7f5bddcec99a759c4c60b020d9666306b92aae6
/src/level4/lesson13/task001/task001v2.java
d562b72233c32408c8514a1494f9e4d0fa7b6ba7
[]
no_license
Deoniska/Java
https://github.com/Deoniska/Java
6c5f0a9f0131144c0c69721b43abdd2106e59904
57525dcdc9f3ecd058f3736b7d1a18380ec38cdc
refs/heads/master
2020-04-05T07:11:36.992000
2019-02-12T12:23:29
2019-02-12T12:23:29
156,666,399
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package level4.lesson13.task001; /* Четные числа */ public class task001v2 { public static void main(String[] args) { int i = 1; while (i<101) { if (i%2==0) System.out.println(i); i++; } } }
UTF-8
Java
258
java
task001v2.java
Java
[]
null
[]
package level4.lesson13.task001; /* Четные числа */ public class task001v2 { public static void main(String[] args) { int i = 1; while (i<101) { if (i%2==0) System.out.println(i); i++; } } }
258
0.510121
0.445344
13
18
14.696939
46
false
false
0
0
0
0
0
0
0.307692
false
false
2
49e3030ecfbbaa2576ec0c2ac992d747d1bf669a
28,063,316,374,372
cd7c0cf10bdb602704862587b26741862880b4c6
/Day3/app/src/main/java/com/orange/clockwork/day3/AudioItemViewHolder.java
5ac9de6dcad32d9fa7a3c3ddb84db0c5836d3a5a
[]
no_license
svartika/LearningAndroid
https://github.com/svartika/LearningAndroid
e1898992377d2c86b1a247b416462466bbda81ad
18cd0c969ec225b4ff70c48a1cbf38c62ed9e6c7
refs/heads/master
2020-03-02T11:39:31.500000
2015-10-16T09:08:40
2015-10-16T09:08:40
40,974,012
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.orange.clockwork.day3; import android.os.Handler; import android.os.Message; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.ToggleButton; import java.sql.Time; import java.util.concurrent.TimeUnit; /** * Created by vartika on 15. 8. 28. */ public class AudioItemViewHolder extends RecyclerView.ViewHolder { public TextView textView2, textView3, textView4, textView5, textView6, textView7, textView8; public ToggleButton playPause; public int trackID; public ImageView imageViewAlbumArt; Handler playStateChangeHanlder = new Handler() { @Override public void handleMessage(Message msg) { playPause.setChecked(false); } }; public AudioItemViewHolder (View v) { super(v); textView2 = (TextView) v.findViewById(R.id.textView2); textView3 = (TextView) v.findViewById(R.id.textView3); textView4 = (TextView) v.findViewById(R.id.textView4); textView5 = (TextView) v.findViewById(R.id.textView5); textView6 = (TextView) v.findViewById(R.id.textView6); textView7 = (TextView) v.findViewById(R.id.textView7); textView8 = (TextView) v.findViewById(R.id.textView8); playPause = (ToggleButton) v.findViewById(R.id.playPause); imageViewAlbumArt = (ImageView) v.findViewById(R.id.imageViewAlbumArt); } void setData(final String fileName , final MainActivity.MusicMetadata musicMetadatas, final Handler handler, final int pos) { if(fileName==null) return; textView2.setText(fileName); //we have old trackid here so we will remove the handler assoicated with this track id //now the handler will go to the new track id AudioStateManager.getInstance().removeHandlerForTrackId(trackID); trackID = musicMetadatas.trackID; AudioStateManager.getInstance().putHandlerForTrackId(trackID, playStateChangeHanlder); String temp = ""; if (musicMetadatas.title == null || musicMetadatas.title.isEmpty()) temp = ""; else temp = musicMetadatas.title; textView3.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.albumName == null || musicMetadatas.albumName.isEmpty()) temp = ""; else temp = musicMetadatas.albumName; textView4.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.artistName == null || musicMetadatas.artistName.isEmpty()) temp = ""; else temp = musicMetadatas.artistName; textView5.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.genre == null || musicMetadatas.genre.isEmpty()) temp = ""; else temp = musicMetadatas.genre; textView6.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.duration == null || musicMetadatas.duration.isEmpty()) temp = ""; else temp = musicMetadatas.duration; int mins = (int) TimeUnit.MILLISECONDS.toMinutes(Long.parseLong(musicMetadatas.duration)); int secs = (int) (TimeUnit.MILLISECONDS.toSeconds(Long.parseLong(musicMetadatas.duration)) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(Long.parseLong(musicMetadatas.duration)))); String time = String.format("%d:%d", mins, secs); textView7.setText(time); //time.toCharArray(), 0, time.length()); temp = ""; if (musicMetadatas.bitrate == null || musicMetadatas.bitrate.isEmpty()) temp = ""; else temp = musicMetadatas.bitrate; textView8.setText(temp.toCharArray(), 0, temp.length()); if(musicMetadatas.coverArt != null) imageViewAlbumArt.setImageBitmap(musicMetadatas.coverArt); playPause.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Message msg = Message.obtain(); HelperFunctions.DetailsFromRecyclerView myObj = new HelperFunctions.DetailsFromRecyclerView(); if (isChecked) { myObj.msgType = HelperFunctions.MESSAGE_TYPE.PLAY; myObj.trackName = fileName; //doubt is pos ok? myObj.trackID = musicMetadatas.trackID; myObj.shouldPlay = isChecked; } else { myObj.msgType = HelperFunctions.MESSAGE_TYPE.PAUSE; myObj.trackName = fileName; //doubt is pos ok? myObj.trackID = musicMetadatas.trackID; myObj.shouldPlay = isChecked; } msg.obj = myObj; handler.sendMessage(msg); } }); } }
UTF-8
Java
5,005
java
AudioItemViewHolder.java
Java
[ { "context": " java.util.concurrent.TimeUnit;\n\n/**\n * Created by vartika on 15. 8. 28.\n */\npublic class AudioItemViewHolde", "end": 389, "score": 0.9991760849952698, "start": 382, "tag": "USERNAME", "value": "vartika" } ]
null
[]
package com.orange.clockwork.day3; import android.os.Handler; import android.os.Message; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.ToggleButton; import java.sql.Time; import java.util.concurrent.TimeUnit; /** * Created by vartika on 15. 8. 28. */ public class AudioItemViewHolder extends RecyclerView.ViewHolder { public TextView textView2, textView3, textView4, textView5, textView6, textView7, textView8; public ToggleButton playPause; public int trackID; public ImageView imageViewAlbumArt; Handler playStateChangeHanlder = new Handler() { @Override public void handleMessage(Message msg) { playPause.setChecked(false); } }; public AudioItemViewHolder (View v) { super(v); textView2 = (TextView) v.findViewById(R.id.textView2); textView3 = (TextView) v.findViewById(R.id.textView3); textView4 = (TextView) v.findViewById(R.id.textView4); textView5 = (TextView) v.findViewById(R.id.textView5); textView6 = (TextView) v.findViewById(R.id.textView6); textView7 = (TextView) v.findViewById(R.id.textView7); textView8 = (TextView) v.findViewById(R.id.textView8); playPause = (ToggleButton) v.findViewById(R.id.playPause); imageViewAlbumArt = (ImageView) v.findViewById(R.id.imageViewAlbumArt); } void setData(final String fileName , final MainActivity.MusicMetadata musicMetadatas, final Handler handler, final int pos) { if(fileName==null) return; textView2.setText(fileName); //we have old trackid here so we will remove the handler assoicated with this track id //now the handler will go to the new track id AudioStateManager.getInstance().removeHandlerForTrackId(trackID); trackID = musicMetadatas.trackID; AudioStateManager.getInstance().putHandlerForTrackId(trackID, playStateChangeHanlder); String temp = ""; if (musicMetadatas.title == null || musicMetadatas.title.isEmpty()) temp = ""; else temp = musicMetadatas.title; textView3.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.albumName == null || musicMetadatas.albumName.isEmpty()) temp = ""; else temp = musicMetadatas.albumName; textView4.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.artistName == null || musicMetadatas.artistName.isEmpty()) temp = ""; else temp = musicMetadatas.artistName; textView5.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.genre == null || musicMetadatas.genre.isEmpty()) temp = ""; else temp = musicMetadatas.genre; textView6.setText(temp.toCharArray(), 0, temp.length()); temp = ""; if (musicMetadatas.duration == null || musicMetadatas.duration.isEmpty()) temp = ""; else temp = musicMetadatas.duration; int mins = (int) TimeUnit.MILLISECONDS.toMinutes(Long.parseLong(musicMetadatas.duration)); int secs = (int) (TimeUnit.MILLISECONDS.toSeconds(Long.parseLong(musicMetadatas.duration)) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(Long.parseLong(musicMetadatas.duration)))); String time = String.format("%d:%d", mins, secs); textView7.setText(time); //time.toCharArray(), 0, time.length()); temp = ""; if (musicMetadatas.bitrate == null || musicMetadatas.bitrate.isEmpty()) temp = ""; else temp = musicMetadatas.bitrate; textView8.setText(temp.toCharArray(), 0, temp.length()); if(musicMetadatas.coverArt != null) imageViewAlbumArt.setImageBitmap(musicMetadatas.coverArt); playPause.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Message msg = Message.obtain(); HelperFunctions.DetailsFromRecyclerView myObj = new HelperFunctions.DetailsFromRecyclerView(); if (isChecked) { myObj.msgType = HelperFunctions.MESSAGE_TYPE.PLAY; myObj.trackName = fileName; //doubt is pos ok? myObj.trackID = musicMetadatas.trackID; myObj.shouldPlay = isChecked; } else { myObj.msgType = HelperFunctions.MESSAGE_TYPE.PAUSE; myObj.trackName = fileName; //doubt is pos ok? myObj.trackID = musicMetadatas.trackID; myObj.shouldPlay = isChecked; } msg.obj = myObj; handler.sendMessage(msg); } }); } }
5,005
0.644955
0.636763
118
41.415253
33.097271
130
false
false
0
0
0
0
0
0
0.940678
false
false
2
3c7e6ca75c2f87b89e295ceaad6ff460e57ec012
18,588,618,495,873
8dc71389a2296c83a15e57499aa1f1e427815e0b
/src/main/java/decodes/db/DataSourceList.java
2fbed1eb7f49cb2df38fa27cbee5b4b91742f332
[ "Apache-2.0" ]
permissive
opendcs/opendcs
https://github.com/opendcs/opendcs
b2a216e0a10b0e09bd6edfc575ea0667bf830db9
8ee9e05bbfc1f556d70c2db1d5003070f4d5635c
refs/heads/master
2023-08-18T20:19:56.906000
2023-08-09T21:01:43
2023-08-09T21:01:43
20,228,381
28
22
Apache-2.0
false
2023-09-14T19:49:06
2014-05-27T17:16:15
2023-08-29T14:42:31
2023-09-14T19:49:05
153,681
23
21
98
Java
false
false
/* * $Id$ * * $State$ * * $Log$ * Revision 1.1.1.1 2014/05/19 15:28:59 mmaloney * OPENDCS 6.0 Initial Checkin * * Revision 1.3 2013/03/21 18:27:39 mmaloney * DbKey Implementation * * Revision 1.2 2009/01/22 00:31:32 mjmaloney * DB Caching improvements to make msgaccess start quicker. * Remove the need to cache the entire database. * * Revision 1.1 2008/04/04 18:21:00 cvs * Added legacy code to repository * * Revision 1.10 2004/08/27 18:41:30 mjmaloney * Platwiz work * * Revision 1.9 2003/11/15 19:37:01 mjmaloney * Removed extraneous WARNING message. * * Revision 1.8 2002/09/19 12:17:28 mjmaloney * SQL Updates. * * Revision 1.7 2001/11/24 18:29:10 mike * First working DbImport! * * Revision 1.6 2001/11/10 14:55:16 mike * Implementing sources & network list editors. * * Revision 1.5 2001/11/09 14:35:11 mike * dev * * Revision 1.4 2001/04/21 20:19:23 mike * Added read & write methods to all DatabaseObjects * * Revision 1.3 2001/04/12 12:30:13 mike * dev * * Revision 1.2 2001/04/02 00:42:33 mike * DatabaseObject is now an abstract base-class. * * Revision 1.1 2001/04/01 17:01:10 mike * *** empty log message *** * */ package decodes.db; import java.util.ArrayList; import java.util.Iterator; import decodes.sql.DbKey; import ilex.util.Logger; /** DataSourceList is a collection of all known DataSource objects. */ public class DataSourceList extends DatabaseObject { /** Internal Vector of sources */ private ArrayList<DataSource> dataSources; /** Cross reference of SQL IDs to data sources. */ private IdRecordList dataSourceIdList; /** default constructor */ public DataSourceList() { dataSources = new ArrayList<DataSource>(); dataSourceIdList = new IdRecordList("DataSource"); } /** @return "DataSourceList" */ public String getObjectType() { return "DataSourceList"; } /** Adds a dataSource object to the collection. @param ds the DataSource to be added */ public void add(DataSource ds) { DataSource tmp = get(ds.getName()); if (tmp != null) { dataSources.remove(tmp); if (tmp.idIsSet()) dataSourceIdList.remove(tmp); } dataSources.add(ds); if (ds.idIsSet()) dataSourceIdList.add(ds); } /** @return a DataSource by name, or null if no match. */ public DataSource get(String name) { for(Iterator<DataSource> it = dataSources.iterator(); it.hasNext(); ) { DataSource ds = it.next(); if (name.equalsIgnoreCase(ds.getName())) return ds; } return null; } /** @return a DataSource by database ID, or null if no match. */ public DataSource getById(DbKey id) { return (DataSource)dataSourceIdList.get(id); } /** Removes a DataSource object from the list. */ public void remove(DataSource ds) { dataSources.remove(ds); dataSourceIdList.remove(ds); } /** @return the internal list as a Vector */ public ArrayList<DataSource> getList() { return dataSources; } /** @return an interator into the internal list of DataSource objects. */ public Iterator<DataSource> iterator() { return dataSources.iterator(); } /** @return number of DataSource objects in the list. */ public int size() { return dataSources.size(); } /** * Used by DB Editor, counts the number of routing specs using each * data source. */ public void countUsedBy() { for(Iterator<DataSource> it = dataSources.iterator(); it.hasNext(); ) { DataSource ds = it.next(); ds.countUsedBy(); } } @Override public void prepareForExec() throws IncompleteDatabaseException, InvalidDatabaseException { throw new InvalidDatabaseException("Not implemented"); } @Override public boolean isPrepared() { return false; } /** Reads the DataSource list from the database. @throws DatabaseException if error. */ public void read() throws DatabaseException { myDatabase.getDbIo().readDataSourceList(this); } /** Writes the DataSource list to the database. @throws DatabaseException if error. */ public void write() throws DatabaseException { for(DataSource ds : dataSources) ds.write(); } public void clear() { dataSources.clear(); dataSourceIdList.clear(); } }
UTF-8
Java
4,185
java
DataSourceList.java
Java
[ { "context": "* $Log$\n* Revision 1.1.1.1 2014/05/19 15:28:59 mmaloney\n* OPENDCS 6.0 Initial Checkin\n*\n* Revision 1.3 ", "end": 85, "score": 0.9996740818023682, "start": 77, "tag": "USERNAME", "value": "mmaloney" }, { "context": "al Checkin\n*\n* Revision 1.3 2013/03/21 18:27:39 mmaloney\n* DbKey Implementation\n*\n* Revision 1.2 2009/0", "end": 165, "score": 0.9996669888496399, "start": 157, "tag": "USERNAME", "value": "mmaloney" }, { "context": "ementation\n*\n* Revision 1.2 2009/01/22 00:31:32 mjmaloney\n* DB Caching improvements to make msgaccess star", "end": 239, "score": 0.999695360660553, "start": 230, "tag": "USERNAME", "value": "mjmaloney" }, { "context": " database.\n*\n* Revision 1.1 2008/04/04 18:21:00 cvs\n* Added legacy code to repository\n*\n* Revision ", "end": 392, "score": 0.7899094223976135, "start": 389, "tag": "USERNAME", "value": "cvs" }, { "context": "epository\n*\n* Revision 1.10 2004/08/27 18:41:30 mjmaloney\n* Platwiz work\n*\n* Revision 1.9 2003/11/15 19:", "end": 478, "score": 0.999715268611908, "start": 469, "tag": "USERNAME", "value": "mjmaloney" }, { "context": "atwiz work\n*\n* Revision 1.9 2003/11/15 19:37:01 mjmaloney\n* Removed extraneous WARNING message.\n*\n* Revis", "end": 544, "score": 0.9997138381004333, "start": 535, "tag": "USERNAME", "value": "mjmaloney" }, { "context": "G message.\n*\n* Revision 1.8 2002/09/19 12:17:28 mjmaloney\n* SQL Updates.\n*\n* Revision 1.7 2001/11/24 18:", "end": 633, "score": 0.9996972680091858, "start": 624, "tag": "USERNAME", "value": "mjmaloney" }, { "context": "L Updates.\n*\n* Revision 1.7 2001/11/24 18:29:10 mike\n* First working DbImport!\n*\n* Revision 1.6 200", "end": 694, "score": 0.9996532201766968, "start": 690, "tag": "USERNAME", "value": "mike" }, { "context": " DbImport!\n*\n* Revision 1.6 2001/11/10 14:55:16 mike\n* Implementing sources & network list editors.\n*", "end": 766, "score": 0.9994958639144897, "start": 762, "tag": "USERNAME", "value": "mike" }, { "context": "t editors.\n*\n* Revision 1.5 2001/11/09 14:35:11 mike\n* dev\n*\n* Revision 1.4 2001/04/21 20:19:23 mi", "end": 859, "score": 0.9996267557144165, "start": 855, "tag": "USERNAME", "value": "mike" }, { "context": "ike\n* dev\n*\n* Revision 1.4 2001/04/21 20:19:23 mike\n* Added read & write methods to all DatabaseObje", "end": 911, "score": 0.9995646476745605, "start": 907, "tag": "USERNAME", "value": "mike" }, { "context": "aseObjects\n*\n* Revision 1.3 2001/04/12 12:30:13 mike\n* dev\n*\n* Revision 1.2 2001/04/02 00:42:33 ", "end": 1007, "score": 0.9048362374305725, "start": 1005, "tag": "NAME", "value": "mi" }, { "context": "Objects\n*\n* Revision 1.3 2001/04/12 12:30:13 mike\n* dev\n*\n* Revision 1.2 2001/04/02 00:42:33 mi", "end": 1009, "score": 0.7142378091812134, "start": 1007, "tag": "USERNAME", "value": "ke" }, { "context": "ike\n* dev\n*\n* Revision 1.2 2001/04/02 00:42:33 mike\n* DatabaseObject is now an abstract base-class", "end": 1059, "score": 0.9320115447044373, "start": 1057, "tag": "NAME", "value": "mi" }, { "context": "\n* dev\n*\n* Revision 1.2 2001/04/02 00:42:33 mike\n* DatabaseObject is now an abstract base-class.\n", "end": 1061, "score": 0.7088549137115479, "start": 1059, "tag": "USERNAME", "value": "ke" }, { "context": "ase-class.\n*\n* Revision 1.1 2001/04/01 17:01:10 mike\n* *** empty log message ***\n*\n*/\npackage decod", "end": 1153, "score": 0.6902852058410645, "start": 1151, "tag": "NAME", "value": "mi" }, { "context": "-class.\n*\n* Revision 1.1 2001/04/01 17:01:10 mike\n* *** empty log message ***\n*\n*/\npackage decodes", "end": 1155, "score": 0.9122746586799622, "start": 1153, "tag": "USERNAME", "value": "ke" } ]
null
[]
/* * $Id$ * * $State$ * * $Log$ * Revision 1.1.1.1 2014/05/19 15:28:59 mmaloney * OPENDCS 6.0 Initial Checkin * * Revision 1.3 2013/03/21 18:27:39 mmaloney * DbKey Implementation * * Revision 1.2 2009/01/22 00:31:32 mjmaloney * DB Caching improvements to make msgaccess start quicker. * Remove the need to cache the entire database. * * Revision 1.1 2008/04/04 18:21:00 cvs * Added legacy code to repository * * Revision 1.10 2004/08/27 18:41:30 mjmaloney * Platwiz work * * Revision 1.9 2003/11/15 19:37:01 mjmaloney * Removed extraneous WARNING message. * * Revision 1.8 2002/09/19 12:17:28 mjmaloney * SQL Updates. * * Revision 1.7 2001/11/24 18:29:10 mike * First working DbImport! * * Revision 1.6 2001/11/10 14:55:16 mike * Implementing sources & network list editors. * * Revision 1.5 2001/11/09 14:35:11 mike * dev * * Revision 1.4 2001/04/21 20:19:23 mike * Added read & write methods to all DatabaseObjects * * Revision 1.3 2001/04/12 12:30:13 mike * dev * * Revision 1.2 2001/04/02 00:42:33 mike * DatabaseObject is now an abstract base-class. * * Revision 1.1 2001/04/01 17:01:10 mike * *** empty log message *** * */ package decodes.db; import java.util.ArrayList; import java.util.Iterator; import decodes.sql.DbKey; import ilex.util.Logger; /** DataSourceList is a collection of all known DataSource objects. */ public class DataSourceList extends DatabaseObject { /** Internal Vector of sources */ private ArrayList<DataSource> dataSources; /** Cross reference of SQL IDs to data sources. */ private IdRecordList dataSourceIdList; /** default constructor */ public DataSourceList() { dataSources = new ArrayList<DataSource>(); dataSourceIdList = new IdRecordList("DataSource"); } /** @return "DataSourceList" */ public String getObjectType() { return "DataSourceList"; } /** Adds a dataSource object to the collection. @param ds the DataSource to be added */ public void add(DataSource ds) { DataSource tmp = get(ds.getName()); if (tmp != null) { dataSources.remove(tmp); if (tmp.idIsSet()) dataSourceIdList.remove(tmp); } dataSources.add(ds); if (ds.idIsSet()) dataSourceIdList.add(ds); } /** @return a DataSource by name, or null if no match. */ public DataSource get(String name) { for(Iterator<DataSource> it = dataSources.iterator(); it.hasNext(); ) { DataSource ds = it.next(); if (name.equalsIgnoreCase(ds.getName())) return ds; } return null; } /** @return a DataSource by database ID, or null if no match. */ public DataSource getById(DbKey id) { return (DataSource)dataSourceIdList.get(id); } /** Removes a DataSource object from the list. */ public void remove(DataSource ds) { dataSources.remove(ds); dataSourceIdList.remove(ds); } /** @return the internal list as a Vector */ public ArrayList<DataSource> getList() { return dataSources; } /** @return an interator into the internal list of DataSource objects. */ public Iterator<DataSource> iterator() { return dataSources.iterator(); } /** @return number of DataSource objects in the list. */ public int size() { return dataSources.size(); } /** * Used by DB Editor, counts the number of routing specs using each * data source. */ public void countUsedBy() { for(Iterator<DataSource> it = dataSources.iterator(); it.hasNext(); ) { DataSource ds = it.next(); ds.countUsedBy(); } } @Override public void prepareForExec() throws IncompleteDatabaseException, InvalidDatabaseException { throw new InvalidDatabaseException("Not implemented"); } @Override public boolean isPrepared() { return false; } /** Reads the DataSource list from the database. @throws DatabaseException if error. */ public void read() throws DatabaseException { myDatabase.getDbIo().readDataSourceList(this); } /** Writes the DataSource list to the database. @throws DatabaseException if error. */ public void write() throws DatabaseException { for(DataSource ds : dataSources) ds.write(); } public void clear() { dataSources.clear(); dataSourceIdList.clear(); } }
4,185
0.686738
0.632019
199
20.025126
20.085855
74
false
false
0
0
0
0
0
0
1.065327
false
false
2
0f385c067e4c3569f55b132eba1d5976f9e23d01
36,412,732,746,133
df2bab9fc0e8dde7a5d70894e8348544ebd3647b
/app/src/main/java/com/kaonstudio/testlocationtracker/ui/history/HistoryAdapter.java
f8b88c2df8c68c8b9c67e63a7303f031f5ad2b2b
[]
no_license
CoriChui/TestLocationTracker
https://github.com/CoriChui/TestLocationTracker
19495a6ad8728279cdcb487fcf71c76ba4550b33
b0428002ccef585d1ec0f7556695676bc2dde953
refs/heads/master
2023-05-31T19:09:48.619000
2021-06-20T13:48:55
2021-06-20T13:48:55
347,989,434
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.kaonstudio.testlocationtracker.ui.history; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.RecyclerView; import com.kaonstudio.testlocationtracker.R; import com.kaonstudio.testlocationtracker.domain.TrackDomain; import org.jetbrains.annotations.NotNull; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Locale; public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ItemHolder> { public final static String DATE_FORMAT_FULL = "yyyy-mm-dd hh:mm:ss"; private List<TrackDomain> tracks = new ArrayList<>(); private OnTrackClickListener listener; public HistoryAdapter(OnTrackClickListener listener) { this.listener = listener; } @NonNull @NotNull @Override public ItemHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_track, parent, false); return new ItemHolder(view, listener); } @Override public void onBindViewHolder(@NonNull @NotNull ItemHolder holder, int position) { holder.bind(tracks.get(position)); } @Override public int getItemCount() { return tracks.size(); } public static class ItemHolder extends RecyclerView.ViewHolder { private final TextView nameTv; private final TextView countTv; private final TextView dateTv; private final OnTrackClickListener listener; public ItemHolder(@NonNull @NotNull View itemView, OnTrackClickListener listener) { super(itemView); nameTv = itemView.findViewById(R.id.item_track_name); countTv = itemView.findViewById(R.id.item_track_count); dateTv = itemView.findViewById(R.id.item_track_date); this.listener = listener; } void bind(TrackDomain trackDomain) { itemView.setOnClickListener(v -> { listener.onTrackClicked(trackDomain); }); nameTv.setText(itemView.getContext().getString(R.string.item_track_name, trackDomain.name)); countTv.setText(itemView.getContext().getString(R.string.item_track_count, trackDomain.coordinates.size())); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(trackDomain.date); DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_FULL, Locale.getDefault()); dateTv.setText(itemView.getContext().getString(R.string.item_track_date, dateFormat.format(calendar.getTime()))); } } public void setTracks(List<TrackDomain> newTracks) { final DiffUtil.Callback diffCallback = new DiffUtil.Callback() { @Override public int getOldListSize() { return tracks.size(); } @Override public int getNewListSize() { return newTracks.size(); } @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { return tracks.get(oldItemPosition).name.equals(newTracks.get(newItemPosition).name); } @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return tracks.get(oldItemPosition).hashCode() == newTracks.get(newItemPosition).hashCode(); } }; final DiffUtil.DiffResult duffResult = DiffUtil.calculateDiff(diffCallback); tracks = newTracks; duffResult.dispatchUpdatesTo(this); } public interface OnTrackClickListener { void onTrackClicked(TrackDomain track); } }
UTF-8
Java
4,008
java
HistoryAdapter.java
Java
[]
null
[]
package com.kaonstudio.testlocationtracker.ui.history; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.RecyclerView; import com.kaonstudio.testlocationtracker.R; import com.kaonstudio.testlocationtracker.domain.TrackDomain; import org.jetbrains.annotations.NotNull; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Locale; public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ItemHolder> { public final static String DATE_FORMAT_FULL = "yyyy-mm-dd hh:mm:ss"; private List<TrackDomain> tracks = new ArrayList<>(); private OnTrackClickListener listener; public HistoryAdapter(OnTrackClickListener listener) { this.listener = listener; } @NonNull @NotNull @Override public ItemHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_track, parent, false); return new ItemHolder(view, listener); } @Override public void onBindViewHolder(@NonNull @NotNull ItemHolder holder, int position) { holder.bind(tracks.get(position)); } @Override public int getItemCount() { return tracks.size(); } public static class ItemHolder extends RecyclerView.ViewHolder { private final TextView nameTv; private final TextView countTv; private final TextView dateTv; private final OnTrackClickListener listener; public ItemHolder(@NonNull @NotNull View itemView, OnTrackClickListener listener) { super(itemView); nameTv = itemView.findViewById(R.id.item_track_name); countTv = itemView.findViewById(R.id.item_track_count); dateTv = itemView.findViewById(R.id.item_track_date); this.listener = listener; } void bind(TrackDomain trackDomain) { itemView.setOnClickListener(v -> { listener.onTrackClicked(trackDomain); }); nameTv.setText(itemView.getContext().getString(R.string.item_track_name, trackDomain.name)); countTv.setText(itemView.getContext().getString(R.string.item_track_count, trackDomain.coordinates.size())); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(trackDomain.date); DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_FULL, Locale.getDefault()); dateTv.setText(itemView.getContext().getString(R.string.item_track_date, dateFormat.format(calendar.getTime()))); } } public void setTracks(List<TrackDomain> newTracks) { final DiffUtil.Callback diffCallback = new DiffUtil.Callback() { @Override public int getOldListSize() { return tracks.size(); } @Override public int getNewListSize() { return newTracks.size(); } @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { return tracks.get(oldItemPosition).name.equals(newTracks.get(newItemPosition).name); } @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return tracks.get(oldItemPosition).hashCode() == newTracks.get(newItemPosition).hashCode(); } }; final DiffUtil.DiffResult duffResult = DiffUtil.calculateDiff(diffCallback); tracks = newTracks; duffResult.dispatchUpdatesTo(this); } public interface OnTrackClickListener { void onTrackClicked(TrackDomain track); } }
4,008
0.682884
0.682884
112
34.785713
31.454737
125
false
false
0
0
0
0
0
0
0.571429
false
false
2
1211970525b66fb02691ae1669cca605455b5903
8,057,358,685,095
e927542923b6eee4022cd2ecb0dcfec6f9909a99
/Jeditor.java
4cf88b12aea531eafb4773e89b738e1b23cfea35
[]
no_license
HAL-E/Jeditor
https://github.com/HAL-E/Jeditor
c7333112a2cfd5ce5c55ccfcad5ef85b8ff196aa
8f9751e464ed88519c37cc1008902e8b1acc89b2
refs/heads/master
2015-08-21T22:55:57.505000
2015-03-20T07:45:45
2015-03-20T07:45:45
32,569,912
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.filechooser.*; import java.io.*; import java.io.BufferedReader; import java.lang.StringBuilder; import java.io.BufferedWriter; import javax.swing.border.*; import java.io.LineNumberReader; import java.util.Timer; import java.util.TimerTask; public class Jeditor extends JFrame { //Field private String FileName; private JTextPane textArea = new JTextPane();; private JTabbedPane InitialTabbedPane = new JTabbedPane(); private int TABNUMBER = 1; private Timer timer = new Timer(); private JLabel statuslabel; //Main method public static void main(String args[]) { Jeditor je = new Jeditor(); je.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); je.setVisible(true); }//Main method end //Constructor private Jeditor() { super("Jeditor"); setSize(500,500); //JMenuBar setJMenuBar(menuBar()); //TextArea TextArea(); //StatusBar StatusBar(); } protected JMenuBar menuBar() { JMenuBar menuBar = new JMenuBar(); //FileMenu JMenu file = new JMenu("File"); JMenuItem newFile = new JMenuItem("New"); newFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { } } ); JMenuItem openFile = new JMenuItem("Open"); openFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { tryOpen(); } } ); JMenuItem saveFile = new JMenuItem("Save"); saveFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { } } ); JMenuItem saveAsFile = new JMenuItem("Save As"); saveAsFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { trySave(); } } ); JMenuItem exitFile = new JMenuItem("Exit"); exitFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { tryExit(); } } ); file.add(newFile); file.add(openFile); file.add(saveFile); file.add(saveAsFile); file.add(exitFile); menuBar.add(file); //View Menu JMenu view = new JMenu("View"); JMenuItem backGround = new JMenuItem("BackGround"); backGround.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { Example ex = new Example(); TextBackGround(); } } ); view.add(backGround); menuBar.add(view); return menuBar; }//MenuBar End // File ActionPerform private void tryOpen() { JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(Jeditor.this); String FileName = fc.getName(); if(returnVal == JFileChooser.APPROVE_OPTION) { try { BufferedReader br = new BufferedReader(new FileReader(fc.getSelectedFile())); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while( line != null ) { sb.append( line ); line = br.readLine(); if( line != null ) { sb.append( '\n' ); } } br.close(); textArea.setText(sb.toString()); statuslabel.setText("File: "+ FileName +"completely opened"); } catch( IOException e ) { } } } private void trySave() { JFileChooser fc = new JFileChooser(); //FileName for Tab String FileName = fc.getName(); int returnVal = fc.showSaveDialog(Jeditor.this); if(returnVal==fc.APPROVE_OPTION) { try { BufferedWriter bw = new BufferedWriter(new FileWriter(fc.getSelectedFile())); bw.write(textArea.getText()); bw.close(); statuslabel.setText("Save complete"); //This timer class does not work does not work. timer.schedule( new TimerTask() { public void run() { statuslabel.setText("status"); } } ,30); } catch( FileNotFoundException ex ) { } catch(IOException e) { } } } private void tryExit() { System.exit(0); } //ViewMenu ActionPerform private void TextBackGround() { /* JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(Jeditor.this); if(returnVal==fc.APPROVE_OPTION) { File image = fc.getSelectedFile(); try{ } catch(IOException e) { } } */ } /* private void TabComponents() { jtp.removeAll(); for(int i=0;i<TABNUMBER;i++) { String tabTitle = FileName; jtp.add(tabTitle, new JLabel(tabTitle)); jtp.setTabComponentAt(i, new ButtonTabComponent(jtp)); } tabComponentsItem.setSelected(true); jtp.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT); scrollLayoutItem.setSelected(false); setSize(new Dimension(400,200)); setLocationRelativeTo(null); setVisible(true); } */ private void TextArea() { add(textArea); JScrollPane sp = new JScrollPane(textArea); sp.setVerticalScrollBarPolicy(sp.VERTICAL_SCROLLBAR_AS_NEEDED); sp.setHorizontalScrollBarPolicy(sp.HORIZONTAL_SCROLLBAR_AS_NEEDED); getContentPane().add(sp, BorderLayout.CENTER); } private void StatusBar() { JPanel StatusBar = new JPanel(); StatusBar.setBorder(new BevelBorder(BevelBorder.LOWERED)); add(StatusBar, BorderLayout.SOUTH); //StatusBar StatusBar.setPreferredSize(new Dimension(getWidth(),16)); StatusBar.setLayout(new BoxLayout(StatusBar, BoxLayout.X_AXIS)); statuslabel = new JLabel("status"); statuslabel.setHorizontalAlignment(SwingConstants.LEFT); StatusBar.add(statuslabel); //LineNumber setVisible(true); } }
UTF-8
Java
6,876
java
Jeditor.java
Java
[]
null
[]
import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.filechooser.*; import java.io.*; import java.io.BufferedReader; import java.lang.StringBuilder; import java.io.BufferedWriter; import javax.swing.border.*; import java.io.LineNumberReader; import java.util.Timer; import java.util.TimerTask; public class Jeditor extends JFrame { //Field private String FileName; private JTextPane textArea = new JTextPane();; private JTabbedPane InitialTabbedPane = new JTabbedPane(); private int TABNUMBER = 1; private Timer timer = new Timer(); private JLabel statuslabel; //Main method public static void main(String args[]) { Jeditor je = new Jeditor(); je.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); je.setVisible(true); }//Main method end //Constructor private Jeditor() { super("Jeditor"); setSize(500,500); //JMenuBar setJMenuBar(menuBar()); //TextArea TextArea(); //StatusBar StatusBar(); } protected JMenuBar menuBar() { JMenuBar menuBar = new JMenuBar(); //FileMenu JMenu file = new JMenu("File"); JMenuItem newFile = new JMenuItem("New"); newFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { } } ); JMenuItem openFile = new JMenuItem("Open"); openFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { tryOpen(); } } ); JMenuItem saveFile = new JMenuItem("Save"); saveFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { } } ); JMenuItem saveAsFile = new JMenuItem("Save As"); saveAsFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { trySave(); } } ); JMenuItem exitFile = new JMenuItem("Exit"); exitFile.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { tryExit(); } } ); file.add(newFile); file.add(openFile); file.add(saveFile); file.add(saveAsFile); file.add(exitFile); menuBar.add(file); //View Menu JMenu view = new JMenu("View"); JMenuItem backGround = new JMenuItem("BackGround"); backGround.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { Example ex = new Example(); TextBackGround(); } } ); view.add(backGround); menuBar.add(view); return menuBar; }//MenuBar End // File ActionPerform private void tryOpen() { JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(Jeditor.this); String FileName = fc.getName(); if(returnVal == JFileChooser.APPROVE_OPTION) { try { BufferedReader br = new BufferedReader(new FileReader(fc.getSelectedFile())); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while( line != null ) { sb.append( line ); line = br.readLine(); if( line != null ) { sb.append( '\n' ); } } br.close(); textArea.setText(sb.toString()); statuslabel.setText("File: "+ FileName +"completely opened"); } catch( IOException e ) { } } } private void trySave() { JFileChooser fc = new JFileChooser(); //FileName for Tab String FileName = fc.getName(); int returnVal = fc.showSaveDialog(Jeditor.this); if(returnVal==fc.APPROVE_OPTION) { try { BufferedWriter bw = new BufferedWriter(new FileWriter(fc.getSelectedFile())); bw.write(textArea.getText()); bw.close(); statuslabel.setText("Save complete"); //This timer class does not work does not work. timer.schedule( new TimerTask() { public void run() { statuslabel.setText("status"); } } ,30); } catch( FileNotFoundException ex ) { } catch(IOException e) { } } } private void tryExit() { System.exit(0); } //ViewMenu ActionPerform private void TextBackGround() { /* JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(Jeditor.this); if(returnVal==fc.APPROVE_OPTION) { File image = fc.getSelectedFile(); try{ } catch(IOException e) { } } */ } /* private void TabComponents() { jtp.removeAll(); for(int i=0;i<TABNUMBER;i++) { String tabTitle = FileName; jtp.add(tabTitle, new JLabel(tabTitle)); jtp.setTabComponentAt(i, new ButtonTabComponent(jtp)); } tabComponentsItem.setSelected(true); jtp.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT); scrollLayoutItem.setSelected(false); setSize(new Dimension(400,200)); setLocationRelativeTo(null); setVisible(true); } */ private void TextArea() { add(textArea); JScrollPane sp = new JScrollPane(textArea); sp.setVerticalScrollBarPolicy(sp.VERTICAL_SCROLLBAR_AS_NEEDED); sp.setHorizontalScrollBarPolicy(sp.HORIZONTAL_SCROLLBAR_AS_NEEDED); getContentPane().add(sp, BorderLayout.CENTER); } private void StatusBar() { JPanel StatusBar = new JPanel(); StatusBar.setBorder(new BevelBorder(BevelBorder.LOWERED)); add(StatusBar, BorderLayout.SOUTH); //StatusBar StatusBar.setPreferredSize(new Dimension(getWidth(),16)); StatusBar.setLayout(new BoxLayout(StatusBar, BoxLayout.X_AXIS)); statuslabel = new JLabel("status"); statuslabel.setHorizontalAlignment(SwingConstants.LEFT); StatusBar.add(statuslabel); //LineNumber setVisible(true); } }
6,876
0.532868
0.530105
302
21.758278
18.040182
89
false
false
0
0
0
0
0
0
0.582781
false
false
2
78a7fd67987f8a236cf5e46fa9905451c35d1763
29,944,512,036,799
b72d4d721283ddb04b5c695d8eae41d5f2afc6f5
/metaj/src/test/java/info/chaintech/block/metaj/utils/HashUtilTest.java
b77f0dffc950a24f1d95b164b9f508f71c75fe16
[ "MIT" ]
permissive
shniu/metachain
https://github.com/shniu/metachain
75539e2db666b52f0d969547fc085d03523108b6
e78a9aaae392c22289ff1e62765571df24afb2b3
refs/heads/master
2020-03-22T21:08:24.446000
2018-09-19T11:30:13
2018-09-19T11:30:13
140,660,311
0
0
MIT
false
2018-08-31T11:05:15
2018-07-12T04:19:14
2018-08-31T07:05:31
2018-08-31T11:05:15
169
0
0
1
C
false
null
package info.chaintech.block.metaj.utils; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.Assert.*; public class HashUtilTest { private final static Logger log = LoggerFactory.getLogger(HashUtilTest.class); @Test public void sha256() { String sha = HashUtil.sha256("111111111111"); log.info(sha); assert null != sha; assertEquals(64, sha.length()); } @Test public void ripeMD160() { String ripe = HashUtil.ripeMD160("22222"); log.info(ripe); assert null != ripe; } @Test public void doubleHash() { String hash1 = HashUtil.sha256("hello"); log.info(hash1); assert null != hash1; String hash2 = HashUtil.ripeMD160(hash1); log.info(hash2); } }
UTF-8
Java
840
java
HashUtilTest.java
Java
[]
null
[]
package info.chaintech.block.metaj.utils; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.Assert.*; public class HashUtilTest { private final static Logger log = LoggerFactory.getLogger(HashUtilTest.class); @Test public void sha256() { String sha = HashUtil.sha256("111111111111"); log.info(sha); assert null != sha; assertEquals(64, sha.length()); } @Test public void ripeMD160() { String ripe = HashUtil.ripeMD160("22222"); log.info(ripe); assert null != ripe; } @Test public void doubleHash() { String hash1 = HashUtil.sha256("hello"); log.info(hash1); assert null != hash1; String hash2 = HashUtil.ripeMD160(hash1); log.info(hash2); } }
840
0.621429
0.567857
37
21.729731
19.146164
82
false
false
0
0
0
0
0
0
0.513514
false
false
2
be8486048c2c929b044371f3848db7ef21c41fee
438,086,705,689
5d47f40c17a926f8f72c59429dbb5764d2be18de
/MyApp/app/src/main/java/com/dawn/mvp/IPresenter.java
539ca9ce48e29f719873183edf8e45ca2cf3f598
[]
no_license
wangxiongtao/Dawn
https://github.com/wangxiongtao/Dawn
c36442c524bd5b7b1c382d692d2761de1893b7e8
5cd214a90c5c184f26f0cc5bd29628d2d50f30fc
refs/heads/master
2021-01-02T08:49:52.676000
2018-09-16T09:30:25
2018-09-16T09:30:25
99,075,372
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.dawn.mvp; /** * Created by Administrator on 2018/1/19 0019. */ public interface IPresenter { IView getView(); void onDestory(); }
UTF-8
Java
156
java
IPresenter.java
Java
[ { "context": "package com.dawn.mvp;\n\n/**\n * Created by Administrator on 2018/1/19 0019.\n */\n\npublic interface IPresent", "end": 54, "score": 0.6143168210983276, "start": 41, "tag": "NAME", "value": "Administrator" } ]
null
[]
package com.dawn.mvp; /** * Created by Administrator on 2018/1/19 0019. */ public interface IPresenter { IView getView(); void onDestory(); }
156
0.653846
0.583333
12
12
14.520101
46
false
false
0
0
0
0
0
0
0.25
false
false
2
f5e707ae105b1fd1d49b2281ff5e0ead9a401880
13,056,700,622,359
4086ae91d7efad7d375d2300e43bf01dcf7caa3b
/src/main/java/com/ibm/airlock/common/AirlockClient.java
c10b9453dd214bdb468b221d67f00c490368da89
[ "MIT" ]
permissive
Perf-Org-5KRepos/airlock-sdk-common
https://github.com/Perf-Org-5KRepos/airlock-sdk-common
0db0f8f3a641448ebe4c0c3f90af9821baa5f7d4
070e4516f200611e573f1033a13d2246aef69c2c
refs/heads/master
2022-02-14T21:44:31.229000
2019-08-12T12:28:46
2019-08-12T12:28:46
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ibm.airlock.common; import com.ibm.airlock.common.model.Feature; import org.json.JSONException; import org.json.JSONObject; import javax.annotation.Nullable; import java.util.Collection; import java.util.List; /** * Defines the external airlock client API * which allows to get airlock basic services */ public interface AirlockClient { AirlockProductManager getAirlockProductManager(); /** * Returns a cloned list of the ROOT children features. * This method is safe to traverse through its returned List, since it clones all the child features. * * @return A cloned list of the ROOT children. */ List<Feature> getRootFeatures(); /** * Returns the feature object by its name. * If the feature doesn't exist in the feature set, getFeature returns a new Feature object * with the given name, isOn=false, and source=missing. * * @param featureName Feature name in the format namespace.name. * @return Returns the feature object. */ Feature getFeature(String featureName); /** * Calculates the status of the features according to the pullFeatures results and return the Features as a tree. * * @param context the airlock context provided by caller * @param purchasedProductIds the list of purchased product an user bought so far. * @throws JSONException if the pullFeature results, the userProfile or the deviceProfile is not in the correct JSON format. */ void calculateFeatures(@Nullable JSONObject context, Collection<String> purchasedProductIds); /** * Calculates the status of the features according to the pullFeatures results. * No feature status changes are exposed until the syncFeatures method is called. * * @param userProfile the user profile * @param airlockContext the airlock runtime context * @throws JSONException if the pullFeature results, the userProfile or the deviceProfile is not in the correct JSON format. */ void calculateFeatures(@Nullable JSONObject userProfile, @Nullable JSONObject airlockContext); /** * Asynchronously downloads the current list of features from the server. * * @param callback Callback to be called when the function returns. */ void pullFeatures(final AirlockCallback callback); /** * Synchronizes the latest refreshFeatures results with the current feature set. * Updates LastSyncTime. * */ void syncFeatures(); }
UTF-8
Java
2,548
java
AirlockClient.java
Java
[]
null
[]
package com.ibm.airlock.common; import com.ibm.airlock.common.model.Feature; import org.json.JSONException; import org.json.JSONObject; import javax.annotation.Nullable; import java.util.Collection; import java.util.List; /** * Defines the external airlock client API * which allows to get airlock basic services */ public interface AirlockClient { AirlockProductManager getAirlockProductManager(); /** * Returns a cloned list of the ROOT children features. * This method is safe to traverse through its returned List, since it clones all the child features. * * @return A cloned list of the ROOT children. */ List<Feature> getRootFeatures(); /** * Returns the feature object by its name. * If the feature doesn't exist in the feature set, getFeature returns a new Feature object * with the given name, isOn=false, and source=missing. * * @param featureName Feature name in the format namespace.name. * @return Returns the feature object. */ Feature getFeature(String featureName); /** * Calculates the status of the features according to the pullFeatures results and return the Features as a tree. * * @param context the airlock context provided by caller * @param purchasedProductIds the list of purchased product an user bought so far. * @throws JSONException if the pullFeature results, the userProfile or the deviceProfile is not in the correct JSON format. */ void calculateFeatures(@Nullable JSONObject context, Collection<String> purchasedProductIds); /** * Calculates the status of the features according to the pullFeatures results. * No feature status changes are exposed until the syncFeatures method is called. * * @param userProfile the user profile * @param airlockContext the airlock runtime context * @throws JSONException if the pullFeature results, the userProfile or the deviceProfile is not in the correct JSON format. */ void calculateFeatures(@Nullable JSONObject userProfile, @Nullable JSONObject airlockContext); /** * Asynchronously downloads the current list of features from the server. * * @param callback Callback to be called when the function returns. */ void pullFeatures(final AirlockCallback callback); /** * Synchronizes the latest refreshFeatures results with the current feature set. * Updates LastSyncTime. * */ void syncFeatures(); }
2,548
0.706044
0.706044
73
33.90411
36.58923
145
false
false
0
0
0
0
0
0
0.30137
false
false
2
d446f9cff86f0dab42981a3326b40d05611bca09
19,713,899,944,306
af9716b2dffb0e12e96d47a0e93c246c8d31ed29
/app/src/main/java/com/example/android/the_guardian_news/QueryUtils.java
85640cf4e74b715821aec87dfdccd8ada38c6fd4
[]
no_license
maniuni/the-guardian-news
https://github.com/maniuni/the-guardian-news
e5b2b1aa7b31f84650d143c40f3fac2418dc8475
e44804498c564e0d2f0d4cb1a075a924ab379f3e
refs/heads/master
2021-01-22T21:45:24.645000
2017-04-04T09:49:36
2017-04-04T09:49:36
85,470,398
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.android.the_guardian_news; import android.text.TextUtils; import android.util.Log; import android.widget.ListView; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /** * Helper methods to use for obtaining news articles from The Guardian website. */ public abstract class QueryUtils { /** Tag for the log messages */ private static final String LOG_TAG = QueryUtils.class.getSimpleName(); // The constructor is required but it will never be used // to make an instance of QueryUtils so it is private. private QueryUtils(){ } public static List<NewsItem> fetchNewsData(String requestUrl){ // Create an URL object. URL url = createUrl(requestUrl); // Perform HTTP request on the url and receive a JSON response back; String jsonResponse = null; try{ jsonResponse = makeHTTPRequest(url); } catch (IOException e){ Log.e(LOG_TAG, "Error closing input stream", e); } /** Extract relevant fields from the JSON response and * create an ArrayList<Earthquake> with the list of {@link NewsItem} objects */ List<NewsItem> newsItems = extractNewsItemsFromJson(jsonResponse); return newsItems; } /** Create an {@link URL} object from a String url */ private static URL createUrl(String urlString){ URL url = null; try{ url = new URL(urlString); } catch (MalformedURLException e){ Log.e(LOG_TAG, "Problem with creating the URL", e); } return url; } /** Make a HTTP connection using the URL object and return a String as a response. */ private static String makeHTTPRequest(URL url) throws IOException{ String jsonResponse = ""; if(url == null){ return jsonResponse; } HttpURLConnection connection = null; InputStream inputStream = null; try{ connection = (HttpURLConnection) url.openConnection(); connection.setReadTimeout(10000 /** milliseconds */); connection.setConnectTimeout(15000 /** milliseconds */); connection.setRequestMethod("GET"); connection.connect(); // If the request was successful (response code 200), // then read the input stream and parse the response. if(connection.getResponseCode() == 200){ inputStream = connection.getInputStream(); jsonResponse = readFromStream(inputStream); } } catch (IOException e){ Log.e(LOG_TAG, "Problem with parsing the JSON response", e); } finally { if(connection != null) { connection.disconnect(); } if(inputStream != null){ inputStream.close(); } } return jsonResponse; } /** Convert the {@link InputStream} object into a String with the JSON response */ private static String readFromStream(InputStream stream) throws IOException{ StringBuilder output = new StringBuilder(); if(stream != null){ InputStreamReader reader = new InputStreamReader(stream, Charset.forName("UTF-8")); BufferedReader bufferedReader = new BufferedReader(reader); String line = bufferedReader.readLine(); while(line != null){ output.append(line); line = bufferedReader.readLine(); } } return output.toString(); } /** * Return a list of {@link NewsItem} objects that has been built up from * parsing a JSON response. */ private static ArrayList<NewsItem> extractNewsItemsFromJson(String jsonString){ // Check if the json is null or empty in which case return early if(TextUtils.isEmpty(jsonString)){ return null; } // Make a new ArrayList that to populate with news items ArrayList<NewsItem> newsItems = new ArrayList<>(); // If there is a problem with the way the JSON is formatted, a JSONException exception object will be thrown. // Catch the exception so the app doesn't crash, and print the error message to the logs.l try{ // Convert jsonString String into a JSONObject JSONObject reader = new JSONObject(jsonString); // First extract the object "response" JSONObject response = reader.getJSONObject("response"); // Then extract the results array from it JSONArray results = response.getJSONArray("results"); // Loop through each result in the array for(int i = 0; i < results.length(); i++){ // Get the result at position i JSONObject result = results.getJSONObject(i); // Get the title of the result String title = result.getString("webTitle"); // Get the time of publication String date = result.getString("webPublicationDate"); // Get the url of the news item String url = result.getString("webUrl"); // Get the section name for the news item String sectionName = result.getString("sectionName"); // Add to the ArrayList of news items newsItems.add(new NewsItem(title, date, url, sectionName)); } } catch (JSONException e){ // If an error is thrown when executing any of the above statements in the "try" block, // catch the exception here, so the app doesn't crash. Print a log message // with the message from the exception. Log.e("QueryUtils", "Problem parsing the earthquake JSON results", e); } return newsItems; } }
UTF-8
Java
6,244
java
QueryUtils.java
Java
[]
null
[]
package com.example.android.the_guardian_news; import android.text.TextUtils; import android.util.Log; import android.widget.ListView; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /** * Helper methods to use for obtaining news articles from The Guardian website. */ public abstract class QueryUtils { /** Tag for the log messages */ private static final String LOG_TAG = QueryUtils.class.getSimpleName(); // The constructor is required but it will never be used // to make an instance of QueryUtils so it is private. private QueryUtils(){ } public static List<NewsItem> fetchNewsData(String requestUrl){ // Create an URL object. URL url = createUrl(requestUrl); // Perform HTTP request on the url and receive a JSON response back; String jsonResponse = null; try{ jsonResponse = makeHTTPRequest(url); } catch (IOException e){ Log.e(LOG_TAG, "Error closing input stream", e); } /** Extract relevant fields from the JSON response and * create an ArrayList<Earthquake> with the list of {@link NewsItem} objects */ List<NewsItem> newsItems = extractNewsItemsFromJson(jsonResponse); return newsItems; } /** Create an {@link URL} object from a String url */ private static URL createUrl(String urlString){ URL url = null; try{ url = new URL(urlString); } catch (MalformedURLException e){ Log.e(LOG_TAG, "Problem with creating the URL", e); } return url; } /** Make a HTTP connection using the URL object and return a String as a response. */ private static String makeHTTPRequest(URL url) throws IOException{ String jsonResponse = ""; if(url == null){ return jsonResponse; } HttpURLConnection connection = null; InputStream inputStream = null; try{ connection = (HttpURLConnection) url.openConnection(); connection.setReadTimeout(10000 /** milliseconds */); connection.setConnectTimeout(15000 /** milliseconds */); connection.setRequestMethod("GET"); connection.connect(); // If the request was successful (response code 200), // then read the input stream and parse the response. if(connection.getResponseCode() == 200){ inputStream = connection.getInputStream(); jsonResponse = readFromStream(inputStream); } } catch (IOException e){ Log.e(LOG_TAG, "Problem with parsing the JSON response", e); } finally { if(connection != null) { connection.disconnect(); } if(inputStream != null){ inputStream.close(); } } return jsonResponse; } /** Convert the {@link InputStream} object into a String with the JSON response */ private static String readFromStream(InputStream stream) throws IOException{ StringBuilder output = new StringBuilder(); if(stream != null){ InputStreamReader reader = new InputStreamReader(stream, Charset.forName("UTF-8")); BufferedReader bufferedReader = new BufferedReader(reader); String line = bufferedReader.readLine(); while(line != null){ output.append(line); line = bufferedReader.readLine(); } } return output.toString(); } /** * Return a list of {@link NewsItem} objects that has been built up from * parsing a JSON response. */ private static ArrayList<NewsItem> extractNewsItemsFromJson(String jsonString){ // Check if the json is null or empty in which case return early if(TextUtils.isEmpty(jsonString)){ return null; } // Make a new ArrayList that to populate with news items ArrayList<NewsItem> newsItems = new ArrayList<>(); // If there is a problem with the way the JSON is formatted, a JSONException exception object will be thrown. // Catch the exception so the app doesn't crash, and print the error message to the logs.l try{ // Convert jsonString String into a JSONObject JSONObject reader = new JSONObject(jsonString); // First extract the object "response" JSONObject response = reader.getJSONObject("response"); // Then extract the results array from it JSONArray results = response.getJSONArray("results"); // Loop through each result in the array for(int i = 0; i < results.length(); i++){ // Get the result at position i JSONObject result = results.getJSONObject(i); // Get the title of the result String title = result.getString("webTitle"); // Get the time of publication String date = result.getString("webPublicationDate"); // Get the url of the news item String url = result.getString("webUrl"); // Get the section name for the news item String sectionName = result.getString("sectionName"); // Add to the ArrayList of news items newsItems.add(new NewsItem(title, date, url, sectionName)); } } catch (JSONException e){ // If an error is thrown when executing any of the above statements in the "try" block, // catch the exception here, so the app doesn't crash. Print a log message // with the message from the exception. Log.e("QueryUtils", "Problem parsing the earthquake JSON results", e); } return newsItems; } }
6,244
0.611947
0.609065
177
34.276836
27.795809
117
false
false
0
0
0
0
0
0
0.468927
false
false
2
8caf8ba04be2d4da0d1d508efe5d82dea9133bf8
28,767,690,984,333
3776272e723faa5d7e8cd92a577f0bd78ced96ab
/FilRouge2/src/main/java/com/maven/FilRouge/metier/CompteCourant.java
9f343f40176bbc24b0c82740c206661b61a55912
[]
no_license
gwenperrot/FilRouge2
https://github.com/gwenperrot/FilRouge2
98dc7f95943cf68a1b3adff579503d711033387d
354044cd14eb7ea99dfafa7f48ece28523aedce3
refs/heads/master
2021-06-27T18:00:00.377000
2017-09-16T20:18:02
2017-09-16T20:18:02
103,375,675
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.maven.FilRouge.metier; /** * Classe de gestion des comptes courants * @author Alexandre * */ public class CompteCourant extends Compte { private int decouvert = 1_000; public int getDecouvert() { return decouvert; } public void setDecouvert(int decouvert) { this.decouvert = decouvert; } }
UTF-8
Java
337
java
CompteCourant.java
Java
[ { "context": "Classe de gestion des comptes courants\r\n * @author Alexandre\r\n *\r\n */\r\npublic class CompteCourant extends Comp", "end": 104, "score": 0.9995988607406616, "start": 95, "tag": "NAME", "value": "Alexandre" } ]
null
[]
package com.maven.FilRouge.metier; /** * Classe de gestion des comptes courants * @author Alexandre * */ public class CompteCourant extends Compte { private int decouvert = 1_000; public int getDecouvert() { return decouvert; } public void setDecouvert(int decouvert) { this.decouvert = decouvert; } }
337
0.679525
0.667656
18
16.722221
16.322464
43
false
false
0
0
0
0
0
0
0.777778
false
false
2
a76d122d606951087c0e51abae22dc0a5890276f
1,803,886,323,787
239ce4b0c494d492cd5af05a4c9d68bcec67bb46
/MedievalChess/src/medievelchess/game/Position3D.java
4bbc2d6ef00079ac0b88d621f4a34c91807c832f
[]
no_license
ITNano/MedievalChess
https://github.com/ITNano/MedievalChess
c58d41b5ed856bf979e842c2e7f12ee2f6b07992
c823cf5db4a487b6e639b2f5f9b29ac74ee9840d
refs/heads/master
2015-08-09T19:20:31.662000
2013-12-22T13:43:23
2013-12-22T13:43:23
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package medievelchess.game; /** * Interface for setting up the specification for 3D-Positions on the form (x, y, z). * * @author Nano * @version 1.0.0 */ public interface Position3D extends Position2D{ /** * Get the z-coordinate * @return The z-coordinate */ public int getZ(); }
UTF-8
Java
315
java
Position3D.java
Java
[ { "context": "-Positions on the form (x, y, z).\r\n * \r\n * @author Nano\r\n * @version 1.0.0\r\n */\r\n\r\npublic interface Posit", "end": 143, "score": 0.9921092391014099, "start": 139, "tag": "NAME", "value": "Nano" } ]
null
[]
package medievelchess.game; /** * Interface for setting up the specification for 3D-Positions on the form (x, y, z). * * @author Nano * @version 1.0.0 */ public interface Position3D extends Position2D{ /** * Get the z-coordinate * @return The z-coordinate */ public int getZ(); }
315
0.631746
0.612698
17
16.529411
21.439703
85
false
false
0
0
0
0
0
0
0.588235
false
false
2
982c53c9b5a43cdcef1afb5b382716f7b6a5a913
9,070,970,951,522
99441fc871a948c90b02b961415820de7e808494
/app/src/main/java/esel/esel/esel/MainActivity.java
fade69d8a39d974a66836ef88194d05a5148a723
[]
no_license
AdrianLxM/Esel
https://github.com/AdrianLxM/Esel
bef3eddec158b6435d36f06ca4b6aed09bb2d7f2
6cbb6db782c3a3a9bbbcb08ac75112f03ee5a855
refs/heads/master
2022-06-25T08:44:26.467000
2019-10-22T15:17:37
2019-10-22T15:17:37
99,326,023
5
8
null
false
2022-05-29T14:55:36
2017-08-04T09:15:06
2020-01-06T12:38:34
2019-10-22T15:17:37
29,433
5
35
6
Java
false
false
package esel.esel.esel; import android.content.ActivityNotFoundException; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.PowerManager; import android.os.SystemClock; import android.provider.Settings; import android.support.v7.app.AlertDialog; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.io.IOException; import java.util.List; import esel.esel.esel.datareader.Datareader; import esel.esel.esel.datareader.SGV; import esel.esel.esel.preferences.Preferences; import esel.esel.esel.preferences.PrefsFragment; import esel.esel.esel.receivers.ReadReceiver; import esel.esel.esel.util.LocalBroadcaster; import esel.esel.esel.util.SP; import esel.esel.esel.util.ToastUtils; public class MainActivity extends MenuActivity { private Button buttonReadValue; private Button buttonSync; private TextView textViewValue; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setupView(R.layout.activity_main); askForBatteryOptimizationPermission(); buttonReadValue = (Button) findViewById(R.id.button_readvalue); buttonSync = (Button) findViewById(R.id.button_manualsync); textViewValue = (TextView) findViewById(R.id.textview_main); /*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(); } });*/ buttonReadValue.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { long currentTime = System.currentTimeMillis(); long syncTime = 30 * 60 * 1000L; List<SGV> valueArray = Datareader.readDataFromContentProvider(getBaseContext(), 6, currentTime - syncTime); if (valueArray != null && valueArray.size() > 0) { textViewValue.setText(""); for (int i = 0; i < valueArray.size(); i++) { SGV sgv = valueArray.get(i); textViewValue.append(sgv.toString() + "\n"); //LocalBroadcaster.broadcast(sgv); } } else { ToastUtils.makeToast("DB not readable!"); } }catch (android.database.CursorIndexOutOfBoundsException eb) { eb.printStackTrace(); ToastUtils.makeToast("DB is empty!\nIt can take up to 15min with running Eversense App until values are available!"); } catch (Exception e) { e.printStackTrace(); } } }); buttonSync.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { int sync = 8; try { sync = SP.getInt("max-sync-hours", sync); } catch (Exception e) { e.printStackTrace(); } ReadReceiver receiver = new ReadReceiver(); int written = receiver.FullSync(getBaseContext(), sync); textViewValue.setText("Read " + written + " values from DB\n(last " + sync + " hours)"); } }); } private void askForBatteryOptimizationPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { final String packageName = getPackageName(); final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); if (!pm.isIgnoringBatteryOptimizations(packageName)) { final Runnable askOptimizationRunnable = new Runnable() { @Override public void run() { try { final Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + packageName)); startActivity(intent); } catch (ActivityNotFoundException e) { final String msg = "Device does not appear to support battery optimization whitelisting!"; runOnUiThread(new Runnable() { @Override public void run() { ToastUtils.makeToast("Device does not appear to support battery optimization whitelisting!"); } }); } } }; try { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Please Allow Permission") .setMessage("ESEL needs battery optimalization whitelisting for proper performance") .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { SystemClock.sleep(100); MainActivity.this.runOnUiThread(askOptimizationRunnable); dialog.dismiss(); } }).show(); } catch (Exception e) { ToastUtils.makeToast("Please whitelist ESEL in the phone settings."); } } } } }
UTF-8
Java
6,562
java
MainActivity.java
Java
[]
null
[]
package esel.esel.esel; import android.content.ActivityNotFoundException; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.PowerManager; import android.os.SystemClock; import android.provider.Settings; import android.support.v7.app.AlertDialog; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.io.IOException; import java.util.List; import esel.esel.esel.datareader.Datareader; import esel.esel.esel.datareader.SGV; import esel.esel.esel.preferences.Preferences; import esel.esel.esel.preferences.PrefsFragment; import esel.esel.esel.receivers.ReadReceiver; import esel.esel.esel.util.LocalBroadcaster; import esel.esel.esel.util.SP; import esel.esel.esel.util.ToastUtils; public class MainActivity extends MenuActivity { private Button buttonReadValue; private Button buttonSync; private TextView textViewValue; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setupView(R.layout.activity_main); askForBatteryOptimizationPermission(); buttonReadValue = (Button) findViewById(R.id.button_readvalue); buttonSync = (Button) findViewById(R.id.button_manualsync); textViewValue = (TextView) findViewById(R.id.textview_main); /*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(); } });*/ buttonReadValue.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { long currentTime = System.currentTimeMillis(); long syncTime = 30 * 60 * 1000L; List<SGV> valueArray = Datareader.readDataFromContentProvider(getBaseContext(), 6, currentTime - syncTime); if (valueArray != null && valueArray.size() > 0) { textViewValue.setText(""); for (int i = 0; i < valueArray.size(); i++) { SGV sgv = valueArray.get(i); textViewValue.append(sgv.toString() + "\n"); //LocalBroadcaster.broadcast(sgv); } } else { ToastUtils.makeToast("DB not readable!"); } }catch (android.database.CursorIndexOutOfBoundsException eb) { eb.printStackTrace(); ToastUtils.makeToast("DB is empty!\nIt can take up to 15min with running Eversense App until values are available!"); } catch (Exception e) { e.printStackTrace(); } } }); buttonSync.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { int sync = 8; try { sync = SP.getInt("max-sync-hours", sync); } catch (Exception e) { e.printStackTrace(); } ReadReceiver receiver = new ReadReceiver(); int written = receiver.FullSync(getBaseContext(), sync); textViewValue.setText("Read " + written + " values from DB\n(last " + sync + " hours)"); } }); } private void askForBatteryOptimizationPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { final String packageName = getPackageName(); final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); if (!pm.isIgnoringBatteryOptimizations(packageName)) { final Runnable askOptimizationRunnable = new Runnable() { @Override public void run() { try { final Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + packageName)); startActivity(intent); } catch (ActivityNotFoundException e) { final String msg = "Device does not appear to support battery optimization whitelisting!"; runOnUiThread(new Runnable() { @Override public void run() { ToastUtils.makeToast("Device does not appear to support battery optimization whitelisting!"); } }); } } }; try { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Please Allow Permission") .setMessage("ESEL needs battery optimalization whitelisting for proper performance") .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { SystemClock.sleep(100); MainActivity.this.runOnUiThread(askOptimizationRunnable); dialog.dismiss(); } }).show(); } catch (Exception e) { ToastUtils.makeToast("Please whitelist ESEL in the phone settings."); } } } } }
6,562
0.570558
0.567053
159
40.270439
29.408569
137
false
false
0
0
0
0
0
0
0.591195
false
false
2
5f21f39bfbab81ead27711c59d4113945be2d27d
26,388,279,073,021
e4e000db442e88dbad133dad4603521fea5f509e
/src/problems/string/RepeatedSubstringPattern.java
ddb30e6cc76bd72337435941fa710e0407c6976d
[]
no_license
XurajB/data_structure_algorithms
https://github.com/XurajB/data_structure_algorithms
363669c2c4098a3e3bab5069a1d7ef11b8a899a2
3f7825d1bf68deaa13d08bd616ec4425a26e5ac9
refs/heads/master
2023-03-13T17:50:45.818000
2021-03-05T03:20:22
2021-03-05T03:20:22
223,202,201
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package problems.string; /** * Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. * You may assume the given string consists of lowercase English letters only and its length will not exceed 10000. */ public class RepeatedSubstringPattern { public static void main(String[] args) { System.out.println(repeatedSubstringPattern("abcabc")); } private static boolean repeatedSubstringPattern(String s) { int n = s.length(); // pattern must repeat at least twice // start with 1, n%0 is undefined for (int len = 1; len <= n/2; len++) { // the length has to be divisible by pattern lenght if (n%len == 0) { String pattern = s.substring(0, len); int i = len; // start of second pattern int j = i+len-1; // end of second pattern while (j < n) { String next = s.substring(i, j+1); if (!next.equals(pattern)) { break; } i = i+len; j = j+len; } if (i == n) { return true; } } } return false; } }
UTF-8
Java
1,344
java
RepeatedSubstringPattern.java
Java
[]
null
[]
package problems.string; /** * Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. * You may assume the given string consists of lowercase English letters only and its length will not exceed 10000. */ public class RepeatedSubstringPattern { public static void main(String[] args) { System.out.println(repeatedSubstringPattern("abcabc")); } private static boolean repeatedSubstringPattern(String s) { int n = s.length(); // pattern must repeat at least twice // start with 1, n%0 is undefined for (int len = 1; len <= n/2; len++) { // the length has to be divisible by pattern lenght if (n%len == 0) { String pattern = s.substring(0, len); int i = len; // start of second pattern int j = i+len-1; // end of second pattern while (j < n) { String next = s.substring(i, j+1); if (!next.equals(pattern)) { break; } i = i+len; j = j+len; } if (i == n) { return true; } } } return false; } }
1,344
0.512649
0.502976
38
34.36842
29.792635
143
false
false
0
0
0
0
0
0
0.447368
false
false
2
6decc6bb529275f1d863ba08374bd1f465ca3ee6
10,668,698,771,074
02f38dccf1144884dc1b1bc6f154b6f22875742c
/user.system/carrier-cord/src/main/java/xinrui/cloud/service/CarrierDataBaseFilesService.java
c748424a1322a04f062d63a401bb52ca4b0ed048
[]
no_license
liuzhuomin/SpringCloud-myself
https://github.com/liuzhuomin/SpringCloud-myself
4cf8a6b66debc4273cce89a6375a36459f0909e2
dda028ee3948bde64a4ce2bd0c98ea8cc0d03090
refs/heads/master
2022-07-01T15:45:38.627000
2019-10-17T01:38:35
2019-10-17T01:38:35
215,513,593
0
0
null
false
2022-06-17T02:40:04
2019-10-16T09:50:40
2019-10-17T01:38:55
2022-06-17T02:40:04
76,562
0
0
3
Java
false
false
package xinrui.cloud.service; import xinrui.cloud.domain.CarrierDataBaseFiles; /** * * @author Jihy * @since 2019-07-04 15:10 */ public interface CarrierDataBaseFilesService extends BaseService<CarrierDataBaseFiles> { /** * 通过载体文件资料库ID和具体文件ID找到文件数据 * @param carrierDataBaseId * @param fileId * @return */ CarrierDataBaseFiles getCarrierDataBaseFilesByDataId(Long carrierDataBaseId, Long fileId); }
UTF-8
Java
464
java
CarrierDataBaseFilesService.java
Java
[ { "context": "ud.domain.CarrierDataBaseFiles;\n\n/**\n *\n * @author Jihy\n * @since 2019-07-04 15:10\n */\npublic interface C", "end": 103, "score": 0.9993867874145508, "start": 99, "tag": "USERNAME", "value": "Jihy" } ]
null
[]
package xinrui.cloud.service; import xinrui.cloud.domain.CarrierDataBaseFiles; /** * * @author Jihy * @since 2019-07-04 15:10 */ public interface CarrierDataBaseFilesService extends BaseService<CarrierDataBaseFiles> { /** * 通过载体文件资料库ID和具体文件ID找到文件数据 * @param carrierDataBaseId * @param fileId * @return */ CarrierDataBaseFiles getCarrierDataBaseFilesByDataId(Long carrierDataBaseId, Long fileId); }
464
0.754717
0.726415
19
21.31579
26.993279
92
false
false
0
0
0
0
0
0
0.210526
false
false
2
9ee416c3c8800a4be7430871aced784938f5a1da
17,746,804,884,838
e4cfdf44a48aa265c9279cae01769b0543e5fbaf
/bakibaki/LeetCode1491/Solution.java
b50f5f1e57816ae213d27f47c33e5c504f91a87b
[]
no_license
uplus-algorithm/UplusWithLeetCode
https://github.com/uplus-algorithm/UplusWithLeetCode
ac893c96361e78aafbd205afb35b8c695eeb76fd
7d7375507c45dcd089d037cca2188785020399b6
refs/heads/main
2023-08-18T05:23:33.115000
2021-09-28T14:54:38
2021-09-28T14:54:38
352,880,841
1
1
null
false
2021-09-28T14:54:39
2021-03-30T05:28:55
2021-09-27T13:24:09
2021-09-28T14:54:38
97
0
1
0
Java
false
false
package LeetCode1491; class Solution { public double average(int[] salary) { double out = 0; int min = salary[0]; int max = salary[0]; for(int i =0; i < salary.length; i++){ out += salary[i]; if(salary[i] < min) min = salary[i]; if(salary[i] > max) max = salary[i]; } return (out-min-max)/(salary.length-2); } }
UTF-8
Java
405
java
Solution.java
Java
[]
null
[]
package LeetCode1491; class Solution { public double average(int[] salary) { double out = 0; int min = salary[0]; int max = salary[0]; for(int i =0; i < salary.length; i++){ out += salary[i]; if(salary[i] < min) min = salary[i]; if(salary[i] > max) max = salary[i]; } return (out-min-max)/(salary.length-2); } }
405
0.493827
0.471605
16
24.375
17.410036
48
false
false
0
0
0
0
0
0
0.625
false
false
2
3f83a278eab07393c7579f36e2b49dc3e0c5a466
7,112,465,861,814
12c664fbad5aecfbd83dc5c9dc0f87446e34d041
/Faculdade/Laboratório de Alogortimo e Estrutura de Dados II/Lista Final/Código/TpLaeds2/src/Permutacao.java
23b140116ee3e22eece1c58021cda513bd333e62
[]
no_license
CMinoves/Projetos-Finalizados
https://github.com/CMinoves/Projetos-Finalizados
2481d21638bd38a3cb1e337ceb128ba9b03a02df
a7f27ef216fb89f1897c679ee110f332bc467501
refs/heads/main
2023-08-19T07:59:27.078000
2021-09-22T21:25:54
2021-09-22T21:25:54
409,262,436
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.security.SecureRandom; import java.util.ArrayList; import java.util.HashSet; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templatesa * and open the template in the editor. */ /** * * @author disan */ //Esse classe servira para criar as permutacoes entre as cidades para que seja usada para encontrar a menor distancia entre elas //Foi baseado no site http://bearcave.com/random_hacks/permute.html no algoritmo da Universidade de Exeter public class Permutacao { public static ArrayList<ArrayList<Integer>> permutacoes; //gera o vetor que sera permutado sem o vertice inicial que sera adicionado posteriormente public static ArrayList<ArrayList<Integer>> permutacoesPossiveis(int verticeInicial, int numVertices) { permutacoes = new ArrayList<>(); ArrayList<ArrayList<Integer>> permutacoesPossiveis = new ArrayList<ArrayList<Integer>>(); ArrayList<Integer> v = new ArrayList<>(); SecureRandom random = new SecureRandom(); while(v.size()!= numVertices-1){ int n = random.nextInt(numVertices); if(n != verticeInicial&& !v.contains(n)) v.add(n); } int []v1 = new int[numVertices-1]; for(int i = 0; i < numVertices-1; i++){ v1[i] = v.get(i); } permuta(v1,0,numVertices-1); return permutacoes; } //Algoritmo da Universidade de Exeter private static void permuta(int [] v, int inicio,int n) { if(inicio == n-1){ if(v != null){ ArrayList<Integer> permutaAtual = new ArrayList<>(); for(int i = 0; i < n; i++){ permutaAtual.add(v[i]); } permutacoes.add(permutaAtual); } } else{ for(int i = inicio; i < n; i++){ int tmp = v[i]; v[i] = v[inicio]; v[inicio] = tmp; permuta(v,inicio+1,n); v[inicio] = v[i]; v[i] = tmp; } } } }
UTF-8
Java
2,213
java
Permutacao.java
Java
[ { "context": "the template in the editor.\n */\n\n/**\n *\n * @author disan\n */\n\n//Esse classe servira para criar as permutac", "end": 301, "score": 0.9016526341438293, "start": 296, "tag": "USERNAME", "value": "disan" } ]
null
[]
import java.security.SecureRandom; import java.util.ArrayList; import java.util.HashSet; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templatesa * and open the template in the editor. */ /** * * @author disan */ //Esse classe servira para criar as permutacoes entre as cidades para que seja usada para encontrar a menor distancia entre elas //Foi baseado no site http://bearcave.com/random_hacks/permute.html no algoritmo da Universidade de Exeter public class Permutacao { public static ArrayList<ArrayList<Integer>> permutacoes; //gera o vetor que sera permutado sem o vertice inicial que sera adicionado posteriormente public static ArrayList<ArrayList<Integer>> permutacoesPossiveis(int verticeInicial, int numVertices) { permutacoes = new ArrayList<>(); ArrayList<ArrayList<Integer>> permutacoesPossiveis = new ArrayList<ArrayList<Integer>>(); ArrayList<Integer> v = new ArrayList<>(); SecureRandom random = new SecureRandom(); while(v.size()!= numVertices-1){ int n = random.nextInt(numVertices); if(n != verticeInicial&& !v.contains(n)) v.add(n); } int []v1 = new int[numVertices-1]; for(int i = 0; i < numVertices-1; i++){ v1[i] = v.get(i); } permuta(v1,0,numVertices-1); return permutacoes; } //Algoritmo da Universidade de Exeter private static void permuta(int [] v, int inicio,int n) { if(inicio == n-1){ if(v != null){ ArrayList<Integer> permutaAtual = new ArrayList<>(); for(int i = 0; i < n; i++){ permutaAtual.add(v[i]); } permutacoes.add(permutaAtual); } } else{ for(int i = inicio; i < n; i++){ int tmp = v[i]; v[i] = v[inicio]; v[inicio] = tmp; permuta(v,inicio+1,n); v[inicio] = v[i]; v[i] = tmp; } } } }
2,213
0.559873
0.554451
68
31.529411
28.583969
128
false
false
0
0
0
0
0
0
0.573529
false
false
2
528bfa4136479438060001589a39e30ce4312672
18,751,827,236,157
3812fd66174486bf11f34b95f0a40029a20a296d
/module_navigation/src/main/java/com/zhq/module_navigation/NavigationModuleInit.java
b15df7bbd9839a9a1b0cad6e2c14bae55798f08a
[]
no_license
qiangshi/Assembly_MVVM_Wan
https://github.com/qiangshi/Assembly_MVVM_Wan
372b5131ffe79a227ba7d792fb56cdc5aa88fd26
934e42c63e50a7cf09b50125f47054211c1a1a25
refs/heads/master
2022-12-01T10:20:02.255000
2020-08-12T01:54:41
2020-08-12T01:54:41
286,889,501
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zhq.module_navigation; import android.app.Application; import com.zhq.library_base.base.IModuleInit; import com.zhq.library_base.base_library.utils.KLog; /** * @Description: java类作用描述 * @Author: 曾海强 * @CreateDate: 2019/3/22 15:08 */ public class NavigationModuleInit implements IModuleInit { @Override public boolean onInitAhead(Application application) { KLog.e("====zhq====>导航onInitAhead<"); return false; } @Override public boolean onInitLow(Application application) { KLog.e("====zhq====>导航onInitLow<"); return false; } }
UTF-8
Java
627
java
NavigationModuleInit.java
Java
[ { "context": "KLog;\n\n\n/**\n * @Description: java类作用描述\n * @Author: 曾海强\n * @CreateDate: 2019/3/22 15:08\n */\npublic class ", "end": 216, "score": 0.9996780157089233, "start": 213, "tag": "NAME", "value": "曾海强" } ]
null
[]
package com.zhq.module_navigation; import android.app.Application; import com.zhq.library_base.base.IModuleInit; import com.zhq.library_base.base_library.utils.KLog; /** * @Description: java类作用描述 * @Author: 曾海强 * @CreateDate: 2019/3/22 15:08 */ public class NavigationModuleInit implements IModuleInit { @Override public boolean onInitAhead(Application application) { KLog.e("====zhq====>导航onInitAhead<"); return false; } @Override public boolean onInitLow(Application application) { KLog.e("====zhq====>导航onInitLow<"); return false; } }
627
0.674959
0.656716
26
22.192308
20.290239
58
false
false
0
0
0
0
0
0
0.307692
false
false
2
69a8f68dbcd614e723235ff6f52cf20aca80fb6c
27,298,812,169,382
27f5457d47aaf3491f0d64032247adc08efba867
/vertx-gaia/vertx-ams/src/main/java/io/horizon/util/HSPI.java
d71ff6c36ab20cb40f56324cdeb7a89ff8df3c86
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
silentbalanceyh/vertx-zero
https://github.com/silentbalanceyh/vertx-zero
e73d22f4213263933683e4ebe87982ba68803878
1ede4c3596f491d5251eefaaaedc56947ef784cd
refs/heads/master
2023-06-11T23:10:29.241000
2023-06-08T16:15:33
2023-06-08T16:15:33
108,104,586
348
71
Apache-2.0
false
2020-04-10T02:15:18
2017-10-24T09:21:56
2020-04-09T16:43:37
2020-04-10T02:15:18
30,172
320
55
2
HTML
false
false
package io.horizon.util; import io.horizon.exception.internal.SPINullException; import java.util.*; /** * @author lang : 2023/4/27 */ final class HSPI { private HSPI() { } static <T> Collection<T> services(final Class<T> clazz) { return services(clazz, null); } static <T> Collection<T> services(final Class<T> clazz, final ClassLoader classLoader) { final List<T> list = new ArrayList<>(); ServiceLoader<T> factories; if (classLoader != null) { factories = ServiceLoader.load(clazz, classLoader); } else { // 等价代码:ServiceLoader.load(clazz, TCCL); factories = ServiceLoader.load(clazz); } if (factories.iterator().hasNext()) { factories.iterator().forEachRemaining(list::add); return list; } else { // 默认使用 TCCL,但在 OSGi 环境中可能不够,因此尝试使用加载此类的类加载器,所以为了兼容 osgi 环境,需要使用 // ServiceLoader.load(clazz, Spi.class.getClassLoader()) 加载 factories = ServiceLoader.load(clazz, HSPI.class.getClassLoader()); if (factories.iterator().hasNext()) { factories.iterator().forEachRemaining(list::add); return list; } else { return Collections.emptyList(); } } } static <T> T service(final Class<T> interfaceCls, final Class<?> caller, final boolean strict) { final ClassLoader loader = Optional.ofNullable(caller).map(Class::getClassLoader).orElse(null); return service(interfaceCls, loader, strict); } static <T> T service(final Class<T> interfaceCls, final ClassLoader loader, final boolean strict) { final Collection<T> collection = services(interfaceCls, loader); final T service; if (!collection.isEmpty()) { service = collection.iterator().next(); } else { service = null; } if (Objects.isNull(service) && strict) { throw new SPINullException(HSPI.class); } return service; } }
UTF-8
Java
2,181
java
HSPI.java
Java
[]
null
[]
package io.horizon.util; import io.horizon.exception.internal.SPINullException; import java.util.*; /** * @author lang : 2023/4/27 */ final class HSPI { private HSPI() { } static <T> Collection<T> services(final Class<T> clazz) { return services(clazz, null); } static <T> Collection<T> services(final Class<T> clazz, final ClassLoader classLoader) { final List<T> list = new ArrayList<>(); ServiceLoader<T> factories; if (classLoader != null) { factories = ServiceLoader.load(clazz, classLoader); } else { // 等价代码:ServiceLoader.load(clazz, TCCL); factories = ServiceLoader.load(clazz); } if (factories.iterator().hasNext()) { factories.iterator().forEachRemaining(list::add); return list; } else { // 默认使用 TCCL,但在 OSGi 环境中可能不够,因此尝试使用加载此类的类加载器,所以为了兼容 osgi 环境,需要使用 // ServiceLoader.load(clazz, Spi.class.getClassLoader()) 加载 factories = ServiceLoader.load(clazz, HSPI.class.getClassLoader()); if (factories.iterator().hasNext()) { factories.iterator().forEachRemaining(list::add); return list; } else { return Collections.emptyList(); } } } static <T> T service(final Class<T> interfaceCls, final Class<?> caller, final boolean strict) { final ClassLoader loader = Optional.ofNullable(caller).map(Class::getClassLoader).orElse(null); return service(interfaceCls, loader, strict); } static <T> T service(final Class<T> interfaceCls, final ClassLoader loader, final boolean strict) { final Collection<T> collection = services(interfaceCls, loader); final T service; if (!collection.isEmpty()) { service = collection.iterator().next(); } else { service = null; } if (Objects.isNull(service) && strict) { throw new SPINullException(HSPI.class); } return service; } }
2,181
0.594517
0.59115
61
33.081966
28.776867
103
false
false
0
0
0
0
0
0
0.590164
false
false
2
399ae9113f4016554d907c3a435ddfe4ba68f59a
7,533,372,689,249
5efca21772fa51c56b25049283bb66070a97e280
/src/main/java/com/sesnu/handler/RealTimeHandler.java
427ac08b33f30b3b954196770c6f4ddc3477a776
[]
no_license
misghna/fireball2
https://github.com/misghna/fireball2
910abbc9e64d59196daf0bf4e21190efab02aa91
530ade7936fd8270b4f28204c2a70bd20ee9855a
refs/heads/master
2021-04-25T09:54:02.338000
2017-12-01T03:44:58
2017-12-01T03:44:58
112,690,394
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sesnu.handler; import com.ib.controller.ApiController.IRealTimeBarHandler; import com.sesnu.service.OrderExit; import com.sesnu.service.Processor; import com.ib.client.Types.WhatToShow; import com.ib.controller.Bar; public class RealTimeHandler implements IRealTimeBarHandler { private WhatToShow wts; private Processor pr; private OrderExit exitOrder; public RealTimeHandler(WhatToShow wts,Processor pr,OrderExit exitOrder) { this.wts=wts; this.pr=pr; this.exitOrder=exitOrder; } @Override public void realtimeBar(Bar bar) { if(wts.equals(WhatToShow.ASK)){ // pr.setAsk(bar.close()); exitOrder.setAsk(bar.close()); }else if(wts.equals(WhatToShow.BID)){ // pr.setBid(bar.open()); exitOrder.setAsk(bar.open()); } } }
UTF-8
Java
773
java
RealTimeHandler.java
Java
[]
null
[]
package com.sesnu.handler; import com.ib.controller.ApiController.IRealTimeBarHandler; import com.sesnu.service.OrderExit; import com.sesnu.service.Processor; import com.ib.client.Types.WhatToShow; import com.ib.controller.Bar; public class RealTimeHandler implements IRealTimeBarHandler { private WhatToShow wts; private Processor pr; private OrderExit exitOrder; public RealTimeHandler(WhatToShow wts,Processor pr,OrderExit exitOrder) { this.wts=wts; this.pr=pr; this.exitOrder=exitOrder; } @Override public void realtimeBar(Bar bar) { if(wts.equals(WhatToShow.ASK)){ // pr.setAsk(bar.close()); exitOrder.setAsk(bar.close()); }else if(wts.equals(WhatToShow.BID)){ // pr.setBid(bar.open()); exitOrder.setAsk(bar.open()); } } }
773
0.743855
0.743855
37
19.891891
19.490517
74
false
false
0
0
0
0
0
0
1.459459
false
false
2
f09d39d70ccde1bce6dddd7a3c9cdc00317a3f1c
33,148,557,641,509
37a45efd4b3b449403f57fb348e454c5987e8563
/src/gui/TetrisGUI.java
a96a26a7a974c7f5b25b5326d0e7dc0ae4f4fb79
[]
no_license
icarus342/Tetris
https://github.com/icarus342/Tetris
44cbdcc3da8c39437f506915df727eca2a7c2928
78366d4fac5b134ce8970c6e725ed0cdb22f0ff3
refs/heads/master
2021-01-20T03:12:29.410000
2017-04-26T18:24:10
2017-04-26T18:24:10
89,509,568
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * TCSS 305 – Winter 2015 * Assignment 6 - Tetris */ package gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Observable; import java.util.Observer; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.Timer; import model.Board; import model.Board.GameStatus; import model.TetrisPiece; import sound.MusicList; import sound.MusicPlayer; import sound.SoundEffects; import sound.SoundPlayer; /** * The graphical representation of Tetris. * * @author Justin Arnett (jarnett@uw.edu) * @version 01 March 2015 */ @SuppressWarnings("serial") public class TetrisGUI extends JFrame implements Observer, PropertyChangeListener { /** Amount of time the timer is initially set to. */ private static final int MILLISECONDS = 1000; /** Minimum size of the window frame. */ private static final Dimension MIN_SIZE = new Dimension(526, 583); /** Used to calculate timer speed based on game level. */ private static final int INITIAL = 1250; /** Used to calculate timer speed based on game level. */ private static final int SCALE = 250; /** The maximum level before the speed of the game stops changing. */ private static final int SPEED_LEVEL_CAP = 22; /** File path of the basic icon. */ private static final String ICON = "/images/icon.jpg"; /** The level of default volume for the sfx player */ private static final float SFX_VOLUME = 0.5f; /** The Tetris game. */ private final Board myTetris; /** The panel that renders the Tetris game. */ private final GamePanel myGamePanel; /** The timer that runs the Tetris game. */ private final Timer myTimer; /** The next piece in the Tetris game. */ private TetrisPiece myNextPiece; /** Current level of the game. */ private int myLevel; /** The scoring panel. */ private final ScorePanel myScorePanel; /** The menu bar. */ private final MenuBar myMenuBar; /** The sound player. */ private SoundPlayer mySoundPlayer; /** The music player. */ private MusicPlayer myMusicPlayer; /** Game over status. */ private boolean myGameIsOver; /** Zelda theme status. */ private boolean myZeldaTheme; /** Next tetris piece panel. */ private NextPiecePanel myNextPiecePanel; /** The difficult level of the next game. */ private int myDifficulty; /** * The GUI of Tetris. */ public TetrisGUI() { super(); myTetris = new Board(); init(); myScorePanel = new ScorePanel(myTetris.getWidth(), mySoundPlayer); myTimer = createTimer(); myGamePanel = new GamePanel(myTetris, myTimer, mySoundPlayer); myMenuBar = new MenuBar(myGamePanel, mySoundPlayer, myMusicPlayer); } /** * Helper method for the constructor. */ private void init() { myDifficulty = 1; myGameIsOver = false; myZeldaTheme = false; myLevel = 1; mySoundPlayer = new SoundPlayer(); for (final SoundEffects sfx : SoundEffects.values()) { sfx.preLoad(mySoundPlayer); sfx.setVolume(SFX_VOLUME, mySoundPlayer); } myMusicPlayer = new MusicPlayer(); } /** * Creates a timer for Tetris. * * @return The timer for Tetris. */ private Timer createTimer() { final Timer time = new Timer(MILLISECONDS, new ActionListener() { @Override public void actionPerformed(final ActionEvent theEvent) { myTetris.step(); updateTimer(); playMusic(); } }); return time; } /** * Builds the main frame of the GUI. */ public void start() { myTimer.start(); myGamePanel.setLayout(new BoxLayout(myGamePanel, BoxLayout.PAGE_AXIS)); add(myGamePanel, BorderLayout.CENTER); final JPanel eastPanel = new JPanel(new BorderLayout()); myNextPiecePanel = new NextPiecePanel(myNextPiece); final JPanel piecePaddingPanel = new JPanel(); piecePaddingPanel.setBackground(Color.BLACK); piecePaddingPanel.add(myNextPiecePanel); eastPanel.add(piecePaddingPanel, BorderLayout.NORTH); eastPanel.add(myScorePanel, BorderLayout.CENTER); add(eastPanel, BorderLayout.EAST); setJMenuBar(myMenuBar); myMenuBar.addPropertyChangeListener(this); myTetris.addObserver(this); myTetris.addObserver(myScorePanel); myTetris.addObserver(myGamePanel); myTetris.addObserver(myNextPiecePanel); myTetris.clear(); // Starts a new game. this.setIconImage(new ImageIcon(getClass().getResource(ICON)).getImage()); this.setMinimumSize(MIN_SIZE); this.setTitle("TCSS 305 Tetris"); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setVisible(true); pack(); this.setLocationRelativeTo(null); } /** * Updates the delay interval of the game timer based on the current level. * Timer stops speeding up after level 22 to avoid less than 50ms speed. */ private void updateTimer() { if (myLevel != myScorePanel.getLevel() && myLevel <= SPEED_LEVEL_CAP) { myLevel = myScorePanel.getLevel(); // Math algorithm used to set the speed dependent on the level. myTimer.setDelay((int) (INITIAL - (SCALE * Math.sqrt(myLevel)))); } } /** * Plays the background music during gameplay. */ private void playMusic() { if (!myMusicPlayer.isStarted() && !myGameIsOver) { if (myZeldaTheme) { MusicList.OVERWORLD.play(myMusicPlayer); } else { MusicList.MAIN.play(myMusicPlayer); } } } /** * Ends the current game. */ private void endGame() { myMusicPlayer.stopPlay(); MusicList.GAME_OVER.play(myMusicPlayer); myGameIsOver = true; myGamePanel.gameOver(); myTimer.stop(); myMenuBar.gameOver(); } /** * Starts a new game. */ private void newGame() { myMusicPlayer.stopPlay(); playMusic(); myGameIsOver = false; myGamePanel.newGame(); myScorePanel.newGame(myDifficulty); updateTimer(); myTimer.start(); myNextPiecePanel.setNextPiece(myNextPiece); } /** * Pauses the current game. */ private void pauseGame() { myGamePanel.pause(); } /** * Updates the global theme settings of the game. * * @param theThemeStatus The status of the Zelda theme. */ private void updateTheme(final boolean theThemeStatus) { myGamePanel.updateTheme(theThemeStatus); myZeldaTheme = theThemeStatus; myMusicPlayer.stopPlay(); } /** * Updates the difficulty for the next game. * * @param theLevel The level of the game. */ private void updateDifficulty(final int theLevel) { myDifficulty = theLevel; } /** * The update method for the Observer interface. * * @param theObj The observable that called us. * @param theArg The argument it passed us. */ public void update(final Observable theObj, final Object theArg) { if (theArg instanceof TetrisPiece) { myNextPiece = (TetrisPiece) theArg; } if (theArg instanceof GameStatus && ((GameStatus) theArg).isGameOver()) { endGame(); } } @Override public void propertyChange(final PropertyChangeEvent theEvent) { switch(theEvent.getPropertyName()) { case "NewGameUpdate": newGame(); break; case "EndGameUpdate": endGame(); break; case "PauseGameUpdate": pauseGame(); break; case "ZeldaThemeUpdate": updateTheme((boolean) theEvent.getNewValue()); break; case "DifficultyUpdate": updateDifficulty((int) theEvent.getNewValue()); break; default: break; } } }
WINDOWS-1252
Java
8,903
java
TetrisGUI.java
Java
[ { "context": "graphical representation of Tetris.\n * \n * @author Justin Arnett (jarnett@uw.edu)\n * @version 01 March 2015\n */\n@S", "end": 764, "score": 0.9998894929885864, "start": 751, "tag": "NAME", "value": "Justin Arnett" }, { "context": "entation of Tetris.\n * \n * @author Justin Arnett (jarnett@uw.edu)\n * @version 01 March 2015\n */\n@SuppressWarnings(", "end": 780, "score": 0.9999286532402039, "start": 766, "tag": "EMAIL", "value": "jarnett@uw.edu" } ]
null
[]
/* * TCSS 305 – Winter 2015 * Assignment 6 - Tetris */ package gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Observable; import java.util.Observer; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.Timer; import model.Board; import model.Board.GameStatus; import model.TetrisPiece; import sound.MusicList; import sound.MusicPlayer; import sound.SoundEffects; import sound.SoundPlayer; /** * The graphical representation of Tetris. * * @author <NAME> (<EMAIL>) * @version 01 March 2015 */ @SuppressWarnings("serial") public class TetrisGUI extends JFrame implements Observer, PropertyChangeListener { /** Amount of time the timer is initially set to. */ private static final int MILLISECONDS = 1000; /** Minimum size of the window frame. */ private static final Dimension MIN_SIZE = new Dimension(526, 583); /** Used to calculate timer speed based on game level. */ private static final int INITIAL = 1250; /** Used to calculate timer speed based on game level. */ private static final int SCALE = 250; /** The maximum level before the speed of the game stops changing. */ private static final int SPEED_LEVEL_CAP = 22; /** File path of the basic icon. */ private static final String ICON = "/images/icon.jpg"; /** The level of default volume for the sfx player */ private static final float SFX_VOLUME = 0.5f; /** The Tetris game. */ private final Board myTetris; /** The panel that renders the Tetris game. */ private final GamePanel myGamePanel; /** The timer that runs the Tetris game. */ private final Timer myTimer; /** The next piece in the Tetris game. */ private TetrisPiece myNextPiece; /** Current level of the game. */ private int myLevel; /** The scoring panel. */ private final ScorePanel myScorePanel; /** The menu bar. */ private final MenuBar myMenuBar; /** The sound player. */ private SoundPlayer mySoundPlayer; /** The music player. */ private MusicPlayer myMusicPlayer; /** Game over status. */ private boolean myGameIsOver; /** Zelda theme status. */ private boolean myZeldaTheme; /** Next tetris piece panel. */ private NextPiecePanel myNextPiecePanel; /** The difficult level of the next game. */ private int myDifficulty; /** * The GUI of Tetris. */ public TetrisGUI() { super(); myTetris = new Board(); init(); myScorePanel = new ScorePanel(myTetris.getWidth(), mySoundPlayer); myTimer = createTimer(); myGamePanel = new GamePanel(myTetris, myTimer, mySoundPlayer); myMenuBar = new MenuBar(myGamePanel, mySoundPlayer, myMusicPlayer); } /** * Helper method for the constructor. */ private void init() { myDifficulty = 1; myGameIsOver = false; myZeldaTheme = false; myLevel = 1; mySoundPlayer = new SoundPlayer(); for (final SoundEffects sfx : SoundEffects.values()) { sfx.preLoad(mySoundPlayer); sfx.setVolume(SFX_VOLUME, mySoundPlayer); } myMusicPlayer = new MusicPlayer(); } /** * Creates a timer for Tetris. * * @return The timer for Tetris. */ private Timer createTimer() { final Timer time = new Timer(MILLISECONDS, new ActionListener() { @Override public void actionPerformed(final ActionEvent theEvent) { myTetris.step(); updateTimer(); playMusic(); } }); return time; } /** * Builds the main frame of the GUI. */ public void start() { myTimer.start(); myGamePanel.setLayout(new BoxLayout(myGamePanel, BoxLayout.PAGE_AXIS)); add(myGamePanel, BorderLayout.CENTER); final JPanel eastPanel = new JPanel(new BorderLayout()); myNextPiecePanel = new NextPiecePanel(myNextPiece); final JPanel piecePaddingPanel = new JPanel(); piecePaddingPanel.setBackground(Color.BLACK); piecePaddingPanel.add(myNextPiecePanel); eastPanel.add(piecePaddingPanel, BorderLayout.NORTH); eastPanel.add(myScorePanel, BorderLayout.CENTER); add(eastPanel, BorderLayout.EAST); setJMenuBar(myMenuBar); myMenuBar.addPropertyChangeListener(this); myTetris.addObserver(this); myTetris.addObserver(myScorePanel); myTetris.addObserver(myGamePanel); myTetris.addObserver(myNextPiecePanel); myTetris.clear(); // Starts a new game. this.setIconImage(new ImageIcon(getClass().getResource(ICON)).getImage()); this.setMinimumSize(MIN_SIZE); this.setTitle("TCSS 305 Tetris"); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setVisible(true); pack(); this.setLocationRelativeTo(null); } /** * Updates the delay interval of the game timer based on the current level. * Timer stops speeding up after level 22 to avoid less than 50ms speed. */ private void updateTimer() { if (myLevel != myScorePanel.getLevel() && myLevel <= SPEED_LEVEL_CAP) { myLevel = myScorePanel.getLevel(); // Math algorithm used to set the speed dependent on the level. myTimer.setDelay((int) (INITIAL - (SCALE * Math.sqrt(myLevel)))); } } /** * Plays the background music during gameplay. */ private void playMusic() { if (!myMusicPlayer.isStarted() && !myGameIsOver) { if (myZeldaTheme) { MusicList.OVERWORLD.play(myMusicPlayer); } else { MusicList.MAIN.play(myMusicPlayer); } } } /** * Ends the current game. */ private void endGame() { myMusicPlayer.stopPlay(); MusicList.GAME_OVER.play(myMusicPlayer); myGameIsOver = true; myGamePanel.gameOver(); myTimer.stop(); myMenuBar.gameOver(); } /** * Starts a new game. */ private void newGame() { myMusicPlayer.stopPlay(); playMusic(); myGameIsOver = false; myGamePanel.newGame(); myScorePanel.newGame(myDifficulty); updateTimer(); myTimer.start(); myNextPiecePanel.setNextPiece(myNextPiece); } /** * Pauses the current game. */ private void pauseGame() { myGamePanel.pause(); } /** * Updates the global theme settings of the game. * * @param theThemeStatus The status of the Zelda theme. */ private void updateTheme(final boolean theThemeStatus) { myGamePanel.updateTheme(theThemeStatus); myZeldaTheme = theThemeStatus; myMusicPlayer.stopPlay(); } /** * Updates the difficulty for the next game. * * @param theLevel The level of the game. */ private void updateDifficulty(final int theLevel) { myDifficulty = theLevel; } /** * The update method for the Observer interface. * * @param theObj The observable that called us. * @param theArg The argument it passed us. */ public void update(final Observable theObj, final Object theArg) { if (theArg instanceof TetrisPiece) { myNextPiece = (TetrisPiece) theArg; } if (theArg instanceof GameStatus && ((GameStatus) theArg).isGameOver()) { endGame(); } } @Override public void propertyChange(final PropertyChangeEvent theEvent) { switch(theEvent.getPropertyName()) { case "NewGameUpdate": newGame(); break; case "EndGameUpdate": endGame(); break; case "PauseGameUpdate": pauseGame(); break; case "ZeldaThemeUpdate": updateTheme((boolean) theEvent.getNewValue()); break; case "DifficultyUpdate": updateDifficulty((int) theEvent.getNewValue()); break; default: break; } } }
8,889
0.590158
0.585215
324
26.472221
20.910801
83
false
false
0
0
0
0
0
0
0.425926
false
false
2
46c3dcbc18a0f15f1c58f353a1d096cf5efa4392
22,462,678,963,744
fb955366a3ecd5e01465aa5d3a83f35d2020328d
/app/src/main/java/com/example/marcin/boatnavigation/SerialConnection/SerialConnection.java
fa1e6fa1a4f808202e1c176df37103cc4590dab6
[]
no_license
marWjciak/BoatNavigation
https://github.com/marWjciak/BoatNavigation
589b76b3577806f07adf207ede9111ca1505f94e
ec2023ccc3dfc905d94d62af04023fc56538dd9c
refs/heads/master
2020-03-15T05:11:06.888000
2019-07-02T17:20:25
2019-07-02T17:20:25
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.marcin.boatnavigation.SerialConnection; import android.hardware.usb.UsbDevice; import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbManager; import android.util.Log; import com.felhr.usbserial.UsbSerialDevice; import java.util.Map; /** * Created by Marcin on 11.10.2018. */ public class SerialConnection { private static final String TAG = "Serial Connection"; private UsbSerialDevice usbSerialDevice; private UsbDeviceConnection usbDeviceConnection; private UsbManager usbManager; public SerialConnection() { this.usbSerialDevice = null; this.usbDeviceConnection = null; this.usbManager = null; } public UsbSerialDevice getUsbSerialDevice() { return usbSerialDevice; } public UsbDeviceConnection getUsbDeviceConnection() { return usbDeviceConnection; } public UsbManager getUsbManager() { return usbManager; } public void setUsbManager(UsbManager usbManager) { this.usbManager = usbManager; } public void setArduinoConnection() { assert usbManager != null; Map<String, UsbDevice> connectedDevices = usbManager.getDeviceList(); for (UsbDevice device : connectedDevices.values()) { // if (device.getVendorId() == 0x6790 && device.getProductId() == 0x29987) { Log.i(TAG, "Device found: " + device.getDeviceName()); startSerialConnection(usbManager, device); break; // } } } private void startSerialConnection(UsbManager usbManager, UsbDevice device) { this.usbDeviceConnection = usbManager.openDevice(device); this.usbSerialDevice = UsbSerialDevice.createUsbSerialDevice(device, this.usbDeviceConnection); } public void setSerialConnectionParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) { if (usbSerialDevice != null && usbSerialDevice.isOpen()) { usbSerialDevice.setBaudRate(baudRate); usbSerialDevice.setDataBits(dataBits); usbSerialDevice.setStopBits(stopBits); usbSerialDevice.setParity(parity); usbSerialDevice.setFlowControl(flowControl); } } public static class UsbSerialDeviceBuilder { private UsbSerialDevice usbSerialDevice; private int baudRate; private int dataBits; private int stopBits; private int parity; private int flowControl; public UsbSerialDeviceBuilder(UsbSerialDevice usbSerialDevice) { this.usbSerialDevice = usbSerialDevice; } public UsbSerialDeviceBuilder baudRate(int baudRate) { this.baudRate = baudRate; this.usbSerialDevice.setBaudRate(this.baudRate); return this; } public UsbSerialDeviceBuilder dataBits(int dataBits) { this.dataBits = dataBits; this.usbSerialDevice.setDataBits(this.dataBits); return this; } public UsbSerialDeviceBuilder stopBits(int stopBits) { this.stopBits = stopBits; this.usbSerialDevice.setStopBits(this.stopBits); return this; } public UsbSerialDeviceBuilder parity(int parity) { this.parity = parity; this.usbSerialDevice.setParity(this.parity); return this; } public UsbSerialDeviceBuilder flowControl(int flowControl) { this.flowControl = flowControl; this.usbSerialDevice.setFlowControl(this.flowControl); return this; } public UsbSerialDeviceBuilder build() { return new UsbSerialDeviceBuilder(this.usbSerialDevice); } } }
UTF-8
Java
3,780
java
SerialConnection.java
Java
[ { "context": "lDevice;\n\nimport java.util.Map;\n\n/**\n * Created by Marcin on 11.10.2018.\n */\n\npublic class SerialConnection", "end": 307, "score": 0.9996633529663086, "start": 301, "tag": "NAME", "value": "Marcin" } ]
null
[]
package com.example.marcin.boatnavigation.SerialConnection; import android.hardware.usb.UsbDevice; import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbManager; import android.util.Log; import com.felhr.usbserial.UsbSerialDevice; import java.util.Map; /** * Created by Marcin on 11.10.2018. */ public class SerialConnection { private static final String TAG = "Serial Connection"; private UsbSerialDevice usbSerialDevice; private UsbDeviceConnection usbDeviceConnection; private UsbManager usbManager; public SerialConnection() { this.usbSerialDevice = null; this.usbDeviceConnection = null; this.usbManager = null; } public UsbSerialDevice getUsbSerialDevice() { return usbSerialDevice; } public UsbDeviceConnection getUsbDeviceConnection() { return usbDeviceConnection; } public UsbManager getUsbManager() { return usbManager; } public void setUsbManager(UsbManager usbManager) { this.usbManager = usbManager; } public void setArduinoConnection() { assert usbManager != null; Map<String, UsbDevice> connectedDevices = usbManager.getDeviceList(); for (UsbDevice device : connectedDevices.values()) { // if (device.getVendorId() == 0x6790 && device.getProductId() == 0x29987) { Log.i(TAG, "Device found: " + device.getDeviceName()); startSerialConnection(usbManager, device); break; // } } } private void startSerialConnection(UsbManager usbManager, UsbDevice device) { this.usbDeviceConnection = usbManager.openDevice(device); this.usbSerialDevice = UsbSerialDevice.createUsbSerialDevice(device, this.usbDeviceConnection); } public void setSerialConnectionParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) { if (usbSerialDevice != null && usbSerialDevice.isOpen()) { usbSerialDevice.setBaudRate(baudRate); usbSerialDevice.setDataBits(dataBits); usbSerialDevice.setStopBits(stopBits); usbSerialDevice.setParity(parity); usbSerialDevice.setFlowControl(flowControl); } } public static class UsbSerialDeviceBuilder { private UsbSerialDevice usbSerialDevice; private int baudRate; private int dataBits; private int stopBits; private int parity; private int flowControl; public UsbSerialDeviceBuilder(UsbSerialDevice usbSerialDevice) { this.usbSerialDevice = usbSerialDevice; } public UsbSerialDeviceBuilder baudRate(int baudRate) { this.baudRate = baudRate; this.usbSerialDevice.setBaudRate(this.baudRate); return this; } public UsbSerialDeviceBuilder dataBits(int dataBits) { this.dataBits = dataBits; this.usbSerialDevice.setDataBits(this.dataBits); return this; } public UsbSerialDeviceBuilder stopBits(int stopBits) { this.stopBits = stopBits; this.usbSerialDevice.setStopBits(this.stopBits); return this; } public UsbSerialDeviceBuilder parity(int parity) { this.parity = parity; this.usbSerialDevice.setParity(this.parity); return this; } public UsbSerialDeviceBuilder flowControl(int flowControl) { this.flowControl = flowControl; this.usbSerialDevice.setFlowControl(this.flowControl); return this; } public UsbSerialDeviceBuilder build() { return new UsbSerialDeviceBuilder(this.usbSerialDevice); } } }
3,780
0.662434
0.657407
118
31.033897
26.162119
118
false
false
0
0
0
0
0
0
0.525424
false
false
2
40a54e0cd1ae18df1dca4341224d96fa210944ad
21,689,584,860,955
8af70d16c81136b3c8bd68bef4ae62f6a39ff505
/src/main/java/com/service/api/model/Step.java
44ad8d53386f6a04272b2517b9e4d14c30a5ef5a
[]
no_license
kholkolg/api
https://github.com/kholkolg/api
9f81e13a697a51d5fdac2ca08938e439408ef667
c83fe0e8da4b7fcdb68cab688c482a7db695aad8
refs/heads/master
2023-05-13T21:07:48.551000
2020-05-06T23:12:13
2020-05-06T23:12:13
261,164,667
0
0
null
false
2021-06-04T02:37:32
2020-05-04T12:06:30
2020-05-06T23:12:31
2021-06-04T02:37:32
172
0
0
2
Java
false
false
/* * 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.service.api.model; import com.service.api.json.StepDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; /** * Step of the route with time, distance, and list of coordinate pairs. * * @author Olga Kholkovskaia */ @JsonDeserialize(using = StepDeserializer.class) public class Step { //duration in seconds private final double duration; //step length in meters private final double distance; private final double[][] waypoints; public Step(double duration, double distance, double[][] waypoints){ this.duration = duration; this.distance = distance; this.waypoints = waypoints; } public double[] getStartPoint(){ return waypoints[0]; } public double[] getEndPoint(){ return waypoints[waypoints.length - 1]; } public double getDuration() { return duration; } public double[][] getWaypoints(){ return waypoints; } public double getSpeedMs(){ return distance/duration; } }
UTF-8
Java
1,315
java
Step.java
Java
[ { "context": "ance, and list of coordinate pairs.\n * \n * @author Olga Kholkovskaia\n */\n@JsonDeserialize(using = StepDeserializer.cla", "end": 439, "score": 0.9998131990432739, "start": 422, "tag": "NAME", "value": "Olga Kholkovskaia" } ]
null
[]
/* * 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.service.api.model; import com.service.api.json.StepDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; /** * Step of the route with time, distance, and list of coordinate pairs. * * @author <NAME> */ @JsonDeserialize(using = StepDeserializer.class) public class Step { //duration in seconds private final double duration; //step length in meters private final double distance; private final double[][] waypoints; public Step(double duration, double distance, double[][] waypoints){ this.duration = duration; this.distance = distance; this.waypoints = waypoints; } public double[] getStartPoint(){ return waypoints[0]; } public double[] getEndPoint(){ return waypoints[waypoints.length - 1]; } public double getDuration() { return duration; } public double[][] getWaypoints(){ return waypoints; } public double getSpeedMs(){ return distance/duration; } }
1,304
0.634981
0.63346
57
22.070175
20.923302
79
false
false
0
0
0
0
0
0
0.368421
false
false
2
b3f2a730edf05ed7382da35aaf8a8a1ac6750bd1
9,543,417,367,489
d485d388c1afe95be8bccd1daf40833bd351b2f3
/Chapter08/CH8Lambda2/FunctionalGift.java
4a4a6438ee3b46f1ba9d201343d013818ade769d
[ "MIT" ]
permissive
PacktPublishing/Hands-On-Design-Patterns-with-Java
https://github.com/PacktPublishing/Hands-On-Design-Patterns-with-Java
4ffb5dc8714342d839ee3820fa799745b6bd3dfa
29ec516d170018b54bc2aa2cbe13551c12849f53
refs/heads/master
2023-01-23T12:08:48.969000
2023-01-18T09:21:34
2023-01-18T09:21:34
159,646,396
81
54
null
null
null
null
null
null
null
null
null
null
null
null
null
package CH8Lambda2; public interface FunctionalGift { void abstractMethod(int number); }
UTF-8
Java
96
java
FunctionalGift.java
Java
[]
null
[]
package CH8Lambda2; public interface FunctionalGift { void abstractMethod(int number); }
96
0.760417
0.739583
7
12.714286
15.191298
36
false
false
0
0
0
0
0
0
0.285714
false
false
2
29840f1ea98d38bbd98633c285dd5aabc952bb19
2,104,534,036,823
4c63499be73867020ed15e54b1fd131d37d6f194
/src/main/java/com/empleodigital/bquiet/util/Estadisticas.java
b280bfcd60d5a96466fd63db6174a13546e58f79
[]
no_license
ivaann2706/BQuiet
https://github.com/ivaann2706/BQuiet
c45605ca800786ad1d87e24217e70f13dd8de4a3
5b452a7e329fa5142a948b3c1f5483f4cb172960
refs/heads/master
2021-01-21T04:04:18.451000
2017-08-30T17:11:55
2017-08-30T17:11:55
101,907,526
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.empleodigital.bquiet.util; import java.util.ArrayList; public class Estadisticas { //formato unixtime:valor public static String getEstadisticasMedia(ArrayList<String> datos, int lmax, int lmin) { //Segundos en cada tipo int smayor = 0; int smedio = 0; int smenor = 0; //Ultima fecha en unix int ufecha = (Integer.parseInt(datos.get(0).split(":")[0]) /3600) *3600; for(String x : datos) { System.out.println("Dato: " + x); String[] ar = x.split(":"); int fecha = Integer.parseInt(ar[0]); int num = Integer.parseInt(ar[1]); int s1 = UnixTime.unixToSeconds(ufecha); int s2 = UnixTime.unixToSeconds(fecha); int resto = s2-s1; System.out.println("Resto: " + resto); if(num>=lmax) smayor+=resto; if(num<lmax && num>lmin) smedio+=resto; if(num<=lmin) smenor+=resto; ufecha = Integer.parseInt(ar[0]); } String json = "{'registros' : [{'rango':'alto','value':<alto>}, {'rango':'medio','value':<medio>}, {'rango':'bajo','value':<bajo>}]}"; json = json.replace("<alto>", ""+smayor); json = json.replace("<medio>", ""+smedio); json = json.replace("<bajo>", ""+smenor); json = json.replace("'", "\""); return json; } }
UTF-8
Java
1,200
java
Estadisticas.java
Java
[]
null
[]
package com.empleodigital.bquiet.util; import java.util.ArrayList; public class Estadisticas { //formato unixtime:valor public static String getEstadisticasMedia(ArrayList<String> datos, int lmax, int lmin) { //Segundos en cada tipo int smayor = 0; int smedio = 0; int smenor = 0; //Ultima fecha en unix int ufecha = (Integer.parseInt(datos.get(0).split(":")[0]) /3600) *3600; for(String x : datos) { System.out.println("Dato: " + x); String[] ar = x.split(":"); int fecha = Integer.parseInt(ar[0]); int num = Integer.parseInt(ar[1]); int s1 = UnixTime.unixToSeconds(ufecha); int s2 = UnixTime.unixToSeconds(fecha); int resto = s2-s1; System.out.println("Resto: " + resto); if(num>=lmax) smayor+=resto; if(num<lmax && num>lmin) smedio+=resto; if(num<=lmin) smenor+=resto; ufecha = Integer.parseInt(ar[0]); } String json = "{'registros' : [{'rango':'alto','value':<alto>}, {'rango':'medio','value':<medio>}, {'rango':'bajo','value':<bajo>}]}"; json = json.replace("<alto>", ""+smayor); json = json.replace("<medio>", ""+smedio); json = json.replace("<bajo>", ""+smenor); json = json.replace("'", "\""); return json; } }
1,200
0.625833
0.609167
47
24.531916
26.321943
136
false
false
0
0
0
0
0
0
2.170213
false
false
2
fe099cd4d5396b937f2df8259729ea9ac610dd32
19,559,281,090,939
9b90bca9d62244f86082c67da9a2bbc29ccbbeab
/src/main/java/com/algorithm/linkedleetcode/ReverseLinkedList.java
e20968d948e19ca06e782298699b0890e797541c
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
java-usecase/algorithm-java
https://github.com/java-usecase/algorithm-java
cbb1eb504d69261bb2048ce2903d56c3a1853e7c
bb8069d7513744241464e2c86a0f687ffba2472a
refs/heads/master
2020-09-07T18:35:29.796000
2019-11-16T06:39:08
2019-11-16T06:39:08
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.algorithm.linkedleetcode; /** * leetcode-206 */ public class ReverseLinkedList { public static ListNode reverse(final ListNode head) { if (head == null || head.next == null) { return head; } ListNode current = head; //当前节点 ListNode previous = null; //上一个节点 ListNode nextCursor = null; //下一个节点 while (current != null) { nextCursor = current.next; current.next=previous; //当前节点的下一个节点,变成前一个节点 previous=current;//当前节点变成前一个节点 current = nextCursor;//当前节点迭代到下一个节点 } return previous; } }
UTF-8
Java
742
java
ReverseLinkedList.java
Java
[]
null
[]
package com.algorithm.linkedleetcode; /** * leetcode-206 */ public class ReverseLinkedList { public static ListNode reverse(final ListNode head) { if (head == null || head.next == null) { return head; } ListNode current = head; //当前节点 ListNode previous = null; //上一个节点 ListNode nextCursor = null; //下一个节点 while (current != null) { nextCursor = current.next; current.next=previous; //当前节点的下一个节点,变成前一个节点 previous=current;//当前节点变成前一个节点 current = nextCursor;//当前节点迭代到下一个节点 } return previous; } }
742
0.577532
0.572785
27
22.407408
19.771397
57
false
false
0
0
0
0
0
0
0.444444
false
false
2
9b40cbd5b90c1184b3cb2664a47a28313101b0ca
13,786,845,033,212
65bcf4c2abf876965c57a308e57bec5cb1441739
/vitamin/src/main/java/kr/co/vitamin/controller/SearchRecruitController.java
97cb4e4be01c71b8d5b82c01604e5eb77d176eaf
[ "Apache-2.0" ]
permissive
n4oah/vitamin
https://github.com/n4oah/vitamin
2140ebcb6937de4d4fb3addd5d83b560da8d2267
d910752ed4757f6c30d704af0a26ea2b02ef3ac7
refs/heads/master
2021-09-04T20:57:15.111000
2018-01-22T11:02:09
2018-01-22T11:02:09
113,859,119
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package kr.co.vitamin.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.google.gson.Gson; import kr.co.vitamin.common.PageResult; import kr.co.vitamin.repository.vo.Address; import kr.co.vitamin.repository.vo.Area; import kr.co.vitamin.repository.vo.City; import kr.co.vitamin.repository.vo.FormService; import kr.co.vitamin.repository.vo.Page; import kr.co.vitamin.repository.vo.Recruit; import kr.co.vitamin.repository.vo.SchoolLevel; import kr.co.vitamin.repository.vo.SearchRecruit; import kr.co.vitamin.repository.vo.Welfare; import kr.co.vitamin.repository.vo.account.Member; import kr.co.vitamin.service.FormServiceService; import kr.co.vitamin.service.SchoolLevelService; import kr.co.vitamin.service.SearchService; @Controller @RequestMapping("/search") public class SearchRecruitController { @Autowired private SchoolLevelService schoolLevelService; @Autowired private FormServiceService formServiceService; @Autowired private SearchService searchService; @RequestMapping("/searchRecruit.do") public void searchRecruit(Model model, @RequestParam(name="pageNo", defaultValue="1") int pageNo, HttpSession session) throws Exception { List<City> cityList = searchService.selectCity(); List<Area> areaList = searchService.selectArea(); int recruitCount = searchService.selectRecruitCount(); Page page = new Page(pageNo); PageResult pageResult = new PageResult(pageNo, recruitCount); List<Recruit> recruitList = searchService.selectRecruit(page); System.out.println(recruitList); List<SchoolLevel> schoolLevelList = schoolLevelService.getSchoolLevels(); List<FormService> formServiceList = formServiceService.selectFormService(); model.addAttribute("pageResult", pageResult); model.addAttribute("schoolLevelList", schoolLevelList); model.addAttribute("formServiceList", formServiceList); model.addAttribute("recruitList", recruitList); model.addAttribute("cityList",cityList); model.addAttribute("areaList",areaList); try { Member m = (Member)session.getAttribute("user"); List<Integer> bookmarkList = formServiceService.bookmarkList(m.getMemberNo()); System.out.println(bookmarkList); model.addAttribute("bookmarkList", bookmarkList); } catch (Exception e) { // TODO: handle exception } } @ResponseBody @RequestMapping("/searchWork.do") public String searchWork(SearchRecruit searchRecruit) throws Exception { System.out.println(searchRecruit); System.out.println(searchRecruit.getPageNo()); Page page = new Page(searchRecruit.getPageNo()); int count = searchService.selectSearchConditionCount(searchRecruit); PageResult pageResult = new PageResult(searchRecruit.getPageNo(), count); System.out.println(searchRecruit.getBegin()); System.out.println(searchRecruit.getEnd()); Map<String, Object> map = new HashMap<>(); map.put("pageResult", pageResult); map.put("recruitList", searchService.selectSearchCondition(searchRecruit)); return new Gson().toJson(map); } }
UTF-8
Java
3,441
java
SearchRecruitController.java
Java
[]
null
[]
package kr.co.vitamin.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.google.gson.Gson; import kr.co.vitamin.common.PageResult; import kr.co.vitamin.repository.vo.Address; import kr.co.vitamin.repository.vo.Area; import kr.co.vitamin.repository.vo.City; import kr.co.vitamin.repository.vo.FormService; import kr.co.vitamin.repository.vo.Page; import kr.co.vitamin.repository.vo.Recruit; import kr.co.vitamin.repository.vo.SchoolLevel; import kr.co.vitamin.repository.vo.SearchRecruit; import kr.co.vitamin.repository.vo.Welfare; import kr.co.vitamin.repository.vo.account.Member; import kr.co.vitamin.service.FormServiceService; import kr.co.vitamin.service.SchoolLevelService; import kr.co.vitamin.service.SearchService; @Controller @RequestMapping("/search") public class SearchRecruitController { @Autowired private SchoolLevelService schoolLevelService; @Autowired private FormServiceService formServiceService; @Autowired private SearchService searchService; @RequestMapping("/searchRecruit.do") public void searchRecruit(Model model, @RequestParam(name="pageNo", defaultValue="1") int pageNo, HttpSession session) throws Exception { List<City> cityList = searchService.selectCity(); List<Area> areaList = searchService.selectArea(); int recruitCount = searchService.selectRecruitCount(); Page page = new Page(pageNo); PageResult pageResult = new PageResult(pageNo, recruitCount); List<Recruit> recruitList = searchService.selectRecruit(page); System.out.println(recruitList); List<SchoolLevel> schoolLevelList = schoolLevelService.getSchoolLevels(); List<FormService> formServiceList = formServiceService.selectFormService(); model.addAttribute("pageResult", pageResult); model.addAttribute("schoolLevelList", schoolLevelList); model.addAttribute("formServiceList", formServiceList); model.addAttribute("recruitList", recruitList); model.addAttribute("cityList",cityList); model.addAttribute("areaList",areaList); try { Member m = (Member)session.getAttribute("user"); List<Integer> bookmarkList = formServiceService.bookmarkList(m.getMemberNo()); System.out.println(bookmarkList); model.addAttribute("bookmarkList", bookmarkList); } catch (Exception e) { // TODO: handle exception } } @ResponseBody @RequestMapping("/searchWork.do") public String searchWork(SearchRecruit searchRecruit) throws Exception { System.out.println(searchRecruit); System.out.println(searchRecruit.getPageNo()); Page page = new Page(searchRecruit.getPageNo()); int count = searchService.selectSearchConditionCount(searchRecruit); PageResult pageResult = new PageResult(searchRecruit.getPageNo(), count); System.out.println(searchRecruit.getBegin()); System.out.println(searchRecruit.getEnd()); Map<String, Object> map = new HashMap<>(); map.put("pageResult", pageResult); map.put("recruitList", searchService.selectSearchCondition(searchRecruit)); return new Gson().toJson(map); } }
3,441
0.781168
0.780878
105
31.771429
24.72333
101
false
false
0
0
0
0
0
0
1.904762
false
false
2
f427df8c12801a43b1d7581ebc4be644022a871e
28,630,252,023,769
da5792345dc3ebd28ede0412b54bfc446e6d8792
/itcast-haoke-manage-dubbo-server/itcast-haoke-manage-dubbo-server-house-resources/itcast-haoke-manage-dubbo-server-house-resources-dubbo-service/src/test/java/cn/itcast/haoke/dubbo/server/service/HouseResourcesServiceImplTest.java
921287362457314f67fbcad8c3f86a2b20759cf3
[]
no_license
YoungCc97/itcast-haoke-manage
https://github.com/YoungCc97/itcast-haoke-manage
51a37b1fee59c44baaea16ace67924990e09ae62
30f1867758a2f4995cbdcbc52fa991d01d5974f4
refs/heads/master
2022-10-10T17:48:24.020000
2019-12-30T09:17:14
2019-12-30T09:17:14
227,800,061
2
6
null
false
2022-09-16T21:08:25
2019-12-13T09:10:53
2022-09-15T03:16:12
2022-09-16T21:08:24
71
1
5
7
Java
false
false
package cn.itcast.haoke.dubbo.server.service; import cn.itcast.haoke.dubbo.server.mapper.HouseResourcesMapper; import cn.itcast.haoke.dubbo.server.pojo.HouseResources; import cn.itcast.haoke.dubbo.server.service.HouseResourcesService; import cn.itcast.haoke.dubbo.server.vo.PageInfo; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class HouseResourcesServiceImplTest { @Autowired private HouseResourcesMapper houseResourcesMapper; @Test public void queryHouseResourcesList() { Page<HouseResources> page = new Page<>(1, 1); IPage<HouseResources> houseResourcesIPage = houseResourcesMapper.selectPage(page, null); System.out.println(houseResourcesIPage.getTotal()); } }
UTF-8
Java
1,082
java
HouseResourcesServiceImplTest.java
Java
[]
null
[]
package cn.itcast.haoke.dubbo.server.service; import cn.itcast.haoke.dubbo.server.mapper.HouseResourcesMapper; import cn.itcast.haoke.dubbo.server.pojo.HouseResources; import cn.itcast.haoke.dubbo.server.service.HouseResourcesService; import cn.itcast.haoke.dubbo.server.vo.PageInfo; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class HouseResourcesServiceImplTest { @Autowired private HouseResourcesMapper houseResourcesMapper; @Test public void queryHouseResourcesList() { Page<HouseResources> page = new Page<>(1, 1); IPage<HouseResources> houseResourcesIPage = houseResourcesMapper.selectPage(page, null); System.out.println(houseResourcesIPage.getTotal()); } }
1,082
0.804067
0.801294
28
37.642857
26.303469
96
false
false
0
0
0
0
0
0
0.642857
false
false
2
9ab660cfb6d6609ff2ba54a8a2e6bf327f51bd73
28,630,252,022,049
170bfbf30fd6dd5e7d3e8e3ccffa078eb039bb30
/emvpaycard/src/main/java/com/qualicom/emvpaycard/data/ApplicationFileLocatorRange.java
45567ca09358a5c3d22519916ee56eca5de7a709
[]
no_license
kangelov/PaycardPOC
https://github.com/kangelov/PaycardPOC
493c13680f60dc817727369b8192ef3fd6a7e2d6
6a6079fb9d35a6e2a6917d6d510b52629e034b06
refs/heads/master
2021-01-10T08:47:23.854000
2015-10-29T20:14:53
2015-10-29T20:14:53
44,829,762
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.qualicom.emvpaycard.data; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.google.gson.annotations.Expose; import com.qualicom.emvpaycard.EmvPayCardException; import java.lang.reflect.Type; /** * A single range of records to read for a given application as returned by the Get Processing Options operation as part * of the ApplicationFileLocator. The AFL will in general have more than one. * * Created by kangelov on 2015-10-29. */ public class ApplicationFileLocatorRange extends EmvData { @Expose private final byte shortFileIdentifier; @Expose private final byte startRecord; @Expose private final byte endRecord; @Expose private final int numRecordsForOfflineDataAuthentication; public ApplicationFileLocatorRange(byte[] raw) throws EmvPayCardException { super(raw); if (getRaw().length != 4) throw new EmvPayCardException("Invalid Application File Locator range passed."); //SFL this.shortFileIdentifier = (byte)(getMaskedValue(0, 0xF8) >> 3); if (this.shortFileIdentifier < 1) throw new EmvPayCardException("Short File Identifier within the Application File Locator is missing or invalid."); this.startRecord = raw[1]; this.endRecord = raw[2]; this.numRecordsForOfflineDataAuthentication = raw[3]; } public byte getEndRecord() { return endRecord; } public byte getStartRecord() { return startRecord; } public byte getLength() { return (byte)(getEndRecord() - getStartRecord()); //possible off by one here, but can't really tell. } public int getNumRecordsForOfflineDataAuthentication() { return numRecordsForOfflineDataAuthentication; } public byte getShortFileIdentifier() { return shortFileIdentifier; } }
UTF-8
Java
1,976
java
ApplicationFileLocatorRange.java
Java
[ { "context": "ll in general have more than one.\n *\n * Created by kangelov on 2015-10-29.\n */\npublic class ApplicationFileLo", "end": 554, "score": 0.9996878504753113, "start": 546, "tag": "USERNAME", "value": "kangelov" } ]
null
[]
package com.qualicom.emvpaycard.data; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.google.gson.annotations.Expose; import com.qualicom.emvpaycard.EmvPayCardException; import java.lang.reflect.Type; /** * A single range of records to read for a given application as returned by the Get Processing Options operation as part * of the ApplicationFileLocator. The AFL will in general have more than one. * * Created by kangelov on 2015-10-29. */ public class ApplicationFileLocatorRange extends EmvData { @Expose private final byte shortFileIdentifier; @Expose private final byte startRecord; @Expose private final byte endRecord; @Expose private final int numRecordsForOfflineDataAuthentication; public ApplicationFileLocatorRange(byte[] raw) throws EmvPayCardException { super(raw); if (getRaw().length != 4) throw new EmvPayCardException("Invalid Application File Locator range passed."); //SFL this.shortFileIdentifier = (byte)(getMaskedValue(0, 0xF8) >> 3); if (this.shortFileIdentifier < 1) throw new EmvPayCardException("Short File Identifier within the Application File Locator is missing or invalid."); this.startRecord = raw[1]; this.endRecord = raw[2]; this.numRecordsForOfflineDataAuthentication = raw[3]; } public byte getEndRecord() { return endRecord; } public byte getStartRecord() { return startRecord; } public byte getLength() { return (byte)(getEndRecord() - getStartRecord()); //possible off by one here, but can't really tell. } public int getNumRecordsForOfflineDataAuthentication() { return numRecordsForOfflineDataAuthentication; } public byte getShortFileIdentifier() { return shortFileIdentifier; } }
1,976
0.710526
0.701923
65
29.384615
30.571829
126
false
false
0
0
0
0
0
0
0.4
false
false
2
6aad8664b623f1aa9d87f7836055d89d3b901f04
24,000,277,290,133
801995a2635092ef21f82221d1328af77e905dd6
/src/main/java/com/crud/kodillalibrary/exceptions/ReaderNotFoundException.java
9949785344a8417f6e8101642a947fb6b3f436fb
[]
no_license
KorneliaAdamczyk/library
https://github.com/KorneliaAdamczyk/library
426dc569e4d8b051d9570ed8b576860caa56baef
cb6d80ea27796a116434698651c68759f11163db
refs/heads/master
2020-03-19T00:48:45.353000
2018-08-30T11:56:05
2018-08-30T11:56:05
135,503,173
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.crud.kodillalibrary.exceptions; public class ReaderNotFoundException extends Exception { public static final String READER_NOT_FOUND_EXCEPTION = "Reader not found exception"; public ReaderNotFoundException(String message){ super(message); } }
UTF-8
Java
278
java
ReaderNotFoundException.java
Java
[]
null
[]
package com.crud.kodillalibrary.exceptions; public class ReaderNotFoundException extends Exception { public static final String READER_NOT_FOUND_EXCEPTION = "Reader not found exception"; public ReaderNotFoundException(String message){ super(message); } }
278
0.758993
0.758993
10
26.799999
29.798658
89
false
false
0
0
0
0
0
0
0.3
false
false
2
bebec2910d4bc47f5dc608109ae72257f997ada1
22,454,089,064,310
f65086d4bf40aa9593cd0225d99bdf895c576765
/wikipedia-miner-core/src/main/java/org/wikipedia/miner/db/MarkupDatabase.java
d39975aa392c7eae8b68d2524dd07e92cfe3e0b0
[]
no_license
namkhanhtran/wikipediaminer
https://github.com/namkhanhtran/wikipediaminer
91da0e675f8c9ecab193afd2e0b64452ebe0401c
f4401b84ba4cdaa491d9e7a44e37d1529a9c8cd6
refs/heads/master
2020-12-25T23:57:04.605000
2015-04-29T07:07:00
2015-04-29T07:07:00
24,895,516
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.wikipedia.miner.db; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.io.input.CountingInputStream; import org.apache.hadoop.record.CsvRecordInput; import org.wikipedia.miner.util.ProgressTracker; import org.wikipedia.miner.util.WikipediaConfiguration; import com.sleepycat.bind.tuple.IntegerBinding; import com.sleepycat.bind.tuple.StringBinding; import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseEntry; import org.apache.tools.bzip2.*; /** * A {@link WDatabase} for associating page ids with page markup. * * This will throw {@link UnsupportedOperationException}s if any attempt is made * to cache this database to memory. */ public class MarkupDatabase extends WDatabase<Integer, String> { private enum DumpTag { page, id, text, ignorable }; /** * Creates or connects to a database, whose name and type will be * {@link WDatabase.DatabaseType#markup}. * * @param env * the WEnvironment surrounding this database */ public MarkupDatabase(WEnvironment env) { super(env, DatabaseType.markup, new IntegerBinding(), new StringBinding()); } @Override public String filterCacheEntry(WEntry<Integer, String> e, WikipediaConfiguration conf) { throw new UnsupportedOperationException(); } @Override public WEntry<Integer, String> deserialiseCsvRecord(CsvRecordInput record) throws IOException { throw new UnsupportedOperationException(); } @Override public void loadFromCsvFile(File dataFile, boolean overwrite, ProgressTracker tracker) throws IOException { throw new UnsupportedOperationException(); } /** * Builds the persistent markup database from an XML dump * * @param dataFile * the XML file containing a wikipedia dump * @param overwrite * true if the existing database should be overwritten, otherwise * false * @param tracker * an optional progress tracker (may be null) * @throws IOException * if there is a problem reading or deserialising the given data * file. * @throws XMLStreamException * if the XML within the data file cannot be parsed. */ public void loadFromXmlFile(File dataFile, boolean overwrite, ProgressTracker tracker) throws IOException, XMLStreamException { if (exists() && !overwrite) return; if (tracker == null) tracker = new ProgressTracker(1, MarkupDatabase.class); tracker.startTask(dataFile.length(), "Loading " + getName() + " database"); Database db = getDatabase(false); Integer currId = null; String currMarkup = null; StringBuffer characters = new StringBuffer(); InputStream reader; if (dataFile.getName().endsWith(".bz2")) reader = new CBZip2InputStream(new FileInputStream(dataFile)); else reader = new FileInputStream(dataFile); XMLInputFactory xmlStreamFactory = XMLInputFactory.newInstance(); CountingInputStream countingReader = new CountingInputStream(reader); XMLStreamReader xmlStreamReader = xmlStreamFactory .createXMLStreamReader(countingReader, "UTF-8"); int pageTotal = 0; long charTotal = 0; long maxChar = 0; boolean flag = false; while (xmlStreamReader.hasNext()) { int eventCode = -1; try { eventCode = xmlStreamReader.next(); } catch (Exception e) { System.out.println("ERROR"); eventCode = -1; flag = true; break; } switch (eventCode) { case XMLStreamReader.START_ELEMENT: switch (resolveDumpTag(xmlStreamReader.getLocalName())) { case page: // System.out.println(" - " + countingReader.getByteCount()) // ; default: break; } break; case XMLStreamReader.END_ELEMENT: switch (resolveDumpTag(xmlStreamReader.getLocalName())) { case id: // only take the first id (there is a 2nd one for the // revision) if (currId == null) currId = Integer.parseInt(characters.toString().trim()); break; case text: currMarkup = characters.toString().trim(); break; case page: if (flag == true) { flag = false; } else { DatabaseEntry key = new DatabaseEntry(); keyBinding.objectToEntry(currId, key); DatabaseEntry value = new DatabaseEntry(); valueBinding.objectToEntry(currMarkup, value); pageTotal++; charTotal = charTotal + currMarkup.length(); maxChar = Math.max(maxChar, currMarkup.length()); db.put(null, key, value); currId = null; currMarkup = null; tracker.update(countingReader.getByteCount()); // if (pageTotal % 10000 == 0) { // System.out.println("Processed " + pageTotal + " pages"); // } } break; default: break; } characters = new StringBuffer(); break; case XMLStreamReader.CHARACTERS: characters.append(xmlStreamReader.getText()); } } xmlStreamReader.close(); env.cleanAndCheckpoint(); getDatabase(true); } private DumpTag resolveDumpTag(String tagName) { try { return DumpTag.valueOf(tagName); } catch (IllegalArgumentException e) { return DumpTag.ignorable; } } }
UTF-8
Java
5,334
java
MarkupDatabase.java
Java
[]
null
[]
package org.wikipedia.miner.db; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.io.input.CountingInputStream; import org.apache.hadoop.record.CsvRecordInput; import org.wikipedia.miner.util.ProgressTracker; import org.wikipedia.miner.util.WikipediaConfiguration; import com.sleepycat.bind.tuple.IntegerBinding; import com.sleepycat.bind.tuple.StringBinding; import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseEntry; import org.apache.tools.bzip2.*; /** * A {@link WDatabase} for associating page ids with page markup. * * This will throw {@link UnsupportedOperationException}s if any attempt is made * to cache this database to memory. */ public class MarkupDatabase extends WDatabase<Integer, String> { private enum DumpTag { page, id, text, ignorable }; /** * Creates or connects to a database, whose name and type will be * {@link WDatabase.DatabaseType#markup}. * * @param env * the WEnvironment surrounding this database */ public MarkupDatabase(WEnvironment env) { super(env, DatabaseType.markup, new IntegerBinding(), new StringBinding()); } @Override public String filterCacheEntry(WEntry<Integer, String> e, WikipediaConfiguration conf) { throw new UnsupportedOperationException(); } @Override public WEntry<Integer, String> deserialiseCsvRecord(CsvRecordInput record) throws IOException { throw new UnsupportedOperationException(); } @Override public void loadFromCsvFile(File dataFile, boolean overwrite, ProgressTracker tracker) throws IOException { throw new UnsupportedOperationException(); } /** * Builds the persistent markup database from an XML dump * * @param dataFile * the XML file containing a wikipedia dump * @param overwrite * true if the existing database should be overwritten, otherwise * false * @param tracker * an optional progress tracker (may be null) * @throws IOException * if there is a problem reading or deserialising the given data * file. * @throws XMLStreamException * if the XML within the data file cannot be parsed. */ public void loadFromXmlFile(File dataFile, boolean overwrite, ProgressTracker tracker) throws IOException, XMLStreamException { if (exists() && !overwrite) return; if (tracker == null) tracker = new ProgressTracker(1, MarkupDatabase.class); tracker.startTask(dataFile.length(), "Loading " + getName() + " database"); Database db = getDatabase(false); Integer currId = null; String currMarkup = null; StringBuffer characters = new StringBuffer(); InputStream reader; if (dataFile.getName().endsWith(".bz2")) reader = new CBZip2InputStream(new FileInputStream(dataFile)); else reader = new FileInputStream(dataFile); XMLInputFactory xmlStreamFactory = XMLInputFactory.newInstance(); CountingInputStream countingReader = new CountingInputStream(reader); XMLStreamReader xmlStreamReader = xmlStreamFactory .createXMLStreamReader(countingReader, "UTF-8"); int pageTotal = 0; long charTotal = 0; long maxChar = 0; boolean flag = false; while (xmlStreamReader.hasNext()) { int eventCode = -1; try { eventCode = xmlStreamReader.next(); } catch (Exception e) { System.out.println("ERROR"); eventCode = -1; flag = true; break; } switch (eventCode) { case XMLStreamReader.START_ELEMENT: switch (resolveDumpTag(xmlStreamReader.getLocalName())) { case page: // System.out.println(" - " + countingReader.getByteCount()) // ; default: break; } break; case XMLStreamReader.END_ELEMENT: switch (resolveDumpTag(xmlStreamReader.getLocalName())) { case id: // only take the first id (there is a 2nd one for the // revision) if (currId == null) currId = Integer.parseInt(characters.toString().trim()); break; case text: currMarkup = characters.toString().trim(); break; case page: if (flag == true) { flag = false; } else { DatabaseEntry key = new DatabaseEntry(); keyBinding.objectToEntry(currId, key); DatabaseEntry value = new DatabaseEntry(); valueBinding.objectToEntry(currMarkup, value); pageTotal++; charTotal = charTotal + currMarkup.length(); maxChar = Math.max(maxChar, currMarkup.length()); db.put(null, key, value); currId = null; currMarkup = null; tracker.update(countingReader.getByteCount()); // if (pageTotal % 10000 == 0) { // System.out.println("Processed " + pageTotal + " pages"); // } } break; default: break; } characters = new StringBuffer(); break; case XMLStreamReader.CHARACTERS: characters.append(xmlStreamReader.getText()); } } xmlStreamReader.close(); env.cleanAndCheckpoint(); getDatabase(true); } private DumpTag resolveDumpTag(String tagName) { try { return DumpTag.valueOf(tagName); } catch (IllegalArgumentException e) { return DumpTag.ignorable; } } }
5,334
0.691226
0.688039
207
24.768116
22.402
80
false
false
0
0
0
0
0
0
2.502415
false
false
2
4ac56049933886d60316c945dbc17a124a3b194e
22,454,089,062,157
7c710ce8a91df9be4e5ccede6228cd50f1829524
/Cars2Driver.java
6d6a7ad6c8033ab2407b3b3c045195b5402d18bf
[]
no_license
rqn25/Ch5.4
https://github.com/rqn25/Ch5.4
318f5371742a6ffb8e72fe7fee146bf7f1f9b51f
9b91b4f5c5fcd97f12a4d72e25f09c661f37cf07
refs/heads/master
2020-06-27T22:18:40.454000
2016-11-22T20:46:59
2016-11-22T20:46:59
74,511,506
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import javax.swing.JOptionPane; public class Cars2Driver { public static void main(String [] args) { Cars2 myCar = new Cars2(); Cars2 hisCar = new Cars2("Black", 400, 3.5, "Honda"); Cars2 herCar = new Cars2("Pink", 300, 2.5, "Volks"); Cars2 ferrariCar = new Cars2("Blue", 650, 6.5, "Ferrari"); JOptionPane.showMessageDialog(null, "myCar: " + myCar + "\nhisCar: " + hisCar + "\nherCar: " + herCar); JOptionPane.showMessageDialog(null, "Is myCar the same as hisCar: " + myCar.equals(hisCar) + "\nIs herCar the same as hisCar: " + herCar.equals(hisCar) + "\nIs myCar the same as herCar: " + myCar.equals(herCar)); JOptionPane.showMessageDialog(null, "ferrariCar: " + ferrariCar); JOptionPane.showMessageDialog(null, "Create newCar"); String color = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar: Color = " + color + ", Horse power = " + horsePower + ", Engine size = " + engineSize + ", Make = " + make); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar: " + make.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: " + Cars2.getCount()); JOptionPane.showMessageDialog(null, "Create newCar2"); String color2 = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower2 = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize2 = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make2 = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar2: Color = " + color2 + ", Horse power = " + horsePower2 + ", Engine size = " + engineSize2 + ", Make = " + make2); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar2: " + make2.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: 6"); JOptionPane.showMessageDialog(null, "Create newCar3"); String color3 = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower3 = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize3 = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make3 = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar3: Color = " + color3 + ", Horse power = " + horsePower3 + ", Engine size = " + engineSize3 + ", Make = " + make3); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar3: " + make3.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: 7"); } }
UTF-8
Java
3,098
java
Cars2Driver.java
Java
[]
null
[]
import javax.swing.JOptionPane; public class Cars2Driver { public static void main(String [] args) { Cars2 myCar = new Cars2(); Cars2 hisCar = new Cars2("Black", 400, 3.5, "Honda"); Cars2 herCar = new Cars2("Pink", 300, 2.5, "Volks"); Cars2 ferrariCar = new Cars2("Blue", 650, 6.5, "Ferrari"); JOptionPane.showMessageDialog(null, "myCar: " + myCar + "\nhisCar: " + hisCar + "\nherCar: " + herCar); JOptionPane.showMessageDialog(null, "Is myCar the same as hisCar: " + myCar.equals(hisCar) + "\nIs herCar the same as hisCar: " + herCar.equals(hisCar) + "\nIs myCar the same as herCar: " + myCar.equals(herCar)); JOptionPane.showMessageDialog(null, "ferrariCar: " + ferrariCar); JOptionPane.showMessageDialog(null, "Create newCar"); String color = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar: Color = " + color + ", Horse power = " + horsePower + ", Engine size = " + engineSize + ", Make = " + make); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar: " + make.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: " + Cars2.getCount()); JOptionPane.showMessageDialog(null, "Create newCar2"); String color2 = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower2 = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize2 = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make2 = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar2: Color = " + color2 + ", Horse power = " + horsePower2 + ", Engine size = " + engineSize2 + ", Make = " + make2); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar2: " + make2.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: 6"); JOptionPane.showMessageDialog(null, "Create newCar3"); String color3 = JOptionPane.showInputDialog(null, "Enter color of the car"); int horsePower3 = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter horse power of the car")); double engineSize3 = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter engine size of the car")); String make3 = JOptionPane.showInputDialog(null, "Enter make of the car"); JOptionPane.showMessageDialog(null, "newCar3: Color = " + color3 + ", Horse power = " + horsePower3 + ", Engine size = " + engineSize3 + ", Make = " + make3); JOptionPane.showMessageDialog(null, "Is ferrariCar the same as newCar3: " + make3.equals("Ferrari")); JOptionPane.showMessageDialog(null, "Total number of Cars: 7"); } }
3,098
0.696901
0.680439
58
51.379311
51.899048
214
false
false
0
0
0
0
0
0
3.051724
false
false
2
35944a3a5abcc2186afab3d4cb3b3a9050258c8f
10,290,741,698,500
d046ae497a9f55abba9a99153e0311f7e0b75ad6
/guozy-admin/src/main/java/com/cactus/guozy/common/schedule/ScheduleJobStatus.java
9a8f8fbde0bbbd347df97b659b9a66d930ea1959
[]
no_license
chandlerphang/gzy
https://github.com/chandlerphang/gzy
dada9449e63a29dbf74e853237650e07cbee161b
bd9656f880c871f25d53427eee0c6a8c1fec5bef
refs/heads/master
2021-01-11T14:36:22.915000
2017-04-20T03:20:04
2017-04-20T03:20:04
80,169,872
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cactus.guozy.common.schedule; import lombok.Getter; @Getter public enum ScheduleJobStatus { INIT(-1, "未开始过"), STARTED(1, "运行中"), STOPPED(0, "暂停"); private int code; private String desc; ScheduleJobStatus(int code, String desc) { this.code = code; this.desc = desc; } }
UTF-8
Java
348
java
ScheduleJobStatus.java
Java
[]
null
[]
package com.cactus.guozy.common.schedule; import lombok.Getter; @Getter public enum ScheduleJobStatus { INIT(-1, "未开始过"), STARTED(1, "运行中"), STOPPED(0, "暂停"); private int code; private String desc; ScheduleJobStatus(int code, String desc) { this.code = code; this.desc = desc; } }
348
0.621212
0.612121
19
16.368422
14.172659
46
false
false
0
0
0
0
0
0
0.684211
false
false
2
bd3935af2985c0396e674af8e0e8770c50e96a83
26,104,811,243,570
c5832edad721879b9e5fea2e8f75408e46e68089
/tb-parent/tb-api-external/src/main/java/com/tradebot/apiexternal/config/package-info.java
33ee34ca5491744bf5b044dcb096d5c8058dd674
[ "Apache-2.0" ]
permissive
7Andro/TradeBot
https://github.com/7Andro/TradeBot
8c643e9f01db78f4f705f0f46fcb5780de99bb2a
d3e66865a226518ea2f0f58474dfb555e97574c7
refs/heads/master
2020-04-06T03:44:11.082000
2016-06-01T09:57:40
2016-06-01T09:57:40
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ /** * @author aditya.shekhar * */ package com.tradebot.apiexternal.config;
UTF-8
Java
96
java
package-info.java
Java
[ { "context": "/**\r\n * \r\n */\r\n/**\r\n * @author aditya.shekhar\r\n *\r\n */\r\npackage com.tradebot.apiexternal.config", "end": 45, "score": 0.9991858601570129, "start": 31, "tag": "NAME", "value": "aditya.shekhar" } ]
null
[]
/** * */ /** * @author aditya.shekhar * */ package com.tradebot.apiexternal.config;
96
0.5625
0.5625
8
10.25
13.386093
40
false
false
0
0
0
0
0
0
0.125
false
false
2
cd5821c2da307cfe532ffb00f9fdf1a023a2258c
27,436,251,087,271
83da9309b6a2711af69f6325f16fb31be387db52
/src/main/java/de/netpage/sample/database/update/spring/UpdateDatabaseService.java
c6d96d436e2f13527b952a9866a65b67f6993cbc
[]
no_license
denisw160/LiquibaseUpdate
https://github.com/denisw160/LiquibaseUpdate
a0ecb86c4208dbc24fc4d227aa5aceb3094bc02d
1037353ae2056d2e0c71e1a7fb32e13f9b2c7a5e
refs/heads/master
2021-01-24T03:36:44.116000
2016-12-16T15:58:52
2016-12-16T15:58:52
49,336,830
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package de.netpage.sample.database.update.spring; import de.netpage.sample.database.update.Updatable; import javax.sql.DataSource; /** * Dies ist das Interface für das Datenbank-Update. * * @author Denis Wirries * @version 1.0 * @since 16.08.2014 */ public interface UpdateDatabaseService extends Updatable { /** * Setzt die Datenbank-Verbindung mittels einer DataSource. * Diese DataSource ist erforderlich für das Update. * * @param dataSource DataSource */ void setDataSource(DataSource dataSource); /** * Sollen die Updates beim Laden ausgeführt werden? * * @param excuteOnLoad Ausführen beim Start */ void setExcuteOnLoad(boolean excuteOnLoad); /** * Setzt die zusammengefasste Change-Database-Datei, die alle Updates bundelt. * Wird keine Datei angegeben, so wird die Standard-Einstellung verwendet. * * @param changeTasksFile Properties-Datei, siehe META-INF/database/changelog.properties */ void setChangeTasks(String changeTasksFile); /** * Setzt die Liste der Updates direkt. Hier werden die XML-Dateien mit den * Change-Database-Daten angegeben. Ist die Liste gesetzt, werden die Updates aus * der Changelog-Datei ignoriert. * * @param changeTaskFiles Liste mit den Changelogs, siehe META-INF/database/update-database-0.3.x.xml */ void setChangeTaskFiles(String[] changeTaskFiles); }
UTF-8
Java
1,447
java
UpdateDatabaseService.java
Java
[ { "context": " Interface für das Datenbank-Update.\n *\n * @author Denis Wirries\n * @version 1.0\n * @since 16.08.2014\n */\npublic i", "end": 218, "score": 0.9998607635498047, "start": 205, "tag": "NAME", "value": "Denis Wirries" } ]
null
[]
package de.netpage.sample.database.update.spring; import de.netpage.sample.database.update.Updatable; import javax.sql.DataSource; /** * Dies ist das Interface für das Datenbank-Update. * * @author <NAME> * @version 1.0 * @since 16.08.2014 */ public interface UpdateDatabaseService extends Updatable { /** * Setzt die Datenbank-Verbindung mittels einer DataSource. * Diese DataSource ist erforderlich für das Update. * * @param dataSource DataSource */ void setDataSource(DataSource dataSource); /** * Sollen die Updates beim Laden ausgeführt werden? * * @param excuteOnLoad Ausführen beim Start */ void setExcuteOnLoad(boolean excuteOnLoad); /** * Setzt die zusammengefasste Change-Database-Datei, die alle Updates bundelt. * Wird keine Datei angegeben, so wird die Standard-Einstellung verwendet. * * @param changeTasksFile Properties-Datei, siehe META-INF/database/changelog.properties */ void setChangeTasks(String changeTasksFile); /** * Setzt die Liste der Updates direkt. Hier werden die XML-Dateien mit den * Change-Database-Daten angegeben. Ist die Liste gesetzt, werden die Updates aus * der Changelog-Datei ignoriert. * * @param changeTaskFiles Liste mit den Changelogs, siehe META-INF/database/update-database-0.3.x.xml */ void setChangeTaskFiles(String[] changeTaskFiles); }
1,440
0.706168
0.697852
50
27.860001
29.928589
105
false
false
0
0
0
0
0
0
0.24
false
false
2
f851e84073e7733d640f8ee9faaed03f998e4bea
12,446,815,289,684
44563ab3b671d86f13842be14e309de77edfb798
/src/main/java/com/orange/weather/service/UserDetailsServiceImpl.java
625908db064636b16a1e5151fac70f802c4b1da8
[]
no_license
michaelsamirg/Weather
https://github.com/michaelsamirg/Weather
39691077f1206a27c9ac689e94180a8444287f71
7de0370cffd8e2f260c8654657ac0565281e28e1
refs/heads/master
2022-12-25T19:12:56.996000
2020-02-18T13:35:56
2020-02-18T13:35:56
88,755,312
1
0
null
false
2022-12-16T06:18:31
2017-04-19T14:35:10
2022-11-03T02:25:18
2022-12-16T06:18:28
435
1
0
10
JavaScript
false
false
package com.orange.weather.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.transaction.annotation.Transactional; import com.orange.weather.dao.UserDao; import com.orange.weather.model.User; import com.orange.weather.model.UserRole; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; public class UserDetailsServiceImpl implements UserDetailsService{ @Autowired private UserDao userDao; @Override @Transactional(readOnly = true) /** * override method to return the login user and its authorities */ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userDao.findByEmail(username); Set<GrantedAuthority> grantedAuthorities = new HashSet<>(); List<?> userRoles = userDao.findUserRole(user.getId()); for (Iterator<?> iterator = userRoles.iterator(); iterator.hasNext();) { UserRole userRole = (UserRole) iterator.next(); grantedAuthorities.add(new SimpleGrantedAuthority(userRole.getRole())); } return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword(), grantedAuthorities); } public UserDao getUserDao() { return userDao; } public void setUserDao(UserDao userDao) { this.userDao = userDao; } }
UTF-8
Java
1,780
java
UserDetailsServiceImpl.java
Java
[]
null
[]
package com.orange.weather.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.transaction.annotation.Transactional; import com.orange.weather.dao.UserDao; import com.orange.weather.model.User; import com.orange.weather.model.UserRole; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; public class UserDetailsServiceImpl implements UserDetailsService{ @Autowired private UserDao userDao; @Override @Transactional(readOnly = true) /** * override method to return the login user and its authorities */ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userDao.findByEmail(username); Set<GrantedAuthority> grantedAuthorities = new HashSet<>(); List<?> userRoles = userDao.findUserRole(user.getId()); for (Iterator<?> iterator = userRoles.iterator(); iterator.hasNext();) { UserRole userRole = (UserRole) iterator.next(); grantedAuthorities.add(new SimpleGrantedAuthority(userRole.getRole())); } return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword(), grantedAuthorities); } public UserDao getUserDao() { return userDao; } public void setUserDao(UserDao userDao) { this.userDao = userDao; } }
1,780
0.755618
0.755618
53
32.584908
31.17415
127
false
false
0
0
0
0
0
0
0.735849
false
false
2
8f79aeb782bea41c8b88787a18fc68d6a84afa15
30,571,577,216,129
59e42688b277575a055cc5eff968a64d76a8ba28
/src/bus/uigen/introspect/CopyOfABeanInfoProxy.java
f40438337c225f2941f9892be13616e264ba05a1
[]
no_license
pdewan/ObjectEditor
https://github.com/pdewan/ObjectEditor
2dbd5bc6f4d4373fdf49945b51ca7b9e2d144261
71b4d1ebf931b125244f672e8e34660c5abb28f7
refs/heads/master
2022-05-01T17:44:42.368000
2022-03-23T22:43:26
2022-03-23T22:43:26
16,308,895
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package bus.uigen.introspect; import java.beans.BeanInfo; import java.beans.MethodDescriptor; import java.beans.PropertyDescriptor; import java.lang.reflect.Modifier; import java.util.Enumeration; import java.util.Vector; //import util.misc.Message; import bus.uigen.reflect.ClassProxy; import bus.uigen.reflect.MethodProxy; public class CopyOfABeanInfoProxy implements BeanInfoProxy { ClassProxy classProxy; BeanInfo binfo; MethodDescriptorProxy[] methodDescriptors; PropertyDescriptorProxy[] propertyDescriptors; BeanDescriptorProxy beanDescriptor; public CopyOfABeanInfoProxy (ClassProxy cls) { classProxy = cls; //BeanInfo binfo = AnIntrospectorProxy.getBeanInfo(cls); } public CopyOfABeanInfoProxy (BeanInfo theBeanInfo, ClassProxy theClassProxy) { binfo = theBeanInfo; classProxy = theClassProxy; } public BeanInfo getJavaBeanInfo() { return binfo; } @Override public BeanDescriptorProxy getBeanDescriptor() { // TODO Auto-generated method stub if (beanDescriptor == null) { if (binfo != null) { beanDescriptor = new ABeanDescriptorProxy(binfo.getBeanDescriptor()); } else beanDescriptor = new ABeanDescriptorProxy(classProxy); } return beanDescriptor; } @Override public MethodDescriptorProxy[] getMethodDescriptors() { // TODO Auto-generated method stub if (methodDescriptors == null) { if (binfo != null && !(classProxy.isInterface() && classProxy.getInterfaces().length != 0)) { MethodDescriptor[] mds = binfo.getMethodDescriptors(); methodDescriptors = new MethodDescriptorProxy[mds.length]; for (int i = 0; i < mds.length; i++) { methodDescriptors[i] = new AMethodDescriptorProxy(mds[i]); } } else { MethodProxy[] methods = classProxy.getMethods(); methodDescriptors = new MethodDescriptorProxy[methods.length]; for (int i = 0; i < methods.length; i++) { int modifiers = methods[i].getModifiers(); if (Modifier.isPublic(modifiers)) methodDescriptors[i] = new AMethodDescriptorProxy(methods[i]); } } } return methodDescriptors; } @Override public PropertyDescriptorProxy[] getPropertyDescriptors() { // TODO Auto-generated method stub if (propertyDescriptors == null) { if (binfo != null) { PropertyDescriptor[] pds = binfo.getPropertyDescriptors(); propertyDescriptors = new PropertyDescriptorProxy[pds.length]; for (int i = 0; i < pds.length; i++) { propertyDescriptors[i] = new APropertyDescriptorProxy(pds[i]); } } else { Vector properties = IntrospectUtility.getAllPropertiesNamesVector(classProxy); propertyDescriptors = new PropertyDescriptorProxy[properties.size()]; for (int i = 0; i < propertyDescriptors.length; i++) { String propertyName = (String) properties.elementAt(i); MethodProxy readMethod = IntrospectUtility.getGetterMethod(classProxy, propertyName); MethodProxy writeMethod = IntrospectUtility.getSetterMethod(classProxy, propertyName); propertyDescriptors[i] = new APropertyDescriptorProxy(propertyName, readMethod, writeMethod); } //MethodProxy[] methods = classProxy.getMethods(); //Message.fatalError("Need to extract properties"); /* methodDescriptors = new MethodDescriptorProxy[methods.length]; for (int i = 0; i < methods.length; i++) { methodDescriptors[i] = new AMethodDescriptorProxy(methods[i]); } */ } } return propertyDescriptors; } }
UTF-8
Java
3,553
java
CopyOfABeanInfoProxy.java
Java
[]
null
[]
package bus.uigen.introspect; import java.beans.BeanInfo; import java.beans.MethodDescriptor; import java.beans.PropertyDescriptor; import java.lang.reflect.Modifier; import java.util.Enumeration; import java.util.Vector; //import util.misc.Message; import bus.uigen.reflect.ClassProxy; import bus.uigen.reflect.MethodProxy; public class CopyOfABeanInfoProxy implements BeanInfoProxy { ClassProxy classProxy; BeanInfo binfo; MethodDescriptorProxy[] methodDescriptors; PropertyDescriptorProxy[] propertyDescriptors; BeanDescriptorProxy beanDescriptor; public CopyOfABeanInfoProxy (ClassProxy cls) { classProxy = cls; //BeanInfo binfo = AnIntrospectorProxy.getBeanInfo(cls); } public CopyOfABeanInfoProxy (BeanInfo theBeanInfo, ClassProxy theClassProxy) { binfo = theBeanInfo; classProxy = theClassProxy; } public BeanInfo getJavaBeanInfo() { return binfo; } @Override public BeanDescriptorProxy getBeanDescriptor() { // TODO Auto-generated method stub if (beanDescriptor == null) { if (binfo != null) { beanDescriptor = new ABeanDescriptorProxy(binfo.getBeanDescriptor()); } else beanDescriptor = new ABeanDescriptorProxy(classProxy); } return beanDescriptor; } @Override public MethodDescriptorProxy[] getMethodDescriptors() { // TODO Auto-generated method stub if (methodDescriptors == null) { if (binfo != null && !(classProxy.isInterface() && classProxy.getInterfaces().length != 0)) { MethodDescriptor[] mds = binfo.getMethodDescriptors(); methodDescriptors = new MethodDescriptorProxy[mds.length]; for (int i = 0; i < mds.length; i++) { methodDescriptors[i] = new AMethodDescriptorProxy(mds[i]); } } else { MethodProxy[] methods = classProxy.getMethods(); methodDescriptors = new MethodDescriptorProxy[methods.length]; for (int i = 0; i < methods.length; i++) { int modifiers = methods[i].getModifiers(); if (Modifier.isPublic(modifiers)) methodDescriptors[i] = new AMethodDescriptorProxy(methods[i]); } } } return methodDescriptors; } @Override public PropertyDescriptorProxy[] getPropertyDescriptors() { // TODO Auto-generated method stub if (propertyDescriptors == null) { if (binfo != null) { PropertyDescriptor[] pds = binfo.getPropertyDescriptors(); propertyDescriptors = new PropertyDescriptorProxy[pds.length]; for (int i = 0; i < pds.length; i++) { propertyDescriptors[i] = new APropertyDescriptorProxy(pds[i]); } } else { Vector properties = IntrospectUtility.getAllPropertiesNamesVector(classProxy); propertyDescriptors = new PropertyDescriptorProxy[properties.size()]; for (int i = 0; i < propertyDescriptors.length; i++) { String propertyName = (String) properties.elementAt(i); MethodProxy readMethod = IntrospectUtility.getGetterMethod(classProxy, propertyName); MethodProxy writeMethod = IntrospectUtility.getSetterMethod(classProxy, propertyName); propertyDescriptors[i] = new APropertyDescriptorProxy(propertyName, readMethod, writeMethod); } //MethodProxy[] methods = classProxy.getMethods(); //Message.fatalError("Need to extract properties"); /* methodDescriptors = new MethodDescriptorProxy[methods.length]; for (int i = 0; i < methods.length; i++) { methodDescriptors[i] = new AMethodDescriptorProxy(methods[i]); } */ } } return propertyDescriptors; } }
3,553
0.703631
0.701942
106
31.518867
26.66325
98
false
false
0
0
0
0
0
0
2.85849
false
false
2
6d516b0a3cb03704e390a1e66a911077eedfa194
3,796,751,095,102
4ef272351b5d04ca19b696a5e73cd85de62367e1
/src/main/java/pl/peterdev/invoices/domain/InvoiceItem.java
fab95bbedad22ad86c31117f2c1ac866f950e32c
[]
no_license
peterdevpl/invoices
https://github.com/peterdevpl/invoices
9416ee26ab79ed0993827c4cd2a18a30899e6ce1
4a1cdc260aada538d60c97032ebc5a860013de9d
refs/heads/master
2021-07-15T01:49:24.046000
2020-05-26T11:19:48
2020-05-26T11:19:48
155,247,774
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pl.peterdev.invoices.domain; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Value; import pl.peterdev.invoices.domain.tax.VatRate; import java.math.BigDecimal; import javax.money.MonetaryAmount; @Value public final class InvoiceItem { private final String name; private final BigDecimal quantity; private final MonetaryAmount unitNetAmount; private final VatRate vatRate; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) public InvoiceItem(@JsonProperty("name") String name, @JsonProperty("quantity") BigDecimal quantity, @JsonProperty("unitNetAmount") MonetaryAmount unitNetAmount, @JsonProperty("vatRate") VatRate vatRate) { this.name = name; this.quantity = quantity; this.unitNetAmount = unitNetAmount; this.vatRate = vatRate; } public MonetaryAmount getTotalNetAmount() { return unitNetAmount.multiply(quantity); } public MonetaryAmount getTotalVatAmount() { return getTotalNetAmount().multiply(vatRate.getRate()); } public MonetaryAmount getTotalGrossAmount() { return getTotalNetAmount().add(getTotalVatAmount()); } }
UTF-8
Java
1,231
java
InvoiceItem.java
Java
[]
null
[]
package pl.peterdev.invoices.domain; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Value; import pl.peterdev.invoices.domain.tax.VatRate; import java.math.BigDecimal; import javax.money.MonetaryAmount; @Value public final class InvoiceItem { private final String name; private final BigDecimal quantity; private final MonetaryAmount unitNetAmount; private final VatRate vatRate; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) public InvoiceItem(@JsonProperty("name") String name, @JsonProperty("quantity") BigDecimal quantity, @JsonProperty("unitNetAmount") MonetaryAmount unitNetAmount, @JsonProperty("vatRate") VatRate vatRate) { this.name = name; this.quantity = quantity; this.unitNetAmount = unitNetAmount; this.vatRate = vatRate; } public MonetaryAmount getTotalNetAmount() { return unitNetAmount.multiply(quantity); } public MonetaryAmount getTotalVatAmount() { return getTotalNetAmount().multiply(vatRate.getRate()); } public MonetaryAmount getTotalGrossAmount() { return getTotalNetAmount().add(getTotalVatAmount()); } }
1,231
0.735987
0.735987
40
29.775
22.987482
81
false
false
0
0
0
0
0
0
0.525
false
false
2
fb8993e410b69094420b697cd817fabdb83ce2e4
13,864,154,501,875
cf1ff851f04925a1e5b1f38edd2c4cab6f96ab5e
/src/main/java/com/technoride/abb/vendorapp/custom/CustomStringValuedColumCellForVariant.java
723d8c650710f96da84679d1cd91b5feb6fb08df
[]
no_license
atulsaurabh/vendorapp
https://github.com/atulsaurabh/vendorapp
1356d6d83fd3db805834f8f2337211a60263ce03
70f4a529ea7158f95abc545b3d6ccd439330c93c
refs/heads/master
2020-03-30T09:27:05.733000
2019-01-16T18:02:01
2019-01-16T18:02:01
151,028,290
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.technoride.abb.vendorapp.custom; import com.technoride.abb.vendorapp.entity.AnalysisLimits; import com.technoride.abb.vendorapp.entity.ProductVariantDetail; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.control.*; public class CustomStringValuedColumCellForVariant extends TableCell<ProductVariantDetail,String> { private TextField stringValueTextField; @Override public void startEdit() { if (!isEmpty()) { super.startEdit(); createEntryBox(); setText(null); setGraphic(stringValueTextField); stringValueTextField.selectAll(); stringValueTextField.requestFocus(); } } @Override public void commitEdit(String newValue) { if (stringValueTextField.getText().equalsIgnoreCase("")) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setContentText("Parameter name required."); alert.setHeaderText("BLANK!!!"); alert.setTitle("Required"); alert.showAndWait(); return; } else { int k = getTableView().getSelectionModel().getFocusedIndex(); ProductVariantDetail item = getTableView().getItems().get(k); TablePosition position=getTableView().getSelectionModel().getSelectedCells().get(0); int col = position.getColumn(); switch(col) { case 0: item.setVariantcode(newValue); break; case 3: item.setBarcode(newValue); break; } setText(stringValueTextField.getText()); setGraphic(null); } } @Override public void cancelEdit() { super.cancelEdit(); } @Override protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (empty) { setText(null); setGraphic(null); } else if (isEditing()) { if (this.stringValueTextField != null) this.stringValueTextField.setText(null); setText(null); setGraphic(stringValueTextField); } else { setText(getItem()); setGraphic(null); } } private void createEntryBox() { stringValueTextField =new TextField(); stringValueTextField.setMinWidth(this.getWidth() - this.getGraphicTextGap() * 2); stringValueTextField.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (!newValue) { commitEdit(stringValueTextField.getText()); getTableView().getSelectionModel().selectNext(); int currentColIndex = getTableView().getColumns().indexOf(getTableColumn()); TableColumn nextCol = getTableView().getColumns().get(currentColIndex+1); if (nextCol != null) getTableView().edit(getTableRow().getIndex(), nextCol); } } }); } }
UTF-8
Java
3,395
java
CustomStringValuedColumCellForVariant.java
Java
[]
null
[]
package com.technoride.abb.vendorapp.custom; import com.technoride.abb.vendorapp.entity.AnalysisLimits; import com.technoride.abb.vendorapp.entity.ProductVariantDetail; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.control.*; public class CustomStringValuedColumCellForVariant extends TableCell<ProductVariantDetail,String> { private TextField stringValueTextField; @Override public void startEdit() { if (!isEmpty()) { super.startEdit(); createEntryBox(); setText(null); setGraphic(stringValueTextField); stringValueTextField.selectAll(); stringValueTextField.requestFocus(); } } @Override public void commitEdit(String newValue) { if (stringValueTextField.getText().equalsIgnoreCase("")) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setContentText("Parameter name required."); alert.setHeaderText("BLANK!!!"); alert.setTitle("Required"); alert.showAndWait(); return; } else { int k = getTableView().getSelectionModel().getFocusedIndex(); ProductVariantDetail item = getTableView().getItems().get(k); TablePosition position=getTableView().getSelectionModel().getSelectedCells().get(0); int col = position.getColumn(); switch(col) { case 0: item.setVariantcode(newValue); break; case 3: item.setBarcode(newValue); break; } setText(stringValueTextField.getText()); setGraphic(null); } } @Override public void cancelEdit() { super.cancelEdit(); } @Override protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (empty) { setText(null); setGraphic(null); } else if (isEditing()) { if (this.stringValueTextField != null) this.stringValueTextField.setText(null); setText(null); setGraphic(stringValueTextField); } else { setText(getItem()); setGraphic(null); } } private void createEntryBox() { stringValueTextField =new TextField(); stringValueTextField.setMinWidth(this.getWidth() - this.getGraphicTextGap() * 2); stringValueTextField.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (!newValue) { commitEdit(stringValueTextField.getText()); getTableView().getSelectionModel().selectNext(); int currentColIndex = getTableView().getColumns().indexOf(getTableColumn()); TableColumn nextCol = getTableView().getColumns().get(currentColIndex+1); if (nextCol != null) getTableView().edit(getTableRow().getIndex(), nextCol); } } }); } }
3,395
0.569956
0.568483
106
31.028301
26.560881
116
false
false
0
0
0
0
0
0
0.490566
false
false
2
d475c029ec14a6cc38043474f50bc4a39a1cc28b
11,965,778,895,418
d13e017a310732dc390338a3e800232c80133088
/backoffice/src/main/java/cdioil/backoffice/console/presentation/BackOfficeConsole.java
0e672d5082f16056830b02204b67e9a791309ff6
[]
no_license
gildurao/cdioil-2017-g003
https://github.com/gildurao/cdioil-2017-g003
2aaf56d084502d7df57127167f0769e6141c7f36
b8ab8240391aa59cf08ce5ebc188523d03809e46
refs/heads/master
2021-09-23T12:07:53.607000
2018-06-23T18:07:55
2018-06-23T18:07:55
149,873,683
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cdioil.backoffice.console.presentation; import cdioil.application.authz.AuthenticationController; /** * Class that represents the backoffice functionalities in console * @author <a href="1160907@isep.ipp.pt">João Freitas</a> */ public class BackOfficeConsole { /** * Constant that represents the message that ocures if a user tries to access backoffice * which doesn't have permissions for it */ private static final String ILLEGAL_BACKOFFICE_ACCESS="O utilizador não têm permissões suficientes " + "para entrar no backoffice da aplicação"; /** * Hides default constructor */ private BackOfficeConsole(){} public static void enterBackoffice(AuthenticationController authenticationController){ if(authenticationController.canAccessAdminBackoffice()){ new MainMenu().mainLoopAdmin(authenticationController); }else if(authenticationController.canAccessManagerBackoffice()){ new MainMenu().mainLoopManager(authenticationController); }else{ throw new IllegalStateException(ILLEGAL_BACKOFFICE_ACCESS); } } }
UTF-8
Java
1,151
java
BackOfficeConsole.java
Java
[ { "context": "ce functionalities in console\n * @author <a href=\"1160907@isep.ipp.pt\">João Freitas</a>\n */\npublic class BackOfficeCons", "end": 218, "score": 0.9999204874038696, "start": 199, "tag": "EMAIL", "value": "1160907@isep.ipp.pt" }, { "context": " console\n * @author <a href=\"1160907@isep.ipp.pt\">João Freitas</a>\n */\npublic class BackOfficeConsole {\n /**\n", "end": 232, "score": 0.9998537302017212, "start": 220, "tag": "NAME", "value": "João Freitas" } ]
null
[]
package cdioil.backoffice.console.presentation; import cdioil.application.authz.AuthenticationController; /** * Class that represents the backoffice functionalities in console * @author <a href="<EMAIL>"><NAME></a> */ public class BackOfficeConsole { /** * Constant that represents the message that ocures if a user tries to access backoffice * which doesn't have permissions for it */ private static final String ILLEGAL_BACKOFFICE_ACCESS="O utilizador não têm permissões suficientes " + "para entrar no backoffice da aplicação"; /** * Hides default constructor */ private BackOfficeConsole(){} public static void enterBackoffice(AuthenticationController authenticationController){ if(authenticationController.canAccessAdminBackoffice()){ new MainMenu().mainLoopAdmin(authenticationController); }else if(authenticationController.canAccessManagerBackoffice()){ new MainMenu().mainLoopManager(authenticationController); }else{ throw new IllegalStateException(ILLEGAL_BACKOFFICE_ACCESS); } } }
1,132
0.719651
0.713537
29
38.482758
32.092133
104
false
false
0
0
0
0
0
0
0.206897
false
false
2
db3e336389b2f31319492548a4103ed2dd25c124
7,438,883,369,927
2199d9defe6d314f984fe2e6b8b3656f8bd2d977
/downloader/src/main/java/json/OutputPackList.java
b8f8175ca02da8c4085f9868d77d25deab83812c
[]
no_license
romainricard/signal-stickers.github.io
https://github.com/romainricard/signal-stickers.github.io
a736ec82ed82bdea8e294565a3690b20eaeb295e
ef7f4611f808c57b27a8a340448d75125591ebaf
refs/heads/master
2020-12-02T05:39:15.451000
2019-12-26T13:25:51
2019-12-26T13:25:51
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package json; import java.util.ArrayList; import java.util.List; public class OutputPackList { public List<OutputPack> packs; public OutputPackList() { this.packs = new ArrayList<>(); } }
UTF-8
Java
201
java
OutputPackList.java
Java
[]
null
[]
package json; import java.util.ArrayList; import java.util.List; public class OutputPackList { public List<OutputPack> packs; public OutputPackList() { this.packs = new ArrayList<>(); } }
201
0.711443
0.711443
12
15.75
13.645054
35
false
false
0
0
0
0
0
0
0.416667
false
false
2
9a5d71038b6fa4abbb8de18e10a46c745b9c8b35
6,554,120,159,294
b43b9b302c3fd9535f7fa1b6f86c4ae48db597df
/src/Servlet/kMap.java
cb1995113c78a6327b42e0ec6049b7e5609e604e
[]
no_license
1194785797/dataOfPeople
https://github.com/1194785797/dataOfPeople
15b5ed80caa57f84adb2c6f8ccad3e6b3c2049db
06e48e5507fc009e78deeef4ea26361b42eb2bf8
refs/heads/master
2023-06-23T16:29:58.561000
2021-07-19T14:06:45
2021-07-19T14:06:45
387,480,833
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; import java.util.List; import java.util.Map; 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 com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import Bean.seleNeo; import DBUtil.DBMysql; /** * Servlet implementation class kMap */ @WebServlet("/kMap") public class kMap extends HttpServlet { @SuppressWarnings("unlikely-arg-type") protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { seleNeo neo = new seleNeo(); request.setCharacterEncoding("utf-8"); String city = request.getParameter("city"); response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); DBMysql mysql = new DBMysql(); // List<HashMap<String, Object>> rk = mysql.queryPeopNum(); // String rkString = JSON.toJSONString(rk); // System.out.println(rkString); // String jo = neo.seleNeo(city); Object object = jo; System.out.println(jo); JSONObject json = JSON.parseObject(jo); System.out.println("parseJsonObject()·½·¨£ºjson==" + json); // System.out.println(json.get(1)); out.println(json); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
ISO-8859-1
Java
1,588
java
kMap.java
Java
[]
null
[]
package Servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; import java.util.List; import java.util.Map; 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 com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import Bean.seleNeo; import DBUtil.DBMysql; /** * Servlet implementation class kMap */ @WebServlet("/kMap") public class kMap extends HttpServlet { @SuppressWarnings("unlikely-arg-type") protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { seleNeo neo = new seleNeo(); request.setCharacterEncoding("utf-8"); String city = request.getParameter("city"); response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); DBMysql mysql = new DBMysql(); // List<HashMap<String, Object>> rk = mysql.queryPeopNum(); // String rkString = JSON.toJSONString(rk); // System.out.println(rkString); // String jo = neo.seleNeo(city); Object object = jo; System.out.println(jo); JSONObject json = JSON.parseObject(jo); System.out.println("parseJsonObject()·½·¨£ºjson==" + json); // System.out.println(json.get(1)); out.println(json); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
1,588
0.742731
0.740202
62
24.516129
25.335646
119
false
false
0
0
0
0
0
0
1.354839
false
false
2