blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b421dc0b8befdd8d601b8995639a3c8220f8544b | 7773ea6f465ffecfd4f9821aad56ee1eab90d97a | /java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamToLoop/beforeIfComment.java | 4ceb2224627282451007e9962c2bc4379488f1b1 | [
"Apache-2.0"
] | permissive | aghasyedbilal/intellij-community | 5fa14a8bb62a037c0d2764fb172e8109a3db471f | fa602b2874ea4eb59442f9937b952dcb55910b6e | refs/heads/master | 2023-04-10T20:55:27.988445 | 2020-05-03T22:00:26 | 2020-05-03T22:26:23 | 261,074,802 | 2 | 0 | Apache-2.0 | 2020-05-04T03:48:36 | 2020-05-04T03:48:35 | null | UTF-8 | Java | false | false | 449 | java | // "Replace Stream API chain with loop" "true"
import java.util.Arrays;
import java.util.List;
public class Main {
private static String test(List<String> list) {
if (list == null) {
return null;
} else {
return list.stream().filter(str -> str.contains("x")).find<caret>First().orElse(null); // comment
}
}
public static void main(String[] args) {
System.out.println(test(Arrays.asList("a", "b", "syz")));
}
} | [
"Tagir.Valeev@jetbrains.com"
] | Tagir.Valeev@jetbrains.com |
63661869ee576603a20dac54f32e67dcec0a1289 | 4eb15bd98f82d5906e58caa644116da81cf553de | /pet-clinic-data/src/main/java/net/ducatillon/sfgpetclinic/services/VetService.java | afde678c2fd41ae5ecc2a81597747a2b9cb2e39a | [] | no_license | francoiducat/sfg-pet-clinic | 2c99f0ad4cb8100a3f96c888e0de842415b6eff4 | e6a9ced0a33308d472d785575c60cb08a392375b | refs/heads/master | 2020-04-19T18:26:35.046188 | 2019-09-18T13:22:02 | 2019-09-18T13:22:02 | 168,363,604 | 0 | 0 | null | 2019-05-24T14:39:08 | 2019-01-30T15:13:49 | Java | UTF-8 | Java | false | false | 158 | java | package net.ducatillon.sfgpetclinic.services;
import net.ducatillon.sfgpetclinic.model.Vet;
public interface VetService extends CrudService<Vet, Long> {
}
| [
"francois.ducatillon@decathlon.com"
] | francois.ducatillon@decathlon.com |
1f2ae8b701fd5e1f2ecd6673f67ca7598849a555 | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/eihealth/src/main/java/com/huaweicloud/sdk/eihealth/v1/model/StartScaleOutPolicyRequest.java | 620691c804afe07155eceb5a61e6d482cf5f593e | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 1,661 | java | package com.huaweicloud.sdk.eihealth.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* Request Object
*/
public class StartScaleOutPolicyRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "id")
private String id;
public StartScaleOutPolicyRequest withId(String id) {
this.id = id;
return this;
}
/**
* 策略id
* @return id
*/
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
StartScaleOutPolicyRequest that = (StartScaleOutPolicyRequest) obj;
return Objects.equals(this.id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StartScaleOutPolicyRequest {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
c7ffdac90f8bbf1d06a90b38d4cc0d2ff47c2280 | 0856bed08400b870101cd24a0aa2460065f64745 | /yqrj-yzj/src/main/java/com/yqrj/modules/yzj/sys/controller/YzjSlideshowController.java | a269b9e685f0a21b0e3a6c4970e7daa5dc5c6544 | [] | no_license | tingyuxuan169/yzj | 108de8c3ac673f09c6dff3ab8ca74cea78d20955 | 17d96ed4a3d2a1a26e80265c386e692f27cfc617 | refs/heads/master | 2022-09-23T07:49:19.882628 | 2019-09-29T14:27:44 | 2019-09-29T14:27:44 | 211,668,875 | 1 | 0 | null | 2022-09-01T23:13:30 | 2019-09-29T13:40:42 | Java | UTF-8 | Java | false | false | 4,110 | java | package com.yqrj.modules.yzj.sys.controller;
import com.yqrj.common.annotation.LogOperation;
import com.yqrj.common.constant.Constant;
import com.yqrj.common.page.PageData;
import com.yqrj.common.utils.ExcelUtils;
import com.yqrj.common.utils.Result;
import com.yqrj.common.validator.AssertUtils;
import com.yqrj.common.validator.ValidatorUtils;
import com.yqrj.common.validator.group.AddGroup;
import com.yqrj.common.validator.group.DefaultGroup;
import com.yqrj.common.validator.group.UpdateGroup;
import com.yqrj.modules.yzj.sys.dto.YzjSlideshowDTO;
import com.yqrj.modules.yzj.sys.excel.YzjSlideshowExcel;
import com.yqrj.modules.yzj.sys.service.YzjSlideshowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 轮播图
*
* @author cxl cxl315@qq.com
* @since 1.0.0 2019-09-06
*/
@RestController
@RequestMapping("yzj/slideshow")
@Api(tags="轮播图")
public class YzjSlideshowController {
@Autowired
private YzjSlideshowService yzjSlideshowService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("yzj:slideshow:page")
public Result<PageData<YzjSlideshowDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<YzjSlideshowDTO> page = yzjSlideshowService.page(params);
return new Result<PageData<YzjSlideshowDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("yzj:slideshow:info")
public Result<YzjSlideshowDTO> get(@PathVariable("id") Long id){
YzjSlideshowDTO data = yzjSlideshowService.get(id);
return new Result<YzjSlideshowDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("yzj:slideshow:save")
public Result save(@RequestBody YzjSlideshowDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
yzjSlideshowService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("yzj:slideshow:update")
public Result update(@RequestBody YzjSlideshowDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
yzjSlideshowService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("yzj:slideshow:delete")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
yzjSlideshowService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("yzj:slideshow:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<YzjSlideshowDTO> list = yzjSlideshowService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, YzjSlideshowExcel.class);
}
} | [
"tingyuxuan169@163.com"
] | tingyuxuan169@163.com |
5d3125f7a3f2cbb52bfdf575154627dd7fe6a262 | 5da5f8bba90a33f2e74e89f031e3092a4a27e976 | /anchorcms-web/src/main/java/com/anchorcms/cms/service/main/impl/ContentChargeMngImpl.java | 1f3fc6eed75215f43abaa80024e83b60cba52344 | [] | no_license | hanshuxia/nmggyy | 3700210e6f1421d67e7bbf2c004a479ea2faef00 | 75665cac07c74e972753874a9f28077a7b649fee | refs/heads/master | 2020-03-27T02:32:23.219385 | 2018-08-24T02:37:17 | 2018-08-24T02:37:17 | 145,797,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,773 | java | package com.anchorcms.cms.service.main.impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.anchorcms.cms.dao.main.ContentChargeDao;
import com.anchorcms.cms.model.main.Content;
import com.anchorcms.cms.model.main.ContentCharge;
import com.anchorcms.cms.service.main.ContentChargeMng;
import com.anchorcms.common.hibernate.Updater;
import com.anchorcms.common.page.Pagination;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
@Transactional
public class ContentChargeMngImpl implements ContentChargeMng {
@Transactional(readOnly=true)
public List<ContentCharge> getList(String contentTitle, Integer authorUserId,
Date buyTimeBegin, Date buyTimeEnd, int orderBy, int count){
return dao.getList(contentTitle,authorUserId,
buyTimeBegin,buyTimeEnd, orderBy, count);
}
@Transactional(readOnly=true)
public Pagination getPage(String contentTitle, Integer authorUserId,
Date buyTimeBegin, Date buyTimeEnd,
int orderBy, int pageNo, int pageSize){
return dao.getPage(contentTitle,authorUserId,
buyTimeBegin,buyTimeEnd,orderBy,pageNo,pageSize);
}
public ContentCharge save(Double chargeAmount, Short charge,Content content){
ContentCharge contentCharge=new ContentCharge();
contentCharge.setChargeAmount(chargeAmount);
contentCharge.setChargeReward(charge);
contentCharge=save(contentCharge, content);
return contentCharge;
}
public void afterContentUpdate(Content bean,Short charge,Double chargeAmount) {
if(charge!=null&&!charge.equals(ContentCharge.MODEL_FREE)){
ContentCharge c=bean.getContentCharge();
//收费金额变更
if(c!=null){
c.setChargeAmount(chargeAmount);
c.setChargeReward(charge);
update(c);
}else{
//从免费变更收费
save(chargeAmount, charge,bean);
}
}else{
ContentCharge c=bean.getContentCharge();
//从收费变免费
if(c!=null){
c.setChargeAmount(0d);
c.setChargeReward(ContentCharge.MODEL_FREE);
update(c);
}
}
}
public ContentCharge update(ContentCharge bean) {
Updater<ContentCharge> updater = new Updater<ContentCharge>(bean);
bean = dao.updateByUpdater(updater);
return bean;
}
public ContentCharge afterUserPay(Double payAmout, Content content){
Calendar curr = Calendar.getInstance();
Calendar last = Calendar.getInstance();
ContentCharge charge=content.getContentCharge();
if(content.getLastBuyTime()!=null){
last.setTime(content.getLastBuyTime());
int currDay = curr.get(Calendar.DAY_OF_YEAR);
int lastDay = last.get(Calendar.DAY_OF_YEAR);
int currYear=curr.get(Calendar.YEAR);
int lastYear=last.get(Calendar.YEAR);
int currMonth = curr.get(Calendar.MONTH);
int lastMonth = last.get(Calendar.MONTH);
if(charge!=null){
if(lastYear!=currYear){
charge.setYearAmount(0d);
charge.setMonthAmount(0d);
charge.setDayAmount(0d);
}else{
if(currMonth!=lastMonth){
charge.setMonthAmount(0d);
charge.setDayAmount(0d);
}else{
if (currDay != lastDay) {
charge.setDayAmount(0d);
}
}
}
}
}
charge.setTotalAmount(charge.getTotalAmount()+payAmout);
charge.setYearAmount(charge.getYearAmount()+payAmout);
charge.setMonthAmount(charge.getMonthAmount()+payAmout);
charge.setDayAmount(charge.getDayAmount()+payAmout);
charge.setLastBuyTime(curr.getTime());
return charge;
}
private ContentCharge save(ContentCharge charge, Content content) {
content.setContentCharge(charge);
charge.setContent(content);
charge.init();
dao.save(charge);
content.setContentCharge(charge);
return charge;
}
@Resource
private ContentChargeDao dao;
} | [
"605128459@qq.com"
] | 605128459@qq.com |
4b5d55133afd26181a29772b199e77631405988f | d040eadc32c3bd71467429cb8e791267fc57e14b | /cloudstack/src/main/java/org/ats/cloudstack/AsyncJobAPI.java | 14d4d5aa83a5afbabf5b5ea966b3df35b7ff7f44 | [] | no_license | nambv2/cloud-ats | 00b0434625cdcf2c3829144b7f2820bfbc165b03 | e81e78e4e5df5253d9e5fea8b3e0007b730cf4f0 | refs/heads/v1.0 | 2021-01-17T12:48:58.243053 | 2015-08-13T07:41:28 | 2015-08-13T07:41:28 | 32,575,973 | 0 | 0 | null | 2015-03-20T09:52:43 | 2015-03-20T09:52:42 | null | UTF-8 | Java | false | false | 857 | java | /**
*
*/
package org.ats.cloudstack;
import java.io.IOException;
import org.ats.cloudstack.model.Job;
import org.json.JSONObject;
/**
* @author <a href="mailto:haithanh0809@gmail.com">Nguyen Thanh Hai</a>
*
* Apr 25, 2014
*/
public class AsyncJobAPI extends CloudStackAPI {
@Deprecated
public static Job queryAsyncJobResult(String jobId) throws IOException {
return queryAsyncJobResult(CloudStackClient.getInstance(), jobId);
}
public static Job queryAsyncJobResult(CloudStackClient client, String jobId) throws IOException {
StringBuilder sb = new StringBuilder("command=queryAsyncJobResult&response=json&jobid=").append(jobId);
String response = request(client, sb.toString());
JSONObject json = new JSONObject(response).getJSONObject("queryasyncjobresultresponse");
return buildModel(Job.class, json);
}
}
| [
"haithanh0809@gmail.com"
] | haithanh0809@gmail.com |
24f65372559966846490c84383a8960f4eaacc12 | 489e5d7c7c54c9ba0e1a15208df781e19404a70a | /QuickAppointmentServiceApplication_152642/src/com/capgemini/doctors/ui/Client.java | 81d6fb0f11bf465aee5d300ec943b23d936428bc | [] | no_license | kakilari97/MavenProject | e956de67cd7edd208294f2e31ee5b7ef6f4add88 | c11169c9edaa629d9cc3e108e6cdc01315a61196 | refs/heads/master | 2020-03-24T06:30:34.542111 | 2018-09-04T10:48:39 | 2018-09-04T10:48:39 | 142,531,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,468 | java | package com.capgemini.doctors.ui;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import com.capgemini.doctors.bean.DoctorAppointment;
import com.capgemini.doctors.service.DoctorAppointmentService;
import com.capgemini.doctors.service.DoctorAppointmentValidate;
public class Client {
static int b;
public static void main(String[] args) {
int choice=0;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("***Quick Appointment Service Application***\n");
System.out.println("-------------------Welcome-----------------\n");
try {
do {
//Menu
System.out.println("Enter your choice:\n"
+ "1.Book Doctor Appointment\n2.View Doctor Appointment\n"
+ "3.Exit\n");
choice=Integer.parseInt(br.readLine());
switch(choice) {
case 1:
bookAppointment();;
break;
case 2:
viewAppointment();
break;
case 3:
System.exit(0);
break;
default:
System.out.println("Invalid choice\n");
break;
}
}while(choice!=3);
}catch(NumberFormatException e) {
e.printStackTrace();
}catch(IOException e) {
e.printStackTrace();
}
}
private static void bookAppointment() {
int appointmentId=0;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
DoctorAppointmentService service=new DoctorAppointmentService();
DoctorAppointment newappointment=new DoctorAppointment();
DoctorAppointmentValidate validate=new DoctorAppointmentValidate();
try
{
System.out.println("Enter Details:\n");
System.out.println("Enter name of the patient:\n");
String patientName=br.readLine();
System.out.println("Enter Phone Number:\n");
String phoneNumber=br.readLine();
System.out.println("Enter Email-id:\n");
String email=br.readLine();
System.out.println("Enter age:\n");
String age=br.readLine();
System.out.println("Enter Gender:\n");
String gender=br.readLine();
System.out.println("Enter Problem Name:\n");
String problemName=br.readLine();
appointmentId = (int) (Math.random() * 1234 +9999);
System.out.println("Appointment ID:"+appointmentId);
newappointment.setPatientName(patientName);
newappointment.setPhoneNumber(phoneNumber);
newappointment.setEmail(email);
newappointment.setAge(Integer.parseInt(age));
newappointment.setGender(gender);
newappointment.setProblemName(problemName);
newappointment.setAppointmentId(appointmentId);
boolean isValidproblemName=validate.validateProblemName(problemName);
boolean isValidemail=validate.validateEmail(email);
boolean isValidGender=validate.validateGender(gender);
boolean isValidPhoneNumber=validate.validatePhoneNumber(phoneNumber);
if(isValidproblemName && isValidemail && isValidGender && isValidPhoneNumber)
{
b=newappointment.getAppointmentId();
System.out.println(newappointment.toString());
System.out.println(service.addDoctorAppointmentDetails(newappointment));
if(b==appointmentId) {
System.out.println("Your Doctor Appointment has been successfully registered, your appointment ID is: "+b);
if(newappointment.getProblemName().equals("Heart"))
{
newappointment.setDoctorName("Dr.Brijesh Kumar");
System.out.println(newappointment.getDoctorName());
}else if(newappointment.getProblemName().equals("Gynecology"))
{
newappointment.setDoctorName("Dr.Sharda Singh");
System.out.println(newappointment.getDoctorName());
}else if(newappointment.getProblemName().equals("Diabetes"))
{
newappointment.setDoctorName("Dr.Heena Khan");
System.out.println(newappointment.getDoctorName());
}else if(newappointment.getProblemName().equals("ENT"))
{
newappointment.setDoctorName("Dr.Paras Mal");
System.out.println(newappointment.getDoctorName());
}else if(newappointment.getProblemName().equals("Bone"))
{
newappointment.setDoctorName("Dr.Renuka Kher");
System.out.println(newappointment.getDoctorName());
}else if(newappointment.getProblemName().equals("Dermatology"))
{
newappointment.setDoctorName("Dr.Kanika Kapoor");
System.out.println(newappointment.getDoctorName());
}else {
System.out.println("null");
}
}
}else
{
System.out.println("Enter valid details!\n");
}
// if(b!=0) {
// System.out.println("AppointmentId"+appointmentId);
// }
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static void viewAppointment() {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
DoctorAppointmentService service=new DoctorAppointmentService();
DoctorAppointment newappointment=new DoctorAppointment();
System.out.println("Enter Appointment ID:\n");
int t;
try {
t=Integer.parseInt(br.readLine());
System.out.println(service.getDoctorAppointmentDetails(t));
System.out.println(newappointment.toString());
System.out.println("Appointment Date and time, along with doctor's phone number will be shared shortly with you\n");
}catch(NumberFormatException e) {
e.printStackTrace();
}catch(IOException e) {
e.printStackTrace();
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b5ef09aa72f10c493ac62c14237d3fd51ea3d5ae | 32036a20d7d887f749c8f2f584471c6c8d09f12e | /src/com/huwl/oracle/design_pattern/multi_static_simple_factory/SenderFactory.java | ad3c92f86dd2e5a666d583f9c92c161d61b2b5f5 | [] | no_license | chenqilin70/Java_23_DesignPattern | cba59c41d73097907b89ce1cc51b7a8fdbf766be | dbeb744608259c40c2433859918841093a0b62a0 | refs/heads/master | 2021-01-22T11:29:34.252143 | 2017-05-30T03:16:20 | 2017-05-30T03:16:20 | 92,704,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java |
package com.huwl.oracle.design_pattern.multi_static_simple_factory;
import com.huwl.oracle.design_pattern.multi_simple_factory.*;
/**
* 简单工厂模式不属于23中涉及模式
* 简单工厂一般分为:普通简单工厂、多方法简单工厂、静态方法简单工厂
* @author aierxuan
*/
//多个静态方法简单工厂
public class SenderFactory {
public static SmsSender produceSmsSender(){
return new SmsSender();
}
public static MailSender produceMailSender(){
return new MailSender();
}
}
| [
"kylinchen85@foxmail.com"
] | kylinchen85@foxmail.com |
cd644c60c8777c91849587d443d538463944b3ad | fdb300f6009033b35903b778b4e8163e2c06d7fe | /access/src/main/java/com/hertfordshire/access/transformation/CreatePaymentMethodInfoTransform.java | 3806dd90b1756c3adc9094662197f8eda3e79326 | [] | no_license | obinnamaduabum/lims_backend | 97e682b248aac2bd1db4125cdd9c8dba86176729 | 9fd12893219a5bf3b65f1afca7f6c46f0c82712d | refs/heads/master | 2023-05-01T14:57:23.468791 | 2020-08-22T19:53:05 | 2020-08-22T19:53:05 | 369,449,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,007 | java | package com.hertfordshire.access.transformation;
import com.google.gson.Gson;
import com.hertfordshire.dto.paymentConfig.PaymentConfigDto;
import com.hertfordshire.service.psql.payment_method_config.PaymentMethodConfigService;
import com.hertfordshire.utils.ResourceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.logging.Logger;
import static com.hertfordshire.access.transformation.Transformer.*;
@Component
public class CreatePaymentMethodInfoTransform {
private static final Logger logger = Logger.getLogger(CreatePaymentMethodInfoTransform.class.getSimpleName());
@Autowired
private PaymentMethodConfigService paymentMethodConfigService;
private Gson gson;
public CreatePaymentMethodInfoTransform() {
this.gson = new Gson();
}
public void createPaymentMethods() {
BufferedReader bufferedReader;
InputStream inputStream = ResourceUtil.getResourceAsStream(TRANSFORMATION_DATA_FOLDER + File.separator + JSON_FOLDER + File.separator + PAYMENT_METHOD_CONFIG);
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
PaymentConfigDto[] paymentConfigDtos = gson.fromJson(bufferedReader, PaymentConfigDto[].class);
logger.info(gson.toJson(paymentConfigDtos));
if (paymentMethodConfigService.findAll().size() <= 0) {
logger.info("Adding payment methods");
for (int i =0; i < paymentConfigDtos.length; i++){
//logger.info("testing public key :"+ paymentConfigDtos[i].getPaymentConfig().getTesting().getPublicKey());
paymentMethodConfigService.save(paymentConfigDtos[i]);
}
logger.info("Done adding payment methods");
}else {
logger.info("payment methods already exist");
}
}
}
| [
"you@example.com"
] | you@example.com |
4851ef3b1ea50ffb0e71731dedba7af40de2ad1a | ecce6f70285a1a50da00835b8ceaf6e0651ecfa8 | /Magma/core/src/main/java/net/avicus/magma/api/graph/mutations/alert_send/AlertSendQueryDefinition.java | e3abc2bcaef0f9f51bd00c17652115860e492e8e | [
"MIT"
] | permissive | Avicus/AvicusNetwork | d59b69f5ee726c54edf73fb89149cd3624a4e0cd | 26c2320788807b2452f69d6f5b167a2fbb2df698 | refs/heads/master | 2022-06-14T22:55:45.083832 | 2022-01-23T06:21:43 | 2022-01-23T06:21:43 | 119,120,459 | 25 | 20 | MIT | 2022-05-20T20:53:20 | 2018-01-27T01:10:39 | Java | UTF-8 | Java | false | false | 144 | java | package net.avicus.magma.api.graph.mutations.alert_send;
public interface AlertSendQueryDefinition {
void define(AlertSendQuery builder);
}
| [
"keenan@keenant.com"
] | keenan@keenant.com |
030ebe9c2529d1741ef3190e223d992efc952532 | 8dc7ddea6e504f85cfc206efad8dc75530f80947 | /notif-pi/src/main/java/com/spiczek/notif/pi/publisher/accel/device/Lis3dhStub.java | 1afeb6a27ea50b1e096acd164c7dd8772a369ea1 | [] | no_license | piotrsiczek/notif | 02341fe873523d1825941e31950d57b395b8638b | d0546b0d359b388f1c4a6e771fb2f564e7af1729 | refs/heads/master | 2021-05-01T07:49:40.451668 | 2018-02-11T22:15:59 | 2018-02-11T22:15:59 | 121,164,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 743 | java | package com.spiczek.notif.pi.publisher.accel.device;
import com.spiczek.notif.pi.publisher.model.AccelData;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import java.util.Random;
/**
* @author Piotr Siczek
*/
@Profile("local")
@Component
public class Lis3dhStub implements Accelerometer {
@Override
public AccelData getReading(String time) throws Exception {
int x = random();
int y = random();
int z = random();
return AccelData.builder().x(x).y(y).z(z).time(time).build();
}
private int random() {
Random r = new Random();
int Low = -100;
int High = 101;
return r.nextInt(High-Low) + Low;
}
} | [
"spiczek@gmail.com"
] | spiczek@gmail.com |
92bd2c337e54fa21f8521e35f5937cb1db6c36ac | 1d858f3ef43656e05bfe181d86b66b6dff5b03ba | /src/test/java/com/Jiabin/TodoList/TodoListApplicationTests.java | 535935d1223f874f001ff8b037e685c6f441bde6 | [] | no_license | oliviaSIT/To-do-list | 8038ac33512b49aa0dff6823cd90b9e467fe39e9 | 4d5e87ec528448a90f8c35b69a409678788a93b4 | refs/heads/master | 2023-04-28T06:10:27.213450 | 2021-05-25T05:11:26 | 2021-05-25T05:11:26 | 367,799,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 213 | java | package com.Jiabin.TodoList;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class TodoListApplicationTests {
@Test
void contextLoads() {
}
}
| [
"olivia.lee8321@gmail.com"
] | olivia.lee8321@gmail.com |
8bb62298d65925b52e10a6ea8892797ff440bf25 | a3287912b2aac3f5f1757f5c2a366fcee96a9e38 | /ProjectEuler/src/Problem27.java | a6c0ff09f2e941300aadcb2c3e1f6480b328a62d | [
"MIT"
] | permissive | mwahba/euler | 5d8e910dc7e3eb16392002981f1ea9a3b73226fe | 8fa9b4157211d5f1b4538765c76dd25a856b0420 | refs/heads/master | 2020-04-03T05:18:42.105759 | 2015-12-01T23:01:00 | 2015-12-01T23:01:00 | 31,556,282 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,284 | java |
public class Problem27 {
public static boolean isPrime(long n) {
if (n <= 3) {
return n > 1;
} else if (n % 2 == 0 || n % 3 == 0) {
return false;
} else {
double sqrtN = Math.floor(Math.sqrt(n));
for (int i = 5; i <= sqrtN; i += 6) {
if (n % i == 0 || n % (i + 2) == 0) {
return false;
}
}
return true;
}
}
public static int getNumPrimes (int a, int b) {
int numPrimes = 0;
for (int i = 0; i < 1000; i++) {
long numInQuestion = (i * i) + (i * a) + b;
if (isPrime(numInQuestion)) {
numPrimes++;
} else {
return numPrimes;
}
}
return numPrimes;
}
/**
* @param args
*/
public static void main(String[] args) {
int maxA = -999, maxB = -999, maxNumPrimes = 0;
for (int a = -999; a < 1000; a++) {
for (int b = -999; b < 1000; b++) {
int currentNumPrimes = getNumPrimes(a, b);
if (currentNumPrimes > maxNumPrimes) {
maxA = a;
maxB = b;
maxNumPrimes = currentNumPrimes;
}
}
if (a % 100 == 0) {
System.out.println(a);
}
}
System.out.println("Max num primes: " + maxNumPrimes + ", a: " + maxA + ", b: " + maxB);
}
}
| [
"markwahba@gmail.com"
] | markwahba@gmail.com |
6aca49f878896b013532f8d9e45d084f03232641 | f69c50ad4eaf5315c7e19eaa1299537dadd69425 | /src/MaxFibonacciHeap.java | 195cc5e49056d2f740bfa0c10b481bd734833321 | [] | no_license | Harikabukkap/PriorityBasedRetrievalSystem | 3b916c2c00cb2a4898a1f4ea8498cebb6a0182eb | 957823e56be4a7b3b84a3b7c044c49fb549897be | refs/heads/master | 2021-01-21T06:21:03.432230 | 2017-02-23T00:00:19 | 2017-02-23T00:00:19 | 82,864,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,702 | java | /*
* MaxFibonacciHeap Class
*/
import java.util.ArrayList;
import java.util.List;
public class MaxFibonacciHeap {
/**********VARIABLES**********/
// Declare a node to store the maximum key value of MaxFibonacciHeap
Node maxNode;
// Declare the size of MaxFibonacciHeap
int size;
/**********METHODS**********/
/*
Method: MaxFibonacciHeap(constructor)
Parm: None
Description: MaxFibonacciHeap class constructor which initializes the class variables
Return value: None
*/
public MaxFibonacciHeap() {
// Initialize the maxNode and size of MaxFibonacciHeap
maxNode = null;
size = 0;
}
/*
Method: max
Parm: None
Description: Returns the maxNode of MaxFibonacciHeap.
Return value: The maxNode of MaxFibonacciHeap.
*/
public Node max() {
if (maxNode != null)
return maxNode;
else
return null;
}
/*
Method: insert
Parm: String tag & int key
Description: Inserts new node with passed hashtag and frequency key values and melds it with existing list of roots.
Return value: The newly created node.
*/
public Node insert(String tag, int key){
// Create new node with passed hashtag and frequency key values
Node node = new Node(key, tag);
//Meld the node into the existing list of roots and update the maxNode
maxNode = meld(maxNode, node);
// Increment the size of MaxFibonacciHeap
size++;
// Return the newly created node
return node;
}
/*
Method: removeMax
Parm: None
Description: Removes maxNode and melds its children with existing list of roots followed by pairwiseCombine of trees with equal degree.
Return value: The removed maxNode.
*/
public Node removeMax(){
// Save the maxNode being removed to return later
Node maxNodeOld = maxNode;
// Proceed if maxNode is non null
if (maxNode != null) {
// Detach the maxNode from the existing list of roots by setting pointers from its prev to its next.
maxNode.prev.next = maxNode.next;
maxNode.next.prev = maxNode.prev;
// Save the next node of maxNode
Node maxNext = null;
if (maxNode.next == maxNode)
maxNext = null;
else maxNext = maxNode.next;
//Set the prev and next of maxNode to refer itself
maxNode.prev = maxNode.next = maxNode;
// Decrement the size of MaxFibonacciHeap
size--;
// Update the parent node of all maxNode children to null
if (maxNode.child != null) {
maxNode.child.parent = null;
for(Node iter = maxNode.child.next; iter != maxNode.child; iter = iter.next) {
iter.parent = null;
}
}
// Meld the child of the removed maxNode with its previously saved next node and update maxNode
maxNode = meld(maxNext, maxNode.child);
// Pairwise combine node trees of equal degree if maxNode is not the only node in MaxFibonacciHeap
if (maxNode != null) {
pairwiseCombine();
}
}
// Return the saved removed maxNode
return maxNodeOld;
}
/*
Method: increaseKey
Parm: Node node & int newKey
Description: Increases the key value of the passed node to newKey value. It also cuts the node if node.key >
node.parent.key followed up cascadingCut on heap.
Return value: None
Throws: New key is smaller than old key if newKey < node.key.
*/
public void increaseKey(Node node, int newKey) {
// Throw exception if newKey < node.key
if (newKey < node.key) {
throw new IllegalArgumentException("New key is smaller than old key.");
}
// Set the key value of the node to the newKey value passed.
node.key = newKey;
// Cut the node from its parent and siblings if node.key > node.parent.key, follow up by cascadingCut
if (node.parent != null && node.compare(node.parent) > 0) {
// Obtain the parent of node
Node parent = node.parent;
// Cut the node
cut(node,parent);
// Perform cascadingCut on the path from node's parent till root
cascadingCut(parent);
}
// Update the maxNode
if (node.compare(maxNode) > 0)
maxNode = node;
}
/*
Method: meld
Parm: Node first node & Node second
Description: Melds the first and second nodes into the MaxFibonacciHeap.
Return value: The maximum node of the two passed nodes.
*/
public Node meld(Node first, Node second){
// If both nodes are non null
if (first != null && second != null) {
// Meld the nodes
Node temp = first.next;
first.next = second.next;
first.next.prev = first;
second.next = temp;
second.next.prev = second;
// Return the maximum of the two nodes
if (first.compare(second) < 0)
return second;
else if (first.compare(second) > 0)
return first;
else return first;
}
// Else if first node is null, return second
else if (first == null) {
return second;
}
// Else if second is null, return first
else if (second == null) {
return first;
}
// Else both are null, return null
else return null;
}
/*
Method: cascadingCut
Parm: None
Description: cascadingCut operation peformed on MaxFibonacciHeap beginning from parent of node cut away til the root
where if childCut value of node is true it is cut away from its parent else its childCut value is changed to true.
Return value: None
*/
public void cascadingCut(Node node){
// Save the node's parent
Node parent = node.parent;
// If node's parent is not null
if (parent != null) {
// If the childCut value of node is false, set it to true
if ( node.childCut == false )
node.childCut = true;
// Else, cut the node
else {
cut(node,parent);
cascadingCut(parent);
}
}
}
/*
Method: cut
Parm: Node node & Node parent
Description: Cut the passed node from its parent and meld it with existing list of roots.
Return value: None
*/
public void cut(Node node, Node parent){
// Detach the node by setting pointers between its prev node and its next node
node.prev.next = node.next;
node.next.prev = node.prev;
// Save its next node
Node nextNode = node.next;
// Make next and prev of the node to point to itself
node.next = node;
node.prev = node;
// Decrement the detached node's parent degree
parent.degree--;
// Set the child of detached node's parent to its sibling or null
if (parent.child == node){
if (nextNode != node)
parent.child = nextNode;
else parent.child = null;
}
// Set the node's parent to null
node.parent = null;
// Meld the node with the existing list of roots
maxNode = meld(maxNode,node);
// Set the childCut value of detached node to false
node.childCut = false;
}
/*
Method: pairwiseCombine
Parm: None
Description: Combines trees of equal degree considering two at a time and updates the maxNode at the end
by examining the trees from the treeTable.
Return value: None
*/
public void pairwiseCombine() {
// ArrayList to keep track of already encountered nodes and their degree
List<Node> treeTable = new ArrayList<Node>();
// ArrayList to store the list of roots of MaxFibonacciHeap for traversal
List<Node> mergeList = new ArrayList<Node>();
// Add the current list of roots to mergeList for traversal
Node curr = maxNode;
do {
mergeList.add(curr);
curr = curr.next;
} while(maxNode != curr);
// Traverse mergeList and perform the pairwisecombine of trees of equal degree
for (Node iter : mergeList) {
// Expand the treeTable to accomodate the entry for iter.degree
while (iter.degree >= treeTable.size()) {
treeTable.add(null);
}
// Keep merging until a tree of equal degree exists
while (treeTable.get(iter.degree) != null) {
// If an equal degree tree exists for encountered node, retrieve its entry from treeTable
Node other = treeTable.get(iter.degree);
// Clear the treeTable entry after retrieval
treeTable.set(iter.degree, null);
// Determine the maximum and minimum list root nodes
Node max,min;
if (iter.compare(other) > 0) {
max = iter;
min = other;
}
else {
max = other;
min = iter;
}
// Detach the min out of list of roots and meld it into max's children list
min.next.prev = min.prev;
min.prev.next = min.next;
// Make min node singleton
min.next = min.prev = min;
// Meld the max's child and min and set the maximum of the two as max's child node
max.child = meld(max.child, min);
// Set max as parent of min
min.parent = max;
// Reset the childCut value of min to false after it got its new parent
min.childCut = false;
// Increment max node's degree
max.degree++;
// Continue combining the max tree
iter = max;
// Expand the treeTable to accomodate the entry for iter.degree
while (iter.degree >= treeTable.size()) {
treeTable.add(null);
}
}
// If an equal degree match is not found, make an entry for iter in treeTable at iter.degree slot
if (treeTable.get(iter.degree) == null)
treeTable.set(iter.degree, iter);
}
// Update maxNode by melding and examining the remaining list of roots in treeTable
maxNode = null;
for (Node n: treeTable) {
if (n!=null) {
// Make the prev and next of node to refer itself before melding with current maxNode
n.next = n;
n.prev = n;
maxNode = meld(maxNode, n);
}
}
}
/*
Method: reinsertMaxNodes
Parm: List<Node> list
Description: Reinserts the nodes in the passed list into the existing list of roots of MaxFibonacciHeap.
Return value: None
*/
public void reinsertMaxNodes(List<Node> list) {
// Iterate through the passed list and meld each node into the existing list of roots
for(Node iter: list) {
// Set the child, parent to null and degree to zero for encountered node
iter.child = null;
iter.parent = null;
iter.degree = 0;
// Meld the encountered node with existing list of roots and update maxNode
maxNode = meld(maxNode, iter);
}
// Clear the list after processing
list.clear();
}
}
| [
"harikasharma93@gmail.com"
] | harikasharma93@gmail.com |
7ccab6573ee4e27d66a2a8dac4f5b8dec1df581a | c5050c5aa2b92dce25f991fbfd210602f009ca7b | /cloud2020/cloud-config-center-3344/src/main/java/com/yipeng/liu/MainAppConfigCenter3344.java | f2215207406a59b75b148a61089b0a3efff3fff0 | [] | no_license | liuyipenggit/springcloud | f9c2d920158bfc764f092c8a2729a780e20f8458 | 1f26e65341c9a0fb6301539d8b646b1b8176e764 | refs/heads/master | 2023-01-02T08:47:25.873906 | 2020-10-24T14:08:55 | 2020-10-24T14:08:55 | 306,924,989 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package com.yipeng.liu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@SpringBootApplication
@EnableConfigServer
public class MainAppConfigCenter3344 {
public static void main(String[] args) {
SpringApplication.run(MainAppConfigCenter3344.class, args);
}
}
| [
"1070547118@qq.com"
] | 1070547118@qq.com |
3282434fffe357bbc0ed330832617be25f1aa197 | 57701cf67ec9ba4a254ecd951df811549fc9dfeb | /javase11/src/main/java/db/PgDAOImpl.java | 9b8a5d1c1de2e5a3601203e45018ebe9741b5003 | [] | no_license | Alexxand/java-course-ee | ba57648db38d1c45ab92964ec6b4d14543040e0d | cfaf4b43330ce94c05c4b84cdae9fbc859ef6f65 | refs/heads/master | 2021-01-12T03:01:57.626086 | 2017-01-23T14:33:04 | 2017-01-23T14:33:04 | 78,150,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,942 | java | package db;
import com.google.inject.Inject;
import model.Gun;
import javax.sql.DataSource;
import java.io.InputStream;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import model.Gun.GunBuilder;
import org.postgresql.jdbc2.optional.PoolingDataSource;
public class PgDAOImpl extends DAO {
/*public PgDAOImpl(){
super(new PoolingDataSource());
}*/
@Inject
public PgDAOImpl(DataSource dataSource){
super(dataSource);
}
@Override
public boolean add(String name, double caliber, double rate, InputStream image, long imageSize) {
try (Connection connection = dataSource.getConnection()){
PreparedStatement statement = connection.prepareStatement("INSERT INTO guns(name,caliber,rate,image) VALUES(?,?,?,?)");
statement.setString(1,name);
statement.setDouble(2,caliber);
statement.setDouble(3,rate);
statement.setBinaryStream(4,image,(int)imageSize);
return statement.executeUpdate() != 0;
} catch (SQLException e){
e.printStackTrace();
}
return false;
}
private Gun buildGun(ResultSet resultSet) throws SQLException{
GunBuilder builder = Gun.builder();
builder.id(resultSet.getInt("id"));
builder.name(resultSet.getString("name"));
builder.caliber(resultSet.getDouble("caliber"));
builder.rate(resultSet.getDouble("rate"));
builder.image(resultSet.getBinaryStream("image"));
return builder.build();
}
private List<Gun> toList(ResultSet resultSet) throws SQLException{
List<Gun> gunList = new ArrayList<>();
while (resultSet.next()) {
gunList.add(buildGun(resultSet));
}
return gunList;
}
@Override
public List<Gun> getRange(int first, int last) {
try (Connection connection = dataSource.getConnection()){
PreparedStatement statement = connection.prepareStatement("SELECT id, name, caliber, rate, image FROM guns ORDER BY id LIMIT ? OFFSET ?");
statement.setInt(1,last - first + 1);
statement.setInt(2,first - 1);
ResultSet resultSet = statement.executeQuery();
return toList(resultSet);
} catch (SQLException e){
e.printStackTrace();
}
return null;
}
@Override
public List<Gun> getByPartOfName(String partOfName) {
try (Connection connection = dataSource.getConnection()){
PreparedStatement statement = connection.prepareStatement("SELECT id, name, caliber, rate, image FROM guns WHERE name LIKE ?");
statement.setString(1,"%" + partOfName + "%");
ResultSet resultSet = statement.executeQuery();
return toList(resultSet);
} catch (SQLException e){
e.printStackTrace();
}
return null;
}
@Override
public Gun getById(int id) {
try (Connection connection = dataSource.getConnection()){
PreparedStatement statement = connection.prepareStatement("SELECT id, name, caliber, rate, image FROM guns WHERE id = ?");
statement.setInt(1,id);
ResultSet resultSet = statement.executeQuery();
if (resultSet.next())
return buildGun(resultSet);
return null;
} catch (SQLException e){
e.printStackTrace();
}
return null;
}
@Override
public boolean delete(int id) {
return deleteAll(Collections.singletonList(id));
}
@Override
public boolean deleteAll(List<Integer> ids) {
try (Connection connection = dataSource.getConnection()){
StringBuilder queryStringBuilder = new StringBuilder("DELETE FROM guns WHERE id IN (");
int nIds = ids.size();
for(int i = 0; i < nIds - 1; ++i){
queryStringBuilder.append("?,");
}
queryStringBuilder.append("?)");
String queryString = queryStringBuilder.toString();
PreparedStatement statement = connection.prepareStatement(queryString);
for (int i = 0; i < nIds; ++i) {
statement.setInt(i + 1, ids.get(i));
}
return statement.executeUpdate() == nIds;
} catch (SQLException e){
e.printStackTrace();
}
return false;
}
@Override
public long getRawsNumber(){
try (Connection connection = dataSource.getConnection()){
Statement statement = connection.createStatement();
ResultSet resultSet =statement.executeQuery("SELECT COUNT(*) FROM guns");
if (resultSet.next())
return resultSet.getLong(1);
else
return -1;
} catch (SQLException e){
e.printStackTrace();
}
return -1;
}
}
| [
"alexmich@yandex.ru"
] | alexmich@yandex.ru |
cc1a70558e12dc1d270ba1ece5b86744421a69f6 | a290d41a2c34ee46603f69f9baa9f6fed8b26e16 | /src/test/java/produtos/apps/unitario/objetos/AppsSolicitarAvaliacao.java | 8f4f32d268529a040aa798e9d4cf581441f09bf6 | [] | no_license | felipe-amorim/auto_avaliar | 02417943bca807b6200407f5f43bc001ec9b339d | cbff22e7c6d6d64a9fd56aeb6c60aa7d34273fc6 | refs/heads/master | 2022-10-02T18:15:47.884303 | 2020-05-19T23:03:49 | 2020-05-19T23:03:49 | 246,102,949 | 1 | 0 | null | 2022-09-08T01:08:56 | 2020-03-09T17:44:32 | Gherkin | UTF-8 | Java | false | false | 9,831 | java | package produtos.apps.unitario.objetos;
import java.util.LinkedHashMap;
public class AppsSolicitarAvaliacao {
public static String appsSolicitarAvaliacaoTitle = "//div[contains(text(), \"Solicitar avaliação\")]";
public static String appsTipoAvaliacaoCombobox = "//select[@ng-model=\"ctrl.valuation.valuation_type_id\"]";
public static String appsAvaliadorResponsavelCombobox = "//select[@ng-model=\"ctrl.valuation.valuer_id\"]";
public static String appsNomeDoClienteInput = "//input[@ng-model=\"ctrl.valuation.name\"]";
public static String appsAnoDeInteresseInput = "//input[@ng-model=\"ctrl.interest.year\"]";
public static String appsCelularInput = "//input[@ng-model=\"ctrl.valuation.cell_phone\"]";
public static String appsPlacaInput = "//input[@ng-model=\"ctrl.valuation.plate\"]";
public static String appsSolicitarButton = "//button[@ng-click=\"ctrl.solicita()\"]";
public static String appsBuscarPlacaButton = "//button[@ng-click=\"ctrl.getPlateData()\"]";
public static String appsVeiculoInput = "//av-search-filter[@label=\"Veículo\"][contains(@controller, \"oraculo/versions/listAll\")]//input[@placeholder=\"Todos\"]";
public static String appsPrimeiroVeiculoLi = "//av-search-filter[@label=\"Veículo\"][contains(@controller, \"oraculo/versions/listAll\")]//li/a";
public static String appsObrigatoriedadeTipoDeAvaliacaoText = "//div[text()=\"É necessário selecionar um TIPO DE AVALIAÇÃO!\"]";
public static String appsObrigatoriedadeAvaliadorResponsavelText = "//div[text()=\"É necessário selecionar um AVALIADOR RESPONSÁVEL!\"]";
public static String appsObrigatoriedadeNomeText = "//div[text()=\"É necessário digitar uma valor para: NOME!\"]";
public static String appsObrigatoriedadeCelularText = "//div[text()=\"É necessário digitar uma valor para: CELULAR!\"]";
public static String appsObrigatoriedadePlacaText = "//div[text()=\"É necessário digitar uma valor para: PLACA!\"]";
public static String appsPlacaInvalidaText = "//div[text()=\"Por favor informe uma PLACA válida!\"]";
public static String appsSolicitarAvaliacoSolicitarButton = "//button[@class=\"btn btn-success m-sm text-uppercase ng-binding\"]";
public static String appsSolicitarAvaliacaoRenavamInput = "//input[@ng-model=\"ctrl.valuation.renavam\"]";
public static String appsSolicitarAvaliacaoChaveReservaSelect = "//label[contains(.,\"O veículo possui chave reserva?\")]/following-sibling::select[@class]";
public static String appsSolicitarAvaliacaoManualSelect = "//label[contains(.,\"Tem manual?\")]/following-sibling::select[@class]";
public static String appsSolicitarAvaliacaoSolicitaButton = "//button[@ng-click=\"ctrl.solicita()\"]";
public static String appsPlacaNaoEncontradaText = "//div[text()=\"Placa não encontrada!\"]";
public static String appsSolicitarAvaliacaoCPFInput = "//div[@class=\"row mt-sm\"]//div[@class=\"col-lg-4 col-sm-4 mb-lg\"]//input[@class=\"form-control ng-pristine ng-untouched ng-valid ng-empty ng-valid-cpf ng-valid-cnpj\"]";
public static String appsSolicitarAvaliacaoExpectativaDoClienteInput = "//input[@ng-model=\"ctrl.valuation.expected_value\"]";
public static String appsSolicitarAvaliacaoOpenFieldObsButton = "//i[@class=\"fa fa-arrow-down\"]";
public static String appsSolicitarAvaliacaoTextObsInput = "//textarea[@class=\"form-control note-editor ng-pristine ng-untouched ng-valid ng-empty\"]";
public static String appsSolicitarAvaliacaoNumeroTelefoneInput = "//input[@class=\"form-control phone_mask\"]";
public static String appsSolicitarAvaliacaoEmailClienteInput = "//input[@ng-model=\"ctrl.valuation.email\"]";
public static String appsSolicitarAvaliacaoAndretaCPFInput = "//div[@ng-show=\"ctrl.$api.showFields.cpf_cnpj && !($root.configKeyExists('dataprovider:use:bci'))\"]//input";
public static String appsSolicitarAvaliacaoEmailInput = "//input[@type=\"mail\"]";
public static String appsSolicitarAvaliacaoTelefoneInput = "//input[@class=\"form-control phone_mask\"]";
public static String appsSolicitarAvaliacaoRenavamAndretaInput = "//div[@ng-show=\"ctrl.$api.showFields.renavam\"]//input";
public static String appsSolicitarAvaliacaoAbrirObservacoesButton = "//button[@class=\"btn btn-xs btn-default\"]";
public static String appsSolicitarAvaliacaoAreaObservacoesText = "//textarea[@class=\"form-control note-editor ng-pristine ng-untouched ng-valid ng-empty\"]";
public static String appsSolicitarAvaliacaoPossuiManualDoVeiculoCombobox = "//label[text()=\"Possui manual do veículo?\"]/../select";
public static String appsSolicitarAvaliacaoVeiculoPossuiGarantiaCombobox = "//label[text()=\"Veículo possui garantia?\"]/../select";
public static String appsSolicitarAvaliacaoRevisoesCombobox = "//label[text()=\"5 - Todas as revisões feitas em concessionárias?\"]/../select";
public static String appsSolicitarAvaliacaoForamEfetuadasRevisoesCombobox = "//label[text()=\"Foram efetuadas revisões?\"]/../select";
public static String appsSolicitarAvaliacaoManualDoProprietarioCombobox = "//label[text()=\"O veículo possui manual do proprietário?\"]/../select";
public static String appsSolicitarAvaliacaoLivreteCombobox = "//label[text()=\"Livrete\"]/../select";
public static String appsSolicitarAvaliacaoVeiculoEmGarantiaDeFabricaCombobox = "//label[text()=\"Veículo esta em garantia de fabrica?\"]/../select";
public static String appsResultadoMarcaButton = "//a[@title=\"FERRARI\"]";
public static String appsResultadoModeloButton = "//a[@title=\"UNO\"]";
public static String appsResultadoVersaoButton = "//a[@title=\"CHERY QQ 1.0 MPFI 12V GASOLINA 4P MANUAL (2011)\"]";
public static LinkedHashMap<String, String> appsSolicitarAvaliacao = createData();
private static LinkedHashMap<String, String> createData() {
LinkedHashMap<String, String> ret = new LinkedHashMap<>();
ret.put(appsSolicitarAvaliacaoTitle, "Titulo solicitar avaliação");
ret.put(appsTipoAvaliacaoCombobox, "Combobox tipo avaliação");
ret.put(appsAvaliadorResponsavelCombobox, "Combobox avaliador responsável");
ret.put(appsNomeDoClienteInput, "Nome do cliente");
ret.put(appsAnoDeInteresseInput, "Ano de interesse");
ret.put(appsVeiculoInput, "Veiculo");
ret.put(appsPrimeiroVeiculoLi, "Primeiro veiculo");
ret.put(appsBuscarPlacaButton, "Buscar placa");
ret.put(appsCelularInput, "Celular");
ret.put(appsPlacaInput, "Placa");
ret.put(appsSolicitarButton, "Solicitar");
ret.put(appsObrigatoriedadeTipoDeAvaliacaoText, "Mensagem de obrigatoriedade do campo tipo de avaliação");
ret.put(appsObrigatoriedadeAvaliadorResponsavelText, "Mensagem de obrigatoriedade do campo avaliador responsável");
ret.put(appsObrigatoriedadeNomeText, "Mensagem de obrigatoriedade do campo nome");
ret.put(appsObrigatoriedadeCelularText, "Mensagem de obrigatoriedade do campo celular");
ret.put(appsObrigatoriedadePlacaText, "Mensagem de obrigatoriedade do campo placa");
ret.put(appsPlacaInvalidaText, "Mensagem de placa inválida");
ret.put(appsSolicitarAvaliacoSolicitarButton, "Botaão solicitar, para finalizar solicitacao de avaliação");
ret.put(appsSolicitarAvaliacaoChaveReservaSelect, "Chave Reserva SIM");
ret.put(appsSolicitarAvaliacaoManualSelect, "Manual SIM");
ret.put(appsSolicitarAvaliacaoSolicitaButton, "Solicita");
ret.put(appsPlacaNaoEncontradaText, "Mensagem de placa não encontrada");
ret.put(appsSolicitarAvaliacaoCPFInput, "Input cpf para solicitar avaliação");
ret.put(appsSolicitarAvaliacaoRenavamInput, "Input renavan para solicitar avaliação");
ret.put(appsSolicitarAvaliacaoExpectativaDoClienteInput, "Input expectativa de preco do cliente para avaliação");
ret.put(appsSolicitarAvaliacaoOpenFieldObsButton, "Botão para abrir o campo observações");
ret.put(appsSolicitarAvaliacaoTextObsInput, "Text area observações");
ret.put(appsSolicitarAvaliacaoNumeroTelefoneInput, "Input numero de telefone");
ret.put(appsSolicitarAvaliacaoEmailClienteInput, "Input e-mail cliente");
ret.put(appsSolicitarAvaliacaoAndretaCPFInput, "Input cpf para solciitar avaliacao");
ret.put(appsSolicitarAvaliacaoTelefoneInput, "Input telefone para solciitar avaliacao");
ret.put(appsSolicitarAvaliacaoRenavamAndretaInput, "Input renavam para solciitar avaliacao");
ret.put(appsSolicitarAvaliacaoAbrirObservacoesButton, "Button abrir campo observacoes");
ret.put(appsSolicitarAvaliacaoAreaObservacoesText, "Text area observacoes");
ret.put(appsSolicitarAvaliacaoPossuiManualDoVeiculoCombobox, "Combobox possui manual do veiculo");
ret.put(appsSolicitarAvaliacaoVeiculoPossuiGarantiaCombobox, "Combobox veiculo possui garantia");
ret.put(appsSolicitarAvaliacaoRevisoesCombobox, "Combobox todas as revisoes foram feitas em concessionarias");
ret.put(appsSolicitarAvaliacaoManualDoProprietarioCombobox, "Combobox o veiculo possui manual do proprietario");
ret.put(appsSolicitarAvaliacaoEmailInput, "Input email");
ret.put(appsSolicitarAvaliacaoForamEfetuadasRevisoesCombobox, "Combobox pergunta foram efetuadas revisoes?");
ret.put(appsSolicitarAvaliacaoLivreteCombobox, "Combobox livrete");
ret.put(appsSolicitarAvaliacaoVeiculoEmGarantiaDeFabricaCombobox, "Combobox este veiculo esta em garantia de fabrica ?");
ret.put(appsResultadoMarcaButton, "FERRARI");
ret.put(appsResultadoModeloButton, "UNO");
ret.put(appsResultadoVersaoButton, "CHERY QQ 1.0 MPFI 12V GASOLINA 4P MANUAL (2011)");
return ret;
}
}
| [
"felipe.murin@gmail.com"
] | felipe.murin@gmail.com |
57e6abbddb6abf88420ec642ed3609565c94b741 | 9abdc373ba11f11593a1db5bae4011348995a677 | /src/main/java/com/codeup/adlister/dao/Categories.java | 41c6fb9226ab10aa98b92d6c3830d884293b8bea | [] | no_license | petlister/petlister | e293fda5412acb77ea41b3428084972113997e80 | 2d04fbabaee86036184c207248b0b115b2dfb2e7 | refs/heads/master | 2022-07-10T07:44:36.550393 | 2020-01-24T20:57:07 | 2020-01-24T20:57:07 | 234,577,864 | 0 | 0 | null | 2022-06-21T02:39:44 | 2020-01-17T15:33:30 | Java | UTF-8 | Java | false | false | 313 | java | package com.codeup.adlister.dao;
import com.codeup.adlister.models.Ad;
import com.codeup.adlister.models.Category;
import java.util.List;
public interface Categories {
List<Category> all();
List<String> findCategory(long id);
void insert(long id, Ad ad);
void deleteCategories(long id);
}
| [
"briggs.l.alyssa@gmail.com"
] | briggs.l.alyssa@gmail.com |
f194aebd6fcf7e20501f6d507c3327e047cbbcbd | 266f3d399572e86cfc6052365bce4542c87d6394 | /src/main/java/edu/uclm/esi/games2020/model/Game.java | 87f6a2a099c4703357530b315f87e58f389bcfd4 | [] | no_license | danigcj31/DisSW | c38d8ac5d3588d06fa788a1ee60082229d61665c | 2a05dd7319fd6db956fb37031b55c3d8c798f3b7 | refs/heads/master | 2023-04-29T10:41:43.433297 | 2020-05-07T14:20:26 | 2020-05-07T14:20:26 | 243,035,297 | 0 | 0 | null | 2023-04-14T17:33:02 | 2020-02-25T15:33:58 | Java | UTF-8 | Java | false | false | 1,009 | java | package edu.uclm.esi.games2020.model;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
public abstract class Game {
protected int requiredPlayers;
protected Queue<Match> pendingMatches;
protected ConcurrentHashMap<String, Match> inPlayMatches;
public Game(int requiredPlayers) {
this.requiredPlayers = requiredPlayers;
this.pendingMatches = new LinkedBlockingQueue<>();
this.inPlayMatches = new ConcurrentHashMap<>();
}
public abstract String getName();
public Match joinToMatch(User user) {
Match match = this.pendingMatches.peek();
if (match==null) {
match = buildMatch();
match.setGame(this);
match.addPlayer(user);
this.pendingMatches.add(match);
} else {
match.addPlayer(user);
if (match.getPlayers().size() == this.requiredPlayers) {
this.pendingMatches.poll();
this.inPlayMatches.put(match.getId(), match);
}
}
return match;
}
protected abstract Match buildMatch();
}
| [
"macario.polo@uclm.es"
] | macario.polo@uclm.es |
284455f383a5eb10df4807b6fc74ce4a7dc38571 | 6aa4604ec0cbffb9c02b5b911e57f38547177b19 | /NewCBS/src/bcel/cardcenter/cbs/varofat/service/VisaAtmUtility.java | 741e253d41c32a1e00b79c837ef191082d421e59 | [] | no_license | i0712326/NewCBS | bab41d3849a04283c7ee008ba8d6b59a8c34accf | e7001597b4e3d38f0e3e4557fbf67e51380387bf | refs/heads/master | 2021-01-10T10:12:35.697587 | 2015-10-30T09:41:11 | 2015-10-30T09:41:11 | 45,241,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package bcel.cardcenter.cbs.varofat.service;
import java.sql.Date;
import java.util.List;
import bcel.cardcenter.cbs.varofat.entity.VisaSettle;
public interface VisaAtmUtility {
public List<VisaSettle> getVisaAtm(Date date, String type, String ref, String card,int page,int rowNum);
public int recordCount(Date date, String type, String ref, String card);
public int updateVisaAtm(String xmlData);
}
| [
"i0712326@gmail.com"
] | i0712326@gmail.com |
cf099b5cf8028def12eda37e59296e26e5db3ed8 | 8ead40b70a424e9b46be4ac721a15b97e537634e | /src/main/java/jacob/su/edu/dao/TeacherDao.java | b950b79c0fbc003b874462833ed96eaa5bc43e9e | [] | no_license | accident5566/EduWebApp | 82dc6a138fcad0d099d0c59234ad6da976f0fd2c | f8ce8fff11a6405b60066b1b5efe2451ed2832d5 | refs/heads/master | 2021-01-10T14:46:39.348313 | 2016-02-09T16:18:13 | 2016-02-09T16:18:13 | 51,378,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 240 | java | package jacob.su.edu.dao;
import java.util.List;
import jacob.su.edu.domain.Teacher;
/**
* <p>TODO</p>
*
* @author <a href="mailto:ysu2@cisco.com">Yu Su</a>
* @version 1.0
*/
public interface TeacherDao extends BaseDao<Teacher> {
}
| [
"649148025@qq.com"
] | 649148025@qq.com |
65f6b9fe4e2aa00ed443c7abb6fbd9aaac32ae12 | 1ce45d6046c2cb37740c2cc65c1d42f2e9bd97b2 | /src/chap14/textbook/s140503/FunctionExample2.java | 05a95463650e8fa67f733a7395f704c1dd596327 | [] | no_license | hyelee-jo/java20200929 | 52f9c06078586abaa79179ed18df6834513897d0 | e4b29bd0b51e07e6ee6e014bd52a497f84dad354 | refs/heads/master | 2023-02-20T19:11:46.953681 | 2021-01-15T03:29:24 | 2021-01-15T03:29:24 | 299,485,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package chap14.textbook.s140503;
import java.util.Arrays;
import java.util.List;
import java.util.function.ToIntFunction;
public class FunctionExample2 {
private static List<Student> list = Arrays.asList(
new Student("홍길동", 90, 96),
new Student("신용권", 95, 93)
);
public static double avg(ToIntFunction<Student> function) {
int sum = 0;
for(Student student : list) {
sum += function.applyAsInt(student);
}
double avg = (double) sum / list.size();
return avg;
}
public static void main(String[] args) {
double englishAvg = avg(s -> s.getEnglishScore());
System.out.println("영어 평균 점수: " + englishAvg);
double mathAvg = avg(s -> s.getMathScore());
System.out.println("수학 평균 점수: " + mathAvg );
}
}
| [
"harbor_@naver.com"
] | harbor_@naver.com |
67de6199531a90ffdbfaf4c2ddc8e4e1e3ece0d1 | 44b5876d7aec315113c7860b5a26e6bcb189475c | /app/src/main/java/com/example/administrator/onetotwo/main/constant/Constant.java | 5c35c72ae0eea8981f1bc9a6c2132767a5174f96 | [] | no_license | Betterforme/OneToTow | 6247e8ffe9a19bacd1c7aa36606e8b4f026eea1e | 464573f557dc0739830da452f7e42b1db3340772 | refs/heads/master | 2021-01-19T00:00:23.521501 | 2017-03-29T03:07:49 | 2017-03-29T03:07:49 | 72,832,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.example.administrator.onetotwo.main.constant;
/**
* by y on 2016/4/28.
*/
public class Constant {
public static final int RECYCLERVIEW_LINEAR = 1;
public static final int RECYCLERVIEW_GRIDVIEW = 2;
public static final int WRITE_EXTERNAL_STORAGE_REQUEST_CODE = 0;
}
| [
"763209836@qq.com"
] | 763209836@qq.com |
25e82069c08a1c95d2a8fb43d13f7d85f11c251a | 43e3e77725b7fd6e5032c14588a183d02d7bf736 | /app/src/main/java/com/apps/home/notewidget/utils/DividerItemDecoration.java | a18eff5f4b9710b4c870721bbfec08788b530eb0 | [] | no_license | kamcio181/NoteWidgetObjEdge | b61df367c5e8f9a659b07df54358b1314cd52648 | 995816bdef01f00a73253a6c7d8f8eac5ba953a5 | refs/heads/master | 2020-12-03T17:55:39.402612 | 2017-03-05T23:07:04 | 2017-03-05T23:07:04 | 66,003,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,414 | java | package com.apps.home.notewidget.utils;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
private static final int[] ATTRS = new int[]{
android.R.attr.listDivider
};
public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
private final Drawable mDivider;
private int mOrientation;
public DividerItemDecoration(Context context, int orientation) {
final TypedArray a = context.obtainStyledAttributes(ATTRS);
mDivider = a.getDrawable(0);
a.recycle();
setOrientation(orientation);
}
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
throw new IllegalArgumentException("invalid orientation");
}
mOrientation = orientation;
}
// @Override
// public void onDraw(Canvas c, RecyclerView parent) {
// if (mOrientation == VERTICAL_LIST) {
// drawVertical(c, parent);
// } else {
// drawHorizontal(c, parent);
// }
// }
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (mOrientation == VERTICAL_LIST) {
drawVertical(c, parent);
} else {
drawHorizontal(c, parent);
}
}
public void drawVertical(Canvas c, RecyclerView parent) {
final int left = parent.getPaddingLeft();
final int right = parent.getWidth() - parent.getPaddingRight();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int top = child.getBottom() + params.bottomMargin;
final int bottom = top + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
public void drawHorizontal(Canvas c, RecyclerView parent) {
final int top = parent.getPaddingTop();
final int bottom = parent.getHeight() - parent.getPaddingBottom();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int left = child.getRight() + params.rightMargin;
final int right = left + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
// @Override
// public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {
// if (mOrientation == VERTICAL_LIST) {
// outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
// } else {
// outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
// }
// }
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
if (mOrientation == VERTICAL_LIST) {
outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
} else {
outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
}
}
}
| [
"kamcio181@o2.pl"
] | kamcio181@o2.pl |
883c01cf26191061fc91b37c04a0de9126d88a10 | a99f1eed7cf43956479368890d512818bb90ae63 | /android/support/design/widget/NavigationView.java | fdc21ee8a5afd6822f68a78b6f3c0439c8670e4e | [] | no_license | abhishekwebcode/Abhishek-Mathur-appdebug_18_source_from_JADX | f2358d5383ec9dd0dcb6b724e09f2ddacfcafaef | b0f21b70b461e623b1a53b22261b137ea28a114f | refs/heads/master | 2020-07-05T00:30:36.448394 | 2019-08-15T03:46:46 | 2019-08-15T03:46:46 | 202,469,934 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,385 | java | package android.support.design.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.ClassLoaderCreator;
import android.os.Parcelable.Creator;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.support.annotation.StyleRes;
import android.support.design.C0013R;
import android.support.design.internal.NavigationMenu;
import android.support.design.internal.NavigationMenuPresenter;
import android.support.design.internal.ScrimInsetsFrameLayout;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.AbsSavedState;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.WindowInsetsCompat;
import android.support.v7.appcompat.C0239R;
import android.support.v7.content.res.AppCompatResources;
import android.support.v7.view.SupportMenuInflater;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.view.menu.MenuBuilder.Callback;
import android.support.v7.view.menu.MenuItemImpl;
import android.support.v7.widget.TintTypedArray;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.MeasureSpec;
public class NavigationView extends ScrimInsetsFrameLayout {
private static final int[] CHECKED_STATE_SET = new int[]{16842912};
private static final int[] DISABLED_STATE_SET = new int[]{-16842910};
private static final int PRESENTER_NAVIGATION_VIEW_ID = 1;
OnNavigationItemSelectedListener mListener;
private int mMaxWidth;
private final NavigationMenu mMenu;
private MenuInflater mMenuInflater;
private final NavigationMenuPresenter mPresenter;
public interface OnNavigationItemSelectedListener {
boolean onNavigationItemSelected(@NonNull MenuItem menuItem);
}
class C03291 implements Callback {
C03291() {
}
public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {
return NavigationView.this.mListener != null && NavigationView.this.mListener.onNavigationItemSelected(item);
}
public void onMenuModeChange(MenuBuilder menu) {
}
}
public static class SavedState extends AbsSavedState {
public static final Creator<SavedState> CREATOR = new C00361();
public Bundle menuState;
static class C00361 implements ClassLoaderCreator<SavedState> {
C00361() {
}
public SavedState createFromParcel(Parcel in, ClassLoader loader) {
return new SavedState(in, loader);
}
public SavedState createFromParcel(Parcel in) {
return new SavedState(in, null);
}
public SavedState[] newArray(int size) {
return new SavedState[size];
}
}
public SavedState(Parcel in, ClassLoader loader) {
super(in, loader);
this.menuState = in.readBundle(loader);
}
public SavedState(Parcelable superState) {
super(superState);
}
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeBundle(this.menuState);
}
}
public NavigationView(Context context) {
this(context, null);
}
public NavigationView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public NavigationView(Context context, AttributeSet attrs, int defStyleAttr) {
ColorStateList itemIconTint;
super(context, attrs, defStyleAttr);
this.mPresenter = new NavigationMenuPresenter();
ThemeUtils.checkAppCompatTheme(context);
this.mMenu = new NavigationMenu(context);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, C0013R.styleable.NavigationView, defStyleAttr, C0013R.style.Widget_Design_NavigationView);
ViewCompat.setBackground(this, a.getDrawable(C0013R.styleable.NavigationView_android_background));
if (a.hasValue(C0013R.styleable.NavigationView_elevation)) {
ViewCompat.setElevation(this, (float) a.getDimensionPixelSize(C0013R.styleable.NavigationView_elevation, 0));
}
ViewCompat.setFitsSystemWindows(this, a.getBoolean(C0013R.styleable.NavigationView_android_fitsSystemWindows, false));
this.mMaxWidth = a.getDimensionPixelSize(C0013R.styleable.NavigationView_android_maxWidth, 0);
if (a.hasValue(C0013R.styleable.NavigationView_itemIconTint)) {
itemIconTint = a.getColorStateList(C0013R.styleable.NavigationView_itemIconTint);
} else {
itemIconTint = createDefaultColorStateList(16842808);
}
boolean textAppearanceSet = false;
int textAppearance = 0;
if (a.hasValue(C0013R.styleable.NavigationView_itemTextAppearance)) {
textAppearance = a.getResourceId(C0013R.styleable.NavigationView_itemTextAppearance, 0);
textAppearanceSet = true;
}
ColorStateList itemTextColor = null;
if (a.hasValue(C0013R.styleable.NavigationView_itemTextColor)) {
itemTextColor = a.getColorStateList(C0013R.styleable.NavigationView_itemTextColor);
}
if (!textAppearanceSet && itemTextColor == null) {
itemTextColor = createDefaultColorStateList(16842806);
}
Drawable itemBackground = a.getDrawable(C0013R.styleable.NavigationView_itemBackground);
this.mMenu.setCallback(new C03291());
this.mPresenter.setId(1);
this.mPresenter.initForMenu(context, this.mMenu);
this.mPresenter.setItemIconTintList(itemIconTint);
if (textAppearanceSet) {
this.mPresenter.setItemTextAppearance(textAppearance);
}
this.mPresenter.setItemTextColor(itemTextColor);
this.mPresenter.setItemBackground(itemBackground);
this.mMenu.addMenuPresenter(this.mPresenter);
addView((View) this.mPresenter.getMenuView(this));
if (a.hasValue(C0013R.styleable.NavigationView_menu)) {
inflateMenu(a.getResourceId(C0013R.styleable.NavigationView_menu, 0));
}
if (a.hasValue(C0013R.styleable.NavigationView_headerLayout)) {
inflateHeaderView(a.getResourceId(C0013R.styleable.NavigationView_headerLayout, 0));
}
a.recycle();
}
protected Parcelable onSaveInstanceState() {
SavedState state = new SavedState(super.onSaveInstanceState());
state.menuState = new Bundle();
this.mMenu.savePresenterStates(state.menuState);
return state;
}
protected void onRestoreInstanceState(Parcelable savedState) {
if (savedState instanceof SavedState) {
SavedState state = (SavedState) savedState;
super.onRestoreInstanceState(state.getSuperState());
this.mMenu.restorePresenterStates(state.menuState);
return;
}
super.onRestoreInstanceState(savedState);
}
public void setNavigationItemSelectedListener(@Nullable OnNavigationItemSelectedListener listener) {
this.mListener = listener;
}
protected void onMeasure(int widthSpec, int heightSpec) {
switch (MeasureSpec.getMode(widthSpec)) {
case Integer.MIN_VALUE:
widthSpec = MeasureSpec.makeMeasureSpec(Math.min(MeasureSpec.getSize(widthSpec), this.mMaxWidth), 1073741824);
break;
case 0:
widthSpec = MeasureSpec.makeMeasureSpec(this.mMaxWidth, 1073741824);
break;
}
super.onMeasure(widthSpec, heightSpec);
}
@RestrictTo({Scope.LIBRARY_GROUP})
protected void onInsetsChanged(WindowInsetsCompat insets) {
this.mPresenter.dispatchApplyWindowInsets(insets);
}
public void inflateMenu(int resId) {
this.mPresenter.setUpdateSuspended(true);
getMenuInflater().inflate(resId, this.mMenu);
this.mPresenter.setUpdateSuspended(false);
this.mPresenter.updateMenuView(false);
}
public Menu getMenu() {
return this.mMenu;
}
public View inflateHeaderView(@LayoutRes int res) {
return this.mPresenter.inflateHeaderView(res);
}
public void addHeaderView(@NonNull View view) {
this.mPresenter.addHeaderView(view);
}
public void removeHeaderView(@NonNull View view) {
this.mPresenter.removeHeaderView(view);
}
public int getHeaderCount() {
return this.mPresenter.getHeaderCount();
}
public View getHeaderView(int index) {
return this.mPresenter.getHeaderView(index);
}
@Nullable
public ColorStateList getItemIconTintList() {
return this.mPresenter.getItemTintList();
}
public void setItemIconTintList(@Nullable ColorStateList tint) {
this.mPresenter.setItemIconTintList(tint);
}
@Nullable
public ColorStateList getItemTextColor() {
return this.mPresenter.getItemTextColor();
}
public void setItemTextColor(@Nullable ColorStateList textColor) {
this.mPresenter.setItemTextColor(textColor);
}
@Nullable
public Drawable getItemBackground() {
return this.mPresenter.getItemBackground();
}
public void setItemBackgroundResource(@DrawableRes int resId) {
setItemBackground(ContextCompat.getDrawable(getContext(), resId));
}
public void setItemBackground(@Nullable Drawable itemBackground) {
this.mPresenter.setItemBackground(itemBackground);
}
public void setCheckedItem(@IdRes int id) {
MenuItem item = this.mMenu.findItem(id);
if (item != null) {
this.mPresenter.setCheckedItem((MenuItemImpl) item);
}
}
public void setItemTextAppearance(@StyleRes int resId) {
this.mPresenter.setItemTextAppearance(resId);
}
private MenuInflater getMenuInflater() {
if (this.mMenuInflater == null) {
this.mMenuInflater = new SupportMenuInflater(getContext());
}
return this.mMenuInflater;
}
private ColorStateList createDefaultColorStateList(int baseColorThemeAttr) {
TypedValue value = new TypedValue();
if (!getContext().getTheme().resolveAttribute(baseColorThemeAttr, value, true)) {
return null;
}
ColorStateList baseColor = AppCompatResources.getColorStateList(getContext(), value.resourceId);
if (!getContext().getTheme().resolveAttribute(C0239R.attr.colorPrimary, value, true)) {
return null;
}
int colorPrimary = value.data;
int defaultColor = baseColor.getDefaultColor();
return new ColorStateList(new int[][]{DISABLED_STATE_SET, CHECKED_STATE_SET, EMPTY_STATE_SET}, new int[]{baseColor.getColorForState(DISABLED_STATE_SET, defaultColor), colorPrimary, defaultColor});
}
}
| [
"mathur17021play@gmail.com"
] | mathur17021play@gmail.com |
fb1e5e1f9174e7e3c9f77cc0e1aa50ec07d29e59 | ceb2b104bece23b2b5296fd0352e8c449a91453b | /2021_03_29_ArrayList_LinkedList/src/telran/ArrayListLinkedListTest.java | 641dfb00ede86290a913f4c8910db35df93b3f92 | [] | no_license | GannaOvchynnykova/16M-OOP | 249cb4f1dd1947a5ab7c9b2b00e14fc248bc239f | 4943848fce69ffaa6440bdae75335ea10f33d7ba | refs/heads/main | 2023-04-05T23:06:00.304397 | 2021-05-08T11:39:45 | 2021-05-08T11:39:45 | 335,565,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,717 | java | package telran;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import static junit.framework.TestCase.*;
public class ArrayListLinkedListTest {
List<String> stringList;
String[] strArr = {"Igor", "Asya", "Galina", "Bibigul", "Feofan", "Fekla"};
@org.junit.Before
public void setUp() throws Exception {
stringList = new ArrayList<>();
stringList = new LinkedList<>();
stringList.addAll(Arrays.asList(strArr));
}
@Test
public void testAdd() {
assertEquals(strArr.length, stringList.size());
for (int i = 0; i < strArr.length; i++) {
assertEquals(strArr[i], stringList.get(i));
}
//String[] strArr = {"Igor", "Asya", "Galina", "Bibigul", "Feofan", "Fekla"};
stringList.add(0, "Kaxa");
assertEquals(strArr.length + 1, stringList.size());
assertEquals("Kaxa", stringList.get(0));
assertEquals("Igor", stringList.get(1));
//String[] strArr = {"Kaxa", "Igor", "Asya", "Galina", "Bibigul", "Feofan", "Fekla"};
stringList.add(strArr.length / 2, "Pedro");
assertEquals(strArr.length + 2, stringList.size());
assertEquals("Asya", stringList.get(2));
//String[] strArr = {"Kaxa", "Igor", "Asya", "Pedro", "Galina", "Bibigul", "Feofan", "Fekla"};
assertTrue(stringList.add("Lev"));
assertEquals(strArr.length + 3, stringList.size());
assertEquals("Lev", stringList.get(stringList.size() - 1));
assertEquals(stringList.size() - 1, stringList.indexOf("Lev"));
}
@Test
public void testRemove() {
assertEquals(strArr.length, stringList.size());
int oldSize = stringList.size();
//String[] strArr = {"Igor", "Asya", "Galina", "Bibigul", "Feofan", "Fekla"};
assertEquals("Igor", stringList.remove(0));
assertEquals(oldSize - 1, stringList.size());
assertFalse(stringList.contains("Igor"));
//String[] strArr = {"Asya", "Galina", "Bibigul", "Feofan", "Fekla"};
assertEquals("Bibigul", stringList.remove(stringList.size() / 2));
assertEquals("Galina", stringList.get(1));
assertEquals("Feofan", stringList.get(2));
assertEquals(oldSize - 2, stringList.size());
assertFalse(stringList.contains("Bibigul"));
//String[] strArr = {"Asya", "Pedro", "Galina", "Feofan", "Fekla"};
assertEquals("Fekla", stringList.remove(stringList.size() - 1));
assertEquals("Feofan", stringList.get(stringList.size() - 1));
assertEquals(oldSize - 3, stringList.size());
assertFalse(stringList.contains("Fekla"));
}
} | [
"ov4innikova.an@gmail.com"
] | ov4innikova.an@gmail.com |
f2fa36ed4c0b8eb8a1c65b46008d1a8d1a40a97c | ffecf164fc56317ca0db03727e9ff7d53bbb2f54 | /app/src/main/java/com/socks/jiandan/ui/fragment/JokeFragment.java | 17b502daaf7957833828b8d74022d7b91902485f | [
"Apache-2.0"
] | permissive | taimur97/JianDan | 333a9651c3023ff2d2a2cca04290f21f55775606 | 902e5796f1f03a8fa5fb78bac8860335df401cc9 | refs/heads/master | 2020-12-29T01:53:32.160995 | 2015-04-21T09:16:28 | 2015-04-21T09:16:28 | 34,349,884 | 1 | 0 | null | 2015-04-21T20:14:46 | 2015-04-21T20:14:46 | null | UTF-8 | Java | false | false | 13,419 | java | package com.socks.jiandan.ui.fragment;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.socks.jiandan.R;
import com.socks.jiandan.base.BaseFragment;
import com.socks.jiandan.callback.LoadFinishCallBack;
import com.socks.jiandan.constant.ToastMsg;
import com.socks.jiandan.model.Comment;
import com.socks.jiandan.model.Joke;
import com.socks.jiandan.model.Vote;
import com.socks.jiandan.net.Request4CommentCounts;
import com.socks.jiandan.net.Request4Joke;
import com.socks.jiandan.net.Request4Vote;
import com.socks.jiandan.ui.CommentListActivity;
import com.socks.jiandan.utils.ShareUtil;
import com.socks.jiandan.utils.ShowToast;
import com.socks.jiandan.utils.String2TimeUtil;
import com.socks.jiandan.view.AutoLoadRecyclerView;
import com.socks.jiandan.view.googleprogressbar.GoogleProgressBar;
import com.socks.jiandan.view.matchview.MatchTextView;
import java.util.ArrayList;
import butterknife.ButterKnife;
import butterknife.InjectView;
/**
* 段子碎片
*
* @author zhaokaiqiang
*/
public class JokeFragment extends BaseFragment {
@InjectView(R.id.recycler_view)
AutoLoadRecyclerView mRecyclerView;
@InjectView(R.id.swipeRefreshLayout)
SwipeRefreshLayout mSwipeRefreshLayout;
@InjectView(R.id.google_progress)
GoogleProgressBar google_progress;
@InjectView(R.id.tv_error)
MatchTextView tv_error;
private JokeAdapter mAdapter;
private LoadFinishCallBack mLoadFinisCallBack;
public JokeFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
mActionBar.setTitle("段子");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_joke, container, false);
ButterKnife.inject(this, view);
mRecyclerView.setHasFixedSize(false);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mLoadFinisCallBack = mRecyclerView;
mRecyclerView.setLoadMoreListener(new AutoLoadRecyclerView.onLoadMoreListener() {
@Override
public void loadMore() {
mAdapter.loadNextPage();
}
});
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mAdapter.loadFirst();
}
});
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mAdapter = new JokeAdapter();
mRecyclerView.setAdapter(mAdapter);
mAdapter.loadFirst();
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_joke, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_refresh) {
mSwipeRefreshLayout.setRefreshing(true);
mAdapter.loadFirst();
return true;
}
return false;
}
@Override
public void onActionBarClick() {
if (mRecyclerView != null && mAdapter.mJokes.size() > 0) {
mRecyclerView.scrollToPosition(0);
}
}
public class JokeAdapter extends RecyclerView.Adapter<ViewHolder> {
private int page;
private ArrayList<Joke> mJokes;
public JokeAdapter() {
mJokes = new ArrayList<Joke>();
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent,
int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_joke, parent, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final Joke joke = mJokes.get(position);
holder.tv_content.setText(joke.getComment_content());
holder.tv_author.setText(joke.getComment_author());
holder.tv_time.setText(String2TimeUtil.dateString2GoodExperienceFormat(joke.getComment_date()));
holder.tv_like.setText(joke.getVote_positive());
holder.tv_comment_count.setText(joke.getComment_counts());
//用于恢复默认的文字
holder.tv_like.setTypeface(Typeface.DEFAULT);
holder.tv_like.setTextColor(getResources().getColor(R.color
.secondary_text_default_material_light));
holder.tv_support_des.setTextColor(getResources().getColor(R.color
.secondary_text_default_material_light));
holder.tv_unlike.setText(joke.getVote_negative());
holder.tv_unlike.setTypeface(Typeface.DEFAULT);
holder.tv_unlike.setTextColor(getResources().getColor(R.color
.secondary_text_default_material_light));
holder.tv_unsupport_des.setTextColor(getResources().getColor(R.color
.secondary_text_default_material_light));
holder.img_share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new MaterialDialog.Builder(getActivity())
.items(R.array.joke_dialog)
.itemsCallback(new MaterialDialog.ListCallback() {
@Override
public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
switch (which) {
//分享
case 0:
ShareUtil.shareText(getActivity(), joke
.getComment_content().trim() + ToastMsg.SHARE_TAIL);
break;
//复制
case 1:
ClipboardManager clip = (ClipboardManager)
getActivity().getSystemService(Context
.CLIPBOARD_SERVICE);
clip.setPrimaryClip(ClipData.newPlainText
(null, joke.getComment_content()));
ShowToast.Short(ToastMsg.COPY_SUCCESS);
break;
}
}
})
.show();
}
});
holder.ll_support.setOnClickListener(new onVoteClickListener(joke.getComment_ID(),
Vote.OO, holder, joke));
holder.ll_unsupport.setOnClickListener(new onVoteClickListener(joke.getComment_ID(),
Vote.XX, holder, joke));
holder.ll_comment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), CommentListActivity.class);
intent.putExtra("thread_key", "comment-" + joke.getComment_ID());
startActivity(intent);
}
});
}
/**
* 投票监听器
*/
private class onVoteClickListener implements View.OnClickListener {
private String comment_ID;
private String tyle;
private ViewHolder holder;
private Joke joke;
public onVoteClickListener(String comment_ID, String tyle, ViewHolder holder, Joke joke) {
this.comment_ID = comment_ID;
this.tyle = tyle;
this.holder = holder;
this.joke = joke;
}
@Override
public void onClick(View v) {
//避免快速点击,造成大量网络访问
if (holder.isClickFinish) {
vote(comment_ID, tyle, holder, joke);
holder.isClickFinish = false;
}
}
}
/**
* 投票
*
* @param comment_ID
*/
public void vote(String comment_ID, String tyle, final ViewHolder holder, final Joke joke) {
String url;
if (tyle.equals(Vote.XX)) {
url = Vote.getXXUrl(comment_ID);
} else {
url = Vote.getOOUrl(comment_ID);
}
executeRequest(new Request4Vote(url, new
Response.Listener<Vote>() {
@Override
public void onResponse(Vote response) {
holder.isClickFinish = true;
String result = response.getResult();
if (result.equals(Vote.RESULT_OO_SUCCESS)) {
ShowToast.Short("顶的好舒服~");
//变红+1
int vote = Integer.valueOf(joke.getVote_positive());
joke.setVote_positive((vote + 1) + "");
holder.tv_like.setText(joke.getVote_positive());
holder.tv_like.setTypeface(Typeface.DEFAULT_BOLD);
holder.tv_like.setTextColor(getResources().getColor
(android.R.color.holo_red_light));
holder.tv_support_des.setTextColor(getResources().getColor
(android.R.color.holo_red_light));
} else if (result.equals(Vote.RESULT_XX_SUCCESS)) {
ShowToast.Short("疼...轻点插");
//变绿+1
int vote = Integer.valueOf(joke.getVote_negative());
joke.setVote_negative((vote + 1) + "");
holder.tv_unlike.setText(joke.getVote_negative());
holder.tv_unlike.setTypeface(Typeface.DEFAULT_BOLD);
holder.tv_unlike.setTextColor(getResources().getColor
(android.R.color.holo_green_light));
holder.tv_unsupport_des.setTextColor(getResources().getColor
(android.R.color.holo_green_light));
} else if (result.equals(Vote.RESULT_HAVE_VOTED)) {
ShowToast.Short("投过票了");
} else {
ShowToast.Short("卧槽,发生了什么!");
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
ShowToast.Short("神秘力量导致投票失败");
holder.isClickFinish = true;
}
}));
}
@Override
public int getItemCount() {
return mJokes.size();
}
public void loadFirst() {
page = 1;
loadData();
}
public void loadNextPage() {
page++;
loadData();
}
private void loadData() {
executeRequest(new Request4Joke(Joke.getRequestUrl(page),
new Response.Listener<ArrayList<Joke>>
() {
@Override
public void onResponse(ArrayList<Joke> response) {
getCommentCounts(response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
tv_error.setVisibility(View.VISIBLE);
google_progress.setVisibility(View.GONE);
mLoadFinisCallBack.loadFinish(null);
if (mSwipeRefreshLayout.isRefreshing()) {
mSwipeRefreshLayout.setRefreshing(false);
}
}
}));
}
//获取评论数量
private void getCommentCounts(final ArrayList<Joke> jokes) {
StringBuilder sb = new StringBuilder();
for (Joke joke : jokes) {
sb.append("comment-" + joke.getComment_ID() + ",");
}
executeRequest(new Request4CommentCounts(Comment.getCommentCountsURL(sb.toString()), new Response
.Listener<ArrayList<Comment>>() {
@Override
public void onResponse(ArrayList<Comment> response) {
google_progress.setVisibility(View.GONE);
tv_error.setVisibility(View.GONE);
for (int i = 0; i < jokes.size(); i++) {
jokes.get(i).setComment_counts(response.get(i).getComments() + "");
}
if (page == 1) {
mJokes.clear();
mJokes.addAll(jokes);
} else {
mJokes.addAll(jokes);
}
notifyDataSetChanged();
if (mSwipeRefreshLayout.isRefreshing()) {
mSwipeRefreshLayout.setRefreshing(false);
}
mLoadFinisCallBack.loadFinish(null);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
mLoadFinisCallBack.loadFinish(null);
tv_error.setVisibility(View.VISIBLE);
google_progress.setVisibility(View.GONE);
if (mSwipeRefreshLayout.isRefreshing()) {
mSwipeRefreshLayout.setRefreshing(false);
}
}
}
));
}
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private TextView tv_author;
private TextView tv_time;
private TextView tv_content;
private TextView tv_like;
private TextView tv_unlike;
private TextView tv_comment_count;
private TextView tv_unsupport_des;
private TextView tv_support_des;
private ImageView img_share;
private LinearLayout ll_support;
private LinearLayout ll_unsupport;
private LinearLayout ll_comment;
//用于处理多次点击造成的网络访问
private boolean isClickFinish;
public ViewHolder(View contentView) {
super(contentView);
isClickFinish = true;
tv_author = (TextView) contentView.findViewById(R.id.tv_author);
tv_content = (TextView) contentView.findViewById(R.id.tv_content);
tv_time = (TextView) contentView.findViewById(R.id.tv_time);
tv_like = (TextView) contentView.findViewById(R.id.tv_like);
tv_unlike = (TextView) contentView.findViewById(R.id.tv_unlike);
tv_comment_count = (TextView) contentView.findViewById(R.id.tv_comment_count);
tv_unsupport_des = (TextView) contentView.findViewById(R.id.tv_unsupport_des);
tv_support_des = (TextView) contentView.findViewById(R.id.tv_support_des);
img_share = (ImageView) contentView.findViewById(R.id.img_share);
ll_support = (LinearLayout) contentView.findViewById(R.id.ll_support);
ll_unsupport = (LinearLayout) contentView.findViewById(R.id.ll_unsupport);
ll_comment = (LinearLayout) contentView.findViewById(R.id.ll_comment);
}
}
}
| [
"zhaokai_qiang@126.com"
] | zhaokai_qiang@126.com |
a01c0b02c49cc3e847699bcb09ac0ae541adb561 | 0a540cea0e3d8d1e6168be111148d899254b6822 | /SQE/abbot-1.3.0/src/example/CelsiusConverterStrings.java | d90fbe9bf12bbd5454f5959a54e9e9ca23cc38d9 | [] | no_license | theZnorf/esdexercises | 0b47ab103f61958c7dbf3676ace043597031d04c | dd3bf377191e28cbd6f945fa713a0db578a205cc | refs/heads/master | 2020-12-31T04:41:31.624351 | 2016-03-03T13:49:57 | 2016-03-03T13:49:57 | 43,483,834 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package example;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* @author tlroche
* @version $Id: CelsiusConverterStrings.java 1407 2004-12-31 04:49:48Z tlroche $
*/
public class CelsiusConverterStrings {
private static final String BUNDLE_NAME = "example.CelsiusConverter";//$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private CelsiusConverterStrings() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}
| [
"franz.profelt@gmail.com"
] | franz.profelt@gmail.com |
575e0c2bb68cac0e047bed09d45dc52f2645aad8 | 28f669514c8006fc732140a462100f00e6f466c3 | /common/src/main/java/com/imspa/rpc/core/RPCRecvExecutor.java | fda9f08e29993df33964172b5bc0a5acc535512d | [] | no_license | HuaiyinMarquis/Simple-DistributedSystem | 46174d46e3c3d6516fc5c7860c2301835533c650 | f513585919a2329068c11a68cbd0aaf19e66dc46 | refs/heads/master | 2022-07-04T01:47:10.334967 | 2019-08-20T04:09:50 | 2019-08-20T04:09:50 | 203,141,175 | 1 | 1 | null | 2021-04-22T18:32:47 | 2019-08-19T09:27:15 | Java | UTF-8 | Java | false | false | 4,232 | java | package com.imspa.rpc.core;
import com.imspa.rpc.model.RPCInterfacesWrapper;
import com.imspa.rpc.threadpool.NamedThreadFactory;
import com.imspa.rpc.threadpool.RPCThreadPool;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import java.nio.channels.spi.SelectorProvider;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author Pann
* @description
* @date 2019-08-07 18:16
*/
public class RPCRecvExecutor implements ApplicationContextAware, InitializingBean {
private static final Logger logger = LogManager.getLogger(RPCRecvExecutor.class);
private String addr;
private final static String DELIMITER = ":";
private Map<String, Object> handlerMap = new ConcurrentHashMap<>();
private static volatile ThreadPoolExecutor threadPoolExecutor;
public RPCRecvExecutor(String serverAddr) {
this.addr = serverAddr;
}
public static void submit(Runnable task) {
if (threadPoolExecutor == null) {
synchronized (RPCRecvExecutor.class) {
if (threadPoolExecutor == null) {
threadPoolExecutor = (ThreadPoolExecutor) RPCThreadPool.getExecutor(16, 1); //TODO thread core
}
}
}
threadPoolExecutor.submit(task);
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
RPCInterfacesWrapper containerWrapper =
(RPCInterfacesWrapper) applicationContext.getBean("serviceContainer");
List<String> container = containerWrapper.getInterfaces();
container.forEach(key -> {
try {
handlerMap.put(key, applicationContext.getBean(Class.forName(key)));
} catch (ClassNotFoundException e) {
logger.error("The Interface config error, In \"{}\"", key);
}
});
}
@Override
public void afterPropertiesSet() throws Exception {
new Thread(()->{
ThreadFactory threadRpcFactory = new NamedThreadFactory(Boolean.TRUE);
int parallel = Runtime.getRuntime().availableProcessors() * 2;
EventLoopGroup boss = new NioEventLoopGroup();
EventLoopGroup worker = new NioEventLoopGroup(parallel, threadRpcFactory, SelectorProvider.provider());
try {
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(boss, worker).channel(NioServerSocketChannel.class)
.childHandler(new RPCRecvChannelInitializer(handlerMap))
.option(ChannelOption.SO_BACKLOG, 128)
.childOption(ChannelOption.SO_KEEPALIVE, true);
String[] serviceAddr = addr.split(RPCRecvExecutor.DELIMITER);
if (serviceAddr.length == 2) {
String host = serviceAddr[0];
int port = Integer.parseInt(serviceAddr[1]);
ChannelFuture future = bootstrap.bind(host, port).sync();
logger.info("Netty RPC Service start success ip:{} port:{}", host, port);
future.channel().closeFuture().sync();
} else {
logger.error("Netty RPC Service start fail!! Because of the service addr:{}", addr);
}
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
worker.shutdownGracefully();
boss.shutdownGracefully();
}
},"RPCServer-MainThread").start();
}
}
| [
"huaiyinmarquis@qq.com"
] | huaiyinmarquis@qq.com |
3540125be9092de6187f12547f3560665a4cb391 | 21dbabe3ad172af3888feec990271ccdfc6f77be | /GoldTrack/app/src/main/java/com/a/goldtrack/Model/AddCompanyRes.java | 0cda8a0514cf5edd75925ecb00b2d4355a629a14 | [] | no_license | natarajbingi/track-it | 6a4c0524cd38513bbf295ec77f3e1169696c1a82 | a35960348f09567f7e1a9aaa3ecf2429b5a64b38 | refs/heads/master | 2021-07-26T18:06:02.455491 | 2021-02-27T03:58:26 | 2021-02-27T03:58:26 | 242,266,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | package com.a.goldtrack.Model;
public class AddCompanyRes {
public String response;
public boolean success;
public int id;
}
| [
"natarajbingi@gmail.com"
] | natarajbingi@gmail.com |
7c9c0c55b69e05f981e9138d3fa8ba2c743a1072 | 54fa5accf4376e9dc5ab31b90940cd78fe7e3f1c | /modules/integration/tests-common/ui-pages/src/main/java/org.wso2.am.integration.ui.pages/login/LoginPage.java | 7400bbb02c64c8ecb841685f5e0b354be305f333 | [
"LicenseRef-scancode-unknown",
"EPL-1.0",
"CC-BY-SA-4.0",
"BSD-3-Clause",
"CC-BY-SA-3.0",
"CC-BY-4.0",
"GPL-1.0-only",
"ICU",
"LGPL-3.0-only",
"MPL-1.0",
"CDDL-1.0",
"GPL-2.0-only",
"GPL-1.0-or-later",
"MPL-2.0",
"Apache-2.0",
"LGPL-2.0-only",
"BSD-2-Clause"
] | permissive | wso2/product-apim | 9256f2915aa6119626991d03768d9372493bf8f7 | 4444f952b0242027bcbe93b0dafde7ec92dbb987 | refs/heads/master | 2023-08-31T22:14:58.792978 | 2023-08-20T16:57:31 | 2023-08-20T16:57:31 | 20,717,348 | 791 | 984 | Apache-2.0 | 2023-09-14T07:32:39 | 2014-06-11T08:05:00 | Java | UTF-8 | Java | false | false | 5,038 | java | /*
*Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
*WSO2 Inc. licenses this file to you under the Apache License,
*Version 2.0 (the "License"); you may not use this file except
*in compliance with the License.
*You may obtain a copy of the License at
*
*http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing,
*software distributed under the License is distributed on an
*"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
*KIND, either express or implied. See the License for the
*specific language governing permissions and limitations
*under the License.
*/
package org.wso2.am.integration.ui.pages.login;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.wso2.am.integration.ui.pages.Jaggery.JaggeryHome;
import org.wso2.am.integration.ui.pages.home.HomePage;
import org.wso2.am.integration.ui.pages.util.UIElementMapper;
import java.io.IOException;
/**
* login page class - contains methods to login to wso2 products.
*/
public class LoginPage {
private static final Log log = LogFactory.getLog(LoginPage.class);
private WebDriver driver;
private UIElementMapper uiElementMapper;
private boolean isCloudEnvironment = false;
public LoginPage(WebDriver driver) throws IOException {
this.driver = driver;
this.uiElementMapper = UIElementMapper.getInstance();
// Check that we're on the right page.
if (!(driver.getCurrentUrl().contains("login.jsp"))) {
// Alternatively, we could navigate to the login page, perhaps logging out first
throw new IllegalStateException("This is not the login page");
}
}
public LoginPage(WebDriver driver, boolean isCloudEnvironment) throws IOException {
this.driver = driver;
this.isCloudEnvironment = isCloudEnvironment;
this.uiElementMapper = UIElementMapper.getInstance();
// Check that we're on the right page.
if (this.isCloudEnvironment) {
if (!(driver.getCurrentUrl().contains("home/index.html"))) {
// Alternatively, we could navigate to the login page, perhaps logging out first
throw new IllegalStateException("This is not the cloud login page");
}
driver.findElement(By.xpath("//*[@id=\"content\"]/div[1]/div/a[2]/img")).click();
} else {
if (!(driver.getCurrentUrl().contains("login.jsp"))) {
// Alternatively, we could navigate to the login page, perhaps logging out first
throw new IllegalStateException("This is not the product login page");
}
}
}
public HomePage loginAs(String userName, String password, boolean isTenant)
throws IOException {
log.info("login as " + userName + ":Tenant");
WebElement userNameField = driver.findElement(By.name(uiElementMapper
.getElement("login.username.name")));
WebElement passwordField = driver.findElement(By.name(uiElementMapper
.getElement("login.password")));
userNameField.sendKeys(userName);
passwordField.sendKeys(password);
if (isCloudEnvironment) {
driver.findElement(
By.xpath("//*[@id=\"loginForm\"]/table/tbody/tr[4]/td[2]/input"))
.click();
return new HomePage(isTenant, driver);
} else {
driver.findElement(
By.className(uiElementMapper
.getElement("login.sign.in.button"))).click();
return new HomePage(isTenant, driver);
}
}
public HomePage loginAs(String userName, String password) throws IOException {
log.info("login as " + userName);
WebElement userNameField = driver.findElement(By.name(uiElementMapper.getElement("login.username.name")));
WebElement passwordField = driver.findElement(By.name(uiElementMapper.getElement("login.password")));
userNameField.sendKeys(userName);
passwordField.sendKeys(password);
if (isCloudEnvironment) {
driver.findElement(By.xpath("//*[@id=\"loginForm\"]/table/tbody/tr[4]/td[2]/input")).click();
return new HomePage(driver, isCloudEnvironment);
} else {
driver.findElement(By.className(uiElementMapper.getElement("login.sign.in.button"))).click();
return new HomePage(driver);
}
}
public JaggeryHome Login(String userName, String password) throws IOException {
log.info("login as " + userName);
WebElement userNameField = driver.findElement(By.name(uiElementMapper.getElement("login.username.name")));
WebElement passwordField = driver.findElement(By.name(uiElementMapper.getElement("login.password")));
userNameField.sendKeys(userName);
passwordField.sendKeys(password);
driver.findElement(By.className(uiElementMapper.getElement("login.sign.in.button"))).click();
return new JaggeryHome(driver);
}
}
| [
"dharshanaw@wso2.com"
] | dharshanaw@wso2.com |
8879e9837f85d70350ceac53c5cc4c97dd3ae7e0 | bfc9cde4a227705699cf0643d47c56fd63eb6994 | /lib-call/src/main/java/com/gcml/call/utils/T.java | d12d4cc8ec12d3609c0546a3e3197c70c80aa7f0 | [] | no_license | dcy000/MLxiao | debcf371230832bef283507dedbbff8cd6271fb7 | 02df66d1d22c3a0658ef1a86acb28885c2dbb691 | refs/heads/master | 2021-01-20T10:14:11.370287 | 2018-10-19T10:23:02 | 2018-10-19T10:23:02 | 101,597,000 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,700 | java | package com.gcml.call.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.StringRes;
import android.widget.TextView;
import android.widget.Toast;
/**
* Created by afirez on 2017/10/11.
*/
public class T {
private static Toast sToast;
@SuppressLint("StaticFieldLeak")
private static Context sContext;
private static Handler sUiHandler = new Handler(Looper.getMainLooper());
public static void init(Context context) {
sContext = context.getApplicationContext();
}
public static void show(@StringRes final int resId) {
show(sContext.getString(resId));
}
public static void showLong(@StringRes final int resId) {
showLong(sContext.getString(resId));
}
public static void show(final String text) {
showOnUiThread(text, Toast.LENGTH_SHORT);
}
public static void showLong(final String text) {
showOnUiThread(text, Toast.LENGTH_LONG);
}
private static void showOnUiThread(final String text, final int duration) {
sUiHandler.post(new Runnable() {
@Override
public void run() {
show(text, duration);
}
});
}
private static void show(String text, int duration) {
if (sToast == null) {
sToast = Toast.makeText(sContext, text, duration);
((TextView) sToast.getView().findViewById(android.R.id.message)).setTextSize(28);
sToast.show();
return;
}
sToast.setText(text);
sToast.setDuration(duration);
sToast.show();
}
}
| [
"afirez@163.com"
] | afirez@163.com |
7af2ce71b2ab8b653f8bc181e230216e62b1f861 | c30ebda6b0a3791b0df40865436fd389827a0bc9 | /src/test/java/com/example/demo/controller/TestUserController3.java | cc9293d6282ecba4d4ee03406c2989fb9770a193 | [] | no_license | lbilla512/sample_springweb | 8e0c0b3e24e8a55552d8bdfd1683a6b0e22b7ff1 | cae021245fb9ec7f23b3872ad6da7a50eedd4bf4 | refs/heads/master | 2022-11-10T22:47:58.675084 | 2020-07-03T14:17:06 | 2020-07-03T14:17:06 | 276,896,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | package com.example.demo.controller;
import static org.hamcrest.Matchers.containsString;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.web.servlet.MockMvc;
import com.example.demo.util.IUserService;
@WebMvcTest(UserController.class)
public class TestUserController3 {
@Autowired
private MockMvc mockMvc;
@MockBean
private IUserService service;
String userName = "Lakshmi";
@Test
public void serviceShouldBeMocked() throws Exception {
when(service.getUserInfo(userName)).thenReturn(userName+"test1");
this.mockMvc.perform(get("/users/Lakshmi")).andDo(print()).andExpect(status().isOk())
.andExpect(content().string(containsString(userName+"test1")));
}
} | [
"lakshmi.billa@in.pega.com"
] | lakshmi.billa@in.pega.com |
4ceec461f0fc427d1fafd24d58c4216f38f0c641 | c6f1ad2c2a66c7f46d6f5c4665a98f48ccf79c57 | /demo/src/main/java/com/example/web/model/common/JsonResponse.java | fd5873e8a95d2e23bb43f67342aa1ca05a33c2ed | [] | no_license | dwyanewang/springboot-loginDemo | ac0d952b32cbae94ee96667dc4bb007a28778f2b | 83069db5d08a4b11709de819fea122e1547757bd | refs/heads/master | 2021-04-06T00:01:16.025148 | 2016-12-06T07:58:18 | 2016-12-06T07:58:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.example.web.model.common;
public abstract class JsonResponse {
private String responseCode;
private String message;
public String getResponseCode() {
return responseCode;
}
public void setResponseCode(String responseCode) {
this.responseCode = responseCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b6b20d108d8cacfcc3460532322ccce588b234ea | 3801ccf8c762d493195f16c22774779bda4b7d3b | /src/main/java/org/preventime/data/util/AbstractRepository.java | c9c564e3148fd0aafde91ea45c8e09dcc8aab301 | [] | no_license | PrevenTime/PrevenTime-backend | 176d7f07aede0a7036642a7abb91a9d3c4603769 | 21cab6306f4f984e300da0c8a01c50bf610164e8 | refs/heads/master | 2022-09-23T16:52:52.294203 | 2020-03-15T21:58:48 | 2020-03-15T21:58:48 | 247,524,209 | 0 | 0 | null | 2022-09-08T01:06:21 | 2020-03-15T18:14:44 | Java | UTF-8 | Java | false | false | 1,331 | java | package org.preventime.data.util;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.dsl.EntityPathBase;
import com.querydsl.core.types.dsl.StringPath;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer;
import org.springframework.data.querydsl.binding.QuerydslBindings;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.query.Param;
import java.util.Arrays;
import java.util.List;
@NoRepositoryBean
public interface AbstractRepository<E extends AbstractEntity, QE extends EntityPathBase<E>>
extends JpaRepository<E, String>, QuerydslPredicateExecutor<E>, QuerydslBinderCustomizer<QE> {
List<E> findByIdIn(@Param("ids") String[] ids);
@Override
default public void customize(QuerydslBindings bindings, QE root) {
bindings.bind(String.class).first((StringPath path, String value) -> {
String[] strings = value.split(",");
List<String> list = Arrays.asList(strings);
BooleanBuilder predicate = new BooleanBuilder();
list.forEach(v -> predicate.or(path.containsIgnoreCase(v)));
return predicate;
});
}
}
| [
"guillermo@theblackbox.io"
] | guillermo@theblackbox.io |
ff8afb3fb22db381e53cfabd571e036ecc83b23b | 6fb2c765318362a153ab9c4f4bad6bebd1582995 | /src/com/vccloud/portal/db/model/TCdrExample.java | 60f22727455a9d5a33048e579ab6ddb77d5db9c2 | [] | no_license | xuankunpeng/vccloud-portal | 79f2a9e242660bcf9a4cee125ca3dc1964306d4c | 6257841e24f8e1f42d23f9f6303ada6df6f84856 | refs/heads/master | 2021-01-01T16:30:48.814945 | 2014-03-21T03:55:37 | 2014-03-21T03:55:37 | 17,967,461 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 31,731 | java | package com.vccloud.portal.db.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TCdrExample {
/**
* This field was generated by Apache iBATIS ibator.
* This field corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
protected String orderByClause;
/**
* This field was generated by Apache iBATIS ibator.
* This field corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
protected List oredCriteria;
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public TCdrExample() {
oredCriteria = new ArrayList();
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
protected TCdrExample(TCdrExample example) {
this.orderByClause = example.orderByClause;
this.oredCriteria = example.oredCriteria;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public List getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public void clear() {
oredCriteria.clear();
}
/**
* This class was generated by Apache iBATIS ibator.
* This class corresponds to the database table t_cdr
*
* @ibatorgenerated Tue Feb 18 14:28:36 CST 2014
*/
public static class Criteria {
protected List criteriaWithoutValue;
protected List criteriaWithSingleValue;
protected List criteriaWithListValue;
protected List criteriaWithBetweenValue;
protected Criteria() {
super();
criteriaWithoutValue = new ArrayList();
criteriaWithSingleValue = new ArrayList();
criteriaWithListValue = new ArrayList();
criteriaWithBetweenValue = new ArrayList();
}
public boolean isValid() {
return criteriaWithoutValue.size() > 0
|| criteriaWithSingleValue.size() > 0
|| criteriaWithListValue.size() > 0
|| criteriaWithBetweenValue.size() > 0;
}
public List getCriteriaWithoutValue() {
return criteriaWithoutValue;
}
public List getCriteriaWithSingleValue() {
return criteriaWithSingleValue;
}
public List getCriteriaWithListValue() {
return criteriaWithListValue;
}
public List getCriteriaWithBetweenValue() {
return criteriaWithBetweenValue;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteriaWithoutValue.add(condition);
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
Map map = new HashMap();
map.put("condition", condition);
map.put("value", value);
criteriaWithSingleValue.add(map);
}
protected void addCriterion(String condition, List values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
Map map = new HashMap();
map.put("condition", condition);
map.put("values", values);
criteriaWithListValue.add(map);
}
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");
}
List list = new ArrayList();
list.add(value1);
list.add(value2);
Map map = new HashMap();
map.put("condition", condition);
map.put("values", list);
criteriaWithBetweenValue.add(map);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return this;
}
public Criteria andIdIn(List values) {
addCriterion("id in", values, "id");
return this;
}
public Criteria andIdNotIn(List values) {
addCriterion("id not in", values, "id");
return this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return this;
}
public Criteria andPortalIdIsNull() {
addCriterion("portal_id is null");
return this;
}
public Criteria andPortalIdIsNotNull() {
addCriterion("portal_id is not null");
return this;
}
public Criteria andPortalIdEqualTo(Long value) {
addCriterion("portal_id =", value, "portalId");
return this;
}
public Criteria andPortalIdNotEqualTo(Long value) {
addCriterion("portal_id <>", value, "portalId");
return this;
}
public Criteria andPortalIdGreaterThan(Long value) {
addCriterion("portal_id >", value, "portalId");
return this;
}
public Criteria andPortalIdGreaterThanOrEqualTo(Long value) {
addCriterion("portal_id >=", value, "portalId");
return this;
}
public Criteria andPortalIdLessThan(Long value) {
addCriterion("portal_id <", value, "portalId");
return this;
}
public Criteria andPortalIdLessThanOrEqualTo(Long value) {
addCriterion("portal_id <=", value, "portalId");
return this;
}
public Criteria andPortalIdIn(List values) {
addCriterion("portal_id in", values, "portalId");
return this;
}
public Criteria andPortalIdNotIn(List values) {
addCriterion("portal_id not in", values, "portalId");
return this;
}
public Criteria andPortalIdBetween(Long value1, Long value2) {
addCriterion("portal_id between", value1, value2, "portalId");
return this;
}
public Criteria andPortalIdNotBetween(Long value1, Long value2) {
addCriterion("portal_id not between", value1, value2, "portalId");
return this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return this;
}
public Criteria andTenantIdIsNotNull() {
addCriterion("tenant_id is not null");
return this;
}
public Criteria andTenantIdEqualTo(Long value) {
addCriterion("tenant_id =", value, "tenantId");
return this;
}
public Criteria andTenantIdNotEqualTo(Long value) {
addCriterion("tenant_id <>", value, "tenantId");
return this;
}
public Criteria andTenantIdGreaterThan(Long value) {
addCriterion("tenant_id >", value, "tenantId");
return this;
}
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
addCriterion("tenant_id >=", value, "tenantId");
return this;
}
public Criteria andTenantIdLessThan(Long value) {
addCriterion("tenant_id <", value, "tenantId");
return this;
}
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
addCriterion("tenant_id <=", value, "tenantId");
return this;
}
public Criteria andTenantIdIn(List values) {
addCriterion("tenant_id in", values, "tenantId");
return this;
}
public Criteria andTenantIdNotIn(List values) {
addCriterion("tenant_id not in", values, "tenantId");
return this;
}
public Criteria andTenantIdBetween(Long value1, Long value2) {
addCriterion("tenant_id between", value1, value2, "tenantId");
return this;
}
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
addCriterion("tenant_id not between", value1, value2, "tenantId");
return this;
}
public Criteria andMemberIdIsNull() {
addCriterion("member_id is null");
return this;
}
public Criteria andMemberIdIsNotNull() {
addCriterion("member_id is not null");
return this;
}
public Criteria andMemberIdEqualTo(Long value) {
addCriterion("member_id =", value, "memberId");
return this;
}
public Criteria andMemberIdNotEqualTo(Long value) {
addCriterion("member_id <>", value, "memberId");
return this;
}
public Criteria andMemberIdGreaterThan(Long value) {
addCriterion("member_id >", value, "memberId");
return this;
}
public Criteria andMemberIdGreaterThanOrEqualTo(Long value) {
addCriterion("member_id >=", value, "memberId");
return this;
}
public Criteria andMemberIdLessThan(Long value) {
addCriterion("member_id <", value, "memberId");
return this;
}
public Criteria andMemberIdLessThanOrEqualTo(Long value) {
addCriterion("member_id <=", value, "memberId");
return this;
}
public Criteria andMemberIdIn(List values) {
addCriterion("member_id in", values, "memberId");
return this;
}
public Criteria andMemberIdNotIn(List values) {
addCriterion("member_id not in", values, "memberId");
return this;
}
public Criteria andMemberIdBetween(Long value1, Long value2) {
addCriterion("member_id between", value1, value2, "memberId");
return this;
}
public Criteria andMemberIdNotBetween(Long value1, Long value2) {
addCriterion("member_id not between", value1, value2, "memberId");
return this;
}
public Criteria andDateIsNull() {
addCriterion("date is null");
return this;
}
public Criteria andDateIsNotNull() {
addCriterion("date is not null");
return this;
}
public Criteria andDateEqualTo(Date value) {
addCriterion("date =", value, "date");
return this;
}
public Criteria andDateNotEqualTo(Date value) {
addCriterion("date <>", value, "date");
return this;
}
public Criteria andDateGreaterThan(Date value) {
addCriterion("date >", value, "date");
return this;
}
public Criteria andDateGreaterThanOrEqualTo(Date value) {
addCriterion("date >=", value, "date");
return this;
}
public Criteria andDateLessThan(Date value) {
addCriterion("date <", value, "date");
return this;
}
public Criteria andDateLessThanOrEqualTo(Date value) {
addCriterion("date <=", value, "date");
return this;
}
public Criteria andDateIn(List values) {
addCriterion("date in", values, "date");
return this;
}
public Criteria andDateNotIn(List values) {
addCriterion("date not in", values, "date");
return this;
}
public Criteria andDateBetween(Date value1, Date value2) {
addCriterion("date between", value1, value2, "date");
return this;
}
public Criteria andDateNotBetween(Date value1, Date value2) {
addCriterion("date not between", value1, value2, "date");
return this;
}
public Criteria andYearIsNull() {
addCriterion("year is null");
return this;
}
public Criteria andYearIsNotNull() {
addCriterion("year is not null");
return this;
}
public Criteria andYearEqualTo(Long value) {
addCriterion("year =", value, "year");
return this;
}
public Criteria andYearNotEqualTo(Long value) {
addCriterion("year <>", value, "year");
return this;
}
public Criteria andYearGreaterThan(Long value) {
addCriterion("year >", value, "year");
return this;
}
public Criteria andYearGreaterThanOrEqualTo(Long value) {
addCriterion("year >=", value, "year");
return this;
}
public Criteria andYearLessThan(Long value) {
addCriterion("year <", value, "year");
return this;
}
public Criteria andYearLessThanOrEqualTo(Long value) {
addCriterion("year <=", value, "year");
return this;
}
public Criteria andYearIn(List values) {
addCriterion("year in", values, "year");
return this;
}
public Criteria andYearNotIn(List values) {
addCriterion("year not in", values, "year");
return this;
}
public Criteria andYearBetween(Long value1, Long value2) {
addCriterion("year between", value1, value2, "year");
return this;
}
public Criteria andYearNotBetween(Long value1, Long value2) {
addCriterion("year not between", value1, value2, "year");
return this;
}
public Criteria andMonthIsNull() {
addCriterion("month is null");
return this;
}
public Criteria andMonthIsNotNull() {
addCriterion("month is not null");
return this;
}
public Criteria andMonthEqualTo(Long value) {
addCriterion("month =", value, "month");
return this;
}
public Criteria andMonthNotEqualTo(Long value) {
addCriterion("month <>", value, "month");
return this;
}
public Criteria andMonthGreaterThan(Long value) {
addCriterion("month >", value, "month");
return this;
}
public Criteria andMonthGreaterThanOrEqualTo(Long value) {
addCriterion("month >=", value, "month");
return this;
}
public Criteria andMonthLessThan(Long value) {
addCriterion("month <", value, "month");
return this;
}
public Criteria andMonthLessThanOrEqualTo(Long value) {
addCriterion("month <=", value, "month");
return this;
}
public Criteria andMonthIn(List values) {
addCriterion("month in", values, "month");
return this;
}
public Criteria andMonthNotIn(List values) {
addCriterion("month not in", values, "month");
return this;
}
public Criteria andMonthBetween(Long value1, Long value2) {
addCriterion("month between", value1, value2, "month");
return this;
}
public Criteria andMonthNotBetween(Long value1, Long value2) {
addCriterion("month not between", value1, value2, "month");
return this;
}
public Criteria andDayIsNull() {
addCriterion("day is null");
return this;
}
public Criteria andDayIsNotNull() {
addCriterion("day is not null");
return this;
}
public Criteria andDayEqualTo(Long value) {
addCriterion("day =", value, "day");
return this;
}
public Criteria andDayNotEqualTo(Long value) {
addCriterion("day <>", value, "day");
return this;
}
public Criteria andDayGreaterThan(Long value) {
addCriterion("day >", value, "day");
return this;
}
public Criteria andDayGreaterThanOrEqualTo(Long value) {
addCriterion("day >=", value, "day");
return this;
}
public Criteria andDayLessThan(Long value) {
addCriterion("day <", value, "day");
return this;
}
public Criteria andDayLessThanOrEqualTo(Long value) {
addCriterion("day <=", value, "day");
return this;
}
public Criteria andDayIn(List values) {
addCriterion("day in", values, "day");
return this;
}
public Criteria andDayNotIn(List values) {
addCriterion("day not in", values, "day");
return this;
}
public Criteria andDayBetween(Long value1, Long value2) {
addCriterion("day between", value1, value2, "day");
return this;
}
public Criteria andDayNotBetween(Long value1, Long value2) {
addCriterion("day not between", value1, value2, "day");
return this;
}
public Criteria andWeekIsNull() {
addCriterion("week is null");
return this;
}
public Criteria andWeekIsNotNull() {
addCriterion("week is not null");
return this;
}
public Criteria andWeekEqualTo(Long value) {
addCriterion("week =", value, "week");
return this;
}
public Criteria andWeekNotEqualTo(Long value) {
addCriterion("week <>", value, "week");
return this;
}
public Criteria andWeekGreaterThan(Long value) {
addCriterion("week >", value, "week");
return this;
}
public Criteria andWeekGreaterThanOrEqualTo(Long value) {
addCriterion("week >=", value, "week");
return this;
}
public Criteria andWeekLessThan(Long value) {
addCriterion("week <", value, "week");
return this;
}
public Criteria andWeekLessThanOrEqualTo(Long value) {
addCriterion("week <=", value, "week");
return this;
}
public Criteria andWeekIn(List values) {
addCriterion("week in", values, "week");
return this;
}
public Criteria andWeekNotIn(List values) {
addCriterion("week not in", values, "week");
return this;
}
public Criteria andWeekBetween(Long value1, Long value2) {
addCriterion("week between", value1, value2, "week");
return this;
}
public Criteria andWeekNotBetween(Long value1, Long value2) {
addCriterion("week not between", value1, value2, "week");
return this;
}
public Criteria andTimesCallinIsNull() {
addCriterion("times_callin is null");
return this;
}
public Criteria andTimesCallinIsNotNull() {
addCriterion("times_callin is not null");
return this;
}
public Criteria andTimesCallinEqualTo(Long value) {
addCriterion("times_callin =", value, "timesCallin");
return this;
}
public Criteria andTimesCallinNotEqualTo(Long value) {
addCriterion("times_callin <>", value, "timesCallin");
return this;
}
public Criteria andTimesCallinGreaterThan(Long value) {
addCriterion("times_callin >", value, "timesCallin");
return this;
}
public Criteria andTimesCallinGreaterThanOrEqualTo(Long value) {
addCriterion("times_callin >=", value, "timesCallin");
return this;
}
public Criteria andTimesCallinLessThan(Long value) {
addCriterion("times_callin <", value, "timesCallin");
return this;
}
public Criteria andTimesCallinLessThanOrEqualTo(Long value) {
addCriterion("times_callin <=", value, "timesCallin");
return this;
}
public Criteria andTimesCallinIn(List values) {
addCriterion("times_callin in", values, "timesCallin");
return this;
}
public Criteria andTimesCallinNotIn(List values) {
addCriterion("times_callin not in", values, "timesCallin");
return this;
}
public Criteria andTimesCallinBetween(Long value1, Long value2) {
addCriterion("times_callin between", value1, value2, "timesCallin");
return this;
}
public Criteria andTimesCallinNotBetween(Long value1, Long value2) {
addCriterion("times_callin not between", value1, value2, "timesCallin");
return this;
}
public Criteria andDurationCallinIsNull() {
addCriterion("duration_callin is null");
return this;
}
public Criteria andDurationCallinIsNotNull() {
addCriterion("duration_callin is not null");
return this;
}
public Criteria andDurationCallinEqualTo(Long value) {
addCriterion("duration_callin =", value, "durationCallin");
return this;
}
public Criteria andDurationCallinNotEqualTo(Long value) {
addCriterion("duration_callin <>", value, "durationCallin");
return this;
}
public Criteria andDurationCallinGreaterThan(Long value) {
addCriterion("duration_callin >", value, "durationCallin");
return this;
}
public Criteria andDurationCallinGreaterThanOrEqualTo(Long value) {
addCriterion("duration_callin >=", value, "durationCallin");
return this;
}
public Criteria andDurationCallinLessThan(Long value) {
addCriterion("duration_callin <", value, "durationCallin");
return this;
}
public Criteria andDurationCallinLessThanOrEqualTo(Long value) {
addCriterion("duration_callin <=", value, "durationCallin");
return this;
}
public Criteria andDurationCallinIn(List values) {
addCriterion("duration_callin in", values, "durationCallin");
return this;
}
public Criteria andDurationCallinNotIn(List values) {
addCriterion("duration_callin not in", values, "durationCallin");
return this;
}
public Criteria andDurationCallinBetween(Long value1, Long value2) {
addCriterion("duration_callin between", value1, value2, "durationCallin");
return this;
}
public Criteria andDurationCallinNotBetween(Long value1, Long value2) {
addCriterion("duration_callin not between", value1, value2, "durationCallin");
return this;
}
public Criteria andTimesCalloutIsNull() {
addCriterion("times_callout is null");
return this;
}
public Criteria andTimesCalloutIsNotNull() {
addCriterion("times_callout is not null");
return this;
}
public Criteria andTimesCalloutEqualTo(Long value) {
addCriterion("times_callout =", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutNotEqualTo(Long value) {
addCriterion("times_callout <>", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutGreaterThan(Long value) {
addCriterion("times_callout >", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutGreaterThanOrEqualTo(Long value) {
addCriterion("times_callout >=", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutLessThan(Long value) {
addCriterion("times_callout <", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutLessThanOrEqualTo(Long value) {
addCriterion("times_callout <=", value, "timesCallout");
return this;
}
public Criteria andTimesCalloutIn(List values) {
addCriterion("times_callout in", values, "timesCallout");
return this;
}
public Criteria andTimesCalloutNotIn(List values) {
addCriterion("times_callout not in", values, "timesCallout");
return this;
}
public Criteria andTimesCalloutBetween(Long value1, Long value2) {
addCriterion("times_callout between", value1, value2, "timesCallout");
return this;
}
public Criteria andTimesCalloutNotBetween(Long value1, Long value2) {
addCriterion("times_callout not between", value1, value2, "timesCallout");
return this;
}
public Criteria andDurationCalloutIsNull() {
addCriterion("duration_callout is null");
return this;
}
public Criteria andDurationCalloutIsNotNull() {
addCriterion("duration_callout is not null");
return this;
}
public Criteria andDurationCalloutEqualTo(Long value) {
addCriterion("duration_callout =", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutNotEqualTo(Long value) {
addCriterion("duration_callout <>", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutGreaterThan(Long value) {
addCriterion("duration_callout >", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutGreaterThanOrEqualTo(Long value) {
addCriterion("duration_callout >=", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutLessThan(Long value) {
addCriterion("duration_callout <", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutLessThanOrEqualTo(Long value) {
addCriterion("duration_callout <=", value, "durationCallout");
return this;
}
public Criteria andDurationCalloutIn(List values) {
addCriterion("duration_callout in", values, "durationCallout");
return this;
}
public Criteria andDurationCalloutNotIn(List values) {
addCriterion("duration_callout not in", values, "durationCallout");
return this;
}
public Criteria andDurationCalloutBetween(Long value1, Long value2) {
addCriterion("duration_callout between", value1, value2, "durationCallout");
return this;
}
public Criteria andDurationCalloutNotBetween(Long value1, Long value2) {
addCriterion("duration_callout not between", value1, value2, "durationCallout");
return this;
}
}
} | [
"xuankunp@163.com"
] | xuankunp@163.com |
c5f30c1e6ce39d2beb422f9da4047d815bf03bb1 | 03513f0bf5b5833a44e5564fdc2ea37d1cb9bf3b | /src/main/java/com/answer1991/design/iterator/package-info.java | da736fa6ef2e50fa18521a21d95d2b72e8ed19fc | [] | no_license | answer1991/DesignPatterns | e42be472848b5821abab18b9b6e8f35f3fd3cf29 | 43076625d388e54d1c5db9db69d14ea31bc9c0a0 | refs/heads/master | 2016-09-05T21:28:09.415466 | 2013-06-11T15:22:17 | 2013-06-11T15:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | /**
* Iterator 迭代器模式。
* 在现在的Java中已经很少会另写一个迭代器,都是使用JDK的迭代器。
* List, Set等都实现了迭代器模式
*/
/**
* @author zet
*
*/
package com.answer1991.design.iterator; | [
"answer1991.chen@gmail.com"
] | answer1991.chen@gmail.com |
6c4bf84b3a87f105b9d97186ad7025af7d557aba | 6dd5a5b64af505c2d62980fadae7a1607c922215 | /src/test/java/pages/BasePage.java | 311ff691c74972e73754e58bfcad9741be32a923 | [] | no_license | Gustavo-Soares94/Estrutura-Web-Automacao | 33c3434de3d032b30d5265d622f9faa19117b55d | b01a2cebd91b50cb38592f84001ed66244c40b84 | refs/heads/master | 2023-04-22T07:23:11.795528 | 2021-05-10T00:20:21 | 2021-05-10T00:20:21 | 278,943,396 | 0 | 0 | null | 2021-05-10T00:20:21 | 2020-07-11T21:19:45 | Java | UTF-8 | Java | false | false | 190 | java | package pages;
import org.openqa.selenium.WebDriver;
public class BasePage {
protected WebDriver driver;
public BasePage(WebDriver driver){
this.driver = driver;
}
}
| [
"gustavosoares.adm@gmail.com"
] | gustavosoares.adm@gmail.com |
cb7bbbfff32e38cbf6cf5ee077d64ed6917014d3 | 472152638c1b0fab475ea8fa30d2b793f5d2e1b9 | /Rea's code/11:15 - 11:19/KthSmallestElementinaBST.java | 824a26d501ad4f8c303338d5ccec7873150589c6 | [] | no_license | mingming733/LCGroup | 0e9c0101aeced0c66cd7e3a573866f252aaf85d0 | d26c6a18749aa176eba0ef000b8276335979fedb | refs/heads/master | 2021-01-13T01:40:51.745175 | 2015-11-25T04:33:32 | 2015-11-25T04:33:32 | 42,124,191 | 0 | 5 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | import java.util.*;
public class KthSmallestElementinaBST {
public int kthSmallest(TreeNode root, int k) {
Stack <TreeNode> s = new Stack <TreeNode>();
TreeNode p = root;
int result = 0;
while (!s.isEmpty() || p != null){
if (p != null){
s.push(p);
p = p.left;
}
else {
TreeNode cur = s.pop();
k --;
if (k == 0){
return cur.val;
}
p = cur.right;
}
}
return result;
}
}
| [
"suddenlyjune@gmail.com"
] | suddenlyjune@gmail.com |
d640de96d0ad22cade0e9e2cf71de90b5e6b0b6e | 20d14fc5189f121bc413f63a05c3cb54d0fd7fa4 | /analysis/src/main/java/org/hps/analysis/trigger/util/TriggerDataUtils.java | 4b3a575dc1cd82c103b763ef449fd4c133c14d1b | [] | no_license | JeffersonLab/hps-java | a86120f5a444e9678494e4fcdb9c34324094d78b | dfbe0238bfd27883f1645cdbd8177fc553b32ac1 | refs/heads/master | 2023-09-01T04:59:52.200899 | 2023-08-31T21:22:42 | 2023-08-31T21:22:42 | 79,490,087 | 10 | 18 | null | 2023-09-07T22:26:16 | 2017-01-19T20:03:21 | Java | UTF-8 | Java | false | false | 977 | java | /**
*
*/
package org.hps.analysis.trigger.util;
import java.util.Date;
import java.util.List;
import org.hps.record.triggerbank.AbstractIntData;
import org.hps.record.triggerbank.HeadBankData;
import org.lcsim.event.EventHeader;
import org.lcsim.event.GenericObject;
/**
* Class with only static utility methods.
*/
public class TriggerDataUtils {
public static Date getEventTimeStamp(EventHeader event, String collectionName) {
List<GenericObject> intDataCollection = event.get(GenericObject.class, collectionName);
for (GenericObject data : intDataCollection) {
if (AbstractIntData.getTag(data) == HeadBankData.BANK_TAG) {
Date date = HeadBankData.getDate(data);
if (date != null) {
return date;
}
}
}
return null;
}
/**
* Private constructor to avoid instantiation of the
*/
private TriggerDataUtils() {}
}
| [
"per.hansson@gmail.com"
] | per.hansson@gmail.com |
93b4225c41538855745b1dbac08df070ab9870f4 | ca3dfb6899666f360683a5b23e7a1effbbe184f1 | /BubleCrash/src/jp/co/marugen/bublecrash/TextureManager.java | 29f5d53c00ae44d13b5c6c4a31f9c3ce17e84792 | [] | no_license | naiken/team2 | 95ba183d9b93a1f787e30abf7562190779966af9 | e4044858776320624e72173c15ebcc6b2a10678b | refs/heads/master | 2016-09-06T05:55:23.279105 | 2014-06-02T12:49:36 | 2014-06-02T12:49:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,099 | java | package jp.co.marugen.bublecrash;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import javax.microedition.khronos.opengles.GL10;
public class TextureManager {
//テクスチャを保持する
private static Map<Integer, Integer> mTextures = new Hashtable<Integer, Integer>();
//ロードしたテクスチャを追加する
public static final void addTexture(int resId, int texId) {
mTextures.put(resId, texId);
}
//テクスチャを削除する
public static final void deleteTexture(GL10 gl, int resId) {
if (mTextures.containsKey(resId)) {
int[] texId = new int[1];
texId[0] = mTextures.get(resId);
gl.glDeleteTextures(1, texId, 0);
mTextures.remove(resId);
}
}
// 全てのテクスチャを削除する
public static final void deleteAll(GL10 gl) {
List<Integer> keys = new ArrayList<Integer>(mTextures.keySet());
for (Integer key : keys) {
deleteTexture(gl, key);
}
}
}
| [
"re795h@tamura-no-MacBook-Air-2.local"
] | re795h@tamura-no-MacBook-Air-2.local |
74ea163e104357dcedb331a8e58438082aff9cc0 | 0cce977024610e5c19b82106ad69b34d4097e914 | /src/by/it/bolotko/jd02_05/Text.java | dec799dc55691da91e16b407f61d0e049217d055 | [] | no_license | Khlystunova-Liza/JD2019-03-11 | 48c06e38ce60ca1a2c51f49ab31c07c3fcfa8c69 | 361b6ae99839d6c379a85a3479087070250ea0a8 | refs/heads/master | 2020-04-30T07:39:47.851162 | 2019-06-10T06:52:56 | 2019-06-10T06:52:56 | 176,691,063 | 2 | 0 | null | 2019-03-20T08:43:37 | 2019-03-20T08:43:36 | null | UTF-8 | Java | false | false | 204 | java | package by.it.bolotko.jd02_05;
public interface Text {
String WELCOME="message.welcome";
String QUESTION="message.question";
String FISRTNAME="person.firstName";
String LASTNAME="person.lastName";
}
| [
"pro100kosti@gmail.com"
] | pro100kosti@gmail.com |
9517f89b1114da1a902bf7132f225379d166b3ec | 45715f783fbe4b91528c0ab819ada2115a8e57a8 | /manage/src/manage/util/JSONDateProcessor.java | d997a505fdd5892234882512ead819919c4ae745 | [] | no_license | naruto2015/Jereh | e98869bbc429e9eead1d092a79eceee258a45fa7 | e149de2dd32538d413c0b5fe9bd9f4a2c23384f2 | refs/heads/master | 2021-01-13T01:37:39.016640 | 2015-06-15T07:35:02 | 2015-06-15T07:35:02 | 36,839,188 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package manage.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;
public class JSONDateProcessor implements JsonValueProcessor {
private SimpleDateFormat sdf=null;
public JSONDateProcessor(){
sdf=new SimpleDateFormat("yyyy-MM-dd");
}
public JSONDateProcessor(String fmt){
sdf=new SimpleDateFormat(fmt);
}
public Object processObjectValue(String key, Object val, JsonConfig conf) {
// TODO Auto-generated method stub
return sdf.format((Date)val);
}
public Object processArrayValue(Object val, JsonConfig conf) {
// TODO Auto-generated method stub
return sdf.format((Date)val);
}
}
| [
"995804286@qq.com"
] | 995804286@qq.com |
f14d2b0d5192dd7261998f64b89b688268bad300 | 04a12720462c0cfce091e25b8cdaedb13f921b61 | /javaAdvance/day03-权限修饰符、代码块、常用API/代码/day03_10包装类/src/com/itheima01_包装类概述与装箱拆箱/Test.java | 83dcbea9b6985f360869dc90a5e4fd392511a21b | [] | no_license | haoxiangjiao/Java20210921 | 31662732e44b248208b21f6f1aaf18e6335b398c | 6edcbd081d33bace427fdc6041e9eeaac89def8a | refs/heads/main | 2023-07-19T03:42:17.498075 | 2021-09-25T15:06:11 | 2021-09-25T15:06:11 | 409,024,583 | 0 | 0 | null | 2021-09-22T01:19:43 | 2021-09-22T01:19:43 | null | UTF-8 | Java | false | false | 2,080 | java | package com.itheima01_包装类概述与装箱拆箱;
/*
概述:
Java提供了两个类型系统,基本类型与引用类型,基本类型效率更高。
为了便于操作,java为在lang包下为基本类型创建了对应的引用类型,称为包装类
由于分类较多,接下来的讲解统一以Integer为例类。
包装类分类
| 类型 | byte | short | int | long | float | double | char | boolean |
| ------ | ---- | ----- | ------- | ---- | ----- | ------ | --------- | ------- |
| 包装类 | Byte | Short | Integer | Long | Float | Double | Character | Boolean |
构造方法
public Integer(int value) 根据 int 值创建 Integer 对象(过时)
public Integer(String s) 根据 String 值创建 Integer 对象(过时)
常用方法
public static Integer valueOf(int i) 返回表示指定的 int 值的 Integer 实例
public static Integer valueOf(String s) 返回保存指定String值的 Integer 对象
public static int intValue() 返回Integer对象的int形式
装箱与拆箱概述:
装箱:从基本类型转换为对应的包装类对象(构造方法/valueOf)。
拆箱:从包装类对象转换为对应的基本类型(intValue)
需求:演示装箱与拆箱
*/
public class Test {
public static void main(String[] args) {
// 装箱:基本类型--->包装类
int i = 10;
Integer ii1 = new Integer(i);
System.out.println(ii1);
String i2 = "20";
Integer ii2 = new Integer(i2);
System.out.println(ii2);
int i3 = 30;
Integer ii3 = Integer.valueOf(i3);
System.out.println(ii3);
String i4 = "40";
Integer ii4 = Integer.valueOf(i4);
System.out.println(ii4);
System.out.println("--------");
// 拆箱 包装类 ---->基本数据类型
Integer ii5 = new Integer(10);
int i5 = ii5.intValue();
System.out.println(i5);
// System.out.println(Integer.toBinaryString(10));
}
}
| [
"70306977+liufanpy@users.noreply.github.com"
] | 70306977+liufanpy@users.noreply.github.com |
a2632421a9870a220316990be7f855c21f9a197e | 7a5b98b7ed58fdf9b6c479bb5c5afe08de5b4d62 | /src/pacs/servlet/BaseBackServlet.java | 00c9408b654bfd58e46924ab1807fbef6dc57fea | [] | no_license | Number-33/how2j | dc661cca4ab52357d2c4841af73de7949174d5b8 | a0d716e0c958c94b419d19d898834051739c6386 | refs/heads/master | 2020-09-24T20:36:15.634727 | 2019-12-04T10:38:29 | 2019-12-04T10:38:29 | 225,837,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,560 | java | package pacs.servlet;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import pacs.dao.*;
import pacs.util.Page;
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 java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @program: PACS
* @Date: 2019/11/24 1:05
* @Author: Mr.Liu
* @Description:
*/
/*服务端跳转/categoryServlet就到了CategoryServlet这个类里
1. 首先CategoryServlet继承了BaseBackServlet,而BaseBackServlet又继承了HttpServlet
2. 服务端跳转过来之后,会访问CategoryServlet的doGet()或者doPost()方法
3. 在访问doGet()或者doPost()之前,会访问service()方法
4. BaseBackServlet中重写了service() 方法,所以流程就进入到了service()中
5. 在service()方法中有三块内容
5.1 第一块是获取分页信息
5.2 第二块是根据反射访问对应的方法
5.3 第三块是根据对应方法的返回值,进行服务端跳转、客户端跳转、或者直接输出字符串。
6. 第一块和第三块放在后面讲解,这里着重讲解第二块是根据反射访问对应的方法
6.1 取到从BackServletFilter中request.setAttribute()传递过来的值 list
6.2 根据这个值list,借助反射机制调用CategoryServlet类中的list()方法
这样就达到了CategoryServlet.list()方法被调用的效果*/
public abstract class BaseBackServlet extends HttpServlet {
public abstract String add(HttpServletRequest request, HttpServletResponse response, Page page) ;
public abstract String delete(HttpServletRequest request, HttpServletResponse response, Page page) ;
public abstract String edit(HttpServletRequest request, HttpServletResponse response, Page page) ;
public abstract String update(HttpServletRequest request, HttpServletResponse response, Page page) ;
public abstract String list(HttpServletRequest request, HttpServletResponse response, Page page) ;
protected CategoryDAO categoryDAO = new CategoryDAO();
protected OrderDAO orderDAO = new OrderDAO();
// protected OrderItemDAO orderItemDAO = new OrderItemDAO();
protected DoctorDAO doctorDAO = new DoctorDAO();
protected DoctorImageDAO doctorImageDAO = new DoctorImageDAO();
protected PropertyDAO propertyDAO = new PropertyDAO();
protected PropertyValueDAO propertyValueDAO = new PropertyValueDAO();
protected ReviewDAO reviewDAO = new ReviewDAO();
protected UserDAO userDAO = new UserDAO();
public void service(HttpServletRequest request, HttpServletResponse response) {
try {
/*获取分页信息*/
int start= 0;
int count = 5;
try {
start = Integer.parseInt(request.getParameter("page.start"));
} catch (Exception e) {
}
try {
count = Integer.parseInt(request.getParameter("page.count"));
} catch (Exception e) {
}
Page page = new Page(start,count);
/*借助反射,调用对应的方法*/
String method = (String) request.getAttribute("method");
Method m = this.getClass().getMethod(method, javax.servlet.http.HttpServletRequest.class,
javax.servlet.http.HttpServletResponse.class,Page.class);
String redirect = m.invoke(this,request, response,page).toString();
/*根据方法的返回值,进行相应的客户端跳转,服务端跳转,或者仅仅是输出字符串*/
if(redirect.startsWith("@"))
response.sendRedirect(redirect.substring(1));//客户端跳转
else if(redirect.startsWith("%"))
response.getWriter().print(redirect.substring(1));//输出内容
else
request.getRequestDispatcher(redirect).forward(request, response);//服务器跳转
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
}
public InputStream parseUpload(HttpServletRequest request, Map<String, String> params) {
InputStream is =null;
try {
DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
// 设置上传文件的大小限制为10M
factory.setSizeThreshold(1024 * 10240);
List items = upload.parseRequest(request);
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (!item.isFormField()) {
// item.getInputStream() 获取上传文件的输入流
is = item.getInputStream();
} else {
String paramName = item.getFieldName();
String paramValue = item.getString();
paramValue = new String(paramValue.getBytes("ISO-8859-1"), "UTF-8");
params.put(paramName, paramValue);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return is;
}
} | [
"lioubiao123@foxmail.com"
] | lioubiao123@foxmail.com |
42f4f08582b8f1c11bb995a672032adb454a40c8 | 4955edd8c884d6efbe22268e2092b16cb73ca818 | /src/com/syntax/class14/TrimMethod.java | 38839d58e252e7fd23376cabba7d159219ef3d3e | [] | no_license | samuelwoldegiorgis/JavaBatch8sam | 47e2cdfdd6f51bf00bb263f9466a16ca1b3188b2 | a96ccc6c5c50e4687663808e8cd24f4d6b0ff2aa | refs/heads/main | 2023-01-12T00:30:46.131438 | 2020-11-07T20:01:00 | 2020-11-07T20:01:00 | 304,180,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package com.syntax.class14;
public class TrimMethod {
public static void main(String[] args) {
String var="Moneer confused ";
System.out.println(var.trim());
System.out.println(var);
}
}
| [
"samgmil19@gmail.com"
] | samgmil19@gmail.com |
62ddaa9df7ba6e6f7626b608078d8088bd233a5c | 04f141bc6b4fdfed14e3d87f265d5f83780afb2d | /lib/DevAssist/src/main/java/dev/engine/json/DevJSONEngine.java | b6817284bd48cee47a389935dc5537892a3a4336 | [
"Apache-2.0"
] | permissive | lovemianhuatang/DevUtils | 961cce323a3a4ea0e553e779d744f38c673c533c | bcc8cd8253ef1348ad058d14b38cc1998d2311fc | refs/heads/master | 2020-09-13T18:43:16.621394 | 2019-11-20T06:49:14 | 2019-11-20T06:49:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,095 | java | package dev.engine.json;
import java.lang.reflect.Type;
/**
* detail: JSON Engine
* @author Ttt
* <pre>
* Application: DevJSONEngine.initEngine()
* use: DevJSONEngine.xxx
* </pre>
*/
public final class DevJSONEngine {
private DevJSONEngine() {
}
// IJSONEngine
private static IJSONEngine sJSONEngine;
/**
* 初始化 Engine
* @param jsonEngine {@link IJSONEngine}
*/
public static void initEngine(final IJSONEngine jsonEngine) {
DevJSONEngine.sJSONEngine = jsonEngine;
}
// ===============
// = IJSONEngine =
// ===============
// ============
// = 转换方法 =
// ============
/**
* 将对象转换为 JSON String
* @param object {@link Object}
* @return JSON String
*/
public static String toJson(final Object object) {
if (sJSONEngine != null) {
return sJSONEngine.toJson(object);
}
return null;
}
/**
* 将对象转换为 JSON String
* @param object {@link Object}
* @param jsonConfig {@link IJSONEngine.JSONConfig}
* @return JSON String
*/
public static String toJson(final Object object, final IJSONEngine.JSONConfig jsonConfig) {
if (sJSONEngine != null) {
return sJSONEngine.toJson(object, jsonConfig);
}
return null;
}
// =
/**
* 将 JSON String 映射为指定类型对象
* @param json JSON String
* @param classOfT {@link Class} T
* @param <T> 泛型
* @return instance of type
*/
public static <T> T fromJson(final String json, final Class<T> classOfT) {
if (sJSONEngine != null) {
return sJSONEngine.fromJson(json, classOfT);
}
return null;
}
/**
* 将 JSON String 映射为指定类型对象
* @param json JSON String
* @param classOfT {@link Class} T
* @param jsonConfig {@link IJSONEngine.JSONConfig}
* @param <T> 泛型
* @return instance of type
*/
public static <T> T fromJson(final String json, final Class<T> classOfT, final IJSONEngine.JSONConfig jsonConfig) {
if (sJSONEngine != null) {
return sJSONEngine.fromJson(json, classOfT, jsonConfig);
}
return null;
}
// =
/**
* 将 JSON String 映射为指定类型对象
* @param json JSON String
* @param typeOfT {@link Type} T
* @param <T> 泛型
* @return instance of type
*/
public static <T> T fromJson(final String json, final Type typeOfT) {
if (sJSONEngine != null) {
return sJSONEngine.fromJson(json, typeOfT);
}
return null;
}
/**
* 将 JSON String 映射为指定类型对象
* @param json JSON String
* @param typeOfT {@link Type} T
* @param jsonConfig {@link IJSONEngine.JSONConfig}
* @param <T> 泛型
* @return instance of type
*/
public static <T> T fromJson(final String json, final Type typeOfT, final IJSONEngine.JSONConfig jsonConfig) {
if (sJSONEngine != null) {
return sJSONEngine.fromJson(json, typeOfT, jsonConfig);
}
return null;
}
// ============
// = 其他方法 =
// ============
/**
* 判断字符串是否 JSON 格式
* @param json 待校验 JSON String
* @return {@code true} yes, {@code false} no
*/
public static boolean isJSON(final String json) {
if (sJSONEngine != null) {
return sJSONEngine.isJSON(json);
}
return false;
}
/**
* JSON String 缩进处理
* @param json JSON String
* @return JSON String
*/
public static String toJsonIndent(final String json) {
if (sJSONEngine != null) {
return sJSONEngine.toJsonIndent(json);
}
return null;
}
/**
* JSON String 缩进处理
* @param json JSON String
* @param jsonConfig {@link IJSONEngine.JSONConfig}
* @return JSON String
*/
public static String toJsonIndent(final String json, final IJSONEngine.JSONConfig jsonConfig) {
if (sJSONEngine != null) {
return sJSONEngine.toJsonIndent(json, jsonConfig);
}
return null;
}
// =
/**
* Object 转 JSON String 并进行缩进处理
* @param object {@link Object}
* @return JSON String
*/
public static String toJsonIndent(final Object object) {
if (sJSONEngine != null) {
return sJSONEngine.toJsonIndent(object);
}
return null;
}
/**
* Object 转 JSON String 并进行缩进处理
* @param object {@link Object}
* @param jsonConfig {@link IJSONEngine.JSONConfig}
* @return JSON String
*/
public static String toJsonIndent(final Object object, final IJSONEngine.JSONConfig jsonConfig) {
if (sJSONEngine != null) {
return sJSONEngine.toJsonIndent(object, jsonConfig);
}
return null;
}
}
| [
"13798405957@163.com"
] | 13798405957@163.com |
c1159d807bbea7401a7a7568d7457274c4708891 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/tinder/domain/common/model/SpotifyTrack.java | 8dd112545aa6c311e66e75d90fd47b62891b9d60 | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 1,520 | java | package com.tinder.domain.common.model;
import android.support.annotation.Nullable;
import java.util.List;
public abstract class SpotifyTrack {
public static abstract class Artist {
public static abstract class Builder {
public abstract Artist build();
public abstract Builder id(String str);
public abstract Builder name(String str);
}
public abstract String id();
public abstract String name();
public static Builder builder() {
return new Builder();
}
}
public static abstract class Builder {
public abstract Builder artists(List<Artist> list);
public abstract Builder artworkUrl(String str);
public abstract SpotifyTrack build();
public abstract Builder id(String str);
public abstract Builder isPlayable(boolean z);
public abstract Builder name(String str);
public abstract Builder popularity(int i);
public abstract Builder previewUrl(String str);
public abstract Builder uri(String str);
}
public abstract List<Artist> artists();
@Nullable
public abstract String artworkUrl();
public abstract String id();
public abstract boolean isPlayable();
public abstract String name();
public abstract int popularity();
@Nullable
public abstract String previewUrl();
public abstract String uri();
public static Builder builder() {
return new Builder();
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
de57d1fefe08952c10d9fb961199eaeca23d2a5f | d575b3bcad08655f86c33b8881dbabfaaa72a270 | /edu/asu/jmars/layer/util/ElevationSource.java | 6013528909e41288480d0d00360e085793c30251 | [] | no_license | cryptowealth-technology/jmars_clone | c99f91dca54ed8bea904bd82329bd2ae1b2ff5c3 | 67a51cb938c717cd1b92514f6724aa3c9a92d19e | refs/heads/master | 2022-03-28T16:17:07.765162 | 2019-12-20T02:42:10 | 2019-12-20T02:42:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 968 | java | package edu.asu.jmars.layer.util;
import edu.asu.jmars.util.HVector;
/**
* Models a DEM, which may come from a file, an image in memory, or a web service.
*/
public interface ElevationSource {
public int getPPD();
/** @return the minimum elevation value of this DEM, in km above center of mass */
public double getMinElevation();
/** @return the maximum elevation value of this DEM, in km above center of mass */
public double getMaxElevation();
/** @return the elevation above this DEM at the give position, in km above center of mass */
public double getElevation(HVector v);
/** @return an array of elevations above this DEM at each corresponding position in the given array, each element in km above center of mass */
public double[] getElevation(HVector[] v);
/** @return the intersection of a ray from the given position along the given look vector with this DEM */
public HVector getSurfacePoint(HVector pos, HVector look);
}
| [
"michael.r.klear@gmail.com"
] | michael.r.klear@gmail.com |
fc24f3d5b83008e2d1691f491619c5265cde90c6 | ab7c374e12ef55482d1c622a0099a7b262195322 | /jami-core/src/main/java/psidev/psi/mi/jami/utils/comparator/participant/UnambiguousExactModelledParticipantInteractorComparator.java | 77643b66a1044d4e7605592c1e4ee39be7538bfe | [
"Apache-2.0"
] | permissive | colin-combe/psi-jami | 9f945d885d76454f7b652382cc676ac98e6faa39 | 64fb0596b99aa8996d865b5eae0a2094be0889c8 | refs/heads/master | 2020-12-07T02:17:10.909871 | 2017-06-07T07:05:14 | 2017-06-07T07:05:14 | 64,655,225 | 0 | 0 | null | 2017-03-09T14:26:30 | 2016-08-01T09:43:06 | Java | UTF-8 | Java | false | false | 3,052 | java | package psidev.psi.mi.jami.utils.comparator.participant;
import psidev.psi.mi.jami.model.ModelledEntity;
import psidev.psi.mi.jami.utils.comparator.interactor.UnambiguousExactComplexComparator;
import psidev.psi.mi.jami.utils.comparator.interactor.UnambiguousExactInteractorComparator;
/**
* Unambiguous exact biological participant comparator based on the interactor only.
* It will compare the basic properties of an interactor using UnambiguousExactInteractorComparator.
*
* This comparator will ignore all the other properties of a biological participant.
*
* @author Marine Dumousseau (marine@ebi.ac.uk)
* @version $Id$
* @since <pre>30/05/13</pre>
*/
public class UnambiguousExactModelledParticipantInteractorComparator extends
ParticipantInteractorComparator<ModelledEntity> implements CustomizableModelledParticipantComparator<ModelledEntity>{
private static UnambiguousExactModelledParticipantInteractorComparator unambiguousExactParticipantInteractorComparator;
private boolean checkComplexesAsInteractor = true;
/**
* Creates a new UnambiguousExactModelledParticipantInteractorComparator. It will use a UnambiguousExactInteractorComparator to compare
* the basic properties of an interactor.
*/
public UnambiguousExactModelledParticipantInteractorComparator() {
super(null);
setInteractorComparator(new UnambiguousExactInteractorComparator(new UnambiguousExactComplexComparator(this)));
}
@Override
public UnambiguousExactInteractorComparator getInteractorComparator() {
return (UnambiguousExactInteractorComparator) super.getInteractorComparator();
}
@Override
/**
* It will compare the basic properties of an interactor using UnambiguousInteractorComparator.
*
* This comparator will ignore all the other properties of a biological participant.
*/
public int compare(ModelledEntity component1, ModelledEntity component2) {
return checkComplexesAsInteractor ? super.compare(component1, component2) : 0;
}
/**
* Use UnambiguousExactModelledParticipantInteractorComparator to know if two biological participants are equals.
* @param component1
* @param component2
* @return true if the two biological participants are equal
*/
public static boolean areEquals(ModelledEntity component1, ModelledEntity component2){
if (unambiguousExactParticipantInteractorComparator == null){
unambiguousExactParticipantInteractorComparator = new UnambiguousExactModelledParticipantInteractorComparator();
}
return unambiguousExactParticipantInteractorComparator.compare(component1, component2) == 0;
}
public boolean isCheckComplexesAsInteractors() {
return checkComplexesAsInteractor;
}
public void setCheckComplexesAsInteractors(boolean checkComplexesAsInteractors) {
this.checkComplexesAsInteractor = checkComplexesAsInteractors;
}
public void clearProcessedComplexes() {
// do nothing
}
}
| [
"mdumousseau@yahoo.com@73e66818-4ebf-11de-a6a3-df26d2c71dbe"
] | mdumousseau@yahoo.com@73e66818-4ebf-11de-a6a3-df26d2c71dbe |
efdffc6f6641e4ddef5fbaf3513315291d0f0b53 | e33134036c047782277aef6408a1fe47437772f1 | /src/odra/sbql/ast/expressions/ToRealExpression.java | a6f4b9412b8dc4bc47d28343c1fdffe1dcbce32c | [] | no_license | gregcarlin/ODRA-with-Enums | 3c7419c8d5adda13d4969acf9058fbd54a667b59 | e8c077acff0b851103f3e439c42effdf957bd67a | refs/heads/master | 2021-05-27T05:08:31.350954 | 2014-09-13T01:43:12 | 2014-09-13T01:43:12 | 17,455,848 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 342 | java | package odra.sbql.ast.expressions;
import odra.sbql.SBQLException;
import odra.sbql.ast.ASTVisitor;
public class ToRealExpression extends UnaryExpression {
public ToRealExpression(Expression e) {
super(e);
}
public Object accept(ASTVisitor vis, Object attr) throws SBQLException {
return vis.visitToRealExpression(this, attr);
}
}
| [
"gregthegeek@optonline.net"
] | gregthegeek@optonline.net |
fcdc210d6cc5b02b4a300b28923fb5d4517dc4b9 | 19384c145f8542c9fff1723ad5d3c949bc5b6f90 | /Lab08/com/unicamp/mc322/lab08/Acao/Acao.java | 512a69865c55496fe9147e6f3fdcc2c7ef3cc130 | [] | no_license | Necctares/MC322 | e75b225cc5bb19ad1eac824875e8578b24f4fd3f | 25f408ab06b5a1d7ffcb18351791bd664ef2b798 | refs/heads/main | 2023-07-17T03:45:51.452462 | 2021-08-04T21:09:14 | 2021-08-04T21:09:14 | 392,819,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.unicamp.mc322.lab08.Acao;
import java.time.LocalDate;
public abstract class Acao {
private LocalDate dataAcao;
protected Acao() {
dataAcao = LocalDate.now();
}
public String getData() {
String dataTweet = String.valueOf(dataAcao.getDayOfMonth()) + "/" + String.valueOf(dataAcao.getMonthValue()) + "/" + String.valueOf(dataAcao.getYear());
return dataTweet;
}
public abstract String informarAcao();
}
| [
"noreply@github.com"
] | noreply@github.com |
13c4d55dd0d63abbd1cf52191751fc9320c8a934 | b0edd31d2129b909426222e2f48d15cf472539c5 | /services/src/main/java/org/keycloak/utils/IpAddressMatcher.java | 24f41172f3e94530fb5ec3055a64924796951edc | [
"Apache-2.0"
] | permissive | nedashley/keycloak | added212654f48c12604cc5ea83784db61a0085c | c1301a8c9e2b97ea0afc02da3b35a801ed5f7ecf | refs/heads/master | 2020-04-08T09:01:04.555219 | 2018-11-26T20:08:28 | 2018-11-26T20:08:28 | 157,523,050 | 0 | 0 | null | 2018-11-14T09:21:32 | 2018-11-14T09:21:32 | null | UTF-8 | Java | false | false | 3,886 | java | package org.keycloak.utils;
/*
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
/**
* This class is based on the IpAddressMatcher from Spring Security Framework
* <p>
* https://github.com/spring-projects/spring-security/blob/master/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java
* <p>
* *** Notes from Author ***
* <p>
* Matches a request based on IP Address or subnet mask matching against the remote
* address.
* <p>
* Both IPv6 and IPv4 addresses are supported, but a matcher which is configured with an
* IPv4 address will never match a request which returns an IPv6 address, and vice-versa.
*
* @author Luke Taylor
* @since 3.0.2
*/
public final class IpAddressMatcher {
private final int nMaskBits;
private final InetAddress requiredAddress;
/**
* Takes a specific IP address or a range specified using the IP/Netmask (e.g.
* 192.168.1.0/24 or 202.24.0.0/14).
*
* @param ipAddress the address or range of addresses from which the request must
* come.
*/
public IpAddressMatcher(String ipAddress) {
if (ipAddress.indexOf('/') > 0) {
String[] addressAndMask = splitString(ipAddress, "/");
ipAddress = addressAndMask[0];
nMaskBits = Integer.parseInt(addressAndMask[1]);
} else {
nMaskBits = -1;
}
requiredAddress = parseAddress(ipAddress);
}
private String[] splitString(String input, String splitRegex) {
if ((input == null) || (input.length() == 0)) {
return new String[]{};
}
return input.split(splitRegex);
}
public boolean matches(HttpServletRequest request) {
return matches(request.getRemoteAddr());
}
public boolean matches(String address) {
InetAddress remoteAddress = parseAddress(address);
if (!requiredAddress.getClass().equals(remoteAddress.getClass())) {
return false;
}
if (nMaskBits < 0) {
return remoteAddress.equals(requiredAddress);
}
byte[] remAddr = remoteAddress.getAddress();
byte[] reqAddr = requiredAddress.getAddress();
int oddBits = nMaskBits % 8;
int nMaskBytes = nMaskBits / 8 + (oddBits == 0 ? 0 : 1);
byte[] mask = new byte[nMaskBytes];
Arrays.fill(mask, 0, oddBits == 0 ? mask.length : mask.length - 1, (byte) 0xFF);
if (oddBits != 0) {
int finalByte = (1 << oddBits) - 1;
finalByte <<= 8 - oddBits;
mask[mask.length - 1] = (byte) finalByte;
}
// System.out.println("Mask is " + new sun.misc.HexDumpEncoder().encode(mask));
for (int i = 0; i < mask.length; i++) {
if ((remAddr[i] & mask[i]) != (reqAddr[i] & mask[i])) {
return false;
}
}
return true;
}
private InetAddress parseAddress(String address) {
try {
return InetAddress.getByName(address);
} catch (UnknownHostException e) {
throw new IllegalArgumentException("Failed to parse address" + address, e);
}
}
} | [
"128699c75e3f14ce1bf6de934ac38c1891152c65"
] | 128699c75e3f14ce1bf6de934ac38c1891152c65 |
7b988c2b7c26c4578b3c050b8065b99b362a6fa2 | 61511002c50792305f287ad9afa64fa3c03d1e7a | /app/src/main/java/com/saskpolytech/cst135/Untils/AsyncResponse.java | 72fd35b10b4a567af6bbaf0c9166b14dbcbf00f8 | [] | no_license | msabares/movie-manager | 74b03ecb23f9da4a873cb0f00cca42db6730f9e0 | 47ecb984c3de87e473a391d751bebd74e3abe909 | refs/heads/master | 2020-06-18T12:33:26.257523 | 2019-07-11T02:28:05 | 2019-07-11T02:28:05 | 196,303,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package com.saskpolytech.cst135.Untils;
import com.saskpolytech.cst135.Movie;
import java.util.ArrayList;
/**
* File Name: AsyncResponse.java
* Author: Michael Sabares CST135
* Date: 05/30/2019
* Purpose: I had to make this MovieSearch can obtain the processed data from NetworkUtils.. maybe?
*/
public interface AsyncResponse {
void processFinish(ArrayList<Movie> movieResultList);
}
| [
"msabares@gmail.com"
] | msabares@gmail.com |
9d589ff2d723261e396e727f8989d209626f7908 | 67c17ceb882006cf46ee1b8dd3598bfdaa1bd113 | /Sandeep/src/Arraysprograms/Excercises/Excercises34.java | 95682ff4d66500ef685d7c8904ae54d4a7e0c3a6 | [] | no_license | TechieFrogs-Warriors/JavaBasics | f235205bcbe557d89409bf6cb74bae1c5279ebcd | 79a83f8db96fc9f57da872a0571497df4551d01b | refs/heads/main | 2023-05-04T15:43:41.130753 | 2021-05-17T07:41:45 | 2021-05-17T07:41:45 | 321,665,844 | 1 | 0 | null | 2020-12-16T04:43:34 | 2020-12-15T12:47:49 | null | UTF-8 | Java | false | false | 652 | java | package Arraysprograms.Excercises;
public class Excercises34 {
public static void main(String[] args) {
int arr1[][] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int row = arr1.length;
int col = arr1[0].length;
int sumr, sumc;
for (int i = 0; i < row; i++) {
sumr = 0;
sumc = 0;
for (int j = 0; j < col; j++) {
sumr += arr1[i][j];
sumc += arr1[j][i];
}
System.out.println("sum of row : " + (i + 1) + " is : " + sumr);
System.out.println("sum of colum : " + (i + 1) + " is " + sumc);
}
}
}
| [
"saimaddipathi@gmail.com"
] | saimaddipathi@gmail.com |
30cfdacb0a6ebd28b3ccf248c9a8749d2ae7f1ac | 8e6090e5778ce247de5a1422d88b0ce7bcff0873 | /Algorithms/_1512NumberofGoodPairs.java | cd24961332e56b742fb7ed8a768678798e614c68 | [] | no_license | HungDuc1710/hungduc1710.github.io | 32a05ecd09cc77f2375091474d4e39bde8be0b4c | 242a11622e004ee29d43fdd61b82aa3b72a0abd9 | refs/heads/main | 2023-08-01T06:25:16.371289 | 2021-09-15T18:04:35 | 2021-09-15T18:04:35 | 346,011,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | class _1512NumberofGoodPairs {
public static int numIdenticalPairs(int[] nums) {
int count = 0;
for (int i = 0; i < nums.length; i++) {
for (int j = 1; j < nums.length; j++) {
if (nums[i] == nums[j] && i < j) {
count++;
}
}
}
return count;
}
public static void main(String[] args) {
int[] nums = { 1,1,1,1 };
System.out.println(numIdenticalPairs(nums));
}
} | [
"pduc96@gmail.com"
] | pduc96@gmail.com |
2839571b304161c03ce421bf413ac62bc360fe2a | 8db9e475380e1a1712840dae9c2f5fae5bed460a | /Watch.java | b23f68b4790c1570db350496c72bdc9a0de4b4f4 | [] | no_license | Ayyappa011/associationprogram | 3da3fec73f4400d2b810d13038b320765601fc8d | eaabc44b95ec28906451a014e0474388bc3ce598 | refs/heads/main | 2023-08-21T14:39:26.000531 | 2021-10-06T06:38:18 | 2021-10-06T06:38:18 | 413,696,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | class Watch
{
int totalno;
float price;
static String name;
Watch(int totalno,float price)
{
this.totalno=totalno;
this.price=price;
}
public static void main(String[] args)
{
Watch wref = new Watch(12,233.0f);
System.out.println(wref.totalno);
System.out.println(wref.price);
String name="sonta";
Watch wref1 = new Watch(11,23.0f);
System.out.println(wref1.price);
System.out.println(wref1.totalno);
String name="maximum";
System.out.println(wref1.name);
}
} | [
"noreply@github.com"
] | noreply@github.com |
fb7c8a454b4bafc3eb179765e8a42205d83e2948 | 22b1fe6a0af8ab3c662551185967bf2a6034a5d2 | /experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/Class_250.java | 1ba9fcbe27d9c4f886320bab7f4bb20591d0f729 | [
"Apache-2.0"
] | permissive | lesaint/experimenting-annotation-processing | b64ed2182570007cb65e9b62bb2b1b3f69d168d6 | 1e9692ceb0d3d2cda709e06ccc13290262f51b39 | refs/heads/master | 2021-01-23T11:20:19.836331 | 2014-11-13T10:37:14 | 2014-11-13T10:37:14 | 26,336,984 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package fr.javatronic.blog.massive.annotation1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_250 {
}
| [
"sebastien.lesaint@gmail.com"
] | sebastien.lesaint@gmail.com |
a8f1e0fe92eb4a923c474ffe470bff77804d4608 | 25cb677ef3376a0f3095cb63920af008e50798f2 | /src/main/java/com/apap/tugas_1/repository/ProvinsiDB.java | daae33e1a484ec6170a7e35aa840d3e5aff40308 | [] | no_license | Apap-2018/tugas1_1606832025 | 1ab819e03d4e99c5d25d29e9d01817e0faf7231b | 25cb8141d23010286b9ed293458f7e42bc377639 | refs/heads/master | 2020-04-03T06:48:28.293302 | 2018-10-29T15:02:54 | 2018-10-29T15:02:54 | 155,084,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package com.apap.tugas_1.repository;
import com.apap.tugas_1.model.ProvinsiModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ProvinsiDB extends JpaRepository<ProvinsiModel, Long>{
ProvinsiModel findProvinsiById(long id);
}
| [
"rachelsausan9g@gmail.com"
] | rachelsausan9g@gmail.com |
58d78df7852d8063cd77ccd5dd9209326d591381 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/appbrand/ui/collection/AppBrandCollectionDisplayVerticalList$$ExternalSyntheticLambda8.java | f5dfea7e7977c150c8eafac9f554dc25f42565b1 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 458 | java | package com.tencent.mm.plugin.appbrand.ui.collection;
public final class AppBrandCollectionDisplayVerticalList$$ExternalSyntheticLambda8
implements Runnable
{
public final void run() {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes8.jar
* Qualified Name: com.tencent.mm.plugin.appbrand.ui.collection.AppBrandCollectionDisplayVerticalList..ExternalSyntheticLambda8
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
5e13f75fbe4480f132a3b55e96a6608eb8d990cf | 1999160ceb1bee6ac64de11e3337a449e8268d07 | /core/src/main/java/io/atomix/core/map/impl/AsyncDistributedSortedJavaMap.java | 2b2a189dbc5fac86eddeb029f5a473b7bd6a3fc8 | [
"Apache-2.0"
] | permissive | aruanruan/atomix | 42cc6345b7dc3c12590392113fb6c65090d97372 | 0ea392ef66067fb2459f62e2b04ec77f13e5f981 | refs/heads/master | 2020-04-13T13:24:22.177537 | 2018-12-27T00:49:59 | 2018-12-27T00:49:59 | 141,731,321 | 0 | 0 | Apache-2.0 | 2018-07-29T23:57:11 | 2018-07-20T15:54:58 | Java | UTF-8 | Java | false | false | 2,238 | java | /*
* Copyright 2018-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.core.map.impl;
import io.atomix.core.map.AsyncDistributedSortedMap;
import io.atomix.core.map.DistributedSortedMap;
import io.atomix.primitive.protocol.PrimitiveProtocol;
import java.time.Duration;
import java.util.Map;
import java.util.SortedMap;
import java.util.concurrent.CompletableFuture;
/**
* Java-map wrapped asynchronous distributed sorted map.
*/
public class AsyncDistributedSortedJavaMap<K extends Comparable<K>, V> extends AsyncDistributedJavaMap<K, V> implements AsyncDistributedSortedMap<K, V> {
private final SortedMap<K, V> map;
public AsyncDistributedSortedJavaMap(String name, PrimitiveProtocol protocol, SortedMap<K, V> map) {
super(name, protocol, map);
this.map = map;
}
@Override
public CompletableFuture<K> firstKey() {
return complete(() -> map.firstKey());
}
@Override
public CompletableFuture<K> lastKey() {
return complete(() -> map.lastKey());
}
@Override
public AsyncDistributedSortedMap<K, V> subMap(K fromKey, K toKey) {
return new AsyncDistributedSortedJavaMap<>(name(), protocol(), map.subMap(fromKey, toKey));
}
@Override
public AsyncDistributedSortedMap<K, V> headMap(K toKey) {
return new AsyncDistributedSortedJavaMap<>(name(), protocol(), map.headMap(toKey));
}
@Override
public AsyncDistributedSortedMap<K, V> tailMap(K fromKey) {
return new AsyncDistributedSortedJavaMap<>(name(), protocol(), map.tailMap(fromKey));
}
@Override
public DistributedSortedMap<K, V> sync(Duration operationTimeout) {
return new BlockingDistributedSortedMap<>(this, operationTimeout.toMillis());
}
}
| [
"jordan.halterman@gmail.com"
] | jordan.halterman@gmail.com |
6513300a99a7174ba6531ad8a51afc5bc7137940 | 16022e4c5a04d35e744f6591b781ae0d5002c9c9 | /web/src/util/ExcelToBean2.java | dd1d89c9c2cf4bd6cde9c1535eb33f6ec4010373 | [] | no_license | er43567/pxzbapp | 6a8aef96ad27882afeaf25a55dd215f936de5fa3 | cfd54464f5e7f21c11e19caa828cb52045afe9cb | refs/heads/master | 2020-03-19T04:49:33.060606 | 2018-06-06T14:03:55 | 2018-06-06T14:03:55 | 135,871,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,184 | java | package util;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
public class ExcelToBean2 {
private static ResourceBundle userPropertiesBundle;
/**
* 2003<将excel表中的数据放入到List<Map<String, Object>>中
*
* @param workbook
* @return
*/
public static <T> List<Map<String, Object>> parseUpdateExcel(Workbook workbook, String path) {
userPropertiesBundle = ResourceBundle.getBundle(path);
List<Map<String, Object>> result = new LinkedList<Map<String, Object>>();
XSSFRow row_0 = (XSSFRow) workbook.getSheetAt(0).getRow(0);
int excleRowLength = row_0.getPhysicalNumberOfCells();
String[] columnName = new String[excleRowLength]; // 相应的javabean类的属性名称数组
/*
* for (String str1ss : userPropertiesBundle.keySet()) { try {
* System.out.println(new String(str1ss.getBytes("ISO-8859-1"),
* "utf-8")); } catch (UnsupportedEncodingException e) {
* e.printStackTrace(); } }
*/
try {
System.out.println(excleRowLength);
for (int i = 0; i < columnName.length; i++) { // 从资源文件中获取
// 获取第0行i列的数据
String str = row_0.getCell(i).getStringCellValue().trim();
// 编码转换
str = new String(str.getBytes("utf-8"), "ISO-8859-1").trim();
if (userPropertiesBundle.containsKey(str)) {
columnName[i] = userPropertiesBundle.getString(str);
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
// sheet
XSSFSheet sheet = (XSSFSheet) workbook.getSheetAt(sheetIndex);
// row
for (int rowIndex = 1; rowIndex < sheet.getPhysicalNumberOfRows(); rowIndex++) {
XSSFRow row = sheet.getRow(rowIndex);
Map<String, Object> map = new HashMap<String, Object>();
System.out.println(row.getPhysicalNumberOfCells());
for (int cellIndex = 0; cellIndex < row.getPhysicalNumberOfCells(); cellIndex++) {
// cell
XSSFCell cell = row.getCell(cellIndex);
if (columnName[cellIndex] != null && columnName[cellIndex].trim().length() > 0) { // 该列值在对应的java对象中有值
// 取出当前cell的值和对应Javabean类的属性放入到map中
map.put(columnName[cellIndex].trim(), getCellValue(cell));
}
}
result.add(map);
}
}
return result;
}
/**
* 将excel表中的数据放入到List<Map<String, Object>>中
*
* @param workbook
* @return
*/
public static <T> List<Map<String, Object>> parseExcel(Workbook workbook, String user) {
userPropertiesBundle = ResourceBundle.getBundle(user);
List<Map<String, Object>> result = new LinkedList<Map<String, Object>>();
HSSFRow row_0 = (HSSFRow) workbook.getSheetAt(0).getRow(0);
int excleRowLength = row_0.getPhysicalNumberOfCells();
String[] columnName = new String[excleRowLength]; // 相应的javabean类的属性名称数组
for (int i = 0; i < columnName.length; i++) { // 从资源文件中获取
String str = row_0.getCell(i).getStringCellValue().trim();
if (userPropertiesBundle.containsKey(str)) {
columnName[i] = userPropertiesBundle.getString(str);
}
}
for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
// sheet
HSSFSheet sheet = (HSSFSheet) workbook.getSheetAt(sheetIndex);
// row
for (int rowIndex = 1; rowIndex < sheet.getPhysicalNumberOfRows(); rowIndex++) {
HSSFRow row = sheet.getRow(rowIndex);
Map<String, Object> map = new HashMap<String, Object>();
for (int cellIndex = 0; cellIndex < row.getPhysicalNumberOfCells(); cellIndex++) {
// cell
HSSFCell cell = row.getCell(cellIndex);
if (columnName[cellIndex] != null && columnName[cellIndex].trim().length() > 0) { // 该列值在对应的java对象中有值
// 取出当前cell的值和对应Javabean类的属性放入到map中
map.put(columnName[cellIndex].trim(), getCellValue(cell));
}
}
result.add(map);
}
}
return result;
}
/**
* 利用反射将List<Map<String,Object>> 结构生成相应的List<T>数据
*/
public static <T> List<T> toObjectPerproList(List<Map<String, Object>> list, Class<T> clazz) throws Exception {
T t = null;
List<T> returnList = new LinkedList<T>();
for (int i = 0; i < list.size(); i++) {
// 利用反射创建Class对应的对象
t = clazz.newInstance();
// 遍历Map对象,用反射填充对象的属性
for (Map.Entry<String, Object> ent : list.get(i).entrySet()) {
String name = ent.getKey();
Object value = ent.getValue();
// 用反射赋值
setFieldValue(t, name, value);
}
returnList.add(t);
}
return returnList;
}
/**
* 获取当前单元格内容
*/
@SuppressWarnings("deprecation")
private static String getCellValue(Cell cell) {
String value = "";
if (null == cell) {
return value;
}
switch (cell.getCellType()) {
// 数值型
case Cell.CELL_TYPE_NUMERIC:
if (HSSFDateUtil.isCellDateFormatted(cell)) {
// 如果是date类型则 ,获取该cell的date值
Date date = HSSFDateUtil.getJavaDate(cell.getNumericCellValue());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
value = format.format(date);
} else {// 纯数字
BigDecimal big = new BigDecimal(cell.getNumericCellValue());
value = big.toString();
// 解决1234.0 去掉后面的.0
if (null != value && !"".equals(value.trim())) {
String[] item = value.split("[.]");
if (1 < item.length && "0".equals(item[1])) {
value = item[0];
}
}
}
break;
// 字符串类型
case Cell.CELL_TYPE_STRING:
value = cell.getStringCellValue().toString();
break;
// 公式类型
case Cell.CELL_TYPE_FORMULA:
// 读公式计算值
value = String.valueOf(cell.getNumericCellValue());
if (value.equals("NaN")) {// 如果获取的数据值为非法值,则转换为获取字符串
value = cell.getStringCellValue().toString();
}
break;
// 布尔类型
case Cell.CELL_TYPE_BOOLEAN:
value = " " + cell.getBooleanCellValue();
break;
// 空值
case Cell.CELL_TYPE_BLANK:
value = "";
break;
// 故障
case Cell.CELL_TYPE_ERROR:
value = "";
System.out.println("excel出现故障");
break;
default:
value = cell.getStringCellValue().toString();
}
if ("null".endsWith(value.trim())) {
value = "";
}
return value;
}
// 利用反射给对象赋值
public static void setFieldValue(Object object, String fieldName, Object value) {
Field field = null;
for (Class<?> superClass = object.getClass(); superClass != Object.class; superClass = superClass
.getSuperclass()) {
try {
field = superClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
System.out.println("异常");
}
}
if (field == null)
throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + object + "]");
if (!Modifier.isPublic(field.getModifiers())) {
field.setAccessible(true);
}
try {
field.set(object, value);
} catch (IllegalAccessException e) {
System.out.println("不可能抛出的异常");
} catch (IllegalArgumentException e1) {
System.out.println("this exception");
try {
field.set(object, Integer.parseInt((String) value));
} catch (IllegalArgumentException e11) {
e11.printStackTrace();
} catch (IllegalAccessException e11) {
e11.printStackTrace();
}
}
}
}
| [
"34000463+er43567@users.noreply.github.com"
] | 34000463+er43567@users.noreply.github.com |
7a5e44aa90e82cba50f44d477ce4e820716063dd | 4c8ce4b2c7c4ee786f474195c3a109fafbade5f2 | /src/main/java/org/ostenant/yoga/store/common/database/DynamicDataSource.java | c02cc7328a455cd001fc12275b6da5a81ededdb5 | [] | no_license | ostenant/yoga-store-core | a788a3e27b0a503b05400dc5049c3d575cf440de | 3a4a6cd6b3caef50c24731ba857ddec4c4a534a7 | refs/heads/master | 2021-01-22T23:34:11.917180 | 2017-04-12T14:24:56 | 2017-04-12T14:24:56 | 85,657,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package org.ostenant.yoga.store.common.database;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/**
* 项目名称:yoga-store <br>
* 类名称:DynamicDataSource <br>
* 类描述: 动态控制管理数据源 <br>
* 创建人:madison <br>
* 创建时间:2015-10-22 下午6:23:28 <br>
* 修改人:madison <br>
* 修改时间:2015-10-22 下午6:23:28 <br>
* 修改备注: <br>
* @version
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
Logger logger = LoggerFactory.getLogger(DynamicDataSource.class);
@Override
protected Object determineCurrentLookupKey() {
logger.debug("now it calls:" + DataSourceHolder.getLookupKey() + " database");
return DataSourceHolder.getLookupKey();
}
}
| [
"ostenant@163.com"
] | ostenant@163.com |
bd1452d78677899423f4a2380cc5d53688896acb | a1428336668b23b15164eeaae61135639f51b18f | /src/main/java/br/gov/ce/sspds/course/entities/User.java | f9678d00b364cc13fa6508963863b1fba7642d67 | [] | no_license | tatianabrito/spring-boot-course | 8e65884eba007cfd371999171ef6c36141282c8d | 275a69f306e3ad5f0fde26565e1d8e0a2d77b463 | refs/heads/master | 2022-12-09T22:32:33.366171 | 2020-09-06T23:41:49 | 2020-09-06T23:41:49 | 287,518,232 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,111 | java | package br.gov.ce.sspds.course.entities;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
@Table(name = "tb_user")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String email;
private String fone;
private String password;
@JsonIgnore
@OneToMany(mappedBy = "client")
private List<Order> orders = new ArrayList<>();
public User() {
}
public User(Long id, String name, String email, String fone, String password) {
super();
this.id = id;
this.name = name;
this.email = email;
this.fone = fone;
this.password = password;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFone() {
return fone;
}
public void setFone(String fone) {
this.fone = fone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public List<Order> getOrders() {
return orders;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"brito.tatiana@gmail.com"
] | brito.tatiana@gmail.com |
2b718b6632097d42b8cbef81dbd9f4207d5a27ac | 4041daeba12eac48874d5fd093bafb02c88aee08 | /src/main/java/com/library/office/OfficeServlet.java | 8849074b6e42c643c09dbb1385dfa6aa04c5c948 | [] | no_license | dmitrySheshko/library | 0411d0b9096397bd4b64c0bff600639a6676c80c | 3733e75dfce8006b10f913f6a2c726a91022add6 | refs/heads/master | 2021-01-19T23:25:14.168282 | 2017-05-08T08:58:05 | 2017-05-08T08:58:05 | 88,977,467 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 668 | java | package com.library.office;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/office")
public class OfficeServlet extends HttpServlet {
private OfficeService officeService = new OfficeService();
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
officeService.getUser(request);
request.getRequestDispatcher("/views/office/office.jsp").forward(request, response);
}
}
| [
"dm.sheshko@gmail.com"
] | dm.sheshko@gmail.com |
c5f10931380626cd5febf3a2335faa891ed3acb5 | db558c6a00423e616a79afb173ea95f0aec055f1 | /Chapter_04/Exercise04_05/Exercise04_05.java | 2816fd42a6e862a228ce1398d35ff18dd22b8a8a | [] | no_license | Zhandos-Hello-World/Introduction-to-Java | 79e455b86269e9cb6d1521de3f49dbddb980cc22 | 7ce2a220265cd48545dfb2d760c37e95acdffb88 | refs/heads/main | 2023-06-29T11:29:55.865640 | 2021-08-03T07:25:13 | 2021-08-03T07:25:13 | 350,361,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | /*
(Geometry: area of a regular polygon) A regular polygon is an n-sided polygon in
which all sides are of the same length and all angles have the same degree (i.e., the
polygon is both equilateral and equiangular). The formula for computing the area
of a regular polygon is
area = (ns * Math.pow(s, 2)) / (4 * Math.tan(Math.toRadians(180.0 / ns)));
Here, s is the length of a side. Write a program that prompts the user to enter the
number of sides and their length of a regular polygon and displays its area. Here is
a sample run:
Enter the number of sides: 5
Enter the side: 6.5
The area of the polygon is 72.69017017488385
*/
import java.util.Scanner;
public class Exercise04_05{
public static void main(String[] args) {
Scanner str = new Scanner(System.in);
System.out.print("Enter the number of sides: ");
double ns = str.nextDouble();
System.out.print("Enter the side: ");
double s = str.nextDouble();
double area = (ns * Math.pow(s, 2)) / (4 * Math.tan(Math.toRadians(180.0 / ns)));
System.out.print("The area of the polygon is " + area);
}
}
| [
"76952603+Zhandos-Hello-World@users.noreply.github.com"
] | 76952603+Zhandos-Hello-World@users.noreply.github.com |
e3a54ddc3ddc3ae6a099ab0fc89a5f58d2ca0cbf | a4386724c5e130ccf465d823f9f0f681a8c8863c | /src/test/java/me/ruici/upyun/GetObjectMetadata.java | baa8db6ad029c1d6ce7f1e6aaef085c13f3bf629 | [
"MIT"
] | permissive | luoruici/upyun-java | 3c778d3f8657fb3982403b573fde33b3eb043091 | 78540af2d814b7e948c15dcbf0f2d5d51fd1c381 | refs/heads/master | 2022-07-08T02:01:34.038827 | 2014-05-13T16:30:09 | 2014-05-13T16:30:09 | 19,681,513 | 0 | 0 | MIT | 2020-03-10T14:19:34 | 2014-05-12T00:50:42 | Java | UTF-8 | Java | false | false | 1,526 | java | package me.ruici.upyun;
import me.ruici.upyun.model.ObjectMetadata;
import me.ruici.upyun.service.GetObjectMetadataService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
@RunWith(JUnit4.class)
public class GetObjectMetadata extends BaseTest {
public static final Logger logger = LoggerFactory.getLogger(GetObjectMetadata.class);
private GetObjectMetadataService getObjectMetadataService;
@Before
@Override
public void init() throws IOException {
super.init();
this.getObjectMetadataService = new GetObjectMetadataService(this.config);
}
@Test
public void getObjectMetadataSuccessfully() {
ObjectMetadata metadata = this.getObjectMetadataService.getObjectMetadata("/icon/4002871.jpg");
Assert.assertEquals(ObjectMetadata.ObjectType.FILE, metadata.getType());
Assert.assertNotNull(metadata.getCreated());
}
@Test(expected = UpyunException.class)
public void getNonExistObjectMetadata() {
this.getObjectMetadataService.getObjectMetadata("/fdaffda/fdafdafaf.jpg");
}
@Test
public void getDirMetadata() {
ObjectMetadata metadata = this.getObjectMetadataService.getObjectMetadata("/icon");
Assert.assertEquals(ObjectMetadata.ObjectType.DIR, metadata.getType());
Assert.assertNotNull(metadata.getCreated());
}
}
| [
"luoruici@gmail.com"
] | luoruici@gmail.com |
7ddd70496f254751f0fc85d2839a86993f19540b | eb40acfd449fd86b23ebc708a5dfac3e2931a65c | /boot-gmall-api/src/main/java/com/jarvis/gmall/bean/PmsSkuInfo.java | 0b65c689ba9378f0910c077628aaca439c557ba2 | [] | no_license | jarvis-jg/boot-gmall | 3994b046cf8aadfff4e9b52135542325d2193bca | 62e3cd1737818bab67f7c41c4fa42d36cbdb8301 | refs/heads/master | 2022-07-01T02:55:34.438778 | 2020-05-13T12:59:49 | 2020-05-13T12:59:49 | 248,229,987 | 0 | 0 | null | 2022-06-17T03:12:23 | 2020-03-18T12:48:28 | Java | UTF-8 | Java | false | false | 2,828 | java | package com.jarvis.gmall.bean;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @param
* @return
*/
public class PmsSkuInfo implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
@Column
String id;
@Column
String productId;
@Transient
String spuId;
@Column
BigDecimal price;
@Column
String skuName;
@Column
BigDecimal weight;
@Column
String skuDesc;
@Column
String catalog3Id;
@Column
String skuDefaultImg;
@Transient
List<PmsSkuImage> skuImageList;
@Transient
List<PmsSkuAttrValue> skuAttrValueList;
@Transient
List<PmsSkuSaleAttrValue> skuSaleAttrValueList;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSpuId() {
return spuId;
}
public void setSpuId(String spuId) {
this.spuId = spuId;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getSkuName() {
return skuName;
}
public void setSkuName(String skuName) {
this.skuName = skuName;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public String getSkuDesc() {
return skuDesc;
}
public void setSkuDesc(String skuDesc) {
this.skuDesc = skuDesc;
}
public String getCatalog3Id() {
return catalog3Id;
}
public void setCatalog3Id(String catalog3Id) {
this.catalog3Id = catalog3Id;
}
public String getSkuDefaultImg() {
return skuDefaultImg;
}
public void setSkuDefaultImg(String skuDefaultImg) {
this.skuDefaultImg = skuDefaultImg;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public List<PmsSkuImage> getSkuImageList() {
return skuImageList;
}
public void setSkuImageList(List<PmsSkuImage> skuImageList) {
this.skuImageList = skuImageList;
}
public List<PmsSkuAttrValue> getSkuAttrValueList() {
return skuAttrValueList;
}
public void setSkuAttrValueList(List<PmsSkuAttrValue> skuAttrValueList) {
this.skuAttrValueList = skuAttrValueList;
}
public List<PmsSkuSaleAttrValue> getSkuSaleAttrValueList() {
return skuSaleAttrValueList;
}
public void setSkuSaleAttrValueList(List<PmsSkuSaleAttrValue> skuSaleAttrValueList) {
this.skuSaleAttrValueList = skuSaleAttrValueList;
}
}
| [
"jarvis_idea@163.com"
] | jarvis_idea@163.com |
9857ce7cd5f34d080ac51a161c1156f4ec5e9563 | 03bb71e6ced2bd66b530abed332df919b852a3db | /src/TransformarTemperatura.java | ad39100bc408be6d26fa17119f5830a013f6f532 | [] | no_license | sagov8/Data-Structure | 7fa5911ec1d68f00eb1de5d81acb303f0150fbcb | 6f2fdec445178a30976f2e265d1e7da9641400b9 | refs/heads/master | 2023-07-26T09:47:14.466407 | 2021-09-11T04:21:22 | 2021-09-11T04:21:22 | 405,281,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | import java.util.Scanner;
public class TransformarTemperatura {
public static void main(String[] args) {
double farenheit;
double celsius;
Scanner t = new Scanner(System.in);
System.out.println("Ingrese el valor en grados Farenheit: ");
farenheit = t.nextInt();
celsius = ( farenheit - 32 ) * 5 / 9;
System.out.println("La temperatura en grados Celsius es: " + celsius + "°");
System.out.println("Ingrese el valor en grados Celcius:");
celsius = t.nextInt();
farenheit = ( celsius * 9 / 5 ) + 32;
System.out.println("La temperatura en grados Farenheit es: " + farenheit + "°");
}
}
| [
"sago.vivas@gmail.com"
] | sago.vivas@gmail.com |
b38e1fb6a6f9427cef16ad09ae5eb58a6ae6a0ed | 3fc3436f05320a3294529749e170f2f30b4c4704 | /app/src/main/java/com/mobisoft/mbstest/index/IndexActivity.java | 4c8a62af4ae7f0787b71d4edaa38b2cd65526025 | [] | no_license | Android-Development-Group/BaseAndroidLib | d1514fa604ee6139cfc3ca212580e89ec252e14d | 4a2799263706ef968da0343f9dc1d695581f36e2 | refs/heads/master | 2020-05-07T13:30:06.924135 | 2019-04-28T05:54:32 | 2019-04-28T05:54:32 | 180,551,097 | 0 | 0 | null | 2019-04-10T09:43:22 | 2019-04-10T09:43:21 | null | UTF-8 | Java | false | false | 6,441 | java | package com.mobisoft.mbstest.index;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.mobisoft.mbstest.Base.BaseUrlConfig;
import com.mobisoft.mbstest.Injection;
import com.mobisoft.mbstest.R;
import com.mobisoft.mbstest.UMTest;
import com.mobisoft.mbstest.data.TasksDataSource;
import com.mobisoft.mbstest.data.TasksRepository;
import com.mobisoft.mbswebplugin.MbsWeb.HybridWebApp;
import com.mobisoft.mbswebplugin.MvpMbsWeb.MbsWebActivity;
import com.mobisoft.mbswebplugin.MvpMbsWeb.MbsWebFragment;
import com.mobisoft.mbswebplugin.helper.CoreConfig;
import com.mobisoft.mbswebplugin.helper.FunctionConfig;
import com.mobisoft.mbswebplugin.helper.ThemeConfig;
import com.mobisoft.mbswebplugin.utils.FileUtils;
import com.mobisoft.mbswebplugin.utils.ToastUtil;
import com.mobisoft.mbswebplugin.view.progress.CustomDialog;
public class IndexActivity extends AppCompatActivity {
private EditText input;
private TasksRepository repository;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_index);
input = (EditText) findViewById(R.id.checkedTextView);
repository = Injection.provideTasksRepository(IndexActivity.this);
String deviceInfo= UMTest.getDeviceInfo(this);
Log.i("deviceInfo",deviceInfo);
input.setText(deviceInfo);
}
/**
* @param view
*/
public void btnOnClick(View view) {
FunctionConfig.Builder builder = new FunctionConfig.Builder();
builder.setIsLeftIconShow(false);
FunctionConfig functionConfig = builder.build();
switch (view.getId()) {
case R.id.button:// 自定义主页
CoreConfig coreConfig1 =
new CoreConfig.Builder(
IndexActivity.this, ThemeConfig.DEFAULT, functionConfig)
.setAccount("8100458")//
.setNoAnimcation(false)
.setHideNavigation(false)
.build();
HybridWebApp.init(coreConfig1).startWebActivity(IndexActivity.this, MainActivity.class, null);
break;
case R.id.button2:// 默认页面
Bundle bundle = new Bundle();
bundle.putBoolean(MbsWebFragment.IS_REFRESH_ENABLE,true);
CoreConfig coreConfig2 =
new CoreConfig.Builder(
IndexActivity.this, ThemeConfig.DEFAULT, functionConfig)
.setNoAnimcation(false)
.setURL(BaseUrlConfig.URL_INDEX)
.setHideNavigation(false)
.build();
HybridWebApp.init(coreConfig2).startWebActivity(IndexActivity.this, MbsWebActivity.class, bundle);
break;
case R.id.button3:// 登录
String s = String.valueOf(input.getText());
if (!TextUtils.isEmpty(s)) {
repository.login(new TasksDataSource.LoadCallback() {
@Override
public void onTasksLoaded(String data) {
}
@Override
public void onDataNotAvailable() {
}
}, s);
CoreConfig coreConfig3 =
new CoreConfig.Builder(
IndexActivity.this, ThemeConfig.DEFAULT, functionConfig)
.setAccount("8100458")//
.setNoAnimcation(false)
.setHideNavigation(false)
.build();
HybridWebApp.init(coreConfig3).startWebActivity(IndexActivity.this, MainActivity.class, null);
IndexActivity.this.finish();
}
break;
case R.id.button4:// 退出
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
builder1.setTitle("提示");
builder1.setMessage("退出登录?");
builder1.setNegativeButton("取消", null);
builder1.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
repository.removeCurrentAccount(new TasksDataSource.LoadCallback() {
@Override
public void onTasksLoaded(String data) {
ToastUtil.showShortToast(IndexActivity.this, data);
}
@Override
public void onDataNotAvailable() {
}
});
}
});
builder1.show();
break;
case R.id.btn_clearcache://清理缓存
FileUtils.deleteFile(IndexActivity.this.getCacheDir());
CustomDialog dialog = new CustomDialog(IndexActivity.this,R.style.CustomDialog);
// CustomDialog dialog = new CustomDialog(IndexActivity.this);
dialog.setMessage("ssss");
dialog.show();
break;
case R.id.button5://清理缓存
// startActivity(new Intent(this, WebActivity.class));
CoreConfig coreConfig3 =
new CoreConfig.Builder(
IndexActivity.this, ThemeConfig.DEFAULT, functionConfig)
.setNoAnimcation(false)
.setURL(BaseUrlConfig.URL_ME )
.setHideNavigation(false)
.build();
HybridWebApp.init(coreConfig3).startWebActivity(IndexActivity.this, MbsWebActivity.class, null);
break;
default:
}
}
}
| [
"853687543@qq.com"
] | 853687543@qq.com |
8668e9c9191d9ff462b8d1ab3c5e7227d51766b6 | 5f329920336af89af4bb8ffca07ead49f492aa77 | /waitt-maven-plugin/src/main/java/net/unit8/waitt/mojo/AbstractRunMojo.java | 989fc6c48beaf097037dc34b1f4d44d96cd0613a | [
"Apache-2.0"
] | permissive | tenten0213/waitt | 7711f2eb55911dee0a66e3f4dc3c19cf5f919716 | c7e34361dd704dfe4a6e07a1b90c41b4926ff72a | refs/heads/master | 2021-01-23T03:05:22.985743 | 2016-08-30T09:18:10 | 2016-08-30T09:18:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,138 | java | package net.unit8.waitt.mojo;
import net.unit8.waitt.api.*;
import net.unit8.waitt.api.configuration.Feature;
import net.unit8.waitt.api.configuration.Server;
import net.unit8.waitt.api.configuration.WebappConfiguration;
import net.unit8.waitt.mojo.component.ArtifactResolver;
import net.unit8.waitt.mojo.component.ServerProvider;
import net.unit8.waitt.mojo.configuration.ExtraWebapp;
import net.unit8.waitt.mojo.configuration.ServerSpec;
import net.unit8.waitt.mojo.log.WaittLogHandler;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.project.ProjectBuildingResult;
import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.util.DirectoryScanner;
import org.fusesource.jansi.AnsiConsole;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.*;
import java.util.*;
import java.util.List;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import static java.util.logging.Level.*;
/**
* @author kawasima
*/
@SuppressWarnings("unchecked")
public abstract class AbstractRunMojo extends AbstractMojo {
private static final String[] WELLKNOWN_DOCROOT = {"src/main/webapp", "WebContent"};
@Parameter
private int port;
@Parameter(defaultValue = "8080")
private int startPort;
@Parameter(defaultValue = "9000")
private int endPort;
@Parameter(defaultValue = "")
private String contextPath;
@Parameter(defaultValue = "")
private String path;
@Parameter
private List<Server> servers;
@Parameter
private List<Feature> features;
@Parameter
protected File docBase;
@Component
protected ProjectBuilder projectBuilder;
@Parameter(defaultValue = "${project}", required = true, readonly = true)
protected MavenProject project;
@Parameter(defaultValue = "${session}", required = true, readonly = true)
protected MavenSession session;
@Component
protected RepositorySystem repositorySystem;
@Component
protected ArtifactResolver artifactResolver;
@Component
protected ServerProvider serverProvider;
private final List<ServerMonitor> serverMonitors = new ArrayList<ServerMonitor>();
private final List<LogListener> logListeners = new ArrayList<LogListener>();
private final List<ExtraWebapp> extraWebapps = new ArrayList<ExtraWebapp>();
private final List<WebappDecorator> webappDecorators = new ArrayList<WebappDecorator>();
/**
* Start embedded server.
*
* @throws MojoExecutionException
* @throws MojoFailureException
*/
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
AnsiConsole.systemInstall();
artifactResolver.setProject(project);
artifactResolver.setSession(session);
initLogger();
if (docBase == null)
docBase = scanDocBase(new File("."));
WebappConfiguration webappConfig = new WebappConfiguration();
webappConfig.setApplicationName(project.getName());
webappConfig.setBaseDirectory(docBase);
webappConfig.setPackages(PackageScanner.scan(new File(project.getBuild().getSourceDirectory())));
webappConfig.setSourceDirectory(new File(project.getBuild().getSourceDirectory()));
ClassRealm waittRealm = (ClassRealm) Thread.currentThread().getContextClassLoader();
ServerSpec serverSpec = serverProvider.selectServer(servers, waittRealm, session.getSettings().getInteractiveMode());
EmbeddedServer embeddedServer = serverSpec.getEmbeddedServer();
if (port == 0)
scanPort();
embeddedServer.setPort(port);
if (contextPath == null || contextPath.equals("/"))
contextPath = "";
embeddedServer.setBaseDir(".");
loadFeature(waittRealm, webappConfig);
try {
embeddedServer.start();
ClassRealm webappRealm = serverSpec.getClassRealm().createChildRealm("Application");
List<URL> classpathUrls = resolveClasspaths();
for (URL url : classpathUrls) {
webappRealm.addURL(url);
}
for (ServerMonitor serverMonitor : serverMonitors) {
serverMonitor.init(embeddedServer);
}
embeddedServer.setWebappDecorators(webappDecorators);
embeddedServer.setMainContext(contextPath, docBase.getAbsolutePath(), webappRealm);
for (ExtraWebapp extraWebapp : extraWebapps) {
extraWebapp.getRealm().setParentRealm(serverSpec.getClassRealm());
embeddedServer.addContext("/_" + extraWebapp.getName(), extraWebapp.getWarPath(), extraWebapp.getRealm());
}
for (ServerMonitor serverMonitor : serverMonitors) {
serverMonitor.start(embeddedServer);
}
path = path == null ? "" : path;
afterStart();
embeddedServer.await();
} catch (Exception e) {
throw new MojoExecutionException("Fail to start server", e);
} finally {
embeddedServer.stop();
}
}
abstract protected void afterStart() throws IOException;
/**
* Read artifacts.
*
* @param subDirectory a sub directory
* @param artifacts artifacts
* @param classpathFiles classpaths
* @throws MojoExecutionException
*/
private void readArtifacts(String subDirectory, List<Artifact> artifacts, List<File> classpathFiles)
throws MojoExecutionException {
File modulePom = (subDirectory == null || subDirectory.isEmpty()) ? new File("pom.xml") : new File(subDirectory, "pom.xml");
try {
ProjectBuildingRequest request = session.getProjectBuildingRequest()
.setProcessPlugins(false)
.setResolveDependencies(true);
ProjectBuildingResult result = projectBuilder.build(modulePom, request);
MavenProject subProject = result.getProject();
if ("war".equals(subProject.getPackaging())) {
docBase = (subDirectory == null || subDirectory.isEmpty()) ?
scanDocBase(new File(".")) :
scanDocBase(new File(subDirectory));
}
for (Artifact dependency : subProject.getArtifacts()) {
String scope = dependency.getScope();
if (Artifact.SCOPE_COMPILE.equals(scope)
|| Artifact.SCOPE_RUNTIME.equals(scope)
|| Artifact.SCOPE_SYSTEM.equals(scope)) {
artifacts.add(dependency);
}
}
classpathFiles.add(new File(subProject.getBuild().getOutputDirectory()));
} catch (Exception e) {
throw new MojoExecutionException("module(" + subDirectory + ") build failure", e);
}
}
/**
* Load features.
*
* @param waittRealm The realm of this plugin
* @param config The configuration of web application
*/
private void loadFeature(ClassRealm waittRealm, WebappConfiguration config) {
if (features == null) return;
for (Feature feature : features) {
String type = feature.getType();
if (type == null) {
type = "jar";
}
Artifact artifact = repositorySystem.createArtifact(feature.getGroupId(), feature.getArtifactId(), feature.getVersion(), type);
ClassRealm realm = artifactResolver.resolve(artifact, waittRealm);
config.getFeatures().add(feature);
if ("war".equals(artifact.getType())) {
String name = artifact.getArtifactId();
if (name.startsWith("waitt-")) {
name = name.substring("waitt-".length());
}
extraWebapps.add(new ExtraWebapp(name, artifact.getFile().getAbsolutePath(), realm));
} else {
ServiceLoader<ServerMonitor> serverMonitorLoader = ServiceLoader.load(ServerMonitor.class, realm);
for (ServerMonitor serverMonitor : serverMonitorLoader) {
if (serverMonitor instanceof ConfigurableFeature) {
((ConfigurableFeature) serverMonitor).config(config);
}
serverMonitors.add(serverMonitor);
}
ServiceLoader<LogListener> logListenerLoader = ServiceLoader.load(LogListener.class, realm);
for (LogListener logListener : logListenerLoader) {
if (logListener instanceof ConfigurableFeature) {
((ConfigurableFeature) logListener).config(config);
}
logListeners.add(logListener);
}
ServiceLoader<WebappDecorator> webappDecoratorLoader = ServiceLoader.load(WebappDecorator.class, realm);
for (WebappDecorator webappDecorator : webappDecoratorLoader) {
if (webappDecorator instanceof ConfigurableFeature) {
((ConfigurableFeature) webappDecorator).config(config);
}
webappDecorators.add(webappDecorator);
}
}
}
}
/**
* Initialize logger.
*/
private void initLogger() {
Logger logger = Logger.getLogger("");
logger.setLevel(ALL);
for (Handler handler : logger.getHandlers()) {
logger.removeHandler(handler);
}
logger.addHandler(new WaittLogHandler(getLog()));
logger.addHandler(new Handler() {
@Override
public void publish(LogRecord record) {
if (record.getLoggerName() != null && record.getLoggerName().startsWith("sun.awt."))
return;
Level lv = record.getLevel();
for (LogListener logListener : logListeners) {
if (Arrays.asList(ALL, CONFIG, FINE, FINER, FINEST).contains(lv)) {
logListener.debug(record.getMessage(), record.getThrown());
} else if (lv.equals(INFO)) {
logListener.info(record.getMessage(), record.getThrown());
} else if (lv.equals(WARNING)) {
logListener.warn(record.getMessage(), record.getThrown());
} else if (lv.equals(SEVERE)) {
logListener.error(record.getMessage(), record.getThrown());
}
}
}
@Override
public void flush() {
}
@Override
public void close() throws SecurityException {
}
});
}
/**
* Resolve dependencies as classpath.
*
* @return find classpath urls
* @throws MojoExecutionException
*/
private List<URL> resolveClasspaths() throws MojoExecutionException {
List<Artifact> artifacts = new ArrayList<Artifact>();
List<File> classpathFiles = new ArrayList<File>();
if (project.getModel().getModules().isEmpty()) {
readArtifacts("", artifacts, classpathFiles);
} else {
for (String module : project.getModel().getModules()) {
readArtifacts(module, artifacts, classpathFiles);
}
}
List<URL> classpathUrls = new ArrayList<URL>();
Set<String> uniqueArtifacts = new HashSet<String>();
try {
for (File classpathFile : classpathFiles) {
URL url = classpathFile.toURI().toURL();
classpathUrls.add(url);
}
for (URL url : ((URLClassLoader) Thread.currentThread().getContextClassLoader()).getURLs()) {
if (url.toString().contains("/org/ow2/asm/")
|| url.toString().contains("/waitt-maven-plugin/")
|| url.toString().contains("/net/sourceforge/cobertura/")) {
classpathUrls.add(url);
}
}
for (Artifact artifact : artifacts) {
if ("provided".equals(artifact.getScope()))
continue;
String versionlessKey = ArtifactUtils.versionlessKey(artifact);
if (!uniqueArtifacts.contains(versionlessKey)) {
classpathUrls.add(artifact.getFile().toURI().toURL());
uniqueArtifacts.add(versionlessKey);
}
}
return classpathUrls;
} catch (MalformedURLException e) {
throw new MojoExecutionException("Error during setting up classpath", e);
}
}
/**
* Scan a base directory.
*
* @param baseDir
* @return document
* @throws MojoExecutionException
*/
protected File scanDocBase(File baseDir) throws MojoExecutionException {
for (String dirStr : WELLKNOWN_DOCROOT) {
File docBase = new File(baseDir, dirStr);
if (docBase.isDirectory()) {
return docBase;
}
}
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(baseDir);
scanner.setIncludes(new String[]{"web.xml"});
scanner.addDefaultExcludes();
scanner.scan();
for (String path : scanner.getIncludedFiles()) {
File webxml = new File(baseDir, path);
if ("WEB-INF".equals(webxml.getParentFile().getName())) {
return webxml.getParentFile().getParentFile();
}
}
File dummy = new File(baseDir, "target/dummy_webapp");
if (!dummy.exists() && !dummy.mkdirs())
throw new MojoExecutionException("Can't create webapp directory");
return dummy;
}
/**
* Scan an available port.
*/
protected void scanPort() {
for (int p = startPort; p <= endPort; p++) {
try {
Socket sock = new Socket("localhost", p);
sock.close();
} catch (IOException e) {
port = p;
return;
}
}
throw new RuntimeException("Can't find available port from " + startPort + " to " + endPort);
}
public int getPort() {
return port;
}
public String getContextPath() {
return contextPath;
}
public String getPath() {
return path;
}
}
| [
"kawasima1016@gmail.com"
] | kawasima1016@gmail.com |
d7819e68e5de7dee81a1b2f9e6d4476450f26e16 | cec1602d23034a8f6372c019e5770773f893a5f0 | /sources/org/apache/commons/cli/AlreadySelectedException.java | b8f9e64feac88ff7a5d72a2b573fc6d5ea060bd2 | [] | no_license | sengeiou/zeroner_app | 77fc7daa04c652a5cacaa0cb161edd338bfe2b52 | e95ae1d7cfbab5ca1606ec9913416dadf7d29250 | refs/heads/master | 2022-03-31T06:55:26.896963 | 2020-01-24T09:20:37 | 2020-01-24T09:20:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | package org.apache.commons.cli;
public class AlreadySelectedException extends ParseException {
private OptionGroup group;
private Option option;
public AlreadySelectedException(String message) {
super(message);
}
public AlreadySelectedException(OptionGroup group2, Option option2) {
this(new StringBuffer().append("The option '").append(option2.getKey()).append("' was specified but an option from this group ").append("has already been selected: '").append(group2.getSelected()).append("'").toString());
this.group = group2;
this.option = option2;
}
public OptionGroup getOptionGroup() {
return this.group;
}
public Option getOption() {
return this.option;
}
}
| [
"johan@sellstrom.me"
] | johan@sellstrom.me |
02c66eca2bc92bfbc3a24b2423a764c92d3e3baf | d5fd6c3f9347579dec4675b3d491957a7a50404a | /src/net/sf/jsqlparser/statement/select/WithItem.java | 32f4ee81e5a4773d0edbb8556bb51223214efbbd | [] | no_license | manuelclavel/OCL2PSQL | 1b55d931f4372fe6ce9a7a7f26e2cda809a64bd1 | a2fa71d5315d4dfd9b1a3b8f1419ba533a017d80 | refs/heads/master | 2020-07-24T04:48:24.825639 | 2019-09-11T03:34:32 | 2019-09-11T03:34:32 | 207,805,732 | 1 | 1 | null | 2019-09-11T12:21:59 | 2019-09-11T12:21:59 | null | UTF-8 | Java | false | false | 2,742 | java | /*
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2013 JSQLParser
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
package net.sf.jsqlparser.statement.select;
import java.util.List;
import org.vgu.sqlsi.main.Injector;
/**
* One of the parts of a "WITH" clause of a "SELECT" statement
*/
public class WithItem implements SelectBody {
private String name;
private List<SelectItem> withItemList;
private SelectBody selectBody;
private boolean recursive;
/**
* The name of this WITH item (for example, "myWITH" in "WITH myWITH AS (SELECT A,B,C))"
*
* @return the name of this WITH
*/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isRecursive() {
return recursive;
}
public void setRecursive(boolean recursive) {
this.recursive = recursive;
}
/**
* The {@link SelectBody} of this WITH item is the part after the "AS" keyword
*
* @return {@link SelectBody} of this WITH item
*/
public SelectBody getSelectBody() {
return selectBody;
}
public void setSelectBody(SelectBody selectBody) {
this.selectBody = selectBody;
}
/**
* The {@link SelectItem}s in this WITH (for example the A,B,C in "WITH mywith (A,B,C) AS ...")
*
* @return a list of {@link SelectItem}s
*/
public List<SelectItem> getWithItemList() {
return withItemList;
}
public void setWithItemList(List<SelectItem> withItemList) {
this.withItemList = withItemList;
}
@Override
public String toString() {
return (recursive ? "RECURSIVE " : "") + name + ((withItemList != null) ? " " + PlainSelect.
getStringList(withItemList, true, true) : "")
+ " AS (" + selectBody + ")";
}
@Override
public void accept(SelectVisitor visitor) {
visitor.visit(this);
}
@Override
public void accept(Injector injector) {
// TODO Auto-generated method stub
}
}
| [
"ngpbhoang1406@gmail.com"
] | ngpbhoang1406@gmail.com |
eee0799f52c9471460896afb9f60c7cf8613216f | d24de9be4c3993d9dc726e9a3c74d9662c470226 | /reverse/Rocketbank_All_3.12.4_source_from_JADX/sources/com/google/android/gms/internal/zzatu.java | 9cf9a8fe71d3516ed2938fa733e29c3a39e2fb00 | [] | no_license | MEJIOMAH17/rocketbank-api | b18808ee4a2fdddd8b3045cd16655b0d82e0b13b | fc4eb0cbb4a8f52277fdb09a3b26b4cceef6ff79 | refs/heads/master | 2022-07-17T20:24:29.721131 | 2019-07-26T18:55:21 | 2019-07-26T18:55:21 | 198,698,231 | 4 | 0 | null | 2022-06-20T22:43:15 | 2019-07-24T19:31:49 | Smali | UTF-8 | Java | false | false | 11,039 | java | package com.google.android.gms.internal;
import android.content.Context;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.util.zze;
public class zzatu extends zzauh {
private String mAppId;
private String zzVX;
private String zzacL;
private String zzacM;
private String zzbqv;
private long zzbqz;
private int zzbsw;
private long zzbsx;
private int zzbsy;
zzatu(zzaue zzaue) {
super(zzaue);
}
public /* bridge */ /* synthetic */ Context getContext() {
return super.getContext();
}
String getGmpAppId() {
zzob();
return this.zzVX;
}
public /* bridge */ /* synthetic */ void zzJV() {
super.zzJV();
}
public /* bridge */ /* synthetic */ void zzJW() {
super.zzJW();
}
public /* bridge */ /* synthetic */ void zzJX() {
super.zzJX();
}
public /* bridge */ /* synthetic */ zzatb zzJY() {
return super.zzJY();
}
public /* bridge */ /* synthetic */ zzatf zzJZ() {
return super.zzJZ();
}
public /* bridge */ /* synthetic */ zzauj zzKa() {
return super.zzKa();
}
public /* bridge */ /* synthetic */ zzatu zzKb() {
return super.zzKb();
}
public /* bridge */ /* synthetic */ zzatl zzKc() {
return super.zzKc();
}
public /* bridge */ /* synthetic */ zzaul zzKd() {
return super.zzKd();
}
public /* bridge */ /* synthetic */ zzauk zzKe() {
return super.zzKe();
}
public /* bridge */ /* synthetic */ zzatv zzKf() {
return super.zzKf();
}
public /* bridge */ /* synthetic */ zzatj zzKg() {
return super.zzKg();
}
public /* bridge */ /* synthetic */ zzaut zzKh() {
return super.zzKh();
}
public /* bridge */ /* synthetic */ zzauc zzKi() {
return super.zzKi();
}
public /* bridge */ /* synthetic */ zzaun zzKj() {
return super.zzKj();
}
public /* bridge */ /* synthetic */ zzaud zzKk() {
return super.zzKk();
}
public /* bridge */ /* synthetic */ zzatx zzKl() {
return super.zzKl();
}
public /* bridge */ /* synthetic */ zzaua zzKm() {
return super.zzKm();
}
public /* bridge */ /* synthetic */ zzati zzKn() {
return super.zzKn();
}
String zzKu() {
zzob();
return this.zzbqv;
}
long zzKv() {
return zzKn().zzKv();
}
long zzKw() {
zzob();
zzmR();
if (this.zzbsx == 0) {
this.zzbsx = this.zzbqb.zzKh().zzM(getContext(), getContext().getPackageName());
}
return this.zzbsx;
}
int zzLX() {
zzob();
return this.zzbsw;
}
int zzLY() {
zzob();
return this.zzbsy;
}
protected void zzbw(Status status) {
if (status == null) {
zzKl().zzLZ().log("GoogleService failed to initialize (no status)");
} else {
zzKl().zzLZ().zze("GoogleService failed to initialize, status", Integer.valueOf(status.getStatusCode()), status.getStatusMessage());
}
}
zzatd zzfD(String str) {
zzmR();
return new zzatd(zzke(), getGmpAppId(), zzmZ(), (long) zzLX(), zzKu(), zzKv(), zzKw(), str, this.zzbqb.isEnabled(), zzKm().zzbts ^ 1, zzKm().zzKq(), zzuW(), this.zzbqb.zzMF(), zzLY());
}
String zzke() {
zzob();
return this.mAppId;
}
public /* bridge */ /* synthetic */ void zzmR() {
super.zzmR();
}
protected void zzmS() {
/* JADX: method processing error */
/*
Error: java.lang.NullPointerException
at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)
at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)
at jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)
at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)
at jadx.core.ProcessClass.process(ProcessClass.java:34)
at jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)
at jadx.core.ProcessClass.process(ProcessClass.java:39)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
at jadx.api.JadxDecompiler$$Lambda$8/1556461159.run(Unknown Source)
*/
/*
r10 = this;
r0 = "unknown";
r1 = "Unknown";
r2 = "Unknown";
r3 = r10.getContext();
r3 = r3.getPackageName();
r4 = r10.getContext();
r4 = r4.getPackageManager();
r5 = 0;
r6 = -2147483648; // 0xffffffff80000000 float:-0.0 double:NaN;
if (r4 != 0) goto L_0x002d;
L_0x001b:
r4 = r10.zzKl();
r4 = r4.zzLZ();
r7 = "PackageManager is null, app identity information might be inaccurate. appId";
r8 = com.google.android.gms.internal.zzatx.zzfE(r3);
r4.zzj(r7, r8);
goto L_0x008b;
L_0x002d:
r7 = r4.getInstallerPackageName(r3); Catch:{ IllegalArgumentException -> 0x0033 }
r0 = r7;
goto L_0x0044;
L_0x0033:
r7 = r10.zzKl();
r7 = r7.zzLZ();
r8 = "Error retrieving app installer package name. appId";
r9 = com.google.android.gms.internal.zzatx.zzfE(r3);
r7.zzj(r8, r9);
L_0x0044:
if (r0 != 0) goto L_0x0049;
L_0x0046:
r0 = "manual_install";
goto L_0x0053;
L_0x0049:
r7 = "com.android.vending";
r7 = r7.equals(r0);
if (r7 == 0) goto L_0x0053;
L_0x0051:
r0 = "";
L_0x0053:
r7 = r10.getContext(); Catch:{ NameNotFoundException -> 0x007a }
r7 = r7.getPackageName(); Catch:{ NameNotFoundException -> 0x007a }
r7 = r4.getPackageInfo(r7, r5); Catch:{ NameNotFoundException -> 0x007a }
if (r7 == 0) goto L_0x008b; Catch:{ NameNotFoundException -> 0x007a }
L_0x0061:
r8 = r7.applicationInfo; Catch:{ NameNotFoundException -> 0x007a }
r4 = r4.getApplicationLabel(r8); Catch:{ NameNotFoundException -> 0x007a }
r8 = android.text.TextUtils.isEmpty(r4); Catch:{ NameNotFoundException -> 0x007a }
if (r8 != 0) goto L_0x0072; Catch:{ NameNotFoundException -> 0x007a }
L_0x006d:
r4 = r4.toString(); Catch:{ NameNotFoundException -> 0x007a }
r2 = r4; Catch:{ NameNotFoundException -> 0x007a }
L_0x0072:
r4 = r7.versionName; Catch:{ NameNotFoundException -> 0x007a }
r1 = r7.versionCode; Catch:{ NameNotFoundException -> 0x0079 }
r6 = r1;
r1 = r4;
goto L_0x008b;
L_0x0079:
r1 = r4;
L_0x007a:
r4 = r10.zzKl();
r4 = r4.zzLZ();
r7 = "Error retrieving package info. appId, appName";
r8 = com.google.android.gms.internal.zzatx.zzfE(r3);
r4.zze(r7, r8, r2);
L_0x008b:
r10.mAppId = r3;
r10.zzbqv = r0;
r10.zzacM = r1;
r10.zzbsw = r6;
r10.zzacL = r2;
r0 = 0;
r10.zzbsx = r0;
r2 = r10.zzKn();
r2.zzLh();
r2 = r10.getContext();
r2 = com.google.android.gms.internal.zzaba.zzaQ(r2);
r4 = 1;
if (r2 == 0) goto L_0x00b3;
L_0x00ab:
r6 = r2.isSuccess();
if (r6 == 0) goto L_0x00b3;
L_0x00b1:
r6 = r4;
goto L_0x00b4;
L_0x00b3:
r6 = r5;
L_0x00b4:
if (r6 != 0) goto L_0x00b9;
L_0x00b6:
r10.zzbw(r2);
L_0x00b9:
if (r6 == 0) goto L_0x0113;
L_0x00bb:
r2 = r10.zzKn();
r2 = r2.zzLj();
r6 = r10.zzKn();
r6 = r6.zzLi();
if (r6 == 0) goto L_0x00db;
L_0x00cd:
r2 = r10.zzKl();
r2 = r2.zzMd();
r4 = "Collection disabled with firebase_analytics_collection_deactivated=1";
L_0x00d7:
r2.log(r4);
goto L_0x0113;
L_0x00db:
if (r2 == 0) goto L_0x00ee;
L_0x00dd:
r6 = r2.booleanValue();
if (r6 != 0) goto L_0x00ee;
L_0x00e3:
r2 = r10.zzKl();
r2 = r2.zzMd();
r4 = "Collection disabled with firebase_analytics_collection_enabled=0";
goto L_0x00d7;
L_0x00ee:
if (r2 != 0) goto L_0x0105;
L_0x00f0:
r2 = r10.zzKn();
r2 = r2.zzwR();
if (r2 == 0) goto L_0x0105;
L_0x00fa:
r2 = r10.zzKl();
r2 = r2.zzMd();
r4 = "Collection disabled with google_app_measurement_enable=0";
goto L_0x00d7;
L_0x0105:
r2 = r10.zzKl();
r2 = r2.zzMf();
r6 = "Collection enabled";
r2.log(r6);
goto L_0x0114;
L_0x0113:
r4 = r5;
L_0x0114:
r2 = "";
r10.zzVX = r2;
r10.zzbqz = r0;
r0 = r10.zzKn();
r0.zzLh();
r0 = com.google.android.gms.internal.zzaba.zzwQ(); Catch:{ IllegalStateException -> 0x0143 }
r1 = android.text.TextUtils.isEmpty(r0); Catch:{ IllegalStateException -> 0x0143 }
if (r1 == 0) goto L_0x012d; Catch:{ IllegalStateException -> 0x0143 }
L_0x012b:
r0 = ""; Catch:{ IllegalStateException -> 0x0143 }
L_0x012d:
r10.zzVX = r0; Catch:{ IllegalStateException -> 0x0143 }
if (r4 == 0) goto L_0x0155; Catch:{ IllegalStateException -> 0x0143 }
L_0x0131:
r0 = r10.zzKl(); Catch:{ IllegalStateException -> 0x0143 }
r0 = r0.zzMf(); Catch:{ IllegalStateException -> 0x0143 }
r1 = "App package, google app id"; Catch:{ IllegalStateException -> 0x0143 }
r2 = r10.mAppId; Catch:{ IllegalStateException -> 0x0143 }
r4 = r10.zzVX; Catch:{ IllegalStateException -> 0x0143 }
r0.zze(r1, r2, r4); Catch:{ IllegalStateException -> 0x0143 }
goto L_0x0155;
L_0x0143:
r0 = move-exception;
r1 = r10.zzKl();
r1 = r1.zzLZ();
r2 = "getGoogleAppId or isMeasurementEnabled failed with exception. appId";
r3 = com.google.android.gms.internal.zzatx.zzfE(r3);
r1.zze(r2, r3, r0);
L_0x0155:
r0 = android.os.Build.VERSION.SDK_INT;
r1 = 16;
if (r0 < r1) goto L_0x0166;
L_0x015b:
r0 = r10.getContext();
r0 = com.google.android.gms.internal.zzade.zzbg(r0);
r10.zzbsy = r0;
return;
L_0x0166:
r10.zzbsy = r5;
return;
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.zzatu.zzmS():void");
}
String zzmZ() {
zzob();
return this.zzacM;
}
public /* bridge */ /* synthetic */ zze zznR() {
return super.zznR();
}
long zzuW() {
zzob();
return 0;
}
}
| [
"mekosichkin.ru"
] | mekosichkin.ru |
7d8a492892e2977894086c5fcca74e50572058e1 | 452af859f3d31b8e7a82cdf7ce987a19973f6180 | /onlineShopping/src/main/java/com/bnr/shoppingbackend/daoImpl/CategoryDaoImpl.java | 67b278f04daeda1195daab77209f1f8bd19908b6 | [] | no_license | beenanaveen/onlineShopping | a8a940083d2dab5f9134ef71806f1628256f15c5 | 36ad95b507cb2fcc6253f1d37973c00f73ac4162 | refs/heads/master | 2020-04-30T17:55:06.568960 | 2019-03-29T16:32:02 | 2019-03-29T16:32:02 | 176,994,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,756 | java | package com.bnr.shoppingbackend.daoImpl;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.bnr.shoppingbackend.dao.CategoryDao;
import com.bnr.shoppingbackend.dto.Category;
@Repository("categoryDao")
@Transactional
public class CategoryDaoImpl implements CategoryDao {
@Autowired
private SessionFactory sessionFactory;
public static List<Category> categories = new ArrayList<>();
@Override
public List<Category> listAllCategories() {
String query="FROM Category WHERE active=:active";
Query<Category> result=sessionFactory.getCurrentSession().createQuery(query);
result.setParameter("active",true);
return result.getResultList();
}
@Override
public Category get(int id) {
return sessionFactory.getCurrentSession().get(Category.class, Integer.valueOf(id));
}
@Override
public boolean add(Category category) {
try {
sessionFactory.getCurrentSession().persist(category);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public boolean update(Category category) {
try {
sessionFactory.getCurrentSession().update(category);
return true;
} catch (Exception e) {
return false;
}
}
@Override
public boolean delete(Category category) {
category.setActive(false);
try {
sessionFactory.getCurrentSession().update(category);
return true;
}catch(Exception e) {
e.printStackTrace();
return false;
}
}
}
| [
"beena.11@hotmail.com"
] | beena.11@hotmail.com |
d7c1d362a1ad3c23d2f9aa8bae99d916307d72e5 | f5e62cf96184147eda6d3d071620db4019cb4940 | /currencyconverter/src/main/java/com/blongho/currencyconverter/Converter.java | c535a0659c777d5bf638be06f8d6b5ec57a550ec | [] | no_license | blongho/currencyconverter | 8954c37784bf7f6d7ce1cc3f2f54b565e46e305b | ad0cbe05b6a9f661784b74a60b2db287d403efcd | refs/heads/master | 2020-12-04T06:24:10.955754 | 2020-01-03T20:05:47 | 2020-01-03T20:05:47 | 231,654,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,521 | java | package com.blongho.currencyconverter;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.TextView;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;
/**
* The type Converter.
*/
public class Converter {
private TextView updateView;
static {
System.loadLibrary("native-lib");
}
private native String stringFromJNI();
private static OkHttpClient client = new OkHttpClient();
private static final String TAG = "Converter";
private CurrencyCode from;
private CurrencyCode to;
/**
* Instantiates a new Converter.
*
* @param from the from
* @param to the to
*/
public Converter(CurrencyCode from, CurrencyCode to) {
this.from = from;
this.to = to;
}
private String requestString() {
return "https://free.currconv.com/api/v7/convert?q=" + from.name() + "_" + to.name()
+ "&compact=ultra&apiKey=" + stringFromJNI();
}
/**
* Make request.
*
* @param context the context
*/
public void makeRequest(final Context context) {
Request request = new Request.Builder()
.url(requestString())
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
Log.e(TAG, "onFailure: " + e.getMessage());
}
@Override
public void onResponse(Response response) {
final String value;
try {
value = response.body().string().split(":")[1];
Log.d(TAG, "onResponse: " + Double.parseDouble(value.substring(0, value.length() - 1)));
final double rate = Double.parseDouble(value.substring(0, value.length() - 1));
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
updateView.setText(String.valueOf(rate));
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
void setTextView(TextView tv) {
this.updateView = tv;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Converter{");
sb.append("from='").append(from).append('\'');
sb.append(", to='").append(to).append('\'');
sb.append('}');
return sb.toString();
}
}
| [
"lobe1602@student.miun.se"
] | lobe1602@student.miun.se |
d6db93d27a3b364d647588e43c0c63dfb45c40bc | f4bd4a649a7ffc67f4de52b77c2d461907c1ba93 | /src/main/java/com/kmecpp/jspark/compiler/parser/statement/statements/MethodInvocation.java | 16280d69541f7274ee1ce279cdbc2f09dd58f705 | [
"MIT"
] | permissive | kmecpp/JSpark | 8893e88b846c7998ac927e8b51710ebf8e29a089 | 27f70839adabdb9477a1bcbf638a4008efc50f96 | refs/heads/master | 2021-09-14T03:54:55.464710 | 2018-05-08T00:17:49 | 2018-05-08T00:17:49 | 109,596,125 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,636 | java | package com.kmecpp.jspark.compiler.parser.statement.statements;
import java.util.ArrayList;
import java.util.Optional;
import java.util.stream.Collectors;
import com.kmecpp.jspark.JSpark;
import com.kmecpp.jspark.compiler.parser.Expression;
import com.kmecpp.jspark.compiler.parser.data.Type;
import com.kmecpp.jspark.compiler.parser.data.Variable;
import com.kmecpp.jspark.compiler.parser.statement.Import;
import com.kmecpp.jspark.compiler.parser.statement.Statement;
import com.kmecpp.jspark.compiler.parser.statement.block.AbstractBlock;
import com.kmecpp.jspark.compiler.parser.statement.block.module.Module;
import com.kmecpp.jspark.language.Keyword;
public class MethodInvocation extends Statement {
// private AbstractBlock block;
private Variable capture;
private String target;
private String method;
private ArrayList<Expression> params;
public MethodInvocation(AbstractBlock block, String target, String method, ArrayList<Expression> params) {
this(block, null, target, method, params);
}
public MethodInvocation(AbstractBlock block, Variable capture, String target, String method, ArrayList<Expression> params) {
super(block);
// this.block = block;
this.capture = capture;
this.target = target;
this.method = method;
this.params = params;
}
public AbstractBlock getBlock() {
return block;
}
public Variable getCapture() {
return capture;
}
public String getTarget() {
return target;
}
public String getMethod() {
return method;
}
public ArrayList<Expression> getParams() {
return params;
}
// @Override
// public final void execute() {
// invoke();
// }
@Override
public void execute() {
if (Keyword.THIS.is(this.target) || this.target == null) {
Module module = block.getModule();
if (module.isStatic()) {
Object target = block.getModule();
// block.getModule().invokeMethod(null, method, params);
} else {
// JSpark.getRuntime().getInstance()
}
}
Object target = Keyword.THIS.is(this.target) ? block.getModule() : block.getVariable(this.target);
Variable var = block.getVariable(this.target);
if (var != null) {
Object obj = var.getValue();
try {
invokeMethod(obj.getClass(), obj);
} catch (Exception e) {
System.err.println("Could not invoke method: " + toString());
e.printStackTrace();
}
}
if (target == null) {
Optional<Import> imprt = block.getModule().getImport(this.target);
if (imprt.isPresent()) {
Module module = JSpark.getRuntime().getModule(imprt.get().getClassName());
module.execute();
} else {
try {
invokeMethod(Class.forName("com.kmecpp.jspark.language.builtin." + this.target), null);
} catch (Exception e) {
System.err.println("Could invoke static method: " + toString());
e.printStackTrace();
}
}
// else if (this.target.equals("Console")) {
// if (this.method.equals("println")) {
// Console.println(params.get(0).evaluate());
// }
// } else {
//
// }
} else if (target instanceof Module) {
Type[] paramTypes = new Type[params.size()];
for (int i = 0; i < paramTypes.length; i++) {
paramTypes[i] = params.get(i).getResultType();
}
((Module) target).getMethod(method, paramTypes).get().invoke(params);
}
}
private void invokeMethod(Class<?> cls, Object target) throws Exception {
Object[] values = new Object[params.size()];
methodSearch: for (java.lang.reflect.Method method : cls.getMethods()) {
Class<?>[] targetTypes = method.getParameterTypes();
if (targetTypes.length != values.length || !method.getName().equals(this.method)) {
continue;
}
for (int i = 0; i < targetTypes.length; i++) {
Object value = params.get(i).evaluate();
if (value == null || targetTypes[i].isAssignableFrom(value.getClass())) {
values[i] = value;
} else {
continue methodSearch;
}
}
Object result = method.invoke(target, values);
if (capture != null) {
capture.setValue(result);
}
return;
}
throw new NoSuchMethodException();
}
@Override
public String toString() {
return toJavaCode();
}
@Override
public String toJavaCode() {
if (target.equals("Console") && method.equals("println")) {
return "System.out.println(" + params.stream().map(String::valueOf).collect(Collectors.joining(" ")) + ")";
}
return target + "." + method + "(" + params.stream().map(String::valueOf).collect(Collectors.joining(" ")) + ")";
}
}
| [
"kmecpp@gmail.com"
] | kmecpp@gmail.com |
8a3d8a71a24a3f5208bdaf793bb2552095d15a6a | ba7ac99921d48d8cd49c54ac54f67654c2796450 | /Project51 Package/Project51 Server/src/ethos/net/discord/DiscordMessage.java | aba03badff6d1fc4f085110aec0a48bf12cfda7e | [] | no_license | JacobAYoung/server | ee1052b1423942036b6c7c77f33a2109e91ce502 | fd04421a6c16ce75f66556c8aeca1016a6318125 | refs/heads/master | 2022-11-22T22:44:10.417014 | 2020-07-03T02:02:06 | 2020-07-03T02:02:06 | 275,973,896 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,436 | java | package ethos.net.discord;
import java.util.ArrayList;
import java.util.List;
import ethos.net.discord.DiscordEmbed;
public class DiscordMessage extends Payload {
private String content;
private String username;
private String avatarURL;
private boolean tts;
private List<DiscordEmbed> embeds = new ArrayList<>();
public DiscordMessage(String content) {
this.content = content;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getAvatarURL() {
return avatarURL;
}
public void setAvatarURL(String avatarURL) {
this.avatarURL = avatarURL;
}
public boolean isTTS() {
return tts;
}
public void setTTS(boolean tts) {
this.tts = tts;
}
public List<DiscordEmbed> getEmbeds() {
return embeds;
}
public void setEmbeds(List<DiscordEmbed> embeds) {
this.embeds = embeds;
}
@Override
public void save(PayloadMap map) {
map.put("content", content);
map.putIfExists("username", username);
map.putIfExists("avatar_url", avatarURL);
map.put("tts", tts);
if (embeds != null && embeds.size() > 0) {
map.put("embeds", embeds);
}
}
public static class Builder {
private final String content;
private final DiscordMessage message;
public Builder(String content) {
this.content = content;
this.message = new DiscordMessage(content);
this.message.setEmbeds(new ArrayList<DiscordEmbed>());
}
public Builder withUsername(String username) {
message.setUsername(username);
return this;
}
public Builder withAvatarURL(String avatarURL) {
message.setAvatarURL(avatarURL);
return this;
}
public Builder withTTS(boolean tts) {
message.setTTS(tts);
return this;
}
public Builder withEmbed(DiscordEmbed embed) {
message.getEmbeds().add(embed);
return this;
}
public DiscordMessage build() {
return message;
}
}
}
| [
"JakeAYoung95@gmail.com"
] | JakeAYoung95@gmail.com |
90234e9e8359002f8b1cbadcf471f888be136861 | cfcb418e923d4c3c8547f4a037da9b9da2902d83 | /src/barcode/EAN13.java | 4a20ed8244b1030a0d1fb9c901895cd1b99cacbf | [] | no_license | YvonneZhang/barcode-encoder-decoder | 598c0f5122d6d519ffc2b8032c3d84e26296842f | 63eec604449d6f1c5d2ff9eb184c5c227154dfad | refs/heads/master | 2021-01-19T14:59:05.986857 | 2014-07-09T06:35:11 | 2014-07-09T06:35:11 | 21,641,697 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,557 | java | package barcode;
public class EAN13 {
/// 获取 EAN-13 条形码
public static String Get(String s, int width, int height)
{
int sum_even = 0;//偶数位之和
int sum_odd = 0;//奇数位之和
for (int i = 0; i < 12; i++)
{
if (i % 2 == 0)
{
sum_odd += Character.getNumericValue(s.charAt(i));
}
else
{
sum_even += Character.getNumericValue(s.charAt(i));
}
}
//校验码
int checkcode = (10 - (sum_even * 3 + sum_odd) % 10) % 10;
//变成13位
s += checkcode;
// 00000000000101左侧42个01010右侧35个校验7个1010000000
String resultBin = "";//二进制串
//起始符
resultBin += "00000000000101";
String type = ean13type(s.charAt(0));
//左侧数据符
for (int i = 1; i < 7; i++)
{
resultBin += ean13(s.charAt(i), type.charAt(i - 1));
}
//中间分隔符
resultBin += "01010";
//右侧数据符
for (int i = 7; i < 13; i++)
{
resultBin += ean13(s.charAt(i), 'C');//右侧数据符及校验符均用字符集中的C子集表示
}
//终止符
resultBin += "1010000000";
return resultBin;
}
private static String ean13(char c, char type)
{
switch (type)
{
case 'A':
{
switch (c)
{
case '0': return "0001101";
case '1': return "0011001";
case '2': return "0010011";
case '3': return "0111101";//011101
case '4': return "0100011";
case '5': return "0110001";
case '6': return "0101111";
case '7': return "0111011";
case '8': return "0110111";
case '9': return "0001011";
default: return "Error!";
}
}
case 'B':
{
switch (c)
{
case '0': return "0100111";
case '1': return "0110011";
case '2': return "0011011";
case '3': return "0100001";
case '4': return "0011101";
case '5': return "0111001";
case '6': return "0000101";//000101
case '7': return "0010001";
case '8': return "0001001";
case '9': return "0010111";
default: return "Error!";
}
}
case 'C':
{
switch (c)
{
case '0': return "1110010";
case '1': return "1100110";
case '2': return "1101100";
case '3': return "1000010";
case '4': return "1011100";
case '5': return "1001110";
case '6': return "1010000";
case '7': return "1000100";
case '8': return "1001000";
case '9': return "1110100";
default: return "Error!";
}
}
default: return "Error!";
}
}
private static String ean13type(char c)
{
switch (c)
{
case '0': return "AAAAAA";
case '1': return "AABABB";
case '2': return "AABBAB";
case '3': return "AABBBA";
case '4': return "ABAABB";
case '5': return "ABBAAB";
case '6': return "ABBBAA";//中国
case '7': return "ABABAB";
case '8': return "ABABBA";
case '9': return "ABBABA";
default: return "Error!";
}
}
}
| [
"zhyifa001@gmail.com"
] | zhyifa001@gmail.com |
9749de9d88caaa8b302b421be038011ad0620864 | 7c20d7db37a629bf859cc1b3f14d5906076c78a4 | /src/com/master/ed/Marca_PneuED.java | bf7ea5fc072d6b468b66206961eac544cb1416d3 | [] | no_license | tbaiocco/nfe4 | 9055b237338f45afe7ec708c94880cea04887325 | 8e2416d30797dc8a2b1deaed1633f88ac26b75b2 | refs/heads/master | 2020-03-24T19:33:25.169266 | 2018-11-22T18:39:27 | 2018-11-22T18:39:27 | 142,933,673 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | package com.master.ed;
import java.io.Serializable;
/**
* @author Regis
*
*/
public class Marca_PneuED extends MasterED implements Serializable {
private static final long serialVersionUID = 7565709400038136233L;
public Marca_PneuED() {
}
private long oid_Marca_Pneu;
private String nm_Marca_Pneu;
private long oid_Empresa;
public String getNm_Marca_Pneu() {
return nm_Marca_Pneu;
}
public void setNm_Marca_Pneu(String nm_Marca_Pneu) {
this.nm_Marca_Pneu = nm_Marca_Pneu;
}
public long getOid_Empresa() {
return oid_Empresa;
}
public void setOid_Empresa(long oid_Empresa) {
this.oid_Empresa = oid_Empresa;
}
public long getOid_Marca_Pneu() {
return oid_Marca_Pneu;
}
public void setOid_Marca_Pneu(long oid_Marca_Pneu) {
this.oid_Marca_Pneu = oid_Marca_Pneu;
}
}
| [
"teofilo.baiocco@letshare.com"
] | teofilo.baiocco@letshare.com |
2a6ef468b9041786fa452a37bac627ed869ca808 | a424256245e111ad8da1ec90db6694f4929955dc | /src/test/java/org/contextmapper/discovery/model/ContextMapTest.java | 0e33aebbc431cac7c7418fde89f26c450df0b88c | [
"Apache-2.0"
] | permissive | ContextMapper/context-map-discovery | f9a6a082826bfb863356bf16d552c33712d8fdd4 | d5ef0573ccad7502471c90243ea64f6b0bebd168 | refs/heads/master | 2022-09-08T14:04:43.275403 | 2022-08-08T11:12:48 | 2022-08-08T11:13:33 | 217,761,579 | 12 | 6 | Apache-2.0 | 2022-03-11T11:55:45 | 2019-10-26T19:51:34 | Java | UTF-8 | Java | false | false | 3,109 | java | /*
* Copyright 2019 The Context Mapper Project Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.contextmapper.discovery.model;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ContextMapTest {
@Test
public void canAddBoundedContext() {
// given
ContextMap contextMap = new ContextMap();
BoundedContext context = new BoundedContext("TestContext");
// when
contextMap.addBoundedContext(context);
// then
assertEquals(1, contextMap.getBoundedContexts().size());
assertEquals("TestContext", contextMap.getBoundedContexts().iterator().next().getName());
}
@Test
public void canAddRelationship() {
// given
ContextMap contextMap = new ContextMap();
BoundedContext upstream = new BoundedContext("Upstream");
BoundedContext downstream = new BoundedContext("Downstream");
contextMap.addBoundedContext(upstream);
contextMap.addBoundedContext(downstream);
Relationship relationship = new Relationship(upstream, downstream);
// when
contextMap.addRelationship(relationship);
// then
assertEquals(1, contextMap.getRelationships().size());
Relationship testRel = contextMap.getRelationships().iterator().next();
assertEquals("Upstream", testRel.getUpstream().getName());
assertEquals("Downstream", testRel.getDownstream().getName());
}
@Test
public void cannotAddRelationshipWithMissingUpstream() {
// given
ContextMap contextMap = new ContextMap();
BoundedContext downstream = new BoundedContext("Downstream");
Relationship relationship = new Relationship(new BoundedContext("Upstream"), downstream);
contextMap.addBoundedContext(downstream);
// when, then
Assertions.assertThrows(IllegalArgumentException.class, () -> {
contextMap.addRelationship(relationship);
});
}
@Test
public void cannotAddRelationshipWithMissingDownstream() {
// given
ContextMap contextMap = new ContextMap();
BoundedContext upstream = new BoundedContext("Upstream");
Relationship relationship = new Relationship(upstream, new BoundedContext("Downstream"));
contextMap.addBoundedContext(upstream);
// when, then
Assertions.assertThrows(IllegalArgumentException.class, () -> {
contextMap.addRelationship(relationship);
});
}
}
| [
"stefan@kapferer.ch"
] | stefan@kapferer.ch |
2549c4cbdf945bd9ddd170e4bd1becec7e46ed49 | ce6331b91130c5b9709fbbf0d3f5170bfa12ca00 | /00_myfirstProject/src/com/kh/first/B_ValuePrinter.java | 76efd9bfcb8a069377435bcf8e06dcf7e575a24f | [] | no_license | Junghwa0731/JavaStudy | c7a853286ac8e243d51a7b0d60f6c7839aa4f781 | f614bdf17d168e35d81978b2845fa838db566cc0 | refs/heads/master | 2023-05-20T19:53:52.368766 | 2021-06-15T10:53:27 | 2021-06-15T10:53:27 | 373,564,148 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,969 | java | package com.kh.first;
public class B_ValuePrinter {
/* < 명명 규칙 >
* 1. 패기지 > 소문자로 시작
* 2. 클레스 > 대문자로 시작
* 3. 메소드 > 소문자로시작
*
* 여러 개의 단어가 있을 떄는 각 단어의 앞자리는 대문자로 > 카멜 표기법(낙타등 표기법)
* Valueprinter -> ValuePrinter
*/
public void printValue1() {
// 여러 가지 형태의 값을 출력하는 기능을 하는 메소드
// 1. 숫자 출력
System.out.println(123); // 정수 값
System.out.println(1.23); // 실수 값
// 2. 문자(한개의문자) 출력 > 따옴표(싱글 쿼테이션) 사용
System.out.println('a');
System.out.println('b');
// 3. 문자열(여러개의문자) 출력 > 쌍따옴표(더블 쿼테이션) 사용
System.out.println("안녕하세요");
System.out.println("반갑습니다");
// 4. 내부에서 연산 가능
System.out.println(1.23 - 0.12);
// > 컴퓨터는 이진수 밖에 표현할 수 없으므로 실수 값 연산은 불완전해서 오차가 생길 수 있음
// 5. 문자는 수자와 연산 가능 > 컴퓨터는 근본적으로 문자를 숫자로 받아들이기 때문
System.out.println('a' + 1); // 97(a의 유니코드) + 1
System.out.println('b' + 1);
// 6. 문자열과 숫자의 합 >
System.out.println("안녕하세요" + 1); // > "안녕하세요1"
System.out.println("반갑습니다" + 22 + 33); // > "반갑습니다22" + 33 > 반갑습니다2233"
}
public void printValue2() {
// 문자열과 숫자의 '+' 연산
System.out.println(9 + 9); // 18
System.out.println(9 + "9"); // 99
System.out.println(9 + 9 + "9"); // 18 +"9" > "189"
System.out.println("9" + 9 + 9); // "99" + 9 > "999"
// 문자열의 위치에따라 결과가 달라짐, 앞에서부터 순서대로 계산됨
}
}
| [
"82106@192.168.0.104"
] | 82106@192.168.0.104 |
211a527466a65c37d733c6ca164e7f0775429ab2 | 48efb09bad0dcae1b12a13438d799043f6f7fdcb | /cmi-db/src/main/java/com/cmi/mall/db/service/LitemallUserFormIdService.java | 38e1cd8ecc72b70f7fd47f105eee0d8a2831cfcb | [] | no_license | wangdavidsihai/cmi-mall | f490db138dfd4572ef45e4325ea029db8ababfdd | 963645abf922999d09aceb6de915a206ec1a0811 | refs/heads/master | 2020-04-15T02:21:23.396701 | 2019-01-11T08:42:11 | 2019-01-11T08:42:11 | 164,311,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,749 | java | package com.cmi.mall.db.service;
import org.springframework.stereotype.Service;
import com.cmi.mall.db.dao.LitemallUserFormidMapper;
import com.cmi.mall.db.domain.LitemallUserFormid;
import com.cmi.mall.db.domain.LitemallUserFormidExample;
import javax.annotation.Resource;
import java.time.LocalDateTime;
@Service
public class LitemallUserFormIdService {
@Resource
private LitemallUserFormidMapper formidMapper;
/**
* 查找是否有可用的FormId
*
* @param openId
* @return
*/
public LitemallUserFormid queryByOpenId(String openId) {
LitemallUserFormidExample example = new LitemallUserFormidExample();
//符合找到该用户记录,且可用次数大于1,且还未过期
example.or().andOpenidEqualTo(openId).andExpireTimeGreaterThan(LocalDateTime.now());
return formidMapper.selectOneByExample(example);
}
/**
* 更新或删除FormId
*
* @param userFormid
*/
public int updateUserFormId(LitemallUserFormid userFormid) {
//更新或者删除缓存
if (userFormid.getIsprepay() && userFormid.getUseamount() > 1) {
userFormid.setUseamount(userFormid.getUseamount() - 1);
userFormid.setUpdateTime(LocalDateTime.now());
return formidMapper.updateByPrimaryKey(userFormid);
} else {
return formidMapper.deleteByPrimaryKey(userFormid.getId());
}
}
/**
* 添加一个 FormId
*
* @param userFormid
*/
public void addUserFormid(LitemallUserFormid userFormid) {
userFormid.setAddTime(LocalDateTime.now());
userFormid.setUpdateTime(LocalDateTime.now());
formidMapper.insertSelective(userFormid);
}
}
| [
"wangdavidsihai@gmail.com"
] | wangdavidsihai@gmail.com |
105ba1b5aab82923df25c996e32f37d19f79fba0 | 0072485d0c35ea9062eed53dcd1c04ec80d46db3 | /Leetcode/src/A.java | 034f837d91c3d8f99b4035c155455509e4cfcd82 | [] | no_license | mugdhachaudhari/DSAlgo | 015fe081fb7c8d44174ae290f98b2da9536aaab4 | 4a29fdf510e28876748d19e685ef37683271b2e6 | refs/heads/master | 2020-05-25T17:35:44.735092 | 2017-03-14T13:09:42 | 2017-03-14T13:09:42 | 84,950,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,214 | java | // you can also use imports, for example:
import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int X) {
// write your code in Java SE 8
int y = X;
List<Integer> ls = new ArrayList<Integer>();
while(y > 0) {
ls.add(y%10);
y = y/10;
}
int res = 0;
for (int i = ls.size() -1; i > 0; i--) {
int p = (int) Math.ceil(((double)ls.get(i) + ls.get(i -1))/2);
if (p >= ls.get(i)) {
return calcNum(ls, i, p);
} else if (i == 1) {
res = calcNum(ls, i, p);
}
}
return res;
}
private int calcNum(List<Integer> ls, int i, int p) {
int res = 0;
for (int j = ls.size() - 1; j > i; j--) {
res += (int) ls.get(j) * Math.pow(10, j -1);
}
res+= (int) p*Math.pow(10, i - 1);
for (int k = i - 2; k >= 0; k--) {
res += (int) ls.get(k) * Math.pow(10, k);
}
return res;
}
} | [
"mugdha.chaudhari@gmail.com"
] | mugdha.chaudhari@gmail.com |
4f79efec844aa2b328ac0241dbeaf90e7e9be025 | 2ae7b983757fd2d4a1d3f5313c38e5bf06bd1052 | /src/main/java/duke/command/AddCommand.java | 69e1cfa0a8d62385ff62cea965e6accda854cc35 | [] | no_license | JonahhGohh/ip | b78316431d3c746fa38e99316b51887724817898 | 75283a539734d25607dc1b1973aaa5326cd41fb7 | refs/heads/master | 2023-03-04T08:58:46.635406 | 2021-02-17T05:35:28 | 2021-02-17T05:35:28 | 330,105,833 | 0 | 0 | null | 2021-02-14T08:02:33 | 2021-01-16T07:11:07 | Java | UTF-8 | Java | false | false | 897 | java | package duke.command;
import duke.storage.Storage;
import duke.task.Task;
import duke.tasklist.TaskList;
import duke.ui.Ui;
/**
* Command for todo, event, deadline input
*/
public class AddCommand extends Command {
/**
* Adds the task into the task list, saves the task list in the internal storage and prints success message
* @param task the task to be added into the task list
* @param taskList the current instance of task list used by Duke
* @param storage the storage instance used to save files into internal storage
*/
@Override
public String execute(String taskDescription, Task task, TaskList taskList, Storage storage) {
// Add task to task list
taskList.addTask(task);
// Update Storage
storage.saveTasksToStorage(taskList);
// Print success message
return Ui.taskAddedMessage(task);
}
}
| [
"jonahgoh@outlook.com"
] | jonahgoh@outlook.com |
b8bf858fba0da06fcef56e4343f59a86c57f2bb2 | f349d240bd6a9150611e987eb76d9e6fde9f0d85 | /servlet/src/com/helloweenvsfei/servlet/ContextParamServlet.java | 654e39a4561266d8291f0d8759f98467b9f1db24 | [] | no_license | szyszy2000/javaweb | 0bd520590f7c5e3633091543672b96a27e7dabfc | a25c5b0b76d3af3cb0df16805fcd1c664776e1dc | refs/heads/master | 2020-12-24T10:32:06.844769 | 2016-12-25T09:51:12 | 2016-12-25T09:51:12 | 73,155,911 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,794 | java | package com.helloweenvsfei.servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ContextParamServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public ContextParamServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>读取上下文参数</TITLE></HEAD>");
out.println(" <link rel='stylesheet' type='text/css' href='../css/style.css'>");
out.println(" <BODY>");
out.println("<div align=center><br/>");
out.println("<fieldset style='width:90%'><legend>所有的上下文参数</legend><br/>");
//获取上下文
ServletContext servletContext = getServletConfig().getServletContext();
//获取参数
String uploadFolder = servletContext.getInitParameter("upload folder");
String allowedFileType = servletContext.getInitParameter("allowed file type");
out.println("<div class='line'>");
out.println(" <div align='left' class='leftDiv'>上传文件夹</div>");
out.println(" <div align='left' class='rightDiv'>"+uploadFolder+"</div>");
out.println("</div>");
out.println("<div class='line'>");
out.println(" <div align='left' class='leftDiv'>实际磁盘路径</div>");
out.println(" <div align='left' class='rightDiv'>"+servletContext.getRealPath(uploadFolder)+"</div>");
out.println("</div>");
out.println("<div class='line'>");
out.println(" <div align='left' class='leftDiv'>允许上传的类型</div>");
out.println(" <div align='left' class='rightDiv'>"+allowedFileType+"</div>");
out.println("</div>");
out.println("</fieldSet></div>");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the POST method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
| [
"songzy@X-CDN-SONGZY.wangsu.com"
] | songzy@X-CDN-SONGZY.wangsu.com |
d717020158b71ac9c0deebe8724a0ea823964aab | 7b3ae6a83e29b5332309929d081102943fa2cee7 | /src/main/java/com/wind/common/Constants.java | 468d6a229d1d8ac82e86af5a0976d47e84758826 | [
"Apache-2.0"
] | permissive | kongjihui/Tess4jUtils- | 34510094b8f0be46ee5055e8a04c73f4fde9881a | 742741adad584468052f39d893cc593f3edd5ad2 | refs/heads/master | 2022-11-23T20:48:57.901272 | 2019-04-08T02:59:54 | 2019-04-08T02:59:54 | 211,039,340 | 0 | 0 | Apache-2.0 | 2022-11-16T11:56:44 | 2019-09-26T08:29:34 | Java | UTF-8 | Java | false | false | 1,626 | java | package com.wind.common;
import java.io.File;
/**
* 常量字符集合
* @author wind
*/
public interface Constants {
/**********************************************分隔符常量************************************************/
String POINT_STR = ".";
String BLANK_STR = "";
String SPACE_STR = " ";
String NEWLINE_STR = "\n";
String SYS_SEPARATOR = File.separator;
String FILE_SEPARATOR = "/";
String BRACKET_LEFT = "[";
String BRACKET_RIGHT = "]";
String UNDERLINE = "_";
String MINUS_STR = "-";
/**********************************************编码格式************************************************/
String UTF8 = "UTF-8";
/**********************************************文件后缀************************************************/
String EXCEL_XLS = ".xls";
String EXCEL_XLSX = ".xlsx";
String IMAGE_PNG = "png";
String IMAGE_JPG = "jpg";
String FILE_ZIP = ".zip";
String FILE_GZ = ".gz";
/**********************************************io流************************************************/
int BUFFER_1024 = 1024;
int BUFFER_512 = 512;
String USER_DIR = "user.dir";
/**********************************************tesseract for java语言字库************************************************/
String ENG = "eng";
String CHI_SIM = "chi_sim";
/**********************************************opencv************************************************/
String OPENCV_LIB_NAME_246 = "libs/x64/opencv_java246";
String OPENCV_LIB_NAME_330 = "libs/x64/opencv_java330";
}
| [
"18771933975@163.com"
] | 18771933975@163.com |
ad8d2a91f695dec4bf4f8f904fad2f2d302ba48b | c1238a97d39de981cf48d21a8d17f64425ed3239 | /src/main/java/com/moses/chat/server/handler/HttpHandler.java | 074dd89094758ce30748299c8ed77225db49a6a4 | [] | no_license | mosesgi/io_netty_samples | aeb90461ba0696df6f7573181d11c3b54096f381 | f46e43a8e849bf655d14800c6354d73e11052d0a | refs/heads/master | 2022-06-23T00:38:03.745129 | 2019-07-05T02:00:55 | 2019-07-05T02:00:55 | 193,356,659 | 0 | 0 | null | 2022-06-17T02:13:26 | 2019-06-23T14:17:31 | Java | UTF-8 | Java | false | false | 3,114 | java | package com.moses.chat.server.handler;
import java.io.File;
import java.io.RandomAccessFile;
import java.net.URL;
import org.apache.log4j.Logger;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.DefaultFileRegion;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.DefaultHttpResponse;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpHeaderValues;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpUtil;
import io.netty.handler.codec.http.LastHttpContent;
public class HttpHandler extends SimpleChannelInboundHandler<FullHttpRequest> {
private static Logger LOG = Logger.getLogger(HttpHandler.class);
// 获取class路径
private URL baseURL = HttpHandler.class.getProtectionDomain().getCodeSource().getLocation();
private final String webroot = "webroot";
private File getResource(String fileName) throws Exception {
String path = baseURL.toURI() + webroot + "/" + fileName;
path = !path.contains("file:") ? path : path.substring(5);
path = path.replaceAll("//", "/");
return new File(path);
}
@Override
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
String uri = request.uri();
RandomAccessFile file = null;
try {
String page = uri.equals("/") ? "chat.html" : uri;
file = new RandomAccessFile(getResource(page), "r");
} catch (Exception e) {
ctx.fireChannelRead(request.retain());
return;
}
HttpResponse response = new DefaultHttpResponse(request.protocolVersion(), HttpResponseStatus.OK);
String contextType = "text/html;";
if (uri.endsWith(".css")) {
contextType = "text/css;";
} else if (uri.endsWith(".js")) {
contextType = "text/javascript;";
} else if (uri.toLowerCase().matches("(jpg|png|gif)$")) {
String ext = uri.substring(uri.lastIndexOf("."));
contextType = "image/" + ext;
}
response.headers().set(HttpHeaderNames.CONTENT_TYPE, contextType + "charset=utf-8;");
boolean keepAlive = HttpUtil.isKeepAlive(request);
if (keepAlive) {
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, file.length());
response.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
}
ctx.write(response);
ctx.write(new DefaultFileRegion(file.getChannel(), 0, file.length()));
// ctx.write(new ChunkedNioFile(file.getChannel()));
ChannelFuture future = ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
if (!keepAlive) {
future.addListener(ChannelFutureListener.CLOSE);
}
file.close();
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
Channel client = ctx.channel();
LOG.info("Client:" + client.remoteAddress() + "异常");
// 当出现异常就关闭连接
cause.printStackTrace();
ctx.close();
}
}
| [
"jimuchen@163.com"
] | jimuchen@163.com |
b18cfa0f1246d7db5815e28085d60b661f59fcbe | 4b90b2aa600d3b48909fb919081b24ddf8b44a14 | /src/br/com/sistemaEstoque/controller/CtrlCliente.java | 8d2033d57284970533882cc751fbc5d005b9d5c9 | [] | no_license | santos-gabriel/sistemaEstoque | 7ba510d6519dc07edf30892f4cef5af5fec01e0d | 562f23d2158c918147f8eb96c60c4bfef44bd56b | refs/heads/master | 2022-03-04T04:36:39.801701 | 2019-11-07T03:05:21 | 2019-11-07T03:05:21 | 209,817,684 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 880 | java | package br.com.sistemaEstoque.controller;
import br.com.sistemaEstoque.model.bean.Cliente;
import br.com.sistemaEstoque.model.dao.ClienteDAO;
import java.util.ArrayList;
import java.util.List;
public class CtrlCliente {
public static void gravar(Cliente cliente) {
ClienteDAO cliDAO = new ClienteDAO();
cliDAO.salvar(cliente);
}
public static List<Cliente> listar() {
ClienteDAO cliDAO = new ClienteDAO();
List<Cliente> lista = new ArrayList<>();
for (Cliente cli : cliDAO.leitura()) {
lista.add(cli);
}
return lista;
}
public static void delete(Cliente cliente) {
ClienteDAO cliDAO = new ClienteDAO();
cliDAO.delete(cliente);
}
public static void editar(Cliente cliente) {
ClienteDAO cliDAO = new ClienteDAO();
cliDAO.editar(cliente);
}
}
| [
"gabrielalmeidads@gmail.com"
] | gabrielalmeidads@gmail.com |
2f87edd2baae0097c194b87e1aeb51278fbe2418 | dfd7e70936b123ee98e8a2d34ef41e4260ec3ade | /analysis/reverse-engineering/decompile-fitts-with-gradle-20191031-2200/src/main/java/io/reactivex/internal/operators/observable/ObservableJoin.java | 0b8eafe32eae3f92c71bc55fd13cff5c0ce7e2b2 | [
"Apache-2.0"
] | permissive | skkuse-adv/2019Fall_team2 | 2d4f75bc793368faac4ca8a2916b081ad49b7283 | 3ea84c6be39855f54634a7f9b1093e80893886eb | refs/heads/master | 2020-08-07T03:41:11.447376 | 2019-12-21T04:06:34 | 2019-12-21T04:06:34 | 213,271,174 | 5 | 5 | Apache-2.0 | 2019-12-12T09:15:32 | 2019-10-07T01:18:59 | Java | UTF-8 | Java | false | false | 12,391 | java | package io.reactivex.internal.operators.observable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Observer;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Function;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.queue.SpscLinkedArrayQueue;
import io.reactivex.internal.util.ExceptionHelper;
import io.reactivex.plugins.RxJavaPlugins;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
public final class ObservableJoin<TLeft, TRight, TLeftEnd, TRightEnd, R> extends AbstractObservableWithUpstream<TLeft, R> {
final Function<? super TLeft, ? extends ObservableSource<TLeftEnd>> leftEnd;
final ObservableSource<? extends TRight> other;
final BiFunction<? super TLeft, ? super TRight, ? extends R> resultSelector;
final Function<? super TRight, ? extends ObservableSource<TRightEnd>> rightEnd;
static final class JoinDisposable<TLeft, TRight, TLeftEnd, TRightEnd, R> extends AtomicInteger implements Disposable, JoinSupport {
static final Integer LEFT_CLOSE = Integer.valueOf(3);
static final Integer LEFT_VALUE = Integer.valueOf(1);
static final Integer RIGHT_CLOSE = Integer.valueOf(4);
static final Integer RIGHT_VALUE = Integer.valueOf(2);
private static final long serialVersionUID = -6071216598687999801L;
final AtomicInteger active;
volatile boolean cancelled;
final CompositeDisposable disposables = new CompositeDisposable();
final Observer<? super R> downstream;
final AtomicReference<Throwable> error = new AtomicReference<>();
final Function<? super TLeft, ? extends ObservableSource<TLeftEnd>> leftEnd;
int leftIndex;
final Map<Integer, TLeft> lefts = new LinkedHashMap();
final SpscLinkedArrayQueue<Object> queue = new SpscLinkedArrayQueue<>(Observable.bufferSize());
final BiFunction<? super TLeft, ? super TRight, ? extends R> resultSelector;
final Function<? super TRight, ? extends ObservableSource<TRightEnd>> rightEnd;
int rightIndex;
final Map<Integer, TRight> rights = new LinkedHashMap();
JoinDisposable(Observer<? super R> observer, Function<? super TLeft, ? extends ObservableSource<TLeftEnd>> function, Function<? super TRight, ? extends ObservableSource<TRightEnd>> function2, BiFunction<? super TLeft, ? super TRight, ? extends R> biFunction) {
this.downstream = observer;
this.leftEnd = function;
this.rightEnd = function2;
this.resultSelector = biFunction;
this.active = new AtomicInteger(2);
}
public void dispose() {
if (!this.cancelled) {
this.cancelled = true;
cancelAll();
if (getAndIncrement() == 0) {
this.queue.clear();
}
}
}
public boolean isDisposed() {
return this.cancelled;
}
/* access modifiers changed from: 0000 */
public void cancelAll() {
this.disposables.dispose();
}
/* access modifiers changed from: 0000 */
public void errorAll(Observer<?> observer) {
Throwable terminate = ExceptionHelper.terminate(this.error);
this.lefts.clear();
this.rights.clear();
observer.onError(terminate);
}
/* access modifiers changed from: 0000 */
public void fail(Throwable th, Observer<?> observer, SpscLinkedArrayQueue<?> spscLinkedArrayQueue) {
Exceptions.throwIfFatal(th);
ExceptionHelper.addThrowable(this.error, th);
spscLinkedArrayQueue.clear();
cancelAll();
errorAll(observer);
}
/* access modifiers changed from: 0000 */
public void drain() {
if (getAndIncrement() == 0) {
SpscLinkedArrayQueue<Object> spscLinkedArrayQueue = this.queue;
Observer<? super R> observer = this.downstream;
int i = 1;
while (!this.cancelled) {
if (((Throwable) this.error.get()) != null) {
spscLinkedArrayQueue.clear();
cancelAll();
errorAll(observer);
return;
}
boolean z = this.active.get() == 0;
Integer num = (Integer) spscLinkedArrayQueue.poll();
boolean z2 = num == null;
if (z && z2) {
this.lefts.clear();
this.rights.clear();
this.disposables.dispose();
observer.onComplete();
return;
} else if (z2) {
i = addAndGet(-i);
if (i == 0) {
return;
}
} else {
Object poll = spscLinkedArrayQueue.poll();
String str = "The resultSelector returned a null value";
if (num == LEFT_VALUE) {
int i2 = this.leftIndex;
this.leftIndex = i2 + 1;
this.lefts.put(Integer.valueOf(i2), poll);
try {
ObservableSource observableSource = (ObservableSource) ObjectHelper.requireNonNull(this.leftEnd.apply(poll), "The leftEnd returned a null ObservableSource");
LeftRightEndObserver leftRightEndObserver = new LeftRightEndObserver(this, true, i2);
this.disposables.add(leftRightEndObserver);
observableSource.subscribe(leftRightEndObserver);
if (((Throwable) this.error.get()) != null) {
spscLinkedArrayQueue.clear();
cancelAll();
errorAll(observer);
return;
}
for (Object apply : this.rights.values()) {
try {
observer.onNext(ObjectHelper.requireNonNull(this.resultSelector.apply(poll, apply), str));
} catch (Throwable th) {
fail(th, observer, spscLinkedArrayQueue);
return;
}
}
} catch (Throwable th2) {
fail(th2, observer, spscLinkedArrayQueue);
return;
}
} else if (num == RIGHT_VALUE) {
int i3 = this.rightIndex;
this.rightIndex = i3 + 1;
this.rights.put(Integer.valueOf(i3), poll);
try {
ObservableSource observableSource2 = (ObservableSource) ObjectHelper.requireNonNull(this.rightEnd.apply(poll), "The rightEnd returned a null ObservableSource");
LeftRightEndObserver leftRightEndObserver2 = new LeftRightEndObserver(this, false, i3);
this.disposables.add(leftRightEndObserver2);
observableSource2.subscribe(leftRightEndObserver2);
if (((Throwable) this.error.get()) != null) {
spscLinkedArrayQueue.clear();
cancelAll();
errorAll(observer);
return;
}
for (Object apply2 : this.lefts.values()) {
try {
observer.onNext(ObjectHelper.requireNonNull(this.resultSelector.apply(apply2, poll), str));
} catch (Throwable th3) {
fail(th3, observer, spscLinkedArrayQueue);
return;
}
}
} catch (Throwable th4) {
fail(th4, observer, spscLinkedArrayQueue);
return;
}
} else if (num == LEFT_CLOSE) {
LeftRightEndObserver leftRightEndObserver3 = (LeftRightEndObserver) poll;
this.lefts.remove(Integer.valueOf(leftRightEndObserver3.index));
this.disposables.remove(leftRightEndObserver3);
} else {
LeftRightEndObserver leftRightEndObserver4 = (LeftRightEndObserver) poll;
this.rights.remove(Integer.valueOf(leftRightEndObserver4.index));
this.disposables.remove(leftRightEndObserver4);
}
}
}
spscLinkedArrayQueue.clear();
}
}
public void innerError(Throwable th) {
if (ExceptionHelper.addThrowable(this.error, th)) {
this.active.decrementAndGet();
drain();
return;
}
RxJavaPlugins.onError(th);
}
public void innerComplete(LeftRightObserver leftRightObserver) {
this.disposables.delete(leftRightObserver);
this.active.decrementAndGet();
drain();
}
public void innerValue(boolean z, Object obj) {
synchronized (this) {
this.queue.offer(z ? LEFT_VALUE : RIGHT_VALUE, obj);
}
drain();
}
public void innerClose(boolean z, LeftRightEndObserver leftRightEndObserver) {
synchronized (this) {
this.queue.offer(z ? LEFT_CLOSE : RIGHT_CLOSE, leftRightEndObserver);
}
drain();
}
public void innerCloseError(Throwable th) {
if (ExceptionHelper.addThrowable(this.error, th)) {
drain();
} else {
RxJavaPlugins.onError(th);
}
}
}
public ObservableJoin(ObservableSource<TLeft> observableSource, ObservableSource<? extends TRight> observableSource2, Function<? super TLeft, ? extends ObservableSource<TLeftEnd>> function, Function<? super TRight, ? extends ObservableSource<TRightEnd>> function2, BiFunction<? super TLeft, ? super TRight, ? extends R> biFunction) {
super(observableSource);
this.other = observableSource2;
this.leftEnd = function;
this.rightEnd = function2;
this.resultSelector = biFunction;
}
/* access modifiers changed from: protected */
public void subscribeActual(Observer<? super R> observer) {
JoinDisposable joinDisposable = new JoinDisposable(observer, this.leftEnd, this.rightEnd, this.resultSelector);
observer.onSubscribe(joinDisposable);
LeftRightObserver leftRightObserver = new LeftRightObserver(joinDisposable, true);
joinDisposable.disposables.add(leftRightObserver);
LeftRightObserver leftRightObserver2 = new LeftRightObserver(joinDisposable, false);
joinDisposable.disposables.add(leftRightObserver2);
this.source.subscribe(leftRightObserver);
this.other.subscribe(leftRightObserver2);
}
}
| [
"33246398+ajid951125@users.noreply.github.com"
] | 33246398+ajid951125@users.noreply.github.com |
af7ed730a1e28dd0aa76aa16cda086dcbe42cc4b | dd7e0abe3cef945de028b4e1806ce983a9aa7c2f | /src/main/java/ru/news/mapper/JournalArticleMap.java | 1f3a325397d4f70bcdb08a794146cde4eba2a12c | [] | no_license | pushkinser/news-portlet | 451385dc116646ac65d80417bd7f7e23c8a48102 | 7fbc64d875384675bf3416a058aa887a693ae0ac | refs/heads/master | 2021-09-11T17:42:13.516833 | 2018-04-10T11:45:07 | 2018-04-10T11:45:07 | 120,593,622 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,468 | java | package ru.news.mapper;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portlet.asset.model.AssetCategory;
import com.liferay.portlet.asset.model.AssetEntry;
import com.liferay.portlet.asset.model.AssetTag;
import com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil;
import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil;
import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil;
import com.liferay.portlet.journal.model.JournalArticle;
import ru.news.model.JournalArticleDTO;
import java.util.ArrayList;
import java.util.List;
public class JournalArticleMap {
private static Log log = LogFactoryUtil.getLog(JournalArticleMap.class);
public static JournalArticleDTO toDto(JournalArticle journalArticle) {
if (journalArticle == null) {
throw new IllegalArgumentException("Can't convert null JournalArticle.");
}
JournalArticleDTO journalArticleDTO = new JournalArticleDTO();
journalArticleDTO.setGroupId(journalArticle.getGroupId());
journalArticleDTO.setArticleId(journalArticle.getArticleId());
journalArticleDTO.setTitle(journalArticle.getTitle());
journalArticleDTO.setContent(journalArticle.getContent());
journalArticleDTO.setPublishDate(journalArticle.getCreateDate());
List<String> tags = new ArrayList<>();
List<String> categories = new ArrayList<>();
try {
AssetEntry assetEntry = AssetEntryLocalServiceUtil.getEntry(journalArticle.getGroupId(), journalArticle.getArticleResourceUuid());
List<AssetTag> assetEntryAssetTags = AssetTagLocalServiceUtil.getAssetEntryAssetTags(assetEntry.getEntryId());
if (!assetEntryAssetTags.isEmpty()) {
log.info("Get List<AssetTag> by assetEntryId " + assetEntry.getEntryId());
for (AssetTag assetTag : assetEntryAssetTags) {
tags.add(assetTag.getName());
}
}
journalArticleDTO.setTags(tags);
List<AssetCategory> assetCategories = AssetCategoryLocalServiceUtil.getCategories(JournalArticle.class.getName(), journalArticle.getResourcePrimKey());
if (!assetCategories.isEmpty()) {
log.info("Get List<AssetCategory> by className " + JournalArticle.class.getSimpleName() + " and resourcePrimKey " + journalArticle.getResourcePrimKey());
for (AssetCategory assetCategory : assetCategories) {
categories.add(assetCategory.getName());
}
}
journalArticleDTO.setCategory(categories);
} catch (PortalException | SystemException e) {
log.error("Problem with AssetEntry, AssetTag, AssetCategory." + e);
}
return journalArticleDTO;
}
public static List<JournalArticleDTO> toDto(List<JournalArticle> journalArticles) {
if (journalArticles == null) {
throw new IllegalArgumentException("Can't convert null List<JournalArticle>.");
}
List<JournalArticleDTO> journalArticleDTOS = new ArrayList<>();
for (JournalArticle journalArticle : journalArticles) {
journalArticleDTOS.add(toDto(journalArticle));
}
return journalArticleDTOS;
}
}
| [
"pushkinsergey.voronezh@gmail.com"
] | pushkinsergey.voronezh@gmail.com |
14f0484421a781c90c596920e39a900d082204a6 | c5c328cfa8a8ba557fac995ddd6310dacde106d7 | /Project3/BinaryHeap.java | e16e9475cf8a1bc7a3a693314beb116e4125a32b | [] | no_license | Zelanias/UTD-Algo | 6ac7a8309a0f1b488a55309c86bd8cfd5148a0fd | f4b13d943d601be66e6e7bcf5853c5c5fb97180a | refs/heads/master | 2022-04-07T15:32:53.009286 | 2020-02-18T20:37:25 | 2020-02-18T20:37:25 | 241,461,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,564 | java | // BinaryHeap class
//
// CONSTRUCTION: with optional capacity (that defaults to 100)
// or an array containing initial items
//
// ******************PUBLIC OPERATIONS*********************
// void insert( x ) --> Insert x
// Comparable deleteMin( )--> Return and remove smallest item
// Comparable findMin( ) --> Return smallest item
// boolean isEmpty( ) --> Return true if empty; else false
// void makeEmpty( ) --> Remove all items
// ******************ERRORS********************************
// Throws UnderflowException as appropriate
/**
* Implements a binary heap.
* Note that all "matching" is based on the compareTo method.
* @author Mark Allen Weiss
*/
import java.lang.Exception;
public class BinaryHeap<AnyType extends Comparable<? super AnyType>>
{
/**
* Construct the binary heap.
*/
public BinaryHeap( )
{
this( DEFAULT_CAPACITY );
}
/**
* Construct the binary heap.
* @param capacity the capacity of the binary heap.
*/
public BinaryHeap( int capacity )
{
currentSize = 0;
array = (AnyType[]) new Comparable[ capacity + 1 ];
}
/**
* Construct the binary heap given an array of items.
*/
public BinaryHeap(AnyType[] items)
{
currentSize = items.length;
array = (AnyType[]) new Comparable[ ( currentSize + 2 ) * 11 / 10 ];
int i = 1;
for( AnyType item : items )
array[ i++ ] = item;
buildHeap( );
}
/**
* Insert into the priority queue, maintaining heap order.
* Duplicates are allowed.
* @param x the item to insert.
*/
public void insert( AnyType x )
{
if( currentSize == array.length - 1 )
enlargeArray( array.length * 2 + 1 );
// Percolate up
int hole = ++currentSize;
for( array[ 0 ] = x; x.compareTo( array[ hole / 2 ] ) < 0; hole /= 2 )
array[ hole ] = array[ hole / 2 ];
array[ hole ] = x;
}
private void enlargeArray( int newSize )
{
AnyType [] old = array;
array = (AnyType []) new Comparable[ newSize ];
for( int i = 0; i < old.length; i++ )
array[ i ] = old[ i ];
}
/**
* Find the smallest item in the priority queue.
* @return the smallest item, or throw an UnderflowException if empty.
*/
public AnyType findMin( ) throws Exception
{
if( isEmpty( ) )
throw new Exception("");
return array[ 1 ];
}
/**
* Remove the smallest item from the priority queue.
* @return the smallest item, or throw an UnderflowException if empty.
*/
public AnyType deleteMin( ) throws Exception
{
if( isEmpty( ) )
throw new Exception("");
AnyType minItem = findMin( );
array[ 1 ] = array[ currentSize-- ];
percolateDown( 1 );
return minItem;
}
/**
* Establish heap order property from an arbitrary
* arrangement of items. Runs in linear time.
*/
private void buildHeap( )
{
for( int i = currentSize / 2; i > 0; i-- )
percolateDown( i );
}
/**
* Test if the priority queue is logically empty.
* @return true if empty, false otherwise.
*/
public boolean isEmpty( )
{
return currentSize == 0;
}
/**
* Make the priority queue logically empty.
*/
public void makeEmpty( )
{
currentSize = 0;
}
private static final int DEFAULT_CAPACITY = 10;
private int currentSize; // Number of elements in heap
private AnyType [ ] array; // The heap array
/**
* Internal method to percolate down in the heap.
* @param hole the index at which the percolate begins.
*/
private void percolateDown( int hole )
{
int child;
AnyType tmp = array[ hole ];
for( ; hole * 2 <= currentSize; hole = child )
{
child = hole * 2;
if( child != currentSize &&
array[ child + 1 ].compareTo( array[ child ] ) < 0 )
child++;
if( array[ child ].compareTo( tmp ) < 0 )
array[ hole ] = array[ child ];
else
break;
}
array[ hole ] = tmp;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
142f90a3714fb3725783f8cc633f04d84592d765 | 192f3ec889517bae533f16fa63004274d129a329 | /src/com/javaex/ex04/Ex04.java | 45b3871878e37eb80ef095c0254de2b7bffcffd8 | [] | no_license | Heontae/chapter01-java- | 0c5c14f3604f6b1dcdc2328f210465bc7828d819 | a52a484cae028ed137762654922a70be0ac307c9 | refs/heads/master | 2022-07-31T23:54:54.576268 | 2020-05-15T01:13:16 | 2020-05-15T01:13:16 | 264,063,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package com.javaex.ex04;
import java.util.Scanner;
public class Ex04 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
while(true){
System.out.println("숫자를 입력하세요:");
int num = sc.nextInt();
if(num%3==0 && num!=0) {
System.out.println("3의 배수입니다.");
}
else if(num%3!=0) {
System.out.println("3의 배수가 아닙니다.");
}
if(num==0) {
System.out.println("종료");
break;
}
}
}
}
| [
"'gjsxo103@naver.com'"
] | 'gjsxo103@naver.com' |
a0ceb6bcaceb8d6bd4759be1c7e771f46318c16b | 7f428e8c83cf805497b18286fa00c71babe244ed | /src/main/java/com/tw/apistackbase/models/Employee.java | b1465924d1317e4761f1d0ba2a26d0b72c7bb738 | [] | no_license | jed1337/springboot-stack-2019-10-10-9-49-20-831 | 2e0c5e24263c6d58721ac667e9f77ae66896fee0 | 9fa07ae8d76db47a881774aa7ac20219549ac1a1 | refs/heads/master | 2020-08-15T01:03:02.126532 | 2019-10-16T01:31:26 | 2019-10-16T01:31:26 | 215,257,604 | 0 | 0 | null | 2019-10-15T09:20:02 | 2019-10-15T09:20:02 | null | UTF-8 | Java | false | false | 919 | java | package com.tw.apistackbase.models;
import java.io.Serializable;
public class Employee implements Serializable {
private int id;
private String name;
private int age;
private String gender;
public Employee() {
}
public Employee(int id, String name, int age, String gender) {
this.id = id;
this.name = name;
this.age = age;
this.gender = gender;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public String getGender() {
return gender;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public void setGender(String gender) {
this.gender = gender;
}
}
| [
"CAYCHJE@OOCL.COM"
] | CAYCHJE@OOCL.COM |
0fe7e398aa4c56988965d340009abfd70c32c45e | e94a7a71004d31270530946a02d6a0b0015981d4 | /TestGitEclipse-1/src/main/java/be/businesstraining/TestGitEclipse_1/App.java | 2df24d5d1c300cf272ab1b0ac798c6bfbcab15c8 | [] | no_license | fannysat/repodemoeclipse | 5d585e200974ad26902d54d898d3a92d42e5404f | 9cc7153b97a4900950bd87442f66eaa134d84857 | refs/heads/master | 2021-01-22T10:57:31.106768 | 2017-09-04T10:32:22 | 2017-09-04T10:32:22 | 102,343,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package be.businesstraining.TestGitEclipse_1;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
showLogginFramework();
}
private static void showLogginFramework() {
System.out.println("hola chu");
}
}
| [
"student@PARIS3-2.bt-training.be"
] | student@PARIS3-2.bt-training.be |
854a85e36208d82af0676ac04aa51efe3983e06e | abb526a335f8e484388aceda8f303c20c78215cb | /src/main/java/learning/session/reactive/rxjava/learnreactive/util/ThreadUtils.java | 013ac4fd124fde6f2a1e7b4de3b9e6be6d3b2810 | [] | no_license | NehalDamania/learning-reactive | 072242878fe64f788c55e6adab0e9408e6958752 | d2710cf0b0c7f7dea9ff914ef2f309f13d93e273 | refs/heads/master | 2020-01-23T22:02:43.989692 | 2016-11-24T22:31:56 | 2016-11-24T22:31:56 | 74,708,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package learning.session.reactive.rxjava.learnreactive.util;
public class ThreadUtils {
public static void sleep( long ms ) {
try {
Thread.sleep(ms);
} catch (InterruptedException ex) {
// suppress
}
}
public static void wait( Object monitor ) {
try {
// Assumes that the monitor is already "synchronized"
monitor.wait();
} catch (InterruptedException ex) {
// suppress
}
}
public static String currentThreadName() {
return Thread.currentThread().getName();
}
}
| [
"nehal.damania@mindfort.tech"
] | nehal.damania@mindfort.tech |
25cc39e02b0a73b0775e17a055dfca04fec7f3b9 | c0b516f738af4963f025646fb99adbccc07d1112 | /login-server/src/main/java/com/ocdsoft/bacta/swg/login/message/GameServerAuthenticate.java | 310a366ab8490946cd46ae4c7cece869f5313567 | [] | no_license | Dust906/swg-server | 159f5a6ba1cbb80cdee56a5148535a1e385fe182 | 03c99dc75119e4b2bd8abe73bed9c5cb0f7e46ee | refs/heads/master | 2023-07-06T01:39:11.199122 | 2017-04-03T00:53:13 | 2017-04-03T00:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.ocdsoft.bacta.swg.login.message;
import com.ocdsoft.bacta.swg.protocol.message.GameNetworkMessage;
import com.ocdsoft.bacta.swg.protocol.message.Priority;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.nio.ByteBuffer;
/**
* Created by kyle on 5/24/2016.
*/
@Getter
@Priority(0x05)
@AllArgsConstructor
public class GameServerAuthenticate extends GameNetworkMessage {
private final byte[] serverName;
private final byte[] serverKey;
public GameServerAuthenticate(final ByteBuffer buffer) {
this.serverName = new byte[buffer.getShort()];
buffer.get(this.serverName);
this.serverKey = new byte[buffer.getShort()];
buffer.get(this.serverKey);
}
@Override
public void writeToBuffer(final ByteBuffer buffer) {
buffer.putShort((short) serverName.length);
buffer.put(serverName);
buffer.putShort((short) serverKey.length);
buffer.put(serverKey);
}
} | [
"mustangcoupe69@gmail.com"
] | mustangcoupe69@gmail.com |
3343cc0bf55e9b5c2a30f50bba4d9bd7c9da1946 | 18010dc7f8fa0010d8ea3dc4f842d1db14771f5a | /src/test/java/org/monjo/core/CollectionAnnotationTest.java | 097fe7b10e2adaca5f14d38fec0ab9f98e0c5ec3 | [] | no_license | equake/monjo | af29e20258593890717939cf3ffa3e811e98ac8a | f8da25f1af937234ef715099055a5b025425ee45 | refs/heads/master | 2021-01-21T00:29:28.522846 | 2012-05-30T21:27:38 | 2012-05-30T21:27:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package org.monjo.core;
import org.bson.types.ObjectId;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
import org.monjo.core.Monjo;
import org.monjo.core.annotations.Entity;
import org.monjo.core.conversion.MonjoConverterFactory;
import org.monjo.document.IdentifiableDocument;
import com.mongodb.DB;
public class CollectionAnnotationTest {
@Test
public void shouldUseCollectionNameFromAnnotationIfGiven() throws Exception {
Monjo<ObjectId, SimplePojoAnnotated> monjo =
new Monjo<ObjectId, CollectionAnnotationTest.SimplePojoAnnotated>(Mockito.mock(DB.class), SimplePojoAnnotated.class);
String string = monjo.findOutCollectionName(SimplePojoAnnotated.class, MonjoConverterFactory.getInstance());
Assert.assertEquals("another_collection", string);
}
@Entity("another_collection")
public static class SimplePojoAnnotated implements IdentifiableDocument<ObjectId>{
private ObjectId objectId;
@Override
public ObjectId getId() {
return objectId;
}
@Override
public void setId(ObjectId id) {
this.objectId = id;
}
}
}
| [
"rdlopes@sp.r7.com"
] | rdlopes@sp.r7.com |
f6123f9a565483e5962bdfd61b90ec98cb8c0e23 | fa28e090bd3b587ac8cc0ea611a407278bd0e670 | /src/test/java/me/jrmensah/daveslist/DaveslistApplicationTests.java | cf03ba7db382baffbb693a72c26dd3288b48f988 | [] | no_license | jrmensah/daveslist | 00bf5145a1a06d33e4c084900f1c4c1cab6b79f6 | 1837e381d15faa8e36e49c7fb0631500914e6f70 | refs/heads/master | 2021-08-14T13:44:06.442486 | 2017-11-15T21:48:48 | 2017-11-15T21:48:48 | 110,890,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package me.jrmensah.daveslist;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DaveslistApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"jerilynmensah@gmail.com"
] | jerilynmensah@gmail.com |
7d9a541d7e88e40db28e8e9ac9a092a67f7ec846 | baea4515af8f72b8ed0d3092035b634271e11623 | /src/test/java/helmes/test/sectors/SectorsApplicationTests.java | a43b6fe9c9b549a618c349da1c022ec55b37bf48 | [] | no_license | WernerTurban/SectorsTest | c068593790195ed018ae5c1a973bf06867e4bed2 | 3c1958c5afd2ea46e86d69d14963e6ff297670ef | refs/heads/master | 2022-12-14T15:37:57.724162 | 2020-09-21T19:53:34 | 2020-09-21T19:53:34 | 297,171,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 221 | java | package helmes.test.sectors;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SectorsApplicationTests {
@Test
void contextLoads() {
}
}
| [
"werner.turban@ttu.ee"
] | werner.turban@ttu.ee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.