blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
97da1386c9ade798b121939e1d56b6e07ec2a32e | 6b9e9f1c5e018ed8c60143b017df7bea80ad88f8 | /leetcode_notes/leetcode_cn/0801.使序列递增的最小交换次数/0801-使序列递增的最小交换次数.java | e06055eefb1676ed93cc03f7f251ba378adbfe59 | [] | no_license | sunlate/java_notes | 80057574d81864f823a8fe3ecf1db19c22561975 | ea195c9ddaa94d829d438c8d47348d7ebbf19004 | refs/heads/master | 2020-12-31T22:53:06.951147 | 2020-02-06T03:23:40 | 2020-02-06T03:23:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | class Solution {
// 801
// Reference: wangzi6147 from leetcode
public int minSwap(int[] A, int[] B) {
// Time: O(n) Sapce: O(1)
if(A == null || B == null || A.length != B.length) return -1;
int swapRecord = 1, fixRecord = 0;
for(int i = 1; i < A.length; i ++) {
if(A[i - 1] >= B[i] || B[i - 1] >= A[i]) {
// fixRecord = fixRecord
swapRecord++;
} else if (A[i - 1] >= A[i] || B[i - 1] >= B[i]) {
int temp = swapRecord;
swapRecord = fixRecord + 1;
fixRecord = temp;
} else {
int min = Math.min(swapRecord, fixRecord);
swapRecord = min + 1;
fixRecord = min;
}
}
return Math.min(swapRecord, fixRecord);
}
} | [
"rli@uei.com"
] | rli@uei.com |
b82127cd4d2b5d0ade2ed5db55cfc2a8d18adea8 | dbd405eed0f4a621d2ebcf5d8a879aaee69136e8 | /main/user-refs/src/main/java/org/osforce/connect/dao/discussion/TopicCategoryDao.java | b6831e5623bfa5756f4808b821941c010c476e34 | [] | no_license | shengang1978/AA | a39fabd54793d0c77a64ad94d8e3dda3f0cd6951 | d7b98b8998d33b48f60514457a873219776d9f38 | refs/heads/master | 2022-12-24T02:42:04.489183 | 2021-04-28T03:26:09 | 2021-04-28T03:26:09 | 33,310,666 | 0 | 1 | null | 2022-12-16T02:29:57 | 2015-04-02T13:36:05 | Java | UTF-8 | Java | false | false | 362 | java | package org.osforce.connect.dao.discussion;
import org.osforce.connect.entity.discussion.TopicCategory;
import org.osforce.spring4me.dao.BaseDao;
/**
*
* @author gavin
* @since 1.0.0
* @create Feb 12, 2011 - 8:10:46 AM
* <a href="http://www.opensourceforce.org">开源力量</a>
*/
public interface TopicCategoryDao extends BaseDao<TopicCategory> {
}
| [
"shengang1978@hotmail.com"
] | shengang1978@hotmail.com |
ddf52bcbd11cfaa35bca0b78a890bc4f060c729c | 025ec5b4ada8ba77cc8c844af33533e60583bc4d | /generics/solution/ex30/Ex30.java | a36566ba687091060c301ac732a21e84995ed029 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | shalk/TIJ4Code | 3ec3aa1772d6c145fba5f8c44fcab20744624db8 | 23190a4a810b675c5320d37d716ab02835745600 | refs/heads/master | 2021-01-21T14:08:09.536617 | 2017-11-13T07:18:43 | 2017-11-13T07:18:43 | 59,626,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,012 | java | package generics.solution.ex30;
import generics.Holder;
import static net.mindview.util.Print.*;
class Holders {
public static <T> Holder<T> generator( T t) {
Holder<T> h = new Holder<T>();
h.set(t);
return h;
}
}
public class Ex30 {
public static void main(String[] args) {
Holder<Integer> h1 = Holders.generator(0);
int i = h1.get();
h1.set(i);
Holder<Short> h2 = Holders.generator((short)2);
short s = h2.get();
h2.set(s);
Holder<Long> h3 = Holders.generator(200L);
long l = h3.get();
h3.set(l);
Holder<Double> h4 = Holders.generator(2.00);
double d = h4.get();
h4.set(d);
Holder<Float> h5 = Holders.generator(3.14f);
float f = h5.get();
h5.set(f);
Holder<Byte> h6 = Holders.generator((byte)2);
byte b = h6.get();
h6.set(b);
Holder<Character> h7 = Holders.generator('c');
char c = h7.get();
h7.set(c);
Holder<Boolean> h8 = Holders.generator(true);
boolean bool = h8.get();
h8.set(bool);
}
}
| [
"xshalk@163.com"
] | xshalk@163.com |
bcb35b90b42ff3c54dd3198fbd1604fbf2912b2c | 03122bad70999d1638dcaac5bd5d598682793c08 | /src/test/java/Testcase/Railways/TestBase.java | 7470f2f50c03155a3af8d50f0b3b4b883f28f53e | [] | no_license | Nguyenlenhatquang98/NguyenQuang_Railway_Automation | cccd60d520b06312512ebbed5eb804142225463f | 1b6872af66eb1107648f708a4e8e6869ec791008 | refs/heads/master | 2023-06-17T01:05:24.382520 | 2021-07-16T08:55:23 | 2021-07-16T08:55:23 | 381,327,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,087 | java | package Testcase.Railways;
import Common.Common.Utilities;
import Common.Constant.Constant;
import Common.WebDriverManager.WebDriverManager;
import Model.Account;
import Model.Ticket;
import PageObjects.Railways.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
public class TestBase {
public GeneralPage generalPage = new GeneralPage();
public HomePage homepage = new HomePage();
public LoginPage loginPage;
public RegisterPage registerPage;
public ForgotPasswordPage forgotPasswordPage;
public BookTicketPage bookTicketPage;
public TicketPricePage ticketPricePage;
public MyTicketPage myTicketPage;
public Account account;
public Ticket ticket;
@BeforeClass
public void BeforeClass() {
System.setProperty("webdriver.chrome.driver", Utilities.getDriverPath());
Constant.WEBDRIVER = WebDriverManager.getInstance();
Constant.WEBDRIVER.maximize();
homepage.open();
}
@AfterClass
public void AfterClass() {
Constant.WEBDRIVER.quit();
}
}
| [
"nguyenlenhatquang98@gmail.com"
] | nguyenlenhatquang98@gmail.com |
5cf896aa724993acb3b7feda522b00ba07abd7ae | a6a2dc933b03e70ee9d8f6e8610a9a4c28f90b8d | /src/main/java/app/entity/Department.java | ac622983087cea5401c05854dd6585c2dabc08ce | [] | no_license | bganem/applus | f08eead342410b3c7b4d9a5cec89b16acdd12bb9 | fb006e44546ee502746dd92af3e64b0f893d2f69 | refs/heads/master | 2020-04-07T21:41:43.021934 | 2018-11-22T18:30:32 | 2018-11-22T18:30:32 | 158,737,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,776 | java | package app.entity;
import java.io.*;
import javax.persistence.*;
import java.util.*;
import javax.xml.bind.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonFilter;
import cronapi.rest.security.CronappSecurity;
import org.eclipse.persistence.annotations.*;
/**
* Classe que representa a tabela DEPARTMENT
* @generated
*/
@Entity
@Table(name = "\"DEPARTMENT\"" ,uniqueConstraints=@UniqueConstraint(columnNames={
"name" }))
@XmlRootElement
@CronappSecurity
@Multitenant(MultitenantType.SINGLE_TABLE)
@TenantDiscriminatorColumn(name = "fk_company", contextProperty = "tenant")
@JsonFilter("app.entity.Department")
public class Department implements Serializable {
/**
* UID da classe, necessário na serialização
* @generated
*/
private static final long serialVersionUID = 1L;
/**
* @generated
*/
@Id
@Column(name = "id", nullable = false, insertable=true, updatable=true)
private java.lang.String id = UUID.randomUUID().toString().toUpperCase();
/**
* @generated
*/
@Column(name = "name", nullable = false, unique = true, insertable=true, updatable=true)
private java.lang.String name;
/**
* @generated
*/
@ManyToOne
@JoinColumn(name="fk_company", nullable = false, referencedColumnName = "id", insertable=false, updatable=false)
private Company company;
/**
* @generated
*/
@Column(name = "chHoraria", nullable = false, unique = false, insertable=true, updatable=true)
private java.lang.Integer chHoraria;
/**
* @generated
*/
@ManyToOne
@JoinColumn(name="fk_user", nullable = true, referencedColumnName = "id", insertable=true, updatable=true)
private User user;
/**
* Construtor
* @generated
*/
public Department(){
}
/**
* Obtém id
* return id
* @generated
*/
public java.lang.String getId(){
return this.id;
}
/**
* Define id
* @param id id
* @generated
*/
public Department setId(java.lang.String id){
this.id = id;
return this;
}
/**
* Obtém name
* return name
* @generated
*/
public java.lang.String getName(){
return this.name;
}
/**
* Define name
* @param name name
* @generated
*/
public Department setName(java.lang.String name){
this.name = name;
return this;
}
/**
* Obtém company
* return company
* @generated
*/
public Company getCompany(){
return this.company;
}
/**
* Define company
* @param company company
* @generated
*/
public Department setCompany(Company company){
this.company = company;
return this;
}
/**
* Obtém chHoraria
* return chHoraria
* @generated
*/
public java.lang.Integer getChHoraria(){
return this.chHoraria;
}
/**
* Define chHoraria
* @param chHoraria chHoraria
* @generated
*/
public Department setChHoraria(java.lang.Integer chHoraria){
this.chHoraria = chHoraria;
return this;
}
/**
* Obtém user
* return user
* @generated
*/
public User getUser(){
return this.user;
}
/**
* Define user
* @param user user
* @generated
*/
public Department setUser(User user){
this.user = user;
return this;
}
/**
* @generated
*/
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Department object = (Department)obj;
if (id != null ? !id.equals(object.id) : object.id != null) return false;
return true;
}
/**
* @generated
*/
@Override
public int hashCode() {
int result = 1;
result = 31 * result + ((id == null) ? 0 : id.hashCode());
return result;
}
}
| [
"bruno_ganem@msn.com"
] | bruno_ganem@msn.com |
1125bc58e4b6bc1174e15ae1e426edf22bcdd8f6 | 1702ba89c092d0533f374925e8e06797184a189a | /webgephi-server/src/main/webapp/WEB-INF/classes/cz/cokrtvac/webgephi/webgephiserver/core/annotations/Available.java | 69f9932777e35c48fa465fc77d19d48df24f14e9 | [] | no_license | Beziks/webgephi | f5f5dd5d8cb6c255d9bb5778804b1bbdbb61a390 | 9897d1a0cb0f3c353c0e316d93a4111786beb41d | refs/heads/master | 2020-04-28T08:25:00.638261 | 2014-06-26T17:10:27 | 2014-06-26T17:10:27 | 16,778,684 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package cz.cokrtvac.webgephi.webgephiserver.core.annotations;
import javax.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* User: Vaclav Cokrt, beziks@gmail.com
* Date: 4.6.13
* Time: 10:24
*/
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
public @interface Available {
}
| [
"beziks@gmail.com"
] | beziks@gmail.com |
e8d1aa10af3745f6c2a8e9a87408b6197f919537 | ff7e44516bf81dae4c803f6f6f62ea05d33f9177 | /slaesvenky/src/main/java/com/mnt/esales/bean/ReportBean.java | ba9fda84d869716fa2357a827cee1cf21479da58 | [] | no_license | venkateshpavuluri/esales | 8e461ee6bab493d361434f28cdac74bd45cc395f | dac0f65187b8ebe258e2705df15f32dbcfe9c8c1 | refs/heads/master | 2016-09-16T02:56:34.248773 | 2014-08-10T13:11:31 | 2014-08-10T13:11:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,447 | java | /**
*
*/
package com.mnt.esales.bean;
/**
* @author Devi
*
*/
public class ReportBean {
private String date;
//daily Sales Report loc wise
private String sdate;
private String branchId;
private String billId;
private String billDate;
private String mobileNo;
private String totalMrp;
private String totalRate;
private String totalDiscount;
private String netAmt;
private String totalPayment;
private String returnChange;
private String total_Quantiy;
private String billDetailId;
private String prodDesc;
private String pdRate;
private String pdQuantity;
private String pdDiscount;
private String vat;
private String pdAmount;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getSdate() {
return sdate;
}
public void setSdate(String sdate) {
this.sdate = sdate;
}
public String getBranchId() {
return branchId;
}
public void setBranchId(String branchId) {
this.branchId = branchId;
}
public String getBillId() {
return billId;
}
public void setBillId(String billId) {
this.billId = billId;
}
public String getBillDate() {
return billDate;
}
public void setBillDate(String billDate) {
this.billDate = billDate;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getTotalMrp() {
return totalMrp;
}
public void setTotalMrp(String totalMrp) {
this.totalMrp = totalMrp;
}
public String getTotalRate() {
return totalRate;
}
public void setTotalRate(String totalRate) {
this.totalRate = totalRate;
}
public String getTotalDiscount() {
return totalDiscount;
}
public void setTotalDiscount(String totalDiscount) {
this.totalDiscount = totalDiscount;
}
public String getNetAmt() {
return netAmt;
}
public void setNetAmt(String netAmt) {
this.netAmt = netAmt;
}
public String getTotalPayment() {
return totalPayment;
}
public void setTotalPayment(String totalPayment) {
this.totalPayment = totalPayment;
}
public String getReturnChange() {
return returnChange;
}
public void setReturnChange(String returnChange) {
this.returnChange = returnChange;
}
public String getTotal_Quantiy() {
return total_Quantiy;
}
public void setTotal_Quantiy(String total_Quantiy) {
this.total_Quantiy = total_Quantiy;
}
public String getBillDetailId() {
return billDetailId;
}
public void setBillDetailId(String billDetailId) {
this.billDetailId = billDetailId;
}
public String getProdDesc() {
return prodDesc;
}
public void setProdDesc(String prodDesc) {
this.prodDesc = prodDesc;
}
public String getPdRate() {
return pdRate;
}
public void setPdRate(String pdRate) {
this.pdRate = pdRate;
}
public String getPdQuantity() {
return pdQuantity;
}
public void setPdQuantity(String pdQuantity) {
this.pdQuantity = pdQuantity;
}
public String getPdDiscount() {
return pdDiscount;
}
public void setPdDiscount(String pdDiscount) {
this.pdDiscount = pdDiscount;
}
public String getVat() {
return vat;
}
public void setVat(String vat) {
this.vat = vat;
}
public String getPdAmount() {
return pdAmount;
}
public void setPdAmount(String pdAmount) {
this.pdAmount = pdAmount;
}
}
| [
"pavuluri.venki@gmail.com"
] | pavuluri.venki@gmail.com |
4f1eadea69498640edaf05eeae3eced6f95fda01 | a08ee5b29e2c3de30148dfeeee6b33302b610e14 | /JC_Lesson5/AppData.java | b7de79c4ef1f15a340e6680d118577fa1d26d563 | [] | no_license | LoveZakharova/GB_2.8 | 9438b36a79678bbf074eabe8582b60eac712d535 | 10579e972bf701f9d286cd1c2b5802765612cd2a | refs/heads/master | 2023-09-02T12:15:29.487761 | 2021-11-21T15:08:49 | 2021-11-21T15:08:49 | 428,719,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,339 | java | package JC_Lesson5;
import java.io.*;
public class AppData {
private static class Table implements Serializable {
public String[] header;
private int[][] data;
public Table(String header, int data) {
this.header = header;
this.data = data;
}
public void info() {
System.out.println(data + " " + header);
}
}
public static void main(String[] args) {
File csvFile = new File("hw.scv");
Table table1Out = new Table("Value1", 1);
Table table2Out = new Table("Value2", 10);
try (ObjectOutputStream objOut = new ObjectOutputStream(new FileOutputStream("hw"))) {
objOut.writeObject(table1Out);
objOut.writeObject(table2Out);
} catch (IOException e) {
e.printStackTrace();
}
Table table1In = null;
Table table2In = null;
try (ObjectInputStream objIn = new ObjectInputStream(new FileInputStream("hw"))) {
table1In = (Table) objIn.readObject();
table2In = (Table) objIn.readObject();
table1In.info();
table2In.info();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"zakharovalove@mail.ru"
] | zakharovalove@mail.ru |
997cddd07eea121c141c36737e853dcf75a139d2 | 4bcb1aca03adb06f579383eedd1e8e2174ea609f | /microservice-file-upload/src/main/java/com/catalpa/example/controller/FileUploadController.java | 8bc37e412e5ea7c68b0badeeb5d20f497b49d5ae | [] | no_license | bruce-wan/spring-cloud-study | 9ecff7a2daa6f1fa092e2dedfe0c8b7584926860 | e52613aaf82a8f74c51cfac7f47600e6b6d130ff | refs/heads/master | 2021-07-07T07:39:51.582384 | 2017-09-29T09:27:50 | 2017-09-29T09:27:50 | 105,093,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | java | package com.catalpa.example.controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
/**
* Created by wanchuan on 2017/9/28.
*/
@RestController
public class FileUploadController {
/**
* 小于1M的文件或者英文名文件不需要加zuul,大于1M的文件或者中文名文件需要加zuul
* @param file
* @return
* @throws Exception
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public String handleFileUpload(@RequestParam(value = "file", required = true) MultipartFile file) throws Exception {
byte[] bytes = file.getBytes();
File fileToSave = new File(file.getOriginalFilename());
FileCopyUtils.copy(bytes, fileToSave);
return fileToSave.getAbsolutePath();
}
}
| [
"165646633@qq.com"
] | 165646633@qq.com |
310e38f9f64bf57d61ddab4f26d562bd05b154e3 | 036728cfb446121a8521d292418c0a9616b999cf | /src/test/java/com/niuliuplay/BlogApplicationTests.java | 478ea4a8a33507d002b90d72ef5f7be00130a3d0 | [] | no_license | niuliuplay/blog | c66c70d8d6a4996440db6a712010c4e849407aad | f0f1b90ce71a92c7468077eda62c2bd8dda807c6 | refs/heads/master | 2020-03-19T21:14:37.849057 | 2018-06-27T06:43:59 | 2018-06-27T06:43:59 | 136,933,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | package com.niuliuplay;
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 BlogApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"liuhuihail@163.com"
] | liuhuihail@163.com |
dc01aa6fc8869c3e1b9d73fb125eec87c91a3c1d | 3053ca682e4feaf51836b74f53791cfd41c9363d | /src/main/java/com/feng/work/schedule/service/ScheduleService.java | 3d1cce5320ea5268318e71f78702a6341bdda97f | [] | no_license | fengzheng88/ssm | d2ebefc48565def503ebafc27f421bc583c85fa1 | 34bd41f4085e7aade042f1ab42594ce82e1b1eb9 | refs/heads/master | 2021-06-25T07:46:26.627297 | 2017-08-23T11:19:31 | 2017-08-23T11:19:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package com.feng.work.schedule.service;
import com.feng.work.entity.ScheduleEntity;
import java.util.List;
import java.util.Map;
/**
* Created by jarry on 2017/6/20.
*/
public interface ScheduleService {
public List<ScheduleEntity> getAllSchedule();
public List<ScheduleEntity> findByCondition(Map<String, String> map);
}
| [
"383165400@qq.com"
] | 383165400@qq.com |
74c07bd478d01e35b979673195f023fd55b9212c | 97ce318718b129a93e69e4b0490447ba13f9f4ca | /src/main/java/com/epam/springadvanced/domain/enums/TicketState.java | 57bc3f69ffd16ff3d320657737e7cd344f24ade4 | [] | no_license | addonin/spring-advanced | 8f639d47ccc4f616312a7ec62b0404198b283821 | 40c89dd521d0c0146853e9b8d74eef4932fb888a | refs/heads/master | 2022-12-16T14:10:43.237999 | 2022-04-17T19:54:55 | 2022-04-17T19:54:55 | 54,463,786 | 0 | 0 | null | 2022-12-06T17:23:06 | 2016-03-22T09:48:09 | Java | UTF-8 | Java | false | false | 139 | java | package com.epam.springadvanced.domain.enums;
/**
* @author dimon
* @since 27/03/16.
*/
public enum TicketState {
FREE, BOOKED
}
| [
"dmitrii.adonin@gmail.com"
] | dmitrii.adonin@gmail.com |
4d4a4821f6aa1026659b361ef9120db277bdfc2b | f2f8ef12fdb58c4965ab7594543c3bad9c522992 | /src/main/java/com/tinkerpop/blueprints/pgm/impls/tg/TinkerElement.java | dcbcf67515dccac0f9008f4d82537800d1023931 | [
"BSD-3-Clause"
] | permissive | germanviscuso/blueprints | 7c08e7f6db7930cd549e92f63ea4c5ba6b4f8a8d | 1e04d2bc7be0835aed19130d8525f2fc9f81782c | refs/heads/master | 2020-05-20T13:11:38.546867 | 2011-04-06T23:54:04 | 2011-04-06T23:54:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,733 | java | package com.tinkerpop.blueprints.pgm.impls.tg;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Element;
import com.tinkerpop.blueprints.pgm.impls.StringFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public abstract class TinkerElement implements Element {
protected Map<String, Object> properties = new HashMap<String, Object>();
protected final String id;
protected final TinkerGraph graph;
protected TinkerElement(final String id, final TinkerGraph graph) {
this.graph = graph;
this.id = id;
}
public Set<String> getPropertyKeys() {
return this.properties.keySet();
}
public Object getProperty(final String key) {
return this.properties.get(key);
}
public void setProperty(final String key, final Object value) {
if (key.equals(StringFactory.ID) || (key.equals(StringFactory.LABEL) && this instanceof Edge))
throw new RuntimeException(key + StringFactory.PROPERTY_EXCEPTION_MESSAGE);
Object oldValue = this.properties.put(key, value);
for (TinkerAutomaticIndex index : this.graph.getAutoIndices()) {
index.autoUpdate(key, value, oldValue, this);
}
}
public Object removeProperty(final String key) {
Object oldValue = this.properties.remove(key);
for (TinkerAutomaticIndex index : this.graph.getAutoIndices()) {
index.autoRemove(key, oldValue, this);
}
return oldValue;
}
public int hashCode() {
return this.getId().hashCode();
}
public String getId() {
return this.id;
}
}
| [
"okrammarko@gmail.com"
] | okrammarko@gmail.com |
7ccdc1c2ea2f3dd69ff1393afadfdfd78f02cbbe | 7ced4b8259a5d171413847e3e072226c7a5ee3d2 | /Workspace/InterviewBit/Two Pointers/remove-duplicates-from-sorted-array.java | 3e2168101ebb41c583cab45c7c30a450a55d626d | [] | no_license | tanishq9/Data-Structures-and-Algorithms | 8d4df6c8a964066988bcf5af68f21387a132cd4d | f6f5dec38d5e2d207fb29ad4716a83553924077a | refs/heads/master | 2022-12-13T03:57:39.447650 | 2020-09-05T13:16:55 | 2020-09-05T13:16:55 | 119,425,479 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | public class Solution {
public int removeDuplicates(ArrayList<Integer> a) {
int i,j,ival=a.get(0),jval=a.get(0);
for(i=1,j=1;j<a.size();j++){
jval=a.get(j);
if(ival!=jval){
a.set(i,jval);
i++;
ival=jval;
}
}
return i;
}
}
| [
"tanishqsaluja18@gmail.com"
] | tanishqsaluja18@gmail.com |
ce10d56b1de7e1f9bc8114b1a8c21bfce4173e8c | b75487ea56426c906b6bd9442a1714efff9ab889 | /src/main/java/com/ss/oauth2/model/AuthenticationWebRequest.java | 21da135fee4f70d4b748694f77892300616c984c | [] | no_license | SimplifySalary/ms-oauth2 | 33cb68145872a5387355547728204c1261f797ee | 55bf49fb869321d94e3938fd81e4049b58403d8f | refs/heads/master | 2020-07-24T09:04:58.170243 | 2019-10-03T15:36:08 | 2019-10-03T15:36:08 | 207,876,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package com.ss.oauth2.model;
import lombok.Data;
import java.io.Serializable;
/**
* @author biandra
*/
@Data
public class AuthenticationWebRequest implements Serializable {
private String nombre_canal;
private String rut;
private String digito_verificador;
private String clave_x;
private String bin_tarjeta;
private String logo;
private String indicador_auto;
private String origen_operacion;
private String cod_comercio;
private String num_dpc;
private String monto_trx;
}
| [
"maxi.britez@redb.ee"
] | maxi.britez@redb.ee |
5980d11ce96e3570990ae63fbc4e102e6df7c2e4 | 35c611b97fa3ec607dae9e7fdbb27d5c7df8fb43 | /bqmobile/native/android/bqmobile/src/com/yonyou/ump/BQLoginPageActivity.java | 53db9153f8b7ec73b09effc7570872cfadeded28 | [] | no_license | wangqzh/umbqmobile | 7f480396415268add252d2754fe4f2b6f8ce8b07 | 8e067c3a4d57c6a40f5b08b89c6433b02ed11c55 | refs/heads/master | 2021-01-13T01:44:31.497150 | 2014-04-30T09:10:02 | 2014-04-30T09:10:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,016 | java | package com.yonyou.ump;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;
public abstract class BQLoginPageActivity extends UMWindowActivity {
protected UMWindow BQLoginPage = null;
protected XVerticalLayout viewPageLogin = null;
protected XHorizontalLayout navigatorbar0 = null;
protected UMButton button0 = null;
protected UMLabel labelLoginTitle = null;
protected UMButton buttonConset = null;
protected UMTextbox textboxUserName = null;
protected UMPassword textboxPassword = null;
protected XHorizontalLayout panel0 = null;
protected UMLabel label2 = null;
protected UMLabel labelAutoLogin = null;
protected UMSwitch switchAutoLogin = null;
protected UMButton buttonLogin = null;
protected final static int ID_BQLOGINPAGE = 527780475;
protected final static int ID_VIEWPAGELOGIN = 1856456868;
protected final static int ID_NAVIGATORBAR0 = 1818638594;
protected final static int ID_BUTTON0 = 190086809;
protected final static int ID_LABELLOGINTITLE = 716895171;
protected final static int ID_BUTTONCONSET = 1403270690;
protected final static int ID_TEXTBOXUSERNAME = 317629107;
protected final static int ID_TEXTBOXPASSWORD = 1031085182;
protected final static int ID_PANEL0 = 1689238292;
protected final static int ID_LABEL2 = 29482570;
protected final static int ID_LABELAUTOLOGIN = 597942563;
protected final static int ID_SWITCHAUTOLOGIN = 1249846483;
protected final static int ID_BUTTONLOGIN = 1624421407;
protected UMWindow currentPage = null;
@Override
public String getControllerName() {
return "BQLoginPageController";
}
@Override
public String getContextName() {
return "USERS";
}
@Override
public String getNameSpace() {
return "com.ufida.uap";
}
protected void onCreate(Bundle savedInstanceState) {
ULog.logLC("onCreate", this);
super.onCreate(savedInstanceState);
onInit(savedInstanceState);
}
@Override
protected void onStart() {
ULog.logLC("onStart", this);
super.onStart();
}
@Override
protected void onRestart() {
ULog.logLC("onRestart", this);
super.onRestart();
}
@Override
protected void onResume() {
ULog.logLC("onResume", this);
super.onResume();
}
@Override
protected void onPause() {
ULog.logLC("onPause", this);
super.onPause();
}
@Override
protected void onStop() {
ULog.logLC("onStop", this);
super.onStop();
}
@Override
protected void onDestroy() {
ULog.logLC("onDestroy", this);
super.onDestroy();
}
public void onInit(Bundle savedInstanceState) {
ULog.logLC("onInit", this);
UMActivity context = this;
UMDslConfigure configure = new UMDslConfigure();
this.getContainer();
new Thread() {
public void run() {
UMPDebugClient.startServer();
}
}.start();
IBinderGroup binderGroup = this;
currentPage = getCurrentWindow(context, binderGroup,configure);
this.setContentView(currentPage);
registerControl();
}
private void registerControl() {
idmap.put("BQLoginPage",ID_BQLOGINPAGE);
idmap.put("viewPageLogin",ID_VIEWPAGELOGIN);
idmap.put("navigatorbar0",ID_NAVIGATORBAR0);
idmap.put("button0",ID_BUTTON0);
idmap.put("labelLoginTitle",ID_LABELLOGINTITLE);
idmap.put("buttonConset",ID_BUTTONCONSET);
idmap.put("textboxUserName",ID_TEXTBOXUSERNAME);
idmap.put("textboxPassword",ID_TEXTBOXPASSWORD);
idmap.put("panel0",ID_PANEL0);
idmap.put("label2",ID_LABEL2);
idmap.put("labelAutoLogin",ID_LABELAUTOLOGIN);
idmap.put("switchAutoLogin",ID_SWITCHAUTOLOGIN);
idmap.put("buttonLogin",ID_BUTTONLOGIN);
}
public void onLoad() {
ULog.logLC("onLoad", this);
if(currentPage!=null) {
currentPage.onLoad();
}
}
public void onDatabinding() {
ULog.logLC("onDatabinding", this);
super.onDatabinding();
}
@Override
public void onReturn(String methodName, Object returnValue) {
}
@Override
public void onAfterInit() {
ULog.logLC("onAfterInit", this);
onLoad();
}
@Override
public Map<String,String> getPlugout(String id) {
XJSON from = this.getUMContext();
Map<String,String> r = super.getPlugout(id);
return r;
}
public View getNavigatorbar0View(final UMActivity context,IBinderGroup binderGroup, UMDslConfigure configure) {
navigatorbar0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_NAVIGATORBAR0
,"height","44.0"
,"color","#e50011"
,"pressed-image","nav"
,"layout-type","linear"
,"font-size","17"
,"width","fill"
,"background-image-dis","navbar_login"
,"font-family","default"
,"valign","center"
,"background-image","navbar_login"
);
navigatorbar0.setup();
button0 = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTON0
,"halign","center"
,"height","44"
,"color","#e50011"
,"layout-type","linear"
,"font-size","18"
,"width","84"
,"font-family","default"
,"valign","center"
);
button0.setup();
navigatorbar0.addView(button0);
labelLoginTitle = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABELLOGINTITLE
,"content","用户登录"
,"halign","center"
,"height","25.0"
,"weight","1"
,"color","#000000"
,"layout-type","linear"
,"font-size","17"
,"width","0"
,"font-family","default"
,"valign","center"
);
labelLoginTitle.setup();
navigatorbar0.addView(labelLoginTitle);
buttonConset = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTONCONSET
,"margin-right","12"
,"halign","center"
,"height","44"
,"color","#e50011"
,"layout-type","linear"
,"font-size","17"
,"width","72"
,"value","设置链接"
,"font-family","default"
,"valign","center"
);
buttonConset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UMEventArgs args = new UMEventArgs(BQLoginPageActivity.this);
actionConnectSetting(buttonConset,args);
}
});
buttonConset.setup();
navigatorbar0.addView(buttonConset);
return navigatorbar0;
}
public View getPanel0View(final UMActivity context,IBinderGroup binderGroup, UMDslConfigure configure) {
panel0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL0
,"margin-right","12"
,"height","32"
,"layout-type","linear"
,"width","fill"
,"margin-left","12"
,"margin-top","12"
,"valign","center"
);
panel0.setup();
label2 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL2
,"halign","center"
,"height","14.0"
,"weight","1"
,"color","#000000"
,"layout-type","linear"
,"font-size","12"
,"width","0"
,"font-family","default"
,"valign","center"
);
label2.setup();
panel0.addView(label2);
labelAutoLogin = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABELAUTOLOGIN
,"content","自动登录"
,"halign","center"
,"height","fill"
,"color","#000000"
,"layout-type","linear"
,"font-size","14"
,"width","90.0"
,"font-family","default"
,"valign","center"
);
labelAutoLogin.setup();
panel0.addView(labelAutoLogin);
switchAutoLogin = (UMSwitch)ThirdControl.createControl(new UMSwitch(context),ID_SWITCHAUTOLOGIN
,"padding-left","2"
,"pressed-image","slideswitch"
,"width","51"
,"background-image-dis","slideswitch"
,"switch-trackoff-image","switch_off"
,"switch-trackon-image","slideswitch"
,"height","fill"
,"color","#e50011"
,"layout-type","linear"
,"font-size","18"
,"value","off"
,"font-family","default"
,"background-image","slideswitch"
);
switchAutoLogin.setup();
panel0.addView(switchAutoLogin);
return panel0;
}
public View getViewPageLoginView(final UMActivity context,IBinderGroup binderGroup, UMDslConfigure configure) {
viewPageLogin = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGELOGIN
,"halign","center"
,"height","fill"
,"layout-type","linear"
,"background","#F5F5F5"
,"width","fill"
,"background-image","contest_bg"
);
viewPageLogin.setup();
View navigatorbar0 = (View) getNavigatorbar0View((UMActivity)context,binderGroup,configure);
viewPageLogin.addView(navigatorbar0);
textboxUserName = (UMTextbox)ThirdControl.createControl(new UMTextbox(context),ID_TEXTBOXUSERNAME
,"padding-left","39"
,"padding-top","21"
,"halign","LEFT"
,"pressed-image","textbox"
,"width","fill"
,"background-image-dis","textbox"
,"padding-bottom","5"
,"margin-right","12"
,"maxlength","256"
,"height","44"
,"color","#000000"
,"layout-type","linear"
,"font-size","16"
,"margin-left","12"
,"value","admin"
,"font-family","default"
,"margin-top","2"
,"background-image","textbox_user"
);
UMTextBinder textboxUserName_binder = new UMTextBinder((IUMContextAccessor)context);
textboxUserName_binder.setBindInfo(new BindInfo("userName"));
textboxUserName_binder.setControl(textboxUserName);
binderGroup.addBinderToGroup(ID_TEXTBOXUSERNAME, textboxUserName_binder);
textboxUserName.setup();
viewPageLogin.addView(textboxUserName);
textboxPassword = (UMPassword)ThirdControl.createControl(new UMPassword(context),ID_TEXTBOXPASSWORD
,"padding-left","39"
,"padding-top","21"
,"halign","LEFT"
,"pressed-image","textbox"
,"width","fill"
,"background-image-dis","textbox"
,"padding-bottom","5"
,"margin-right","12"
,"maxlength","256"
,"height","44"
,"color","#000000"
,"layout-type","linear"
,"font-size","16"
,"margin-left","12"
,"value","123456"
,"font-family","default"
,"margin-top","4"
,"background-image","textbox_passwd"
);
UMTextBinder textboxPassword_binder = new UMTextBinder((IUMContextAccessor)context);
textboxPassword_binder.setBindInfo(new BindInfo("passWord"));
textboxPassword_binder.setControl(textboxPassword);
binderGroup.addBinderToGroup(ID_TEXTBOXPASSWORD, textboxPassword_binder);
textboxPassword.setup();
viewPageLogin.addView(textboxPassword);
View panel0 = (View) getPanel0View((UMActivity)context,binderGroup,configure);
viewPageLogin.addView(panel0);
buttonLogin = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTONLOGIN
,"halign","center"
,"pressed-image","themes/ios7/hdpi/login_touch.png"
,"width","fill"
,"font-pressed-color","#ffffff"
,"pressed-color","#e50011"
,"margin-right","12"
,"height","44"
,"color","#e50011"
,"layout-type","linear"
,"background","#ffffff"
,"font-size","17"
,"margin-left","12"
,"font-family","default"
,"margin-top","12"
,"valign","center"
);
buttonLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UMEventArgs args = new UMEventArgs(BQLoginPageActivity.this);
actionLoadconfig(buttonLogin,args);
}
});
buttonLogin.setup();
viewPageLogin.addView(buttonLogin);
return viewPageLogin;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup, UMDslConfigure configure) {
BQLoginPage = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_BQLOGINPAGE
,"halign","center"
,"height","fill"
,"layout-type","linear"
,"layout","vbox"
,"width","fill"
,"context","USERS"
,"controller","BQLoginPageController"
,"namespace","com.ufida.uap"
);
BQLoginPage.setup();
View viewPageLogin = (View) getViewPageLoginView((UMActivity)context,binderGroup,configure);
BQLoginPage.addView(viewPageLogin);
return (UMWindow)BQLoginPage;
}
public void actionConnectSetting(View control, UMEventArgs args) {
String actionid = "connectSetting";
args.put("viewid","com.yonyou.BQLoginPageconset");
args.put("iskeep","false");
args.put("animation-type","Fade");
args.put("containername","");
ActionProcessor.exec(this, actionid, args);
UMView.open(args);
}
public void actionLoginAction(View control, UMEventArgs args) {
String actionid = "loginAction";
this.dataCollect();
args.put("callback","openHTTPS");
args.put("type","nc");
args.put("user","#{userName}");
args.put("containername","");
args.put("pass","#{passWord}");
ActionProcessor.exec(this, actionid, args);
UMService.login(args);
}
public void actionOpenHTTPS(View control, UMEventArgs args) {
String actionid = "openHTTPS";
args.put("ishttps","#{ishttps}");
args.put("callback","openMainview");
args.put("containername","");
ActionProcessor.exec(this, actionid, args);
UMService.openHTTPS(args);
}
public void actionOpenMainview(View control, UMEventArgs args) {
String actionid = "openMainview";
args.put("viewid","com.yonyou.Personlist");
args.put("iskeep","false");
args.put("animation-type","Fade");
args.put("containername","");
ActionProcessor.exec(this, actionid, args);
UMView.open(args);
}
public void actionLoadconfig(View control, UMEventArgs args) {
String actionid = "loadconfig";
args.put("ishttps","ishttps");
args.put("callback","openHTTPS");
args.put("containername","");
ActionProcessor.exec(this, actionid, args);
UMService.loadConfigure(args);
}
}
| [
"27696830@qq.com"
] | 27696830@qq.com |
7cefc7b713e9e24649fd40393eafb43b9f873198 | 306c665cbe4c9680eca8ae58c331752d5c4aea2b | /03-big_data_sxt3/src/com/sxt/transformer/mr/nu/MyNewInstallUserMapper.java | eec6820860d957f9812b10d7ce8e3a855fc60c35 | [] | no_license | ldp1063891253/logpro | 0804b9a3214a917de31ba81e0c1198b2a524757f | a66b81f6390aecad219a4de3b35e899b9620a00c | refs/heads/master | 2020-09-20T23:58:44.727519 | 2019-11-28T09:57:18 | 2019-11-28T09:57:18 | 224,622,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,138 | java | package com.sxt.transformer.mr.nu;
import com.sxt.common.DateEnum;
import com.sxt.common.EventLogConstants;
import com.sxt.common.GlobalConstants;
import com.sxt.common.KpiType;
import com.sxt.transformer.model.dim.StatsCommonDimension;
import com.sxt.transformer.model.dim.StatsUserDimension;
import com.sxt.transformer.model.dim.base.BrowserDimension;
import com.sxt.transformer.model.dim.base.DateDimension;
import com.sxt.transformer.model.dim.base.KpiDimension;
import com.sxt.transformer.model.dim.base.PlatformDimension;
import com.sxt.transformer.model.value.map.TimeOutputValue;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableMapper;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import java.io.IOException;
import java.lang.management.GarbageCollectorMXBean;
import java.util.List;
//每个分析条件(由各个维度组成的)作为key,uuid作为value
public class MyNewInstallUserMapper extends TableMapper<StatsUserDimension, TimeOutputValue> {
private StatsUserDimension statsUserDimension = new StatsUserDimension();
private TimeOutputValue timeOutputValue = new TimeOutputValue();
@Override
protected void map(ImmutableBytesWritable key, Result value, Context context) throws IOException, InterruptedException {
//时间
//浏览器
//平台
//模块
String serverTime = getCellValue(
value,
EventLogConstants.EVENT_LOGS_FAMILY_NAME,
EventLogConstants.LOG_COLUMN_NAME_SERVER_TIME
);
String browserName = getCellValue(
value,
EventLogConstants.EVENT_LOGS_FAMILY_NAME,
EventLogConstants.LOG_COLUMN_NAME_BROWSER_NAME
);
String browserVersion = getCellValue(
value,
EventLogConstants.EVENT_LOGS_FAMILY_NAME,
EventLogConstants.LOG_COLUMN_NAME_BROWSER_VERSION
);
//平台
String platform = getCellValue(
value,
EventLogConstants.EVENT_LOGS_FAMILY_NAME,
EventLogConstants.LOG_COLUMN_NAME_PLATFORM
);
String uuid = getCellValue(
value,
EventLogConstants.EVENT_LOGS_FAMILY_NAME,
EventLogConstants.LOG_COLUMN_NAME_UUID
);
Long time = Long.valueOf(serverTime);
//时间维度信息类
DateDimension dateDimension = DateDimension.buildDate(time, DateEnum.DAY);
//浏览器维度
// 两个分支:某浏览器所有的新增用户信息,某浏览器某个版本的新增用户信息
List<BrowserDimension> browserDimensions = BrowserDimension.buildList(browserName, browserVersion);
//平台维度类 app pc web
List<PlatformDimension> platformDimensions = PlatformDimension.buildList(platform);
//统计浏览器维度的新用户kpi
KpiDimension newInstallUserKpi = new KpiDimension(KpiType.NEW_INSTALL_USER.name);
//统计新用户的kpi
KpiDimension browserNewInstallUserKpi = new KpiDimension(KpiType.BROWSER_NEW_INSTALL_USER.name);
timeOutputValue.setTime(time);
timeOutputValue.setId(uuid);
statsUserDimension.getStatsCommon().setDate(dateDimension);
BrowserDimension emptyBrowserDimension = new BrowserDimension("", "");
for (PlatformDimension platformDimension : platformDimensions) {
// 清空上次循环留下的浏览器信息
statsUserDimension.setBrowser(emptyBrowserDimension);
// 此处的输出跟浏览器无关,数据应该发送到newInstallUser模块
statsUserDimension.getStatsCommon().setKpi(newInstallUserKpi);
statsUserDimension.getStatsCommon().setPlatform(platformDimension);
context.write(statsUserDimension, timeOutputValue);
for (BrowserDimension browserDimension : browserDimensions) {
// 此处的输出跟浏览器有关,数据应该发送到browserNewInstallUser模块
statsUserDimension.getStatsCommon().setKpi(browserNewInstallUserKpi);
statsUserDimension.setBrowser(browserDimension);
context.write(statsUserDimension,timeOutputValue);
}
}
}
public String getCellValue(Result value, String familyName, String columnName) {
String strValue = Bytes.toString(CellUtil.cloneValue(value.getColumnLatestCell(
familyName.getBytes(),
columnName.getBytes()
)));
return strValue;
}
}
| [
"15525743169@163.com"
] | 15525743169@163.com |
270fd715d40af318bb105581ac489214219c7bc5 | 53bab11f379b3e625d872b9dd8670dc12e487a1f | /oauth2-server-resource/src/main/java/personal/starzonecn/example/oauth2/resource/config/security/CustomAuthenticationEventPublisher.java | 8e05d0d3e8d59e37eb57a5e0f2ad3c59af5a8881 | [] | no_license | StarzoneCN/demo-oauth2 | 68b6a0d69143bdbc9561e04c3d513e355bc843bf | 1d1eacd8c4ec2f1772eea1c9d769e83eafc793df | refs/heads/master | 2021-10-11T22:51:19.991721 | 2019-01-30T08:22:37 | 2019-01-30T08:22:37 | 111,632,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package personal.starzonecn.example.oauth2.resource.config.security;
import org.springframework.context.annotation.Primary;
import org.springframework.security.authentication.AuthenticationEventPublisher;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
/**
* @author: LiHongxing
* @email: lihongxing@bluemoon.com.cn
* @date: Create in 2018/5/16 15:09
* @modefied:
*/
@Component
@Primary
public class CustomAuthenticationEventPublisher implements AuthenticationEventPublisher {
@Override
public void publishAuthenticationSuccess(Authentication authentication) {
System.out.println("自定义AuthenticationEventPublisher:CustomAuthenticationEventPublisher");
}
@Override
public void publishAuthenticationFailure(AuthenticationException exception, Authentication authentication) {
}
}
| [
"lihongxing@bluemoon.com.cn"
] | lihongxing@bluemoon.com.cn |
d04749b3975f153b358fe59330517606c8680e59 | 09af2ede97941c613967de9d9d37f8773a828f90 | /src/test/java/Junit5/InterfacesTest.java | d3008a0fff9bec9849b66906d36348c149e548e0 | [] | no_license | fermt18/poc-junit5 | dcee522d81cb11118c4f023cf4d45278b0cb081a | c0e6017db8fafa7936ab7727c96d64f093d3554f | refs/heads/master | 2022-12-30T11:25:06.153448 | 2019-12-30T09:32:21 | 2019-12-30T09:32:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package Junit5;
import static org.junit.jupiter.api.Assertions.assertEquals;
import Junit5.TestInterfaces.TestInterfaceDynamicTestsDemo;
import Junit5.TestInterfaces.TestLifeCycleLogger;
import Junit5.TestInterfaces.TimeExecutionLogger;
import org.junit.jupiter.api.Test;
class InterfacesTest implements TestLifeCycleLogger,
TimeExecutionLogger,
TestInterfaceDynamicTestsDemo {
@Test
void isEqualValue() {
assertEquals(1, 1);
}
}
| [
"ferran.montes@mango.com"
] | ferran.montes@mango.com |
2deb07e2b0dc512eaf893ffbe3f55cbbae603a85 | fe1c558c833798ccbff90b215705612ef7aae3cb | /shiro-example-chapter23-client/src/main/java/com/github/zhangkaitao/shiro/chapter23/client/ClientRealm.java | a6800a2be98006de71884c3c48300149ff25ae77 | [] | no_license | rulinggbc/shiro-example | 66af0e82f2cb9507afd93864c8d9ef1cc73df2b0 | 74deebfd5605445e21c351095f3779e7c62d1449 | refs/heads/master | 2021-01-21T07:45:19.756250 | 2014-03-14T07:45:54 | 2014-03-14T07:46:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,677 | java | package com.github.zhangkaitao.shiro.chapter23.client;
import com.github.zhangkaitao.shiro.chapter23.remote.PermissionContext;
import com.github.zhangkaitao.shiro.chapter23.remote.RemoteServiceInterface;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
/**
* <p>User: Zhang Kaitao
* <p>Date: 14-3-13
* <p>Version: 1.0
*/
public class ClientRealm extends AuthorizingRealm {
private RemoteServiceInterface remoteService;
private String appKey;
public void setRemoteService(RemoteServiceInterface remoteService) {
this.remoteService = remoteService;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
String username = (String) principals.getPrimaryPrincipal();
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
PermissionContext context = remoteService.getPermissions(appKey, username);
authorizationInfo.setRoles(context.getRoles());
authorizationInfo.setStringPermissions(context.getPermissions());
return authorizationInfo;
}
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
//永远不会被调用
return null;
}
}
| [
"zhangkaitao0503@gmail.com"
] | zhangkaitao0503@gmail.com |
4ee5332bcc428e01c6d87aec0e87c602a9b485e8 | 6816f603e920677b6b1094270909efd68fb5f767 | /automatas/proyecto/Analizador lexico- sintactico/GUICompilador/src/guicompilador/GUICompiladorC.java | c43ba6935b995c48fe48695255129cd953a413bb | [] | no_license | LuisEnriqueSosaHernandez/Automatas-Compilador | f7f4a147a2a6ff830c8019f2b3fc7bc14fb6f4bc | 6a49b5f34b2d838d9ac250f1bb549454b55a6606 | refs/heads/master | 2021-01-25T01:03:29.035351 | 2018-03-04T21:38:13 | 2018-03-04T21:38:13 | 94,718,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,130 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package guicompilador;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import javax.swing.JOptionPane;
/**
*
* @author Programador
*/
public class GUICompiladorC extends javax.swing.JFrame {
/**
* Creates new form GUICompiladorC
*/
private String dirNuevo="";
private String nomNuevo="";
public GUICompiladorC() {
initComponents();
this.setLocationRelativeTo(null);
this.setTitle("Analizadorls");
jtxtArea.setEnabled(false);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
output = new javax.swing.JTextArea();
jLabel2 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jPanel1 = new javax.swing.JPanel();
lineCounter = new javax.swing.JTextArea();
jScrollPane1 = new javax.swing.JScrollPane();
jtxtArea = new javax.swing.JTextArea();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("BarbonC™ Compiler");
output.setColumns(20);
output.setRows(5);
output.setDisabledTextColor(new java.awt.Color(0, 0, 0));
output.setEnabled(false);
jScrollPane2.setViewportView(output);
jLabel2.setText("Salida:");
lineCounter.setEditable(false);
lineCounter.setColumns(2);
lineCounter.setLineWrap(true);
lineCounter.setRows(2);
lineCounter.setTabSize(2);
lineCounter.setText("1");
lineCounter.setAutoscrolls(false);
lineCounter.setCaretColor(new java.awt.Color(51, 51, 255));
lineCounter.setFocusable(false);
jtxtArea.setColumns(20);
jtxtArea.setLineWrap(true);
jtxtArea.setRows(5);
jtxtArea.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jtxtAreaKeyPressed(evt);
}
public void keyReleased(java.awt.event.KeyEvent evt) {
jtxtAreaKeyReleased(evt);
}
});
jScrollPane1.setViewportView(jtxtArea);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(lineCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)
.addComponent(lineCounter)
);
jScrollPane3.setViewportView(jPanel1);
jMenu1.setText("Archivo");
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setText("Nuevo");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);
jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem2.setText("Abrir");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem2);
jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem5.setText("Guardar");
jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem5ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem5);
jMenuBar1.add(jMenu1);
jMenu2.setText("Accion");
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, 0));
jMenuItem3.setText("Compilar");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem3);
jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem6.setText("Ver tokens");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem6);
jMenuBar1.add(jMenu2);
jMenu3.setText("Ayuda");
jMenuItem4.setText("Acerca de");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem4);
jMenuBar1.add(jMenu3);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 770, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 770, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
// TODO add your handling code here:
Nuevo nv=new Nuevo(this, true,this);
nv.show();
}//GEN-LAST:event_jMenuItem1ActionPerformed
public boolean Guardar(){
FileOutputStream out;
PrintStream p;
try {
out = new FileOutputStream(dirNuevo);
p = new PrintStream(out);
p.println(this.jtxtArea.getText());
p.close();
this.setTitle(this.getTitle().replace("Trabajando", ""));
return true;
} catch (Exception e) {
//System.err.println("BarbonC - No se puede guardar el archivo");
return false;
}
}
private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
// TODO add your handling code here:
if(Guardar())
JOptionPane.showMessageDialog(this,"Analizadorls - Guardado con exito");
else
JOptionPane.showMessageDialog(this,"Analizadorls - No se puede guardar el archivo");
}//GEN-LAST:event_jMenuItem5ActionPerformed
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
// TODO add your handling code here:
//C:\Users\Programador\Desktop\prueba.txt
try {
Guardar();
Process p = Runtime.getRuntime().exec("../Analizadorls.exe " + dirNuevo);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = reader.readLine();
String el[]=line.split("-");
while(el.length<2) {
line = reader.readLine();
el=line.split("-");
}
if(line!=null){
if(el[0].equals("Exito")){
output.setText("Compilado con exito.\nNumero de filas compiladas: "+el[1]);
}
else{
output.setText("Error en la linea: "+el[1]);
}
}
} catch (Exception e1) {
JOptionPane.showMessageDialog(this, e1.getMessage()+" ");
}
}//GEN-LAST:event_jMenuItem3ActionPerformed
public void contarFilas(){
int totalrows=jtxtArea.getLineCount();
lineCounter.setText("1\n");
for(int i=2; i<=totalrows;i++){
lineCounter.setText(lineCounter.getText()+i+"\n");
}
}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
// TODO add your handling code here:
Abrir a=new Abrir(this, true, this);
a.setVisible(true);
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void jtxtAreaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtxtAreaKeyPressed
// TODO add your handling code here:
if(!this.getTitle().contains(" Trabajando")){
this.setTitle(this.getTitle()+" Trabajando");
}
}//GEN-LAST:event_jtxtAreaKeyPressed
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
// TODO add your handling code here:
VerTokens vtk=new VerTokens(this, true, dirNuevo, this);
vtk.show();
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void jtxtAreaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtxtAreaKeyReleased
// TODO add your handling code here:
if(evt.isControlDown() || evt.getKeyCode()==10 || evt.getKeyCode()==8 || evt.getKeyCode()==127){
contarFilas();
}
}//GEN-LAST:event_jtxtAreaKeyReleased
public void habilitarCampo(String dirnovo, String nomnovo){
this.setTitle("Analizadorls");
this.nomNuevo=nomnovo;
this.dirNuevo=dirnovo+nomNuevo+".jx";
this.setTitle(this.getTitle()+" - "+dirNuevo);
jtxtArea.enable(true);
contarFilas();
}
public void habilitarCampo(String dirnovo){
this.setTitle("Analizadorls");
this.dirNuevo=dirnovo;
try {
FileInputStream fstream = new FileInputStream(dirNuevo);
DataInputStream in = new DataInputStream(fstream);
this.jtxtArea.setText("");
while (in.available() != 0) {
this.jtxtArea.setText(this.jtxtArea.getText() + in.readLine() + "\n");
}
in.close();
this.setTitle(this.getTitle()+" - "+dirNuevo);
jtxtArea.enable(true);
contarFilas();
} catch (Exception e) {
JOptionPane.showMessageDialog(this,"File input error");
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(GUICompiladorC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(GUICompiladorC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(GUICompiladorC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(GUICompiladorC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new GUICompiladorC().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private static javax.swing.JTextArea jtxtArea;
private javax.swing.JTextArea lineCounter;
private javax.swing.JTextArea output;
// End of variables declaration//GEN-END:variables
}
| [
"kiquesasuke@gmail.com"
] | kiquesasuke@gmail.com |
5c8dd04c57ff3e7572d11742030bdef073394ac0 | e62526bbf7f1f3ffb3dbfb781e59cd2a9480889a | /ad-service/ad-search/src/main/java/com/jh/search/controller/SponsorFeignController.java | 82668a0f8043e9e9b67fc2141260fa4530782dcf | [] | no_license | 457376245/ad-system | e5611499d9a9df132a6aef39feafc8ada1ddb98c | cdef272896415c97e11f3c5397681b053f8ce82d | refs/heads/master | 2023-02-08T22:29:17.666351 | 2021-01-02T12:54:05 | 2021-01-02T12:54:05 | 325,498,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 935 | java | package com.jh.search.controller;
import com.jh.common.exception.AdException;
import com.jh.common.vo.CommonResponse;
import com.jh.search.service.feign.SponsorFeign;
import com.jh.sponsor.entity.AdPlan;
import com.jh.sponsor.vo.AdPlanGetRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController
public class SponsorFeignController {
@Resource(name = "com.jh.search.feign.SponsorFeign")
private SponsorFeign feign;
@PostMapping("/ad-plan/get/adPlan")
public CommonResponse<List<AdPlan>> getAdPlanByIds(
@RequestBody AdPlanGetRequest request) throws AdException{
ArrayList<Integer> list=new ArrayList<>();
return feign.getAdPlanByIds(request);
}
}
| [
"457376245@qq.com"
] | 457376245@qq.com |
677d1f43ac3fad4500d35769f5cf311579c4c748 | e50a8e9ebbfde544faffb6e9432a115b95894e4e | /app/src/main/java/com/jason/www/utils/LogUtils.java | 6dd053da32698fdc2f1a48d0f48cbcbe487b88f6 | [] | no_license | Jason0501/WanAndroid | 60baa51de93de5b86b3e52d4826f3e09546489ec | 7f977372994c53f8c0ed6250aa82a631403d6b35 | refs/heads/master | 2023-03-11T00:51:23.918695 | 2021-02-26T06:26:21 | 2021-02-26T06:26:21 | 284,658,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | package com.jason.www.utils;
import android.util.Log;
import com.jason.www.BuildConfig;
/**
* @author:Jason
* @date:2020/7/28 10:48
* @email:1129847330@qq.com
* @description:
*/
public class LogUtils {
private static final String TAG = "WanAndroid";
public static void i(String log) {
i(TAG, log);
}
public static void i(String tag, String log) {
if (BuildConfig.DEBUG) {
Log.i(tag, log);
}
}
public static void d(String tag, String log) {
if (BuildConfig.DEBUG) {
Log.d(tag, log);
}
}
public static void d(String log) {
d(TAG, log);
}
public static void e(String tag, String log) {
if (BuildConfig.DEBUG) {
Log.e(tag, log);
}
}
public static void e(String log) {
e(TAG, log);
}
} | [
"1129847330@qq.com"
] | 1129847330@qq.com |
298e6c76f31d6a1a78e2e9862b2d3c49a41b2d6c | bcbb14fbca8cae5386c0dcb8f15d36c830931d91 | /src/no/systema/overview/ufortolledeoppdrag/controller/UoppdragGateController.java | c748e1de97f55e7afaa96e4a91cc5ff037b32d92 | [] | no_license | SystemaAS/espedsg | b4457ce5e5ea6fe56efd8475db82b33e443089d3 | 6ce983826a1e696c11ff568a298bde9cf8d91d53 | refs/heads/master | 2020-04-05T18:29:45.311582 | 2018-04-25T08:10:48 | 2018-04-25T08:10:48 | 53,931,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,406 | java | package no.systema.overview.ufortolledeoppdrag.controller;
import java.io.File;
import java.util.*;
import org.apache.log4j.Logger;
import org.springframework.validation.BindingResult;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Required;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//import no.systema.tds.service.MainHdTopicService;
import no.systema.main.service.UrlCgiProxyService;
import no.systema.overview.ufortolledeoppdrag.url.store.UrlDataStore;
import no.systema.overview.ufortolledeoppdrag.model.jsonjackson.JsonTopicContainer;
import no.systema.overview.ufortolledeoppdrag.model.jsonjackson.JsonTopicRecord;
import no.systema.overview.ufortolledeoppdrag.model.jsonjackson.JsonTopicRecordAvdGroup;
import no.systema.overview.ufortolledeoppdrag.model.jsonjackson.JsonTopicRecordDiagramChart;
import no.systema.overview.ufortolledeoppdrag.service.UoppdragService;
import no.systema.overview.ufortolledeoppdrag.service.StandardFallbackChartListFor3DBarService;
import no.systema.overview.ufortolledeoppdrag.util.UoppdragConstants;
import no.systema.overview.ufortolledeoppdrag.util.jfreechart.GeneralDistributionChart;
import no.systema.overview.ufortolledeoppdrag.util.jfreechart.manager.IJFreeChartDimension;
import no.systema.overview.ufortolledeoppdrag.util.jfreechart.manager.JFreeChartDynamicBarDimensionMgr;
import no.systema.overview.ufortolledeoppdrag.util.manager.SearchFilterMgr;
import no.systema.overview.ufortolledeoppdrag.model.DiagramColorChartMetaData;
import no.systema.overview.ufortolledeoppdrag.filter.SearchFilterGateChart;
import no.systema.overview.util.io.FileManager;
//application imports
import no.systema.main.model.SystemaWebUser;
import no.systema.main.util.AppConstants;
import no.systema.main.util.JsonDebugger;
//models
import no.systema.main.util.io.TextFileReaderService;
/**
* Gateway to the Ufortollede Oppdrag Application
*
* The user will be prompted with a general distribution Bar chart and will go forward from there...
*
*
* @author oscardelatorre
* @date Aug 27, 2013
*
*/
@Controller
public class UoppdragGateController {
private final String DROP_DOWN_KEY_SIGN = "hsSign";
private final String DROP_DOWN_KEY_TARIFFOR = "hsTariffor";
private final String DROP_DOWN_KEY_AVD = "hsAvd";
private final String DROP_DOWN_KEY_AVD_AVDNAVN = "hsAvdAvdNavn";
private final String DROP_DOWN_KEY_AVD_GROUP_LIST = "avdGroupsList";
private final String DROP_DOWN_KEY_TOLLAGERKOD = "hsTollagerkod";
private final String DROP_DOWN_KEY_TOLLAGERKOD_SIZE = "hsTollagerkodSize";
private final String DROP_DOWN_KEY_TOLLAGERDELKOD = "hsTollagerdelkod";
private final String DROP_DOWN_KEY_TOLLAGERDELKOD_SIZE = "hsTollagerdelkodSize";
private static final Logger logger = Logger.getLogger(UoppdragGateController.class.getName());
private ModelAndView loginView = new ModelAndView("login");
private StandardFallbackChartListFor3DBarService standardFallbackChartListFor3DBarService = new StandardFallbackChartListFor3DBarService();
private JsonDebugger jsonDebugger = new JsonDebugger();
//
/**
* This method fetches all data from the back-end (deep refresh)
*
* @param user
* @param result
* @param request
* @return
*/
@RequestMapping(value="uoppdraggate.do", method={RequestMethod.GET, RequestMethod.POST})
public ModelAndView uoppdraggate(HttpSession session, HttpServletRequest request){
logger.info("[INFO] Inside uoppdraggate...");
ModelAndView successView = new ModelAndView("uoppdraggate");
SystemaWebUser appUser = (SystemaWebUser)session.getAttribute(AppConstants.SYSTEMA_WEB_USER_KEY);
String sessionId = session.getId();
Map model = new HashMap();
//get filter if applicable otherwise remove it since this is a refresh
SearchFilterGateChart searchFilterGateChart = null;
String action = request.getParameter("action");
String deepSubmit = request.getParameter("deepSubmit");
String chartTickerInterval = request.getParameter("chartTickerInterval");
//special session variable in order to be able to refresh the chart according to drop-down id="autoRefresh"
session.setAttribute("chartTickerInterval_SESSION", "-99"); //init
if(chartTickerInterval!=null && !"".equals(chartTickerInterval)){
session.setAttribute("chartTickerInterval_SESSION", chartTickerInterval);
}
JsonTopicContainer jsonTopicContainer = null;
if("doBack".equals(action)){
//this is usually a situation when the user returns to the main chart without refreshing (in order to maintain the search conditions once entered)
searchFilterGateChart = (SearchFilterGateChart)session.getAttribute(sessionId + UoppdragConstants.DOMAIN_SEARCH_FILTER_GATE_CHAR);
}else{
//populate filter
searchFilterGateChart = new SearchFilterGateChart();
ServletRequestDataBinder binder = new ServletRequestDataBinder(searchFilterGateChart);
binder.bind(request);
}
if(appUser==null){
return this.loginView;
}else{
String jsonPayload = null;
//deep submit means no AS400 jsonPayload.
if(deepSubmit!=null){
//init relevant variables on session
session.removeAttribute(sessionId + UoppdragConstants.SESSION_UOPP_JSON_CONTAINER_GRAPH);
session.removeAttribute(sessionId + UoppdragConstants.SESSION_UOPP_SUBSET_LIST);
//--------------------------------------
//EXECUTE the FETCH (RPG program) here
//--------------------------------------
String BASE_URL = UrlDataStore.OVERVIEW_UFORTOLLEDE_OPPDRAG_MAINLIST_URL;
//url params
String urlRequestParamsKeys = this.getRequestUrlKeyParameters(appUser);
//for debug purposes in GUI
session.setAttribute(UoppdragConstants.ACTIVE_URL_RPG, BASE_URL + "==>params: " + urlRequestParamsKeys.toString());
logger.info(Calendar.getInstance().getTime() + " CGI-start timestamp");
logger.info("URL: " + BASE_URL);
logger.info("URL PARAMS: " + urlRequestParamsKeys);
jsonPayload = this.urlCgiProxyService.getJsonContent(BASE_URL, urlRequestParamsKeys);
}else{
//NO back-end involved
//get filter from session in order to present values (if needed)
//SearchFilterGateChart searchFilterGateChart = (SearchFilterGateChart)session.getAttribute(sessionId + UoppdragConstants.DOMAIN_SEARCH_FILTER_GATE_CHAR);
logger.info("[INFO] getting jsonPayload from JsonTopicContainer.getJsonPayload()");
jsonTopicContainer = (JsonTopicContainer)session.getAttribute(sessionId + UoppdragConstants.SESSION_UOPP_JSON_CONTAINER_GRAPH);
jsonPayload = jsonTopicContainer.getJsonPayload();
}
if(jsonPayload!=null){
try{
//Debug -->
this.jsonDebugger.debugJsonPayload(jsonPayload);
jsonTopicContainer = this.uoppdragService.getContainer(jsonPayload);
logger.info(Calendar.getInstance().getTime() + " CGI-end timestamp");
if(jsonTopicContainer!=null){
jsonTopicContainer.setJsonPayload(jsonPayload);
Collection<JsonTopicRecord> ufortList = jsonTopicContainer.getUfortList();
Collection<JsonTopicRecordDiagramChart> chartListRaw = jsonTopicContainer.getChartList();
//Check if the chartList has been configured in the user profile. If not, use the standard implementation
if(chartListRaw!=null && chartListRaw.size()>0){
//nothing since the user profile has a chart configuration defined (AS400)
}else{
//get standard fall-back implementation (from file JSON string)
chartListRaw = standardFallbackChartListFor3DBarService.getStdImplementationFromTextFile(this.uoppdragService);
jsonTopicContainer.setChartList(chartListRaw);
}
//fill chart with categories (since JSON does not have this required field)
int categoryId = 0;
Collection<JsonTopicRecordDiagramChart> chartList = new ArrayList<JsonTopicRecordDiagramChart>();
for (JsonTopicRecordDiagramChart record : jsonTopicContainer.getChartList()){
record.setCategoryId(categoryId);
chartList.add(record);
categoryId++;
}
jsonTopicContainer.setChartList(chartList);
//At this point we now have a charList with its category Id per category (color chart)
this.populateSearchFilterDropDownsForDatasetCoupledValues(jsonTopicContainer , model);
//------------------------------
//START search filter conditions
//------------------------------
//if the user chose a filter condition we must then filter the complete list in order to have the main set based on the filter conditions
if(this.filterIsPopulated(searchFilterGateChart)){
Collection<JsonTopicRecord> matchedList = new ArrayList<JsonTopicRecord>();
Set<Map.Entry<String, String>> setOfEntries = searchFilterGateChart.getPopulatedFields().entrySet();
if(setOfEntries.size()>0){
//logger.info("################## setOfEntries: " + setOfEntries.size());
//logger.info("SUBSET-list-Filtered (size): " + ufortList.size());
matchedList = new SearchFilterMgr().filterUoppragDataset(searchFilterGateChart, ufortList);
}else{
logger.info("XXXXXXXXXXXXXXXXXX setOfEntries = 0");
logger.info("SUBSET-list (size): " + ufortList.size());
matchedList = ufortList;
}
ufortList = matchedList;
model.put(UoppdragConstants.DOMAIN_SEARCH_FILTER_GATE_CHAR, searchFilterGateChart);
}
//------------------------------
//END search filter conditions
//------------------------------
//Debug
//this.debugLagerKode(ufortList);
//put the graph and the JSON container in session since we will use the info until a refresh (in another user activity)
//from this point forward we will be getting the dataset from the session until we return to this method (refresh)
jsonTopicContainer.setUfortList(ufortList); //refresh the list in case some filter values were applicable
session.setAttribute(sessionId + UoppdragConstants.SESSION_UOPP_JSON_CONTAINER_GRAPH, jsonTopicContainer );
//save the searchFilter object as well for use until next refresh
session.setAttribute(sessionId + UoppdragConstants.DOMAIN_SEARCH_FILTER_GATE_CHAR, searchFilterGateChart);
//----------------------------------
//START build the chart dynamically
//----------------------------------
//IJFreeChartDimension jfreeChartDimensionMgr = new JFreeChartStandardBarDimensionMgr();
IJFreeChartDimension jfreeChartDimensionMgr = new JFreeChartDynamicBarDimensionMgr();
jfreeChartDimensionMgr.buildChart(ufortList, chartList);
model.put(UoppdragConstants.DOMAIN_JFREE_CHART_MANAGER, jfreeChartDimensionMgr);
model.put(UoppdragConstants.DOMAIN_LIST, ufortList);
model.put(UoppdragConstants.DOMAIN_UFORT_LIST_SIZE, ufortList.size());
model.put(UoppdragConstants.DOMAIN_CHART_CATEGORIES_LIST, chartList);
//Delete the previous chart file
new FileManager().deleteOldChartFile((File)session.getAttribute(sessionId));
//(1)Start now with the new chart (for this request)
GeneralDistributionChart jfreeChart = new GeneralDistributionChart();
String targetDirectory = request.getSession().getServletContext().getRealPath(FileManager.JFREE_CHARTS_ROOT_DIRECTORY);
//(2) set target File graphFileName = this.getGraphFileName(targetDirectory);
jfreeChart.setGraphFileName(targetDirectory);
logger.info("[INFO] " + Calendar.getInstance().getTime() + " START for producing jFreeChart");
//(3) produce the chart and store the file name in session in order to delete it in the next iteration
//jfreeChart.produceBarChartJPEG_DynamicDays(jfreeChartDimensionMgr);
jfreeChart.produceBarChartJPEG_DynamicDays(jfreeChartDimensionMgr);
logger.info("[INFO] " + Calendar.getInstance().getTime() + " END for producing jFreeChart");
//-------------------------------
//END build the chart dynamically
//-------------------------------
//put the chart available for view and in session
successView.addObject("jfreeChartFile",jfreeChart.getGraphFileName().getName());
session.setAttribute(sessionId, jfreeChart.getGraphFileName());
//Debug
/*for(JsonTopicRecordAvdGroup record : jsonTopicContainer.getAvdGroups()){
logger.info("DEBUG getAvdGroups: " + record.getAvdList());
}*/
//put the final model (other than the chart) available for view
successView.addObject(UoppdragConstants.DOMAIN_MODEL, model);
}else{
session.setAttribute(AppConstants.ASPECT_ERROR_MESSAGE, "[ERROR fatal] jsonContainer is NULL. Check logs...");
}
}catch(Exception e){
e.printStackTrace();
session.setAttribute(AppConstants.ASPECT_ERROR_MESSAGE, "[ERROR fatal] jsonPayload is NULL. Check logs...");
}
}
}
return successView;
}
/**
*
* @param list
*/
private void debugLagerKode (Collection<JsonTopicRecord> list){
Set hashSet = new HashSet();
for (JsonTopicRecord record : list){
if(record.getTollagerkod()!=null && !"".equals(record.getTollagerkod())){
hashSet.add(record.getTollagerkod());
logger.info("TOLLAGER - raw - LIST (A):" + record.getTollagerkod() );
}
}
for(Iterator iter = hashSet.iterator();iter.hasNext();){
String value = (String)iter.next();
if(value!=null && !"".equals(value)){
logger.info("TOLLAGER - final - COMBO LIST (B):" + value);
}
}
}
/**
*
* @param searchFilterGateChart
* @return
*/
private boolean filterIsPopulated(SearchFilterGateChart searchFilterGateChart){
boolean retval = false;
try{
Set<Map.Entry<String, String>> setOfEntries = searchFilterGateChart.getPopulatedFields().entrySet();
if(setOfEntries.size()>0){
for(Map.Entry<String, String> entry : setOfEntries) {
String searchFilterField = entry.getKey();
String searchFilterValue = entry.getValue();
if(searchFilterValue!=null && !"".equals(searchFilterValue)){
retval = true;
}
}
}
}catch(Exception e){
e.printStackTrace();
}
return retval;
}
/**
*
* This method gets the total set of values for drop downs. We use the original list (without filtering)
* since there is no such a decoupled function
*
* @param container
* @param model
*/
private void populateSearchFilterDropDownsForDatasetCoupledValues(JsonTopicContainer container, Map model){
//Implement the Sets as TreeSets in order to respect sort ordering (asc)
Set<String> hsSign= new TreeSet<String>();
Set<String> hsTariffor= new TreeSet<String>();
Set<String> hsAvd= new TreeSet<String>();
Set<String> hsAvdAvdNavn= new TreeSet<String>();
Set<String> hsTollagerkod= new TreeSet<String>();
Set<String> hsTollagerdelkod= new TreeSet<String>();
//List<JsonTopicRecord> sortedList = this.getSortedListByColumn(list, column, imgSortPng);
for(JsonTopicRecord record : container.getUfortList()){
try{
hsSign.add(record.getSign());
hsAvd.add(record.getAvd());
//default
String avdAvdNavn = record.getAvd();
if(record.getAvdNavn()!=null && !"".equals(record.getAvdNavn())){
avdAvdNavn += " " + record.getAvdNavn();
}
hsAvdAvdNavn.add(avdAvdNavn);
hsTariffor.add(record.getTariffor());
if(record.getTollagerkod()!=null && !"".equals(record.getTollagerkod().trim())){
hsTollagerkod.add(record.getTollagerkod());
//logger.info("############## tollagerkod:" + record.getTollagerkod());
}
if(record.getTollagerdelkod()!=null && !"".equals(record.getTollagerdelkod().trim())){
hsTollagerdelkod.add(record.getTollagerdelkod());
//logger.info("############## tollagerdelkod:" + record.getTollagerdelkod());
}
}catch(Exception e){
e.printStackTrace();
}
}
//Sort the avd groups since this is an own list in its own right
List<JsonTopicRecordAvdGroup> sortedGroupList = (List)container.getAvdGroups();
Collections.sort(sortedGroupList, new JsonTopicRecordAvdGroup.OrderByName());
model.put(this.DROP_DOWN_KEY_AVD_GROUP_LIST, sortedGroupList);
//Now put all the Sets
model.put(this.DROP_DOWN_KEY_SIGN, hsSign);
model.put(this.DROP_DOWN_KEY_TARIFFOR, hsTariffor);
model.put(this.DROP_DOWN_KEY_AVD, hsAvd);
model.put(this.DROP_DOWN_KEY_AVD_AVDNAVN, hsAvdAvdNavn);
//Tollagerkod
model.put(this.DROP_DOWN_KEY_TOLLAGERKOD, hsTollagerkod);
model.put(this.DROP_DOWN_KEY_TOLLAGERKOD_SIZE, hsTollagerkod.size());
logger.info("tollager_SIZE:" + hsTollagerkod.size());
//Tollagerdelkod
model.put(this.DROP_DOWN_KEY_TOLLAGERDELKOD, hsTollagerdelkod);
model.put(this.DROP_DOWN_KEY_TOLLAGERDELKOD_SIZE, hsTollagerdelkod.size());
logger.info("tollagerDelkod_SIZE:" + hsTollagerdelkod.size());
//This is required since we do have to save this values once. The reason is because there is no decoupled function
//for this values and we must grab them from the JSON string...
container.setHtmlDropDownSign(hsSign);
container.setHtmlDropDownTariffor(hsTariffor);
container.setHtmlDropDownAvd(hsAvd);
container.setHtmlDropDownAvdAvdNavn(hsAvdAvdNavn);
container.setHtmlDropDownTollagerkod(hsTollagerkod);
container.setHtmlDropDownTollagerdelkod(hsTollagerdelkod);
}
/**
*
* @param appUser
* @return
*/
private String getRequestUrlKeyParameters(SystemaWebUser appUser){
StringBuffer urlRequestParamsKeys = new StringBuffer();
//String action = request.getParameter("action");
urlRequestParamsKeys.append("user=" + appUser.getUser());
//more params here ...urlRequestParamsKeys.append(UoppdragConstants.URL_CHAR_DELIMETER_FOR_PARAMS_WITH_HTML_REQUEST + "avd=" + avd);
return urlRequestParamsKeys.toString();
}
//Wired - SERVICES
@Qualifier ("urlCgiProxyService")
private UrlCgiProxyService urlCgiProxyService;
@Autowired
@Required
public void setUrlCgiProxyService (UrlCgiProxyService value){ this.urlCgiProxyService = value; }
public UrlCgiProxyService getUrlCgiProxyService(){ return this.urlCgiProxyService; }
@Qualifier ("uoppdragService")
private UoppdragService uoppdragService;
@Autowired
@Required
public void setUoppdragService (UoppdragService value) { this.uoppdragService = value; }
public UoppdragService getUoppdragService(){ return this.uoppdragService; }
}
| [
"oscar@systema.no"
] | oscar@systema.no |
ce1ddcecca2771e4632c10da1c34c12f96739a98 | f59579d76a8a5beceeb000998ec608b0c3e894ba | /runner/src/main/java/org/ananas/runner/kernel/job/JobRepository.java | b601c146dcefb07ffd744654d97f187a362986c2 | [
"Apache-2.0"
] | permissive | y44k0v/ananas-desktop | 9a081e68b932daa4f2d8ad20dc61dca62105af57 | 129d05b27eb89059e70916c86cc74d32c8dd5f4f | refs/heads/master | 2022-06-05T01:21:49.752408 | 2019-08-15T00:11:22 | 2019-08-15T00:11:22 | 202,634,275 | 0 | 0 | Apache-2.0 | 2022-05-12T01:29:14 | 2019-08-16T01:11:08 | Java | UTF-8 | Java | false | false | 687 | java | package org.ananas.runner.kernel.job;
import java.util.List;
import java.util.Set;
public interface JobRepository {
/**
* Get job by id
*
* @param id
* @return
*/
Job getJob(String id);
/**
* Get all jobs
*
* @return
*/
Set<Job> getJobs(int offset, int n);
/**
* Get jobs by trigger id, for scheduled job
*
* @param triggerId
* @return
*/
List<Job> getJobsByScheduleId(String triggerId, int offset, int n);
/**
* Get jobs by goal
*
* @param goalId
* @return
*/
List<Job> getJobsByGoal(String goalId, int offset, int n);
/**
* Delete a job
*
* @param jobId
*/
void deleteJob(String jobId);
}
| [
"daily.bhou@gmail.com"
] | daily.bhou@gmail.com |
5f32110238cb557f22ee6fce8610f4177ba5f38c | dde5f1e7014502d92331a9dd56c1c9ee3f8590df | /src/RestTesting.java | 877014c4d30ffa9130cd54a5b401bd39defaa641 | [] | no_license | sanjeet1211/newpipeline | 23e627cca48412e06810e69c88bf9b41ae6065da | c82ab6a401a0c15b92e1bff4a139d4e818c25dca | refs/heads/master | 2023-04-27T12:39:27.742340 | 2019-07-08T04:42:44 | 2019-07-08T04:42:44 | 194,469,500 | 0 | 0 | null | 2023-04-14T17:50:16 | 2019-06-30T03:09:22 | HTML | UTF-8 | Java | false | false | 615 | java | import java.util.Map;
import org.json.simple.JSONObject;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
/**
*
*/
/**
* @author sanjeet
*
*/
public class RestTesting {
/**
* @param args
*/
@Test
public void getUserData() {
Response resp=RestAssured.get("http://samples.openweathermap.org/data/2.5/weather?q="+"Newyork"+","+"usa"+"&appid=b6907d289e10d714a6e88b30761fae22");
System.out.println("response data"+resp.getStatusCode());
}
} | [
"sanjeet.k.thakur@gmail.com"
] | sanjeet.k.thakur@gmail.com |
642470397be210cd562640578c0b6ed0cbc27868 | b8662467ce3c2e583b929e5e34b64eac7f4d3b84 | /src/main/java/be/aga/dominionSimulator/cards/SacrificeCard.java | cac133507ebe89675ba6f3b44c04badbd44d70a5 | [
"MIT"
] | permissive | Geronimoo/DominionSim | 2c6d913aabde60b28435a1d6a273d0960e159670 | 6dca3383be3ec9ca7ee140c0e9c4b71ca1c0a26e | refs/heads/master | 2022-07-22T23:26:17.572128 | 2022-07-20T10:07:54 | 2022-07-20T10:07:54 | 66,362,907 | 44 | 21 | MIT | 2020-10-13T07:25:10 | 2016-08-23T11:58:23 | Java | UTF-8 | Java | false | false | 3,629 | java | package be.aga.dominionSimulator.cards;
import be.aga.dominionSimulator.DomCard;
import be.aga.dominionSimulator.enums.DomCardName;
import be.aga.dominionSimulator.enums.DomCardType;
import java.util.ArrayList;
import java.util.Collections;
public class SacrificeCard extends DomCard {
public SacrificeCard() {
super( DomCardName.Sacrifice);
}
public void play() {
DomCard theCardToTrash = null;
if (owner.getCardsInHand().isEmpty())
return;
if (owner.isHumanOrPossessedByHuman()) {
ArrayList<DomCardName> theChooseFrom = new ArrayList<DomCardName>();
for (DomCard theCard : owner.getCardsInHand()) {
theChooseFrom.add(theCard.getName());
}
theCardToTrash = owner.getCardsFromHand(owner.getEngine().getGameFrame().askToSelectOneCard("Trash a card", theChooseFrom, "Mandatory!")).get(0);
} else {
theCardToTrash = findCardToTrash();
if (theCardToTrash == null) {
//this is needed when card is played with Throne Room effect
Collections.sort(owner.getCardsInHand(), SORT_FOR_TRASHING);
theCardToTrash = owner.getCardsInHand().get(0);
}
}
boolean isAction = theCardToTrash.hasCardType(DomCardType.Action);
boolean isTreasure = theCardToTrash.hasCardType(DomCardType.Treasure);
boolean isVictory = theCardToTrash.hasCardType(DomCardType.Victory);
owner.trash(owner.removeCardFromHand( theCardToTrash ));
if (isAction) {
owner.addActions(2);
owner.drawCards(2);
}
if (isTreasure)
owner.addAvailableCoins(2);
if (isVictory)
owner.addVP(2);
}
private DomCard findCardToTrash() {
Collections.sort( owner.getCardsInHand(), SORT_FOR_TRASHING);
DomCard theCardToTrash = owner.getCardsInHand().get( 0 );
if (!theCardToTrash.hasCardType(DomCardType.Action) && owner.getActionsAndVillagersLeft()==0 && !owner.getCardsFromHand(DomCardType.Action).isEmpty() && owner.getCardsFromHand(DomCardType.Action).get(0).getName()!=DomCardName.Market_Square)
theCardToTrash=owner.getCardsFromHand(DomCardType.Action).get(0);
return theCardToTrash;
}
@Override
public int getPlayPriority() {
if (owner.getActionsAndVillagersLeft()==1 && owner.getCardsFromHand(DomCardType.Action).size()>1) {
for (DomCard theCard : owner.getCardsFromHand(DomCardType.Action)){
if (theCard!=this && theCard.getTrashPriority()<=getTrashPriority())
return 15;
}
}
return super.getPlayPriority();
}
public boolean wantsToBePlayed() {
for (DomCard theCard : owner.getCardsInHand()) {
if (theCard==this)
continue;
if (theCard.getName()==DomCardName.Sacrifice)
return true;
if (theCard!=this && theCard.getTrashPriority()<16 )
return true;
}
return false;
}
@Override
public boolean wantsToBeMultiplied() {
int count = 0;
for (DomCard theCard : owner.getCardsInHand()) {
if (theCard!=this && theCard.getTrashPriority()<16 )
count++;
}
if (owner.count(DomCardName.King$s_Court)>0)
return count>2;
return count>1;
}
@Override
public boolean hasCardType(DomCardType aType) {
if (aType==DomCardType.Treasure && owner != null && owner.hasBuiltProject(DomCardName.Capitalism))
return true;
return super.hasCardType(aType);
}
} | [
"jeroen_aga@yahoo.com"
] | jeroen_aga@yahoo.com |
bad8ce79398ebef53fd7090ed49c5ebd5e290d92 | aa5da795e0feddd514f30ef29b3d26f5acd8d4cc | /app/src/main/java/com/example/dikshantmanocha/saddarestaurant/MenuActivity.java | 1b8a4ace1ff1b91198eee9afec57e7821e476907 | [] | no_license | dikshant097/SaddaRestaurant | bba55ebf8f03472d0bcb38ec5ffdc976828de4f5 | 621cda9e561f1826c87e8790c29228c4e50dc530 | refs/heads/master | 2020-03-20T15:41:42.279046 | 2018-08-12T10:20:43 | 2018-08-12T10:20:43 | 137,519,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,312 | java | package com.example.dikshantmanocha.saddarestaurant;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.dikshantmanocha.saddarestaurant.HomeActivity;
import com.example.dikshantmanocha.saddarestaurant.R;
import java.util.ArrayList;
import java.util.List;
import fragments.Bevarages;
import fragments.Breads;
import fragments.Desserts;
import fragments.NonVegMainCourse;
import fragments.NonVegStarters;
import fragments.Snacks;
import fragments.VegMainCourse;
import fragments.VegStarters;
@SuppressLint("ValidFragment")
public class MenuActivity extends AppCompatActivity {
private HomeActivity context;
private ViewPager viewPager;
private TabLayout tabLayout;
private Toolbar toolbar;
private FloatingActionButton floatingActionButton;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu);
toolbar=findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Our Menu");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
floatingActionButton = (FloatingActionButton) findViewById(R.id.fab);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
@Override
public boolean onSupportNavigateUp() {
finish();
return true;
}
private void setupViewPager(ViewPager viewPager) {
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new VegStarters(), "Veg Starters");
adapter.addFragment(new NonVegStarters(), "Non-Veg Starters");
adapter.addFragment(new VegMainCourse(), "Veg Main Course");
adapter.addFragment(new NonVegMainCourse(), "Non-Veg Main Course");
adapter.addFragment(new Breads(), "Breads");
adapter.addFragment(new Bevarages(), "Bevarages");
adapter.addFragment(new Desserts(), "Desserts");
adapter.addFragment(new Snacks(), "Snacks");
viewPager.setAdapter(adapter);
}
class ViewPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public ViewPagerAdapter(FragmentManager manager) {
super(manager);
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
}
}
| [
"manocha.dikshant@gmail.com"
] | manocha.dikshant@gmail.com |
b8b21a29723c5939444a75bf94728137f1788108 | d1a5906be47219bcdba185c885540e6adfb1c0a3 | /app/src/main/java/ru/ustyantsev/konus/utils/Log.java | 2d5681a3b3a55a9735044debfb10cd18abf5732a | [] | no_license | romust/konus | 8e0516eea19fed95e1dca3c97711b7937e2b0a77 | 0c4f260928530679275d0ae9baece89c2b5caea2 | refs/heads/master | 2020-03-15T20:45:47.210652 | 2018-07-02T17:23:35 | 2018-07-02T17:23:35 | 132,340,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,598 | java | package ru.ustyantsev.konus.utils;
import android.text.TextUtils;
public final class Log {
public static void l() {
android.util.Log.d(getLocation(), "");
}
public static void d(String msg) {
android.util.Log.d(getLocation(),/* getLocation() + */msg + " ---------------------------------------------------- ");
}
private static String getLocation() {
final String className = Log.class.getName();
final StackTraceElement[] traces = Thread.currentThread().getStackTrace();
boolean found = false;
for (int i = 0; i < traces.length; i++) {
StackTraceElement trace = traces[i];
try {
if (found) {
if (!trace.getClassName().startsWith(className)) {
Class<?> clazz = Class.forName(trace.getClassName());
return "[" + getClassName(clazz) + ":" + trace.getMethodName() + ":" + trace.getLineNumber() + "]: ";
}
}
else if (trace.getClassName().startsWith(className)) {
found = true;
continue;
}
}
catch (ClassNotFoundException e) {
}
}
return "[]: ";
}
private static String getClassName(Class<?> clazz) {
if (clazz != null) {
if (!TextUtils.isEmpty(clazz.getSimpleName())) {
return clazz.getSimpleName();
}
return getClassName(clazz.getEnclosingClass());
}
return "";
}
} | [
"schoolarts9ru@gmail.com"
] | schoolarts9ru@gmail.com |
a615fafe4e08ca6b3e322b52622bc920d45b2978 | 08c17ec05b4ed865c2b9be53f19617be7562375d | /aws-java-sdk-sesv2/src/main/java/com/amazonaws/services/simpleemailv2/model/transform/PutDedicatedIpWarmupAttributesRequestMarshaller.java | a4a5013e3cba2e2c472a4d2e6d5f8ebd104b888d | [
"Apache-2.0"
] | permissive | shishir2510GitHub1/aws-sdk-java | c43161ac279af9d159edfe96dadb006ff74eefff | 9b656cfd626a6a2bfa5c7662f2c8ff85b7637f60 | refs/heads/master | 2020-11-26T18:13:34.317060 | 2019-12-19T22:41:44 | 2019-12-19T22:41:44 | 229,156,587 | 0 | 1 | Apache-2.0 | 2020-02-12T01:52:47 | 2019-12-19T23:45:32 | null | UTF-8 | Java | false | false | 2,495 | java | /*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.simpleemailv2.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.simpleemailv2.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* PutDedicatedIpWarmupAttributesRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class PutDedicatedIpWarmupAttributesRequestMarshaller {
private static final MarshallingInfo<String> IP_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PATH)
.marshallLocationName("IP").build();
private static final MarshallingInfo<Integer> WARMUPPERCENTAGE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("WarmupPercentage").build();
private static final PutDedicatedIpWarmupAttributesRequestMarshaller instance = new PutDedicatedIpWarmupAttributesRequestMarshaller();
public static PutDedicatedIpWarmupAttributesRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(PutDedicatedIpWarmupAttributesRequest putDedicatedIpWarmupAttributesRequest, ProtocolMarshaller protocolMarshaller) {
if (putDedicatedIpWarmupAttributesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putDedicatedIpWarmupAttributesRequest.getIp(), IP_BINDING);
protocolMarshaller.marshall(putDedicatedIpWarmupAttributesRequest.getWarmupPercentage(), WARMUPPERCENTAGE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| [
""
] | |
04bde5a46d40d7879bdfe51f8e3de5fda5949b0d | ba62e69addff5271ea34a75229e2d0f45cd28e64 | /FMP_api_java/src/main/java/com/madhouse/fmp/common/SimpleValidateMsg.java | b1c7a4c730843c0df00f992c9d3c775659a3ca4d | [] | no_license | evoup/fmp | 56653e5a1f870993baf18736e42c622d6748ff29 | 78d2156e823e13faae0008dda35b8e8b2e755a64 | refs/heads/master | 2021-01-25T07:35:18.952405 | 2015-07-30T05:37:15 | 2015-07-30T05:37:15 | 31,296,854 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.madhouse.fmp.common;
public class SimpleValidateMsg {
private final String err_name;
private final String err_msg;
public SimpleValidateMsg(String err_name, String err_msg) {
this.err_name = err_name;
this.err_msg = err_msg;
}
public String getErr_name() {
return this.err_name;
}
public String getErr_msg() {
return this.err_msg;
}
}
| [
"evoup@localhost.localdomain"
] | evoup@localhost.localdomain |
0da4e6157a4f3fbeac5f0a2ec8539654cfd9b41b | c054aec95bad4cf4a05a196b394e81e0dbceda1f | /src/media/frontend/components/Details.java | 66bc04fc84f237444eecb2b5826e246487b6e355 | [] | no_license | soerenreichardt/DB3 | 9b346d706dc2841fb8311857251a9a0bfc88ef06 | c9353c5b625c33de17dd7c4040cd85fe1ef1f5b3 | refs/heads/master | 2021-05-27T05:55:40.261844 | 2014-09-25T19:12:03 | 2014-09-25T19:12:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,039 | java | package media.frontend.components;
import java.util.List;
import java.util.ArrayList;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import javax.swing.*;
import media.definitions.MediaDbInterface;
import media.definitions.Offer;
import media.definitions.Product;
import media.definitions.Music.Track;
import media.frontend.utils.*;
import java.net.URL;
/**
* Hier wird die Detail-Kartei designed.
*
* @author Tobias Peitzsch, Silvio Paschke, Stefan Endrullis
* @author Alrik Hausdorf: Aenderungen damit das Korrekte angezeigt wird
*/
public class Details extends JComponent implements Component {
final static long serialVersionUID =
"media.frontend.components.Details".hashCode();
private MediaDbInterface mdi;
private Clipboard clipboard =
Toolkit.getDefaultToolkit().getSystemClipboard();
// GUI
private JTextField[] att;
private JComboBox price;
private JPanel picture;
private JPanel detailinfos;
private Table table = null;
public Details(MediaDbInterface mdi) {
this.mdi = mdi;
initComponent();
}
public void initComponent() {
try {
this.removeAll();
} catch (Exception e) {
}
this.setName("Details");
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//grobe zeilenstruktur
JPanel[] line = new JPanel[3];
add(line[0] = new JPanel());
add(line[1] = new JPanel());
add(line[2] = new JPanel());
//in den zeile sollen die Elemente nebeneinander stehen
line[0].setLayout(new BoxLayout(line[0], BoxLayout.X_AXIS));
line[1].setLayout(new BoxLayout(line[1], BoxLayout.X_AXIS));
line[2].setLayout(new BoxLayout(line[2], BoxLayout.X_AXIS));
//die dritte zeile soll nochmal gespalten werden
detailinfos = new JPanel();
detailinfos.setLayout(new BoxLayout(detailinfos, BoxLayout.Y_AXIS));
picture = new JPanel();
att = new JTextField[]{
new JTextField("id"),
new JTextField("status"),
new JTextField("aver"),
new JTextField("salesr"),
new JTextField("avail"),
new JTextField("type"),
new JTextField("title")
};
JButton aktual = new JButton("ID aus Clipboard");
aktual.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
loadDetailsFromClipboard();
}
});
price = new JComboBox();
line[0].add(new BorderPanel(att[0], "Artikelnummer", 150, 65));
line[0].add(new BorderPanel(att[1], "Status", 150, 65));
line[0].add(new BorderPanel(att[2], "Durchschn. Bewertung", 150, 65));
line[0].add(new BorderPanel(att[3], "Verkaufsrang", 150, 65));
line[0].add(new BorderPanel(att[4], "Verfuegbarkeit", 150, 65));
line[1].add(new BorderPanel(price, "Preis", 150, 65));
line[1].add(new BorderPanel(att[5], "Produkttyp", 150, 65));
line[1].add(new BorderPanel(att[6], "Produktbezeichnung", 300, 65));
line[1].add(aktual);
line[2].add(new BorderPanel(detailinfos, "Detailinfos", 500, 600));
line[2].add(new BorderPanel(picture, "Bild", 500, 600));
this.table = new Table();
this.table.createTable(detailinfos);
}
private void setDetails(Product product) {
List<Offer> offers = new ArrayList<Offer>();
try {
offers = mdi.getOffers(product);
} catch (Exception e) {
e.printStackTrace(System.err);
}
try {
// change: Ausgabe der Asin
att[0].setText("" + product.getAsin());
} catch (Exception e) {
att[0].setText("");
}
att[1].setText("New");
try {
att[2].setText(product.getAvgRating().toString());
} catch (Exception e) {
att[2].setText("");
}
try {
att[3].setText(product.getSalesRank().toString());
} catch (Exception e) {
att[3].setText("");
}
att[4].setText(product.isAvailable() ? "YES" : "NO");
if (product.isAvailable()) att[4].setBackground(java.awt.Color.GREEN);
else att[4].setBackground(java.awt.Color.RED);
att[5].setText(product.isBook() ? "Buch" : product.isDvd() ? "DVD" : product.isMusic() ? "Musik" : "unbek.");
try {
att[6].setText(product.getTitle());
} catch (Exception e) {
att[6].setText("");
}
try {
URL url = new URL(product.getPicUrl());
ImageIcon pic = new ImageIcon(url);
JLabel lpic = new JLabel(pic);
//change: damit die Bilder nur einmal angezeigt werden
picture.removeAll();
picture.add(lpic);
} catch (Exception e) {
}
price.removeAllItems();
for (Offer offer : offers) {
price.addItem(String.format("%.2f %s %s", offer.getPrice(), offer.getCurrency(), offer.getLocation()));
}
price.updateUI();
String[] header = null;
List<String[]> data = new ArrayList<String[]>();
switch (product.getType()) {
case book:
header = new String[]{"ISBN", "Seiten", "Publikation", "Verleger", "Autor"};
media.definitions.Book book = mdi.getBook(product.getAsin());
String[] dumpb = new String[5];
try {
dumpb[0] = book.getIsbn();
} catch (Exception e) {
}
try {
dumpb[1] = book.getPages().toString();
} catch (Exception e) {
}
try {
dumpb[2] = book.getPubDate().toString();
} catch (Exception e) {
}
try {
dumpb[3] = book.getPublishers().iterator().next().getName();
} catch (Exception e) {
}
try {
dumpb[4] = book.getAuthors().iterator().next().getName();
} catch (Exception e) {
}
data.add(dumpb);
break;
case dvd:
header = new String[]{"Format", "Region", "Laufzeit", "Actor", "Creator", "Direktor"};
media.definitions.DVD dvd = mdi.getDVD(product.getAsin());
String[] dumpd = new String[6];
try {
dumpd[0] = dvd.getFormat();
} catch (Exception e) {
}
try {
dumpd[1] = dvd.getRegionCode().toString();
} catch (Exception e) {
}
try {
dumpd[2] = dvd.getRunningTime().toString();
} catch (Exception e) {
}
try {
dumpd[3] = dvd.getActors().iterator().next().getName();
} catch (Exception e) {
}
try {
dumpd[4] = dvd.getCreators().iterator().next().getName();
} catch (Exception e) {
}
try {
dumpd[5] = dvd.getDirectors().iterator().next().getName();
} catch (Exception e) {
}
data.add(dumpd);
break;
case music:
header = new String[]{"Release", "Tracks", "Labels", "Artist"};
media.definitions.Music music = mdi.getMusic(product.getAsin());
String[] dumpm = new String[4];
try {
dumpm[0] = music.getReleaseDate().toString();
} catch (Exception e) {
}
try {
List<Track> tracks=music.getTracks();
for(int j=0;j<tracks.size();j++){
if (j != 0) dumpm[1] += ", " + tracks.get(j).getName();
else dumpm[1] = tracks.get(j).getName();
}
/*
String[] tracks = music.getTracks().toArray(new String[0]);
for (int i = 0; i < tracks.length; i++)
if (i != 0) dumpm[1] += ", " + tracks[i];
else dumpm[1] = tracks[0];*/
} catch (Exception e) {
}
try {
dumpm[2] = String.valueOf(music.getLabels().iterator().next());
} catch (Exception e) {
}
try {
dumpm[3] = String.valueOf(music.getArtists().iterator().next());
} catch (Exception e) {
}
data.add(dumpm);
break;
}
this.table.fillTable(header, data);
}
/**
* Realisierung des rebuild-Knopfes. Die Daten werden aus der Zwischenablage aktualisiert.
*/
public void loadDetailsFromClipboard() {
java.awt.datatransfer.Transferable transferred = this.clipboard.getContents(null);
java.awt.datatransfer.DataFlavor flavors[] = transferred.getTransferDataFlavors();
java.awt.datatransfer.DataFlavor flavor = flavors[0];
try {
String content = transferred.getTransferData(flavor).toString();
String productId = content;
if (productId == null) return;
Product product = null;
try {
product = mdi.getProduct(productId);
if (product != null) {
setDetails(product);
}
} catch (Exception e) {
e.printStackTrace(System.err);
return;
}
} catch (Exception e) {
}
}
public void loadDetailsFromProduct(Product product) {
setDetails(product);
}
}
| [
"soer3nreichardt@googlemail.com"
] | soer3nreichardt@googlemail.com |
3b564b0b42ce6c0950edc2d9b0aa277891050fba | c6cb5aa8a115a4f85d0b6506d612029a5ed27380 | /src/main/java/pdetection/BodyDetection.java | eed8af8bb76f53e023abc16a87e7fc9c6c267060 | [] | no_license | tmuryn/pdetection | 9ac88926f36164c9c9d6367da3e995250e679140 | 215e3a0b0897e7f96d0c7a53749da6f99d2496b8 | refs/heads/master | 2020-04-24T14:16:10.363836 | 2013-04-16T12:33:05 | 2013-04-16T12:33:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,632 | java | package pdetection;
import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.cpp.opencv_objdetect;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_BGR2GRAY;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCvtColor;
import static com.googlecode.javacv.cpp.opencv_objdetect.cvHaarDetectObjects;
public class BodyDetection {
private static final String CASCADE_FILE = "src/main/resources/algorithm/HS.xml";
public static void main(String[] args) throws Exception {
FrameGrabber grabber = FrameGrabber.createDefault(0);
grabber.start();
IplImage originalImage;
while (true) {
originalImage = grabber.grab();
IplImage grayImage = IplImage.create(originalImage.width(), originalImage.height(), IPL_DEPTH_8U, 1);
cvCvtColor(originalImage, grayImage, CV_BGR2GRAY);
CvMemStorage storage = CvMemStorage.create();
opencv_objdetect.CvHaarClassifierCascade cascade = new opencv_objdetect.CvHaarClassifierCascade(cvLoad(CASCADE_FILE));
CvSeq faces = cvHaarDetectObjects(grayImage, cascade, storage, 1.1, 1, 0);
for (int i = 0; i < faces.total(); i++) {
CvRect r = new CvRect(cvGetSeqElem(faces, i));
cvRectangle(originalImage, cvPoint(r.x(), r.y()), cvPoint(r.x() + r.width(), r.y() + r.height()), CvScalar.YELLOW, 1, CV_AA, 0);
}
cvShowImage("S1", originalImage);
cvWaitKey(33);
}
}
} | [
"tmuryn@gmail.com"
] | tmuryn@gmail.com |
770ce8040ff1435a46a0c5d0b4a513abf2662096 | 087669942a42ec85d1e88e42a0f27a9501992a50 | /app/src/main/java/com/liuwei1995/red/util/permission/Request.java | d192ac61515829409403ff27ff54df4d07750833 | [] | no_license | liuwei1995/Red | b968830714c57291488ea97536f8848571ab1067 | 21d52922eba8b71bf3920ce9bbc7c5753c476e11 | refs/heads/master | 2021-01-20T14:40:06.179312 | 2018-03-09T05:33:30 | 2018-03-09T05:33:30 | 90,644,889 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,230 | java | package com.liuwei1995.red.util.permission;
import android.support.annotation.NonNull;
/**
* Created by liuwei on 2017/5/3
*/
public interface Request<T extends Request> {
/**
* Here to fill in all of this to apply for permission, can be a, can be more.
*
* @param permissions one or more permissions.
* @return {@link Request}.
*/
@NonNull
T setPermission(String... permissions);
/**
* Request code.
*
* @param requestCode int, the first parameter in callback {@code onRequestPermissionsResult(int, String[],
* int[])}}.
* @return {@link Request}.
*/
@NonNull
T setRequestCode(int requestCode);
/**
* Set the callback object.
*
* @return {@link Request}.
*/
T setCallback(PermissionListener callback);
/**
* Request permission.
*/
void start();
// /**
// * With user privilege refused many times, the Listener will be called back, you can prompt the user
// * permissions role in this method.
// *
// * @param listener {@link RationaleListener}.
// * @return {@link Request}.
// */
// @NonNull
// T setRationale(RationaleListener listener);
}
| [
"liuwei9502@163.com"
] | liuwei9502@163.com |
b000f408518f19ee9be6643c801712b3eceb02f9 | cfb6c48444586e99653f2b5a90d94eb772985240 | /MyEthics/src/app/src/main/java/com/hunter/owen/myethics/PurchasesFragment.java | 54245651c5c62c144ea9ba9822f2cbeab7d3a792 | [] | no_license | owen-hunter1/4630f2020 | ee551e37f6ce654d2bdd16042a2009ae144c885c | 6c3159b2f5a77fb2f0f850e9a005843f0d996ecb | refs/heads/master | 2023-01-31T00:40:45.620342 | 2020-12-15T21:41:13 | 2020-12-15T21:41:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,121 | java | package com.hunter.owen.myethics;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
public class PurchasesFragment extends Fragment {
private ListView purchaseListView;
private Button addPurchaseButton;
private List<Purchase> purchaseList;
PurchaseArrayAdapter purchaseArrayAdapter;
public static PurchasesFragment newInstance() {
return new PurchasesFragment();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.purchases_fragment, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
purchaseListView = view.findViewById(R.id.purchases_list);
addPurchaseButton = view.findViewById(R.id.add_purchase_button);
purchaseArrayAdapter = new PurchaseArrayAdapter(view.getContext(), android.R.layout.simple_list_item_1, purchaseList);
purchaseList = new ArrayList<Purchase>();
final PurchaseArrayAdapter purchaseArrayAdapter = new PurchaseArrayAdapter(view.getContext(), android.R.layout.simple_list_item_1, purchaseList);
purchaseListView.setAdapter(purchaseArrayAdapter);
addPurchaseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), CreatePurchaseActivity.class);
startActivity(intent);
}
});
DatabaseConnect.getPurchases(view.getContext(), new ServerCallback() {
@Override
public void onSuccess(JsonObject result) {
Log.i("result: ", result.toString());
JsonArray jsonArray = result.get("purchases").getAsJsonArray();
purchaseList.clear();
for (JsonElement jsonElement : jsonArray){
Log.i("json element", jsonElement.getAsJsonObject().toString());
Purchase t_purchase = new Gson().fromJson(jsonElement.getAsJsonObject(), Purchase.class);
Log.i("t_purchase: ", t_purchase.getProduct_name() + ", " + t_purchase.getPurchase_date().getTimeInMillis() + ", " + t_purchase.getScore());
purchaseList.add(t_purchase);
purchaseArrayAdapter.notifyDataSetChanged();
}
}
});
}
@Override
public void onResume() {
super.onResume();
Log.i("resumed: ","resumed");
DatabaseConnect.getPurchases(getContext(), new ServerCallback() {
@Override
public void onSuccess(JsonObject result) {
Log.i("result: ", result.toString());
JsonArray jsonArray = result.get("purchases").getAsJsonArray();
purchaseList.clear();
for (JsonElement jsonElement : jsonArray){
Log.i("json element", jsonElement.getAsJsonObject().toString());
Purchase t_purchase = new Gson().fromJson(jsonElement.getAsJsonObject(), Purchase.class);
Log.i("t_purchase: ", t_purchase.getProduct_name() + ", " + t_purchase.getPurchase_date().getTimeInMillis() + ", " + t_purchase.getScore());
purchaseList.add(t_purchase);
purchaseArrayAdapter.notifyDataSetChanged();
}
}
});
purchaseArrayAdapter.notifyDataSetChanged();
}
}
| [
"70711604+owen-hunter1@users.noreply.github.com"
] | 70711604+owen-hunter1@users.noreply.github.com |
2a84f548c244cfa32278cbdd7289c6f026151d66 | 35cfd2b759a13d4576b02e067335aea93b288a93 | /app/src/main/java/edu/gsu/httpcs/mobileappfinal/Fragments/PageFragment.java | 8476236501c032aa2a53dbbfa773a07b50692560 | [] | no_license | spri0/MobileAppFinal | 80cf0ff9930b4213d78b744330360ef9d660b0ed | 40789ab8a88e6ed4106b91bbfced612036eee27d | refs/heads/master | 2021-01-01T06:29:51.922153 | 2017-07-17T11:10:15 | 2017-07-17T11:10:15 | 97,439,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package edu.gsu.httpcs.mobileappfinal.Fragments;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import edu.gsu.httpcs.mobileappfinal.R;
/**
* A simple {@link Fragment} subclass.
*/
public class PageFragment extends android.support.v4.app.Fragment {
TextView textView;
public PageFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.page_fragment_layout,container,false);
textView=(TextView)view.findViewById(R.id.textview);
Bundle bundle=getArguments();
String pages = Integer.toString(bundle.getInt("count"));
textView.setText("Page " +pages+ "Summer 2017 Mobile App Dev Project");
return view;
}
}
| [
"yungboke@gmail.com"
] | yungboke@gmail.com |
ba53b93c6577e14d2595265f80d186dbb9fdc680 | 7e1a576f0f6121ebad169a51703adf903790e2b2 | /output/PPerformanceMeasure.java | eb4dbeca04a759f03c7f88df0bafd4cc5ee6b564 | [
"Apache-2.0"
] | permissive | thuhiensp/Generator | 5e118d868bb68b96070bc07d8f97108b87c18fcd | 808cf825247825a0ca8efeb7a46a66ca394f3a97 | refs/heads/master | 2022-05-26T22:49:35.910572 | 2019-09-27T16:02:56 | 2019-09-27T16:02:56 | 211,355,898 | 0 | 0 | null | 2022-05-20T21:10:04 | 2019-09-27T16:03:41 | Java | UTF-8 | Java | false | false | 1,089 | java | /*
* Copyright 2019 SmartTrade Technologies
* Pony SDK
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.ponysdk.core.ui2;
import com.ponysdk.core.model.ServerToClientModel;
import com.ponysdk.core.writer.ModelWriter;
import com.ponysdk.core.server.application.UIContext;
public class PPerformanceMeasure extends PPerformanceEntry {
private PPerformanceMeasure(){
}
@Override
protected PLeafTypeNoArgs widgetNoArgs() {
return null;
}
@Override
protected PLeafTypeWithArgs widgetWithArgs() {
return null;
}
} | [
"hle@smart-trade.net"
] | hle@smart-trade.net |
e186acfbab64e79d7dfcaf5864078bd95cc17d32 | 535e1dc621b26542047b973d9b3122a94ce5c2e9 | /src/main/java/msb/class11/Code03_PrintAllPermutations.java | 691a3be99cbfc84e0a664fafdb190b8d47bbab64 | [] | no_license | zhangshuang007/algorithm_basic | f2dd93966278eacb5e1b7c6605c6009b552e0905 | 561b6f610d8e24b312b0242a058775a75b912bc1 | refs/heads/master | 2023-05-31T04:54:07.396387 | 2021-06-28T02:41:16 | 2021-06-28T02:41:16 | 380,870,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,688 | java | package msb.class11;
import java.util.ArrayList;
import java.util.List;
/**
* 1、打印一个字符串的全部排列
* 2、打印一个字符串的全部排列,要求不要出现重复的排列(分支限界)
* @Author zhangshuang
* @Date 2021/6/1 10:49
*/
public class Code03_PrintAllPermutations {
public static ArrayList<String> permutation(String str) {
ArrayList<String> res = new ArrayList<>();
if (str == null || str.length() == 0) {
return res;
}
char[] chs = str.toCharArray();
process(chs, 0, res);
return res;
}
// str[0..i-1]已经做好决定的
// str[i...]都有机会来到i位置
// i终止位置,str当前的样子,就是一种结果->ans
public static void process(char[] str, int i, ArrayList<String> ans) {
if (i == str.length) {
ans.add(String.valueOf(str));
return;
}
// 如果i没有终止,i...都可以来到i位置
for (int j = i; j < str.length; j++) {// j i后面所有的字符都有机会
swap(str, i, j);
process(str, i + 1, ans);
swap(str, i, j);// 恢复现场
}
}
public static ArrayList<String> permutationNoRepeat(String str) {
ArrayList<String> res = new ArrayList<>();
if (str == null || str.length() == 0) {
return res;
}
char[] chs = str.toCharArray();
process2(chs, 0, res);
return res;
}
// 分支限界,比展示完所有可能性再过滤的方法要快
// str[0..i-1]已经做好决定的
// str[i...]都有机会来到i位置
// i终止位置,str当前的样子,就是一种结果->ans
public static void process2(char[] str, int i, ArrayList<String> ans) {
if (i == str.length) {
ans.add(String.valueOf(str));
return;
}
// 如果不止26种字符,visit搞成hash表的形式即可
// visit[0] 0位置a这个字符有没有使用过,
// visit[1] 1位置b这个字符有没有使用过
boolean[] visit = new boolean[26]; // visit[0 1 .. 25]
for (int j = i; j < str.length; j++) {
// str[j] = 'a' -> 0 visit[0] -> 'a'
// str[j] = 'z' -> 25 visit[25] -> 'z'
if (!visit[str[j] - 'a']) {// 这种字符没出现过才去走支路
visit[str[j] - 'a'] = true;// 登记一下,以后再来就算使用过了
swap(str, i, j);
process2(str, i + 1, ans);
swap(str, i, j);
}
}
}
public static void swap(char[] chs, int i, int j) {
char tmp = chs[i];
chs[i] = chs[j];
chs[j] = tmp;
}
public static void main(String[] args) {
String s = "aac";
List<String> ans1 = permutation(s);
for (String str : ans1) {
System.out.println(str);
}
System.out.println("=======");
List<String> ans2 = permutationNoRepeat(s);
for (String str : ans2) {
System.out.println(str);
}
}
}
| [
"sz19870213@126.com"
] | sz19870213@126.com |
96aaa4f1ffc0dc2e0505b695ff063bae53bab5fc | 460b2f0def829ceb74f95f3f6270bf325990bd27 | /app/src/main/java/de/java/testtodelete/SecondActivity.java | 2f521ccac0be83245bcb8ba2d20786b505018a14 | [] | no_license | AIRAT1/Android2DZ1 | 7360244cb1bc898278df7f742889f2d9c487db3c | ecc166620ac952ead9083543d93f7fcd4519d229 | refs/heads/master | 2016-09-01T15:41:31.370162 | 2016-02-21T09:16:31 | 2016-02-21T09:16:31 | 51,813,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,119 | java | package de.java.testtodelete;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;
import data.DBHelper;
public class SecondActivity extends Activity implements View.OnClickListener,AdapterView.OnItemLongClickListener{
private EditText editText;
private LinearLayout linearLayoutRoot;
private Button button;
private ListView listView;
private List<String> list;
private Animation animation;
private ArrayAdapter<String> adapter;
private String companyName;
static DBHelper dbHelper;
static SQLiteDatabase db;
private ContentValues cv;
private Cursor cursor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
init();
button.setOnClickListener(this);
}
void init() {
editText = (EditText)findViewById(R.id.editText);
companyName = getIntent().getStringExtra(MainActivity.COMPANY_NAME);
editText.setHint(getResources().getString(R.string.enter_person_from) + " "
+ companyName + " " + getString(R.string.here));
linearLayoutRoot = (LinearLayout)findViewById(R.id.linearLayoutRoot);
linearLayoutRoot.setBackgroundColor(getResources().getColor(R.color.linearLayoutRoot));
editText.setBackgroundColor(getResources().getColor(R.color.linearLayoutRoot));
listView = (ListView)findViewById(R.id.listView);
listView.setBackgroundColor(getResources().getColor(R.color.linearLayoutRoot));
button = (Button)findViewById(R.id.button);
load();
adapter = new ArrayAdapter<>(SecondActivity.this, android.R.layout.simple_list_item_1, list);
listView.setAdapter(adapter);
listView.setOnItemLongClickListener(this);
}
@Override
protected void onPause() {
super.onPause();
save();
}
private void save() {
db = dbHelper.getWritableDatabase();
db.delete(DBHelper.TABLE_NAME, null, null);
cv = new ContentValues();
for (String s : list) {
cv.put(DBHelper.COLUMN_NAME, s);
db.insert(DBHelper.TABLE_NAME, null, cv);
}
db.close();
cv.clear();
}
private List<String> load() {
dbHelper = new DBHelper(this, DBHelper.DB_NAME + companyName, null, 1);
db = dbHelper.getWritableDatabase();
cursor = db.query(DBHelper.TABLE_NAME, null,
null, null, null, null, null);
list = new ArrayList<>();
for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
list.add(cursor.getString(cursor.getColumnIndex(DBHelper.COLUMN_NAME)));
}
db.close();
cursor.close();
return list;
}
@Override
public void onClick(View v) {
animation = AnimationUtils.loadAnimation(SecondActivity.this, R.anim.rotate);
button.setBackgroundColor(getResources().getColor(R.color.green));
button.setAnimation(animation);
list.add(0, editText.getText().toString());
adapter.notifyDataSetChanged();
editText.setText("");
}
@Override
public boolean onItemLongClick(final AdapterView<?> parent, View view, final int position, long id) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.delete)
.setMessage(R.string.are_you_really_want_to_delete_this)
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
})
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_backward);
button.setBackgroundColor(getResources().getColor(R.color.red));
button.startAnimation(animation);
adapter.remove(parent.getItemAtPosition(position).toString());
adapter.notifyDataSetChanged();
if (list.size() == 0) button.setBackgroundColor(getResources().getColor(R.color.base_color));
}
}).create().show();
return true;
}
}
| [
"ayrat1@mail.ru"
] | ayrat1@mail.ru |
f7f165e1070a60f1db0d87aa7d6a71930368feea | 7396d2675360a510d4a06529119d9cbf91902123 | /src/main/java/com/blazartech/products/blazarsql/components/gui/ProfileManagerPanel.java | bc48ea543af5bd36309e0d643133b8c05d474771 | [] | no_license | drsaaron/BlazarSQL | 307248de0e789cae378894305dcaced52da4902c | 4c4ee5c291de1f155ded86b5511f7d8fbc6376a1 | refs/heads/master | 2023-08-05T21:58:01.534038 | 2023-07-31T22:17:57 | 2023-07-31T22:17:57 | 139,463,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,612 | java | /*
* ProfileManagerPanel.java
*
* Created on April 12, 2004, 11:05 AM
*/
package com.blazartech.products.blazarsql.components.gui;
import com.blazartech.products.blazarsql.components.profile.ConnectionProfile;
import javax.swing.JPanel;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
*
* @author aar1069
*/
@Component
@Scope("prototype") // make a prototype to ensure L&F updates get propogated.
public class ProfileManagerPanel extends JPanel implements InitializingBean {
/** Creates new form ProfileManagerPanel
* @throws java.lang.Exception */
@Override
public void afterPropertiesSet() throws Exception {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
_profileList = new javax.swing.JList();
jPanel1 = new javax.swing.JPanel();
_deleteProfileButton = new javax.swing.JButton();
setLayout(new java.awt.BorderLayout());
_profileList.setModel(profileListModel);
_profileList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
_profileList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
_profileListValueChanged(evt);
}
});
jScrollPane1.setViewportView(_profileList);
add(jScrollPane1, java.awt.BorderLayout.CENTER);
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));
_deleteProfileButton.setText("Delete");
_deleteProfileButton.setEnabled(false);
_deleteProfileButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
_deleteProfileButtonActionPerformed(evt);
}
});
jPanel1.add(_deleteProfileButton);
add(jPanel1, java.awt.BorderLayout.EAST);
}// </editor-fold>//GEN-END:initComponents
private void _deleteProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__deleteProfileButtonActionPerformed
// Add your handling code here:
ProfileListModel model = (ProfileListModel) _profileList.getModel();
ConnectionProfile p = (ConnectionProfile) _profileList.getSelectedValue();
model.removeProfile(p);
}//GEN-LAST:event__deleteProfileButtonActionPerformed
private void _profileListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event__profileListValueChanged
// Add your handling code here:
_deleteProfileButton.setEnabled(true);
}//GEN-LAST:event__profileListValueChanged
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton _deleteProfileButton;
private javax.swing.JList _profileList;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
@Autowired
private ProfileListModel profileListModel;
}
| [
"scottaaron@northwesternmutual.com"
] | scottaaron@northwesternmutual.com |
7ae41fb175b201f63278a4aa89c998f8e35594fb | 047e8ed9425e902a4c9cd89e89b0356c5ed13654 | /src/com/jeztech/repomanager/dao/StorageKeepDao.java | f0701968b3d6b594956bb7bb630928a97546ede0 | [] | no_license | vdustleo/ReposityManager | b41f184a0010d0a58c7ce3750cde9d477a1180c4 | 0fd619887602c61f46d81549fd603ae878252a87 | refs/heads/master | 2021-09-01T14:27:28.043925 | 2017-12-27T13:10:16 | 2017-12-27T13:10:16 | 115,521,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,126 | java | package com.jeztech.repomanager.dao;
import java.util.List;
import java.util.Map;
import com.jeztech.repomanager.model.StorageInfo;
public interface StorageKeepDao {
/**
* 添加一个项目
*/
public void addItem(StorageInfo info);
/**
* 删除一个项目
*/
public void deleteItem(StorageInfo info);
/**
* 修改一个项目
*/
public void modifyItem(StorageInfo info);
/**
* 根据key查询对应的项目,用于入库
*/
public StorageInfo getItemByKey(StorageInfo info);
/**
* 根据key查询对应的项目, 用于出库
*/
public StorageInfo getItemById(StorageInfo info);
/**
* 列出所有的符合条件的项目数
*/
public Integer getAllItemCount(Map<String, Object> param);
/**
* 列出所有的符合条件的项目
*/
public List<StorageInfo> getAllItem(Map<String, Object> param);
/**
* 列出所有的项目
*/
public List<StorageInfo> getAllItems(Map<String, Object> param);
/**
* 列出所有的货物总数
*/
public Integer getAllKeepGoodsCount(Map<String, Object> param);
}
| [
"vdust.leo@163.com"
] | vdust.leo@163.com |
e7b6b0d061037e6aa5cac434515e93e619063f26 | 1ae1abd2b2c39a862aad47eaf8afa85e958302dd | /ippse-mblog-web/src/main/java/com/ippse/mblog/web/oauth/OkUserConfig.java | 8f29259459278c922226612d46c330e3e713b3ec | [] | no_license | mahaorong/mblog | 5963eea5111317f9fb0506ea9dcef289633ed5ab | debfa389a09b45bd6f70fff0440f0f6b57183a07 | refs/heads/master | 2023-03-05T09:01:17.252973 | 2019-06-24T02:18:15 | 2019-06-24T02:18:15 | 193,416,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,310 | java | package com.ippse.mblog.web.oauth;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OkUserConfig implements java.io.Serializable {
private static final long serialVersionUID = 1801219483748426473L;
@JsonView(OkUser.Views.Profile.class)
private String property;
@JsonView(OkUser.Views.Profile.class)
private String name;
@JsonView(OkUser.Views.Profile.class)
private Set<String> vals = new HashSet<String>();
@JsonView(OkUser.Views.Profile.class)
private Set<String> options = new HashSet<String>();
@JsonView(OkUser.Views.Profile.class)
private Set<String> defvals = new HashSet<String>();
@JsonView(OkUser.Views.Profile.class)
private String type;
public OkUserConfig(String property, String name, Set<String> options, Set<String> defvals, String type) {
this.property = property;
this.name = name;
this.options = options;
this.defvals = defvals;
this.type = type;
}
public boolean check(String option) {
for (String val : this.getVals()) {
if (StringUtils.equals(option, val)) {
return true;
}
}
return false;
}
} | [
"931380187@qq.com"
] | 931380187@qq.com |
20ada650022ef988dbaf40e6a6be89a5dc1a1702 | bc5b77e4247c632b786cf50ca5ee378eff9739dc | /app/src/main/java/digiwizards/sih/com/tollpay/service/LocationReceiveService.java | 1523ffa09dc877e89d707679c618d9ec5e2bc66f | [] | no_license | singhania1408/TollPay | 40e00b9e31df813f3d12804294115d285d266398 | 33fb920b29107d8d849b9dfa7a01b2c8c1436f25 | refs/heads/master | 2021-01-23T04:33:43.887014 | 2017-03-28T20:29:11 | 2017-03-28T20:29:11 | 86,208,938 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,439 | java | package digiwizards.sih.com.tollpay.service;
import android.app.IntentService;
import android.content.Intent;
import android.content.Context;
import android.location.Location;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.location.LocationResult;
import java.util.List;
import static com.google.android.gms.location.LocationAvailability.hasLocationAvailability;
import static com.google.android.gms.location.LocationResult.extractResult;
import static com.google.android.gms.location.LocationResult.hasResult;
/**
* An {@link IntentService} subclass for handling asynchronous task requests in
* a service on a separate handler thread.
* <p>
* helper methods.
*/
public class LocationReceiveService extends IntentService {
// IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS
private static final String ACTION_LOCATION = "digiwizards.sih.com.tollpay.service.action.LOCATION";
private static final String EXTRA_PARAM1 = "digiwizards.sih.com.tollpay.notification.extra.PARAM1";
private static final String EXTRA_PARAM2 = "digiwizards.sih.com.tollpay.notification.extra.PARAM2";
private final String TAG = getClass().getSimpleName();
List<Location> locationList;
Location lastLocation;
public LocationReceiveService() {
super("LocationReceiveService");
}
public static void startActionBaz(Context context, String param1, String param2) {
Intent intent = new Intent(context, LocationReceiveService.class);
//intent.setAction(ACTION_BAZ);
intent.putExtra(EXTRA_PARAM1, param1);
intent.putExtra(EXTRA_PARAM2, param2);
context.startService(intent);
}
public static Intent getLocationIntent(Context context) {
Intent intent = new Intent(context, LocationReceiveService.class);
intent.setAction(ACTION_LOCATION);
/* intent.putExtra(EXTRA_PARAM1, param1);
intent.putExtra(EXTRA_PARAM2, param2);*/
return intent;
}
@Override
protected void onHandleIntent(Intent intent) {
if (intent != null) {
final String action = intent.getAction();
if (ACTION_LOCATION.equals(action)) {
if(hasResult(intent)){
handleActionLocation(intent);
}
final String param1 = intent.getStringExtra(EXTRA_PARAM1);
final String param2 = intent.getStringExtra(EXTRA_PARAM2);
} /*else if (ACTION_BAZ.equals(action)) {
final String param1 = intent.getStringExtra(EXTRA_PARAM1);
final String param2 = intent.getStringExtra(EXTRA_PARAM2);
handleActionBaz(param1, param2);
}*/
}
}
/**
* Handle action Location in the provided background thread with the provided
* parameters.
*/
private void handleActionLocation(Intent intent) {
LocationResult locationResult=extractResult(intent);
locationList=locationResult.getLocations();
lastLocation=locationResult.getLastLocation();
Log.v(TAG,"Yeaah Location is getting"+lastLocation.getSpeed()+" "+lastLocation.getLongitude()
+" "+lastLocation.getLatitude());
Toast.makeText(this,"Yeaah Location is getting"+lastLocation.getSpeed()+" "+lastLocation.getLongitude()
+" "+lastLocation.getLatitude(),Toast.LENGTH_SHORT).show();
}
}
| [
"abhisinghania14@gmail.com"
] | abhisinghania14@gmail.com |
6b3731d9b8cf185e0ba8cda3ab3218162380a2da | d4a7ce72523ddc27c3d71811b1af410b12bfc709 | /src/icrud/PersonDBRepository.java | 157f6d6eee5c92eb13635a818d4b402fecd10930 | [] | no_license | martinp98/herokutest | 9b501943ce23f4ff385d3463bafc4dcaa92ffc5c | 9d8bac09970d1f2f43c8ec87c2c90e25935dbb70 | refs/heads/master | 2023-01-19T23:29:09.875527 | 2020-09-04T07:19:00 | 2020-09-04T07:19:00 | 316,603,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package icrud;
public class PersonDBRepository implements ICrud {
@Override
public void create(Person p) {
}
@Override
public Person read(int id) {
return null;
}
@Override
public void update(Person p) {
}
@Override
public void delete(int id) {
}
}
| [
"clbo@kea.dk"
] | clbo@kea.dk |
473f413c7ecb0850258c13e76d8e54eff31784f5 | 58c0529be1ee5ad274292184cc0fc19c7d0e0fd2 | /HHTask/.svn/pristine/b4/b4b5584acf333a139aa7c575feb0afd7bb3d9058.svn-base | fe6b28f8a0e03ddd31fb8b73dc9d33519b8b86ec | [] | no_license | hbliyafei/nianfojishu | 6dc348fdca415d2e7aa328c76f0cbfb9b3aba9c3 | 0a8a125e661f0d582245a4c2586d57f85e496399 | refs/heads/master | 2023-03-17T15:03:03.247703 | 2019-05-14T07:56:20 | 2019-05-14T07:56:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,586 | package com.task.entity.menjin;
import java.io.Serializable;
/**
* 门禁历史记录表
*
* @author Li_Cong 表名 ta_mj_AccessRecords 所有进出记录(后台自动添加)
*/
public class AccessRecords implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String recordType;// 开门验证类型(车牌/验证码/员工卡)
private String recordContents;// 开门验证内容(记录的验证码,卡号或车牌)
private String recordisIn;// 是否内部车辆(内部/来访/常访)
private String recordStatus;// 开门状态(已识别/已开门/已通过)
private String openTime;// 开门时间
private String enterTime;// 通过时间
private String openType;// 开门类型(进门/出门)
private String equipmentDaoType;// (人行道/车行道)
private String outOfPosition;// 进出位置
private Integer asWeam_id;// 开门摄像头ID
private Integer asEqt_id;// 对应设备ID
private String asWeam_ip;// 开门摄像头IP
private String asEqt_ip;// 对应设备IP
private String addTime;// 添加时间
private String recordPass;// 通过方式(由外向内/由内向外)(CC/DD)
private String inCode;// 员工工号
private String inDept;// 员工部门
private Integer inId;// 内部员工Id
private String inName;// 员工姓名
private String inmarkId;// 进出内部员工卡号
private String waitCheck;// 待检(待检查,已检查)(紧急)
private String checkName;// 检车人名称卡号
private String urgentCar;// (紧急)
private Integer banciId;// 是否要添加考勤(不为空代表有班次,有班次就代表要添加考勤)
private String isKong;// 此车卡号需要控制灯
// 请假加班id
private String entityName;// 对应实体类名称
private Integer entityId;// 对应实体类id
// get set
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRecordType() {
return recordType;
}
public void setRecordType(String recordType) {
this.recordType = recordType;
}
public String getRecordContents() {
return recordContents;
}
public void setRecordContents(String recordContents) {
this.recordContents = recordContents;
}
public String getRecordStatus() {
return recordStatus;
}
public void setRecordStatus(String recordStatus) {
this.recordStatus = recordStatus;
}
public String getOpenTime() {
return openTime;
}
public void setOpenTime(String openTime) {
this.openTime = openTime;
}
public String getEnterTime() {
return enterTime;
}
public void setEnterTime(String enterTime) {
this.enterTime = enterTime;
}
public String getOpenType() {
return openType;
}
public void setOpenType(String openType) {
this.openType = openType;
}
public String getIsKong() {
return isKong;
}
public void setIsKong(String isKong) {
this.isKong = isKong;
}
public String getOutOfPosition() {
return outOfPosition;
}
public void setOutOfPosition(String outOfPosition) {
this.outOfPosition = outOfPosition;
}
public Integer getAsWeam_id() {
return asWeam_id;
}
public void setAsWeam_id(Integer asWeamId) {
asWeam_id = asWeamId;
}
public String getAddTime() {
return addTime;
}
public void setAddTime(String addTime) {
this.addTime = addTime;
}
public Integer getAsEqt_id() {
return asEqt_id;
}
public void setAsEqt_id(Integer asEqtId) {
asEqt_id = asEqtId;
}
public String getAsWeam_ip() {
return asWeam_ip;
}
public void setAsWeam_ip(String asWeamIp) {
asWeam_ip = asWeamIp;
}
public String getAsEqt_ip() {
return asEqt_ip;
}
public void setAsEqt_ip(String asEqtIp) {
asEqt_ip = asEqtIp;
}
public String getRecordisIn() {
return recordisIn;
}
public void setRecordisIn(String recordisIn) {
this.recordisIn = recordisIn;
}
public String getEquipmentDaoType() {
return equipmentDaoType;
}
public void setEquipmentDaoType(String equipmentDaoType) {
this.equipmentDaoType = equipmentDaoType;
}
public String getRecordPass() {
return recordPass;
}
public void setRecordPass(String recordPass) {
this.recordPass = recordPass;
}
public String getInCode() {
return inCode;
}
public void setInCode(String inCode) {
this.inCode = inCode;
}
public String getInDept() {
return inDept;
}
public void setInDept(String inDept) {
this.inDept = inDept;
}
public Integer getInId() {
return inId;
}
public void setInId(Integer inId) {
this.inId = inId;
}
public String getInName() {
return inName;
}
public void setInName(String inName) {
this.inName = inName;
}
public String getWaitCheck() {
return waitCheck;
}
public void setWaitCheck(String waitCheck) {
this.waitCheck = waitCheck;
}
public String getUrgentCar() {
return urgentCar;
}
public void setUrgentCar(String urgentCar) {
this.urgentCar = urgentCar;
}
public String getInmarkId() {
return inmarkId;
}
public void setInmarkId(String inmarkId) {
this.inmarkId = inmarkId;
}
public Integer getBanciId() {
return banciId;
}
public void setBanciId(Integer banciId) {
this.banciId = banciId;
}
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getEntityName() {
return entityName;
}
public void setEntityName(String entityName) {
this.entityName = entityName;
}
public Integer getEntityId() {
return entityId;
}
public void setEntityId(Integer entityId) {
this.entityId = entityId;
}
}
| [
"horsexming.sina.com"
] | horsexming.sina.com | |
65bfffda58cb20cfd39ba7f2f2bb076fe8ee426e | 16081ed52f66b4970fb2e05029e179826ee7c927 | /hbaseMapReduce/src/main/java/com/gtensor/stack/HDFS/HadoopOper.java | cd22a6521eb4064ce326ed01bccc650ce26a20a7 | [] | no_license | 0xqq/Hbase-bulk-load | 412e04daad3e81d043ae7b8728aef239462b957b | 214498bcc31ffd96398f1fae6e3d9c4a7a80aa13 | refs/heads/master | 2020-03-26T08:48:18.843050 | 2018-07-29T08:47:56 | 2018-07-29T08:47:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.gtensor.stack.HDFS;
import java.io.IOException;
import com.gtensor.stack.readprop.PropReader;
public class HadoopOper {
public static void main(String[] args) {
try {
//直接在配置文件中设置传入数据的源地址和目的地址即可
HadoopUtil.uploadFile(PropReader.Reader("src_csv"),PropReader.Reader("dst_scv"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"18811106069@163.com"
] | 18811106069@163.com |
2904552507cfe37f36b7af697c15e024ea967f36 | c6b040f28bbd10c17cb0cd1c55fd4432b7dbebd8 | /DesignMode/src/com/cyw/singleton/Singleton.java | e96d38259ba4e0b5ca82e63b2b24044ef5406a93 | [] | no_license | AGipsy/CywLeetCode | 904d5cf78e9c53ed6ced2621059e93a194fdb669 | fc139b00c2100a0ed7e3c82aa271be996d0def61 | refs/heads/master | 2022-01-30T21:30:23.930250 | 2016-06-05T09:53:58 | 2016-06-05T09:53:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,399 | java | package com.cyw.singleton;
/**
* 单例模式,是设计模式中使用最为普遍的模式之一。
* 是一种对象创建模式,确保一类一对象。好处是:
* 1、对于频繁的使用的队象,可以省略很多创建所花费的时间。尤其是对于那些重量级的对象
* 2、由于new操作的次数减少,对系统的内存的使用频率也会降低,降低GC压力。
* 核心是:通过一个接口,返回唯一的对象实例。
* 缺点是,不会延迟加载。即是说,在其他地方若用到该类时候,单例也会被加载
* @author cyw
* The first mode of singleton.
*/
public class Singleton {
/**
* 构造函数是private,确保不会被其他代码实例化
*/
private Singleton() {
//The process of creating a instance is too slow.
System.out.println("Singleton is created!");
}
private static Singleton instance = new Singleton();
public static Singleton getInstance(){
return instance;
}
//不能延迟加载,在该类使用比如这个方法的时候,也会加载单例类。因为instance是static的。
public static void createString(){
System.out.println("CreateString in Singleton");
}
public static void main(String [] args){
Singleton.createString();
/**
* 输出了:
* Singleton is created!
* CreateString in Singleton
* 说明,单例类也被加载了。
*/
}
}
| [
"2927096163@qq.com"
] | 2927096163@qq.com |
91dd4c9cd576f4692e66b53252aa8c91ccc84e82 | 39d4c8cffed09f7d2e7cf1598d10209cf74d926d | /Lottery/app/src/main/java/com/international/wtw/lottery/activity/mine/ForgetPwd1Activity.java | d0cf005461a8fd6264008af7217082b45c9423dc | [] | no_license | a12791602/newlottery | e257ad8d293bcfa76a7e8ada2f387168b68e658d | c34a0f6e7cbbd6e3f765d97e9d6164f5e892489f | refs/heads/master | 2022-02-15T23:27:12.940385 | 2019-07-30T06:44:00 | 2019-07-30T06:44:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,414 | java | package com.international.wtw.lottery.activity.mine;
import android.content.Intent;
import android.support.v4.util.ArrayMap;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.google.gson.Gson;
import com.international.wtw.lottery.R;
import com.international.wtw.lottery.base.Constants;
import com.international.wtw.lottery.base.app.BaseActivity;
import com.international.wtw.lottery.base.app.ViewHolder;
import com.international.wtw.lottery.dialog.ToastDialog;
import com.international.wtw.lottery.json.ErrorPhoneBean;
import com.international.wtw.lottery.utils.CountDownTimerUtils;
import com.international.wtw.lottery.utils.LogUtil;
import org.json.JSONObject;
import java.util.Map;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
/**
* 忘记密码
*/
public class ForgetPwd1Activity extends BaseActivity implements View.OnClickListener {
private ImageView imageView_toLeftArrow;
private EditText et_username, et_phone, et_code;
private Button btn_code, btn_binding;
@Override
protected int getLayoutId() {
return R.layout.activity_forget_pwd1;
}
@Override
protected void initViews(ViewHolder holder, View root) {
InitView();
}
private void InitView() {
imageView_toLeftArrow = (ImageView) findViewById(R.id.imageView_toLeftArrow);
et_username = (EditText) findViewById(R.id.et_username);
et_phone = (EditText) findViewById(R.id.et_phone);
et_code = (EditText) findViewById(R.id.et_code);
btn_code = (Button) findViewById(R.id.btn_code);
btn_binding = (Button) findViewById(R.id.btn_binding);
imageView_toLeftArrow.setOnClickListener(this);
btn_code.setOnClickListener(this);
btn_binding.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.imageView_toLeftArrow:
finish();
break;
case R.id.btn_code:
if (!TextUtils.isEmpty(et_username.getText().toString().trim())) {
if (!TextUtils.isEmpty(et_phone.getText().toString().trim())) {
SetData1(et_username.getText().toString().trim(), et_phone.getText().toString().trim());
} else {
ToastDialog.error("请输入手机号").show(getSupportFragmentManager());
}
} else {
ToastDialog.error("请输入用户名").show(getSupportFragmentManager());
}
break;
case R.id.btn_binding:
if (!TextUtils.isEmpty(et_code.getText().toString().trim())) {
SetData2(et_username.getText().toString().trim(), et_code.getText().toString().trim());
} else {
ToastDialog.error("请输入验证码").show(getSupportFragmentManager());
}
break;
}
}
private void SetData1(String username, String phone) {
Map<String, Object> jsonParams = new ArrayMap<>();
jsonParams.put("username", username);
jsonParams.put("mobile_phone", phone);
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), (new JSONObject(jsonParams)).toString());
CodeRequest1(body);
}
private void CodeRequest1(RequestBody body) {
new Thread() {
@Override
public void run() {
Request request = new Request.Builder()
.url(Constants.BASE_URL + Constants.SEND_VERIFICATIONCODE)
.post(body)
.build();
try {
Response response = client.newCall(request).execute();
ResponseBody body = response.body();
int responseCode = response.code();
String result = body.string();
LogUtil.e("忘记密码---手机验证码-" + responseCode + "-" + result);
if (responseCode == 200) {
Gson gson = new Gson();
ErrorPhoneBean errorPhoneBean = gson.fromJson(result, ErrorPhoneBean.class);
String info = errorPhoneBean.getInfo();
int msg = errorPhoneBean.getMsg();
if (msg == 2006) {
runOnUiThread(new Runnable() {
@Override
public void run() {
CountDownTimerUtils countDownTimerUtils = new CountDownTimerUtils(btn_code, 60000, 1000);
countDownTimerUtils.start();
ToastDialog.success(info).show(getSupportFragmentManager());
}
});
} else {
ToastDialog.error(info).show(getSupportFragmentManager());
}
} else {
LogUtil.e("请求失败");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
}
private void SetData2(String username, String code) {
Map<String, Object> jsonParams = new ArrayMap<>();
jsonParams.put("username", username);
jsonParams.put("verification_code", code);
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), (new JSONObject(jsonParams)).toString());
CodeRequest2(body);
}
private void CodeRequest2(RequestBody body) {
new Thread() {
@Override
public void run() {
Request request = new Request.Builder()
.url(Constants.BASE_URL + Constants.MAKESURE_VERIFICATIONCODE)
.post(body)
.build();
try {
Response response = client.newCall(request).execute();
ResponseBody body = response.body();
int responseCode = response.code();
String result = body.string();
LogUtil.e("忘记密码---验证码验证-" + responseCode + "-" + result);
if (responseCode == 200) {
Gson gson = new Gson();
ErrorPhoneBean errorPhoneBean = gson.fromJson(result, ErrorPhoneBean.class);
String info = errorPhoneBean.getInfo();
int msg = errorPhoneBean.getMsg();
if (msg == 2006) {
runOnUiThread(new Runnable() {
@Override
public void run() {
ToastDialog.success("验证码通过")
.setDismissListener(new ToastDialog.OnDismissListener() {
@Override
public void onDismiss(ToastDialog dialog) {
Intent intent = new Intent(ForgetPwd1Activity.this, ForgetPwd2Activity.class);
intent.putExtra("et_username", et_username.getText().toString().trim());
intent.putExtra("info", info);
startActivity(intent);
}
}).show(getSupportFragmentManager());
}
});
} else {
ToastDialog.error(info).show(getSupportFragmentManager());
}
} else {
LogUtil.e("请求失败");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
}
}
| [
"jason19990099@gmail.com"
] | jason19990099@gmail.com |
b4c4cd8111fafe1381eaa339e1fee90bf5845dec | cceb4e618ce4ccf7a20ae1e6a2a0b53cf5924a19 | /src/main/java/cn/bestsec/dcms/platform/api/model/Statistics_QueryFileListRequest.java | b20964748efcfbe2e694afab595cf54166fd5e89 | [] | no_license | zhanght86/dcms | 9843663cb278ebafb6f26bc662b385b713f2058d | 8e51ec3434ffb1784d9ea5d748e8972dc8fc629b | refs/heads/master | 2021-06-24T16:14:09.891624 | 2017-09-08T08:18:39 | 2017-09-08T08:18:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package cn.bestsec.dcms.platform.api.model;
import cn.bestsec.dcms.platform.api.support.CommonRequestFieldsSupport;
/**
* 自动生成的API请求/响应Model类,不要手动修改
*/
public class Statistics_QueryFileListRequest extends CommonRequestFieldsSupport {
private String token;
public Statistics_QueryFileListRequest() {
}
public Statistics_QueryFileListRequest(String token) {
this.token = token;
}
/**
*
*/
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
| [
"liu@gmail.com"
] | liu@gmail.com |
3e0654e4b18bc7c0a211b1b772580aa97702ed50 | a60b6afcc5afa48babfa1574255dd90861791047 | /microservice-bibliotheque/src/main/java/fr/oc/bibliotheque/microservicebibliotheque/MicroserviceBibliothequeApplication.java | d568180fe52fc13e8e6bcf5393ccf7ab12da4416 | [] | no_license | YoannR09/microservice_bibliotheque | 346a28b00281a9a1a9ae2c1ca7022dd72e2169d8 | 0550e097f3c1319451df36ad72a3c614e85b3221 | refs/heads/master | 2020-06-08T18:11:52.985312 | 2019-06-24T09:29:33 | 2019-06-24T09:29:33 | 193,279,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package fr.oc.bibliotheque.microservicebibliotheque;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MicroserviceBibliothequeApplication {
public static void main(String[] args) {
SpringApplication.run(MicroserviceBibliothequeApplication.class, args);
}
}
| [
"el-rambo-poto@hotmail.fr"
] | el-rambo-poto@hotmail.fr |
a8f9a06c6aecd65f7fba47180fae0e04dcdd3e1d | a9ec31d5a39d45a8f29c3c94f08a55cb2e354ada | /src/sowon/week17/quiz7_2455.java | cff15c52754f92e74f18b0f5626e13771cf3cd21 | [] | no_license | beyondAwesomeDev/Rhythming-Algorithm | 9a70efe328bba3bf12cb97f8b3c8ccf7bba3ae51 | 844f5e25e49930b9d725cc10d25a21d99a188490 | refs/heads/main | 2023-07-05T19:17:08.099454 | 2021-08-30T00:01:32 | 2021-08-30T00:01:32 | 322,190,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,051 | java | package sowon.week17;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// https://www.acmicpc.net/problem/2455
// 지능형 기차
public class quiz7_2455 {
public static void main(String[] args) throws IOException {
//sol memory 11484 runtime 80
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] ppl = br.readLine().split(" ");
int getOutppl = Integer.parseInt(ppl[0]);
int getInppl = Integer.parseInt(ppl[1]);
int Totalppl = getInppl; //현재 기차에 있는 사람의 수
int max = getInppl; //기차안 사람수의 최대값
for(int i=0; i<3; i++){
String[] pplFromSecondLine = br.readLine().split(" ");
getOutppl = Integer.parseInt(pplFromSecondLine[0]);
getInppl = Integer.parseInt(pplFromSecondLine[1]);
Totalppl = Totalppl + getInppl - getOutppl;
if(Totalppl > max){
max = Totalppl;
}
}
System.out.println(max);
}
}
/*
input
0 32
3 13
28 25
39 0
output
42
*/
| [
"sowonkim177@gmail.com"
] | sowonkim177@gmail.com |
e84d3faad16fad80240eaa1f9afe11887b130d72 | fd3c5791407993da6acec9b33f8dce3e38fb6245 | /CodingChallenges/OOPMasterChallengeExercise/src/com/company/Main.java | b064b4caab49043b4697b1ca9e5a7b919fe48d35 | [] | no_license | IanHefflefinger/JavaProgrammingMasterclassForSoftwareDevelopers | 0eb91b95cfdf082830e98b8b4d146ffeaa1bb32c | 29595b5ac73262b4fa6d695250779ab1ceb6eb9f | refs/heads/main | 2023-04-02T15:34:40.467473 | 2021-04-05T15:40:22 | 2021-04-05T15:40:22 | 331,090,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.company;
public class Main {
public static void main(String[] args) {
Hamburger hamburger = new Hamburger("regular", "beef", 6);
hamburger.setName("Ian's burger");
// hamburger.showPrice();
hamburger.setLettuce(true);
hamburger.setOnion(true);
hamburger.setPickle(true);
hamburger.setTomato(true);
hamburger.showPrice();
}
}
| [
"ian.hefflefinger@snhu.edu"
] | ian.hefflefinger@snhu.edu |
c5f02593cc089c48af858fb15f1151f149f4c099 | dc0b8cc424a03783bcff15f07cc3fa6fbd674c83 | /src/main/java/facebookIntegration/FacebookDataCollector.java | b1f466aafa9ba86105b86c0e226428f2771ce8cf | [] | no_license | Ioankall/TripAgenda-Data-Collector | f3ed0428ed1b9cb3c85e421874c20ce1aeb6756f | c78413bad554b185cf140108510f1ea2aefaa6ec | refs/heads/master | 2021-05-01T14:51:46.779827 | 2018-02-10T15:09:21 | 2018-02-10T15:09:21 | 121,025,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,969 | java | package facebookIntegration;
import com.mongodb.client.MongoDatabase;
import static com.mongodb.client.model.Filters.eq;
import facebook4j.FacebookException;
import java.util.TreeMap;
import org.bson.Document;
import utilities.StringComparator;
public class FacebookDataCollector {
private TreeMap<String, FacebookPlace> venues;
public TreeMap<String, FacebookPlace> getAllFacebookVenues(){ return venues; }
//Keywords extracted from Facebook supported categories, separated in groups of more general categories
private final String[] public_places = {"City", "Airport", "Terminal", "Beach", "Public", "Place", "Landmark", "Landscaping", "Lake", "Mountain", "Park", "Tours", "Sightseeing"};
private final String[] history_and_art = {"Historical", "Monument", "Museum", "Church", "Art", "Library", "Gallery", "Archaeological"};
private final String[] culture_and_sports = {"Concert", "Venue", "Sports", "Stadium", "Movie", "Attraction", "Zoo", "Aquarium"};
private final String[] food_and_drink = {"Bar", "Night", "Club", "Restaurant", "Lounge", "Pub", "Tea", "Nightlife", "Cafe", "Diner", "Entertainment", "Food", "Burger", "Breakfast", "Desert", "Club", "Bakery", "Pizza", "Salad", "Juice"};
private final String[] shopping = {"Shopping", "Mall", "Retail", "Clothing", "Outlet"};
private final String[] accomondation_and_personal_care = {"Gym", "Spa", "Pool", "Hotel", "Motel", "Lodging"};
//Used to extract info from Facebook's API. Creates one thread per category.
public int scrap (double latitude, double longitude, int radius) throws FacebookException, InterruptedException {
FacebookScrapper [] facebookScrappers = {
new FacebookScrapper(food_and_drink, latitude, longitude, radius),
new FacebookScrapper(shopping, latitude, longitude, radius),
new FacebookScrapper(accomondation_and_personal_care, latitude, longitude, radius),
new FacebookScrapper(culture_and_sports, latitude, longitude, radius),
new FacebookScrapper(history_and_art, latitude, longitude, radius),
new FacebookScrapper(public_places, latitude, longitude, radius)
};
for (int i=0; i<facebookScrappers.length; i++) {
facebookScrappers[i].start();
}
for (int i=0; i<facebookScrappers.length; i++) {
facebookScrappers[i].join();
}
venues = facebookScrappers[0].getVenues();
mergeDuplicates();
return venues.size();
}
private void mergeDuplicates () {
TreeMap<String, FacebookPlace> venuesNoDuplicates = new TreeMap<>();
StringComparator cmp = new StringComparator();
boolean duplicateFound;
for (String k: venues.keySet()) {
String name = venues.get(k)
.getName();
duplicateFound = false;
for (String d: venuesNoDuplicates.keySet()) {
if (cmp.compareStrings(name, venuesNoDuplicates.get(d).getName())>0.8) {
venuesNoDuplicates.get(d).setNumOfCheckins(venuesNoDuplicates.get(d).getNumOfCheckins() + venues.get(k).getNumOfCheckins());
venuesNoDuplicates.get(d).setNumOfLikes(venuesNoDuplicates.get(d).getNumOfLikes() + venues.get(k).getNumOfLikes());
venuesNoDuplicates.get(d).setNumOfTalkingAboutCount(venuesNoDuplicates.get(d).getNumOfTalkingAboutCount() + venues.get(k).getNumOfTalkingAboutCount());
venuesNoDuplicates.get(d).setNumOfWereHereCount(venuesNoDuplicates.get(d).getNumOfWereHereCount() + venues.get(k).getNumOfWereHereCount());
duplicateFound = true;
break;
}
}
if (!duplicateFound) {
venuesNoDuplicates.put(k, venues.get(k));
}
}
venues = venuesNoDuplicates;
}
}
| [
"ioankall@csd.auth.gr"
] | ioankall@csd.auth.gr |
0cc1f17cdb40accdda8b9264978b654160747f3b | 2afa84afd05852b0d859d1da3a161b59ca2846cf | /NetLogov6.1/src/LPSolverExtension.java | 7dca43afcf5627dda54c3fa747bf13358e227a57 | [] | no_license | cstaelin/NetLogoLPSolver | e86f3a28622440a006489fbb7c5d3c0db5a4348e | 559e2ae433f4ab4c8a6d04f82994c68c266de70b | refs/heads/master | 2020-09-11T18:24:10.982117 | 2019-11-24T15:15:42 | 2019-11-24T15:15:42 | 222,151,974 | 0 | 0 | null | 2019-11-16T19:55:48 | 2019-11-16T19:55:48 | null | UTF-8 | Java | false | false | 5,897 | java | /**
* LPSolverExtension is the wrapper for the extension.
*
* @author AFMac
* @version 3.0.0 Updated for NetLogo v6.1 by Charles Staelin
*/
package org.nlogo.extensions.lpsolver;
import java.io.File;
import org.nlogo.api.Context;
import org.nlogo.api.ExtensionException;
import org.nlogo.api.LogoException;
import org.nlogo.api.PrimitiveManager;
import org.nlogo.api.JavaLibraryPath;
public class LPSolverExtension extends org.nlogo.api.DefaultClassManager {
private static org.nlogo.workspace.ExtensionManager em;
// runs when the extension is loaded to make sure all the needed .jar,
// .dll and/or .so files can be found.
@Override
public void runOnce(org.nlogo.api.ExtensionManager em)
throws org.nlogo.api.ExtensionException {
// We don't use this, yet.
LPSolverExtension.em = (org.nlogo.workspace.ExtensionManager) em;
// find out what operating system and JVM we have.
String operatingSystem = System.getProperty("os.name").toLowerCase();
String jvmArchitecture = System.getProperty("os.arch").toLowerCase();
// As it stands, only 64-bit systems are supported by the underlying
// shared libraries. Check that this is such a system. Note:
// apparently, the "os.arc" property returns the type of JVM, not
// the undrerlying operating system. However, that is probably
// sufficient for our purposes.
if (!jvmArchitecture.contains("64")) {
throw new ExtensionException(
"The underlying software on which lpsolver is built "
+ "requires a 64-bit system and this appears not to "
+ "be such a system. Please refer to the "
+ "LPSolver installation instructions "
+ "contained in the README.md file.");
}
// All the OS's need java.lang.library to be set. We find out where
// the extension is installed and set java.lang.path to that directory.
String userExtensionDirectory
= org.nlogo.api.FileIO.perUserDir("extensions"
+ File.separator + "lpsolver", false);
File toAdd = new File(userExtensionDirectory);
// this code uses the JavaLibraryPath.add method from NetLogo.
try {
JavaLibraryPath.add(toAdd);
} catch (Exception ex) {
throw new ExtensionException(
"Error adding extension path to java.library.path.\n", ex);
}
// now deal with OS specific issues
if (operatingSystem.contains("win")) {
// the lpsolver installation directory must be in the path.
String pathEnv = System.getenv("PATH");
if (!pathEnv.contains("lpsolver")) {
throw new ExtensionException(
"The path to the lpsolver extension: "
+ userExtensionDirectory
+ ", must be added to the "
+ "PATH environment variable. Please refer to the "
+ "LPSolver installation instructions for Windows, "
+ "contained in the README.md file at the same location.");
}
} else if (operatingSystem.contains("mac")) {
// No 64-bit library for the macOS.
throw new ExtensionException(
"The underlying software on which lpsolver is built "
+ "is not compatible with the 64-bit version of "
+ "NetLogo for the macOS.");
} else {
/**
* we assume Linux. Ideally we would like to alter LD_LIBRARY_PATH
* to point to the directory where the extension is installed.
* However, Ubuntu (at least) does not allow the user to set this
* environment variable in any way that persists, so we are reduced
* to copying the liblpsolve55.so shared library to where Linux will
* look without being told. /usr/lib is one such place. It would be
* nice if we could do the copy here, but doing so requires
* administrator privileges.
*/
// See if liblpsolve55.so is where it needs to be.
File soLib = new File("/usr/lib/liblpsolve55.so");
if (!soLib.exists()) {
throw new ExtensionException(
"The dynamic link library 'liblpsolve55.so' must be "
+ "placed in '/usr/lib'. Please refer to the "
+ "LPSolver installation instructions for Linux, "
+ "contained in the README.md file at "
+ userExtensionDirectory + ".");
}
}
}
@Override
public void load(PrimitiveManager primitiveManager) {
primitiveManager.addPrimitive("max", new LPMaximize());
primitiveManager.addPrimitive("min", new LPMinimize());
primitiveManager.addPrimitive("dualsens", new DualSens());
}
private static void addToPath(String toAdd) {
String currentPath = System.getProperty("PATH");
if (!currentPath.contains(toAdd)) {
currentPath += File.pathSeparator + toAdd;
System.setProperty("PATH", currentPath);
}
}
// This is used for debugging only.
public static void writeToNetLogo(String mssg, Boolean toOutputArea,
Context context) throws ExtensionException {
try {
context.workspace().outputObject(mssg, null, true, true,
(toOutputArea)
? org.nlogo.api.OutputDestinationJ.OUTPUT_AREA()
: org.nlogo.api.OutputDestinationJ.NORMAL());
} catch (LogoException e) {
throw new ExtensionException(e);
}
}
}
| [
"cstaelin@smith.edu"
] | cstaelin@smith.edu |
c1e3a7cac401af656895e37330de7fb1d32ba70f | 04b2d359fa36d9f12e529c255a1fa768acf01281 | /ContractNet/src/mas/onto/Tender.java | 163ba0a521c2b0775e2e0cf63b525635ae1fefde | [] | no_license | predan20/mas-project | b1aa391229db75fac957d1cc976fe778719a1266 | 2fbfa04d37613b6283ee18fff05b4007116b2fdd | refs/heads/master | 2021-01-23T06:19:57.810937 | 2010-04-23T21:47:12 | 2010-04-23T21:47:12 | 38,443,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package mas.onto;
import jade.content.Predicate;
import java.util.List;
public class Tender implements Predicate {
private List<ConfigTender> subtenders = null;
private int totalPrice;
public Tender() {}
public Tender(List<ConfigTender> subtenders) {
this.subtenders = subtenders;
}
public int getTotalPrice() {
if(totalPrice == 0){
for(ConfigTender ct : subtenders){
for(Component component : ct.getComponents()){
totalPrice += component.getPrice() * component.getCount();
}
}
}
return totalPrice;
}
public void setTotalPrice(int totalPrice) {
this.totalPrice = totalPrice;
}
public List<ConfigTender> getSubtenders() {
return subtenders;
}
public void setSubtenders(List<ConfigTender> subtenders) {
this.subtenders = subtenders;
}
}
| [
"alex.pankov@a5adaed8-e0dc-11de-ae3c-8df03fb1c7b4"
] | alex.pankov@a5adaed8-e0dc-11de-ae3c-8df03fb1c7b4 |
ecadf28538cbfa567e41783972dbb9a0fff179fb | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/19/19_638b92702566e7ac3ca9e73a93b0f403bebf0dc7/BaseInterface/19_638b92702566e7ac3ca9e73a93b0f403bebf0dc7_BaseInterface_s.java | d6d4cb01cab11bc9f6c29f401d5b4db328b3ad47 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 973 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.javaloader.blog;
/**
* Base interface to test inheritance detection
*/
public interface BaseInterface {
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
788e41cb11e0fd2dd55eab56209c1064461d91d8 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes5.dex_source_from_JADX/com/facebook/graphql/model/GraphQLEventTicketActionLink__JsonHelper.java | d3121efa1814a7ff1ce5f4829029b07345c084d6 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,773 | java | package com.facebook.graphql.model;
import com.facebook.debug.fieldusage.FieldAccessQueryTracker;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
/* compiled from: image_uri */
public final class GraphQLEventTicketActionLink__JsonHelper {
public static boolean m7292a(GraphQLEventTicketActionLink graphQLEventTicketActionLink, String str, JsonParser jsonParser) {
String str2 = null;
if ("event".equals(str)) {
GraphQLEvent a;
if (jsonParser.g() != JsonToken.VALUE_NULL) {
a = GraphQLEvent__JsonHelper.m7344a(FieldAccessQueryTracker.a(jsonParser, "event"));
}
graphQLEventTicketActionLink.f3670d = a;
FieldAccessQueryTracker.a(jsonParser, graphQLEventTicketActionLink, "event", graphQLEventTicketActionLink.a_, 0, true);
return true;
} else if ("title".equals(str)) {
if (!(jsonParser.g() == JsonToken.VALUE_NULL || jsonParser.g() == JsonToken.VALUE_NULL)) {
str2 = jsonParser.o();
}
graphQLEventTicketActionLink.f3671e = str2;
FieldAccessQueryTracker.a(jsonParser, graphQLEventTicketActionLink, "title", graphQLEventTicketActionLink.B_(), 1, false);
return true;
} else if (!"url".equals(str)) {
return false;
} else {
if (!(jsonParser.g() == JsonToken.VALUE_NULL || jsonParser.g() == JsonToken.VALUE_NULL)) {
str2 = jsonParser.o();
}
graphQLEventTicketActionLink.f3672f = str2;
FieldAccessQueryTracker.a(jsonParser, graphQLEventTicketActionLink, "url", graphQLEventTicketActionLink.B_(), 2, false);
return true;
}
}
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
421b1ce0456e84b8e166591f3a54e457c156df88 | 1a83f3f213dca04890764ac096ba3613f50e5665 | /src/main/java/io/server/game/event/impl/NpcClickEvent.java | c8ba020c25e6604dfcb112de9afb3372638ee3dc | [] | no_license | noveltyps/NewRunityRebelion | 52dfc757d6f784cce4d536c509bcdd6247ae57ef | 6b0e5c0e7330a8a9ee91c691fb150cb1db567457 | refs/heads/master | 2020-05-20T08:44:36.648909 | 2019-05-09T17:23:50 | 2019-05-09T17:23:50 | 185,468,893 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package io.server.game.event.impl;
import io.server.game.event.Event;
import io.server.game.world.entity.mob.npc.Npc;
public class NpcClickEvent implements Event {
private final int type;
private final Npc npc;
public NpcClickEvent(int type, Npc npc) {
this.type = type;
this.npc = npc;
}
public int getType() {
return type;
}
public Npc getNpc() {
return npc;
}
}
| [
"43006455+donvlee97@users.noreply.github.com"
] | 43006455+donvlee97@users.noreply.github.com |
8bc1557bdc6802965d0e1681c8fc00533c60392d | 7e8646dba681e41a0c478b6d0c01dd93e514a99d | /part-II-A/src/IRedBlackTreeDate.java | 6cf1f81f3925653b1d6988823ccfc309b7b374c1 | [] | no_license | ManosTs/project | c9e3cf6013e9b6f1179c83bb990cff59e1b7019f | f48da4fca7b1f6f95b16621f4438437146fa7953 | refs/heads/master | 2023-04-16T21:26:22.971920 | 2021-05-02T09:41:45 | 2021-05-02T09:41:45 | 363,615,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | import java.util.Date;
public interface IRedBlackTreeDate {
void insert(Record data);
void printTree();
void search(Date key);
void modifyVolume(Date key);
void deletion(Date key);
}
| [
"mtsiorbas@gmail.com"
] | mtsiorbas@gmail.com |
2080720e5f5fee2eafb34b6aed88aecc209b9031 | 72ba968fe4501c806d6309a6bc8fc4543de43d74 | /threes/mutantes/generation-1/mutant-0/threes/ThreesController/move_up/COI/239/threes/ThreesController.java | e60f08d1cec4775747efe068139a2f9d8e4f7da4 | [] | no_license | cesarcorne/threes | 010c0ef7e1760531e99be1d331269f35489b17e2 | b7d56d9bdb149292decf7fa6c5d1f30726e445ae | refs/heads/master | 2021-01-01T04:35:22.141150 | 2016-05-20T15:10:12 | 2016-05-20T15:10:12 | 58,375,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,313 | java | package threes;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Map;
public class ThreesController {
//Stores the Threes board
private ThreesBoard board;
//Stores the next tile that will appear in the board.
private int nextTileValue;
//Stores the rows that move during the last movement
private LinkedList<Integer> movedRows;
//Stores the columns that move during the last movement
private LinkedList<Integer> movedColumns;
public ThreesController() {
//Create the initial board.
//9 random tails set with 1, 2 or 3.
board = new ThreesBoard( 9 );
//Set randomly the next tile to appear in the board.
nextTileValue = board.getRandom( 3 ) + 1;
//initially no row or column has been moved.
movedRows = new LinkedList<Integer>();
movedColumns = new LinkedList<Integer>();
}
public ThreesController( ThreesBoard b ) {
this.board = b;
//Set randomly the next tile to appear in the board.
nextTileValue = board.getRandom( 3 ) + 1;
//initially no row or column has been moved.
movedRows = new LinkedList<Integer>();
movedColumns = new LinkedList<Integer>();
}
public ThreesBoard getBoard() {
return board;
}
public int getNextTileValue() {
return nextTileValue;
}
//command move up
public boolean move_up() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_up()) {
return false;
}
boolean modified = false;
for (int j = 0; j < ThreesBoard.COLUMNS; j++) {
//can_combine iff the last two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( 0, j ).isFree() && !board.get_tile( 1, j ).isFree() && !(board.get_tile( 2, j ).isFree() && !board.get_tile( 3, j ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int i = 0;
while (!board.get_tile( i, j ).isFree()) {
i++;
}
for (int k = i + 1; k < ThreesBoard.ROWS; k++) {
if (!board.get_tile( k, j ).isFree()) {
movedColumns.add( j );
}
board.set_tile( k - 1, j, board.get_tile( k, j ).getValue() );
}
board.set_tile( ThreesBoard.ROWS - 1, j, 0 );
//empty the last position
modified = !true;
//fix bug
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int i = 0; i < ThreesBoard.ROWS - 1 && !updated; i++) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i + 1, j ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i + 1, j ) );
board.set_tile( i, j, t.getValue() );
//move anything else up in the same row
for (int k = i + 1; k < ThreesBoard.ROWS - 1; k++) {
board.set_tile( k, j, board.get_tile( k + 1, j ).getValue() );
}
movedColumns.add( j );
board.set_tile( ThreesBoard.ROWS - 1, j, 0 );
//empty the last position
modified = true;
updated = true;
}
}
}
}
loadNextTileOnColumns( true );
return modified;
}
//command move down
public boolean move_down() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_down()) {
return false;
}
boolean modified = false;
for (int j = 0; j < ThreesBoard.COLUMNS; j++) {
//can_combine iff the last two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( 3, j ).isFree() && !board.get_tile( 2, j ).isFree() && !(board.get_tile( 1, j ).isFree() && !board.get_tile( 0, j ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int i = ThreesBoard.ROWS - 1;
while (!board.get_tile( i, j ).isFree()) {
i--;
}
for (int k = i - 1; k >= 0; k--) {
if (!board.get_tile( k, j ).isFree()) {
movedColumns.add( j );
}
board.set_tile( k + 1, j, board.get_tile( k, j ).getValue() );
}
board.set_tile( 0, j, 0 );
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int i = ThreesBoard.ROWS - 1; i > 0 && !updated; i--) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i - 1, j ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i - 1, j ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = i - 2; k >= 0; k--) {
board.set_tile( k + 1, j, board.get_tile( k, j ).getValue() );
}
movedColumns.add( j );
board.set_tile( 0, j, 0 );
//empty the last position
//no actualiza la variable updated lo cual permitiria hacer dos cambios en la misma columna
updated = true;
modified = true;
}
}
}
}
loadNextTileOnColumns( false );
return modified;
}
//command move left
public boolean move_left() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_left()) {
return false;
}
boolean modified = false;
for (int i = 0; i < ThreesBoard.ROWS; i++) {
//can_combine iff the first two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( i, 0 ).isFree() && !board.get_tile( i, 1 ).isFree() && !(board.get_tile( i, 2 ).isFree() && !board.get_tile( i, 3 ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int j = 0;
while (!board.get_tile( i, j ).isFree()) {
j++;
}
for (int k = j + 1; k < ThreesBoard.COLUMNS; k++) {
if (!board.get_tile( i, k ).isFree()) {
movedRows.add( i );
}
board.set_tile( i, k - 1, board.get_tile( i, k ).getValue() );
}
board.set_tile( i, ThreesBoard.COLUMNS - 1, 0 );
//empty the last position
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int j = 0; j < ThreesBoard.COLUMNS - 1 && !updated; j++) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i, j + 1 ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i, j + 1 ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = j + 1; k < ThreesBoard.COLUMNS - 1; k++) {
board.set_tile( i, k, board.get_tile( i, k + 1 ).getValue() );
}
movedRows.add( i );
board.set_tile( i, ThreesBoard.COLUMNS - 1, 0 );
//empty the last position
updated = true;
modified = true;
}
}
}
}
loadNextTileOnRows( true );
return modified;
}
//command move right
public boolean move_right() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_right()) {
return false;
}
boolean modified = false;
for (int i = 0; i < ThreesBoard.ROWS; i++) {
//can_combine iff the first two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( i, 3 ).isFree() && !board.get_tile( i, 2 ).isFree() && !(board.get_tile( i, 1 ).isFree() && !board.get_tile( i, 0 ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int j = ThreesBoard.COLUMNS - 1;
while (!board.get_tile( i, j ).isFree()) {
j--;
}
for (int k = j - 1; k >= 0; k--) {
if (!board.get_tile( i, k ).isFree()) {
movedRows.add( i );
}
board.set_tile( i, k + 1, board.get_tile( i, k ).getValue() );
}
board.set_tile( i, 0, 0 );
//empty the first position
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int j = ThreesBoard.COLUMNS - 1; j > 0 && !updated; j--) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i, j - 1 ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i, j - 1 ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = j - 2; k >= 0; k--) {
board.set_tile( i, k + 1, board.get_tile( i, k ).getValue() );
}
movedRows.add( i );
board.set_tile( i, 0, 0 );
//empty the last position
updated = true;
modified = true;
}
}
}
}
loadNextTileOnRows( false );
return modified;
}
private void loadNextTileOnColumns( boolean up ) {
//Assume an upward or downward was performed.
if (!movedColumns.isEmpty()) {
int pos = board.getRandom( movedColumns.size() );
if (up) {
board.set_tile( ThreesBoard.ROWS - 1, movedColumns.get( pos ), nextTileValue );
} else {
board.set_tile( 0, movedColumns.get( pos ), nextTileValue );
}
nextTileValue = board.getRandom( 3 ) + 1;
}
}
private void loadNextTileOnRows( boolean left ) {
//Assume an upward or downward was performed.
if (!movedRows.isEmpty()) {
int pos = board.getRandom( movedRows.size() );
if (left) {
board.set_tile( movedRows.get( pos ), ThreesBoard.COLUMNS - 1, nextTileValue );
} else {
board.set_tile( movedRows.get( pos ), 0, nextTileValue );
}
nextTileValue = board.getRandom( 3 ) + 1;
}
}
/* For mocking: */
private ISaveManager savemanager;
public void setSaveManager( ISaveManager m ) {
savemanager = m;
}
public boolean saveGame( String folderName, String fileName ) {
try {
if (savemanager.setFolder( folderName ) && !fileName.contains( "." )) {
java.lang.String fileNameExt = fileName + ".ths";
return savemanager.saveToFile( board, nextTileValue, fileNameExt );
}
} catch ( IOException e ) {
System.out.println( "Save failed!" );
}
return false;
}
public boolean loadGame( String folderName, String fileName ) {
try {
if (savemanager.setFolder( folderName ) && fileName.endsWith( ".ths" )) {
java.util.Map.Entry<ThreesBoard, Integer> res = savemanager.loadFromFile( fileName );
if (res != null) {
board = res.getKey();
nextTileValue = res.getValue();
}
}
} catch ( IOException e ) {
System.out.println( "Save failed!" );
}
return false;
}
}
| [
"cesarmcornejo@gmail.com"
] | cesarmcornejo@gmail.com |
02f10acfaa4544f09140b10ac49ae727173531de | 8b29767fe7b4fe845edb788da9a0934376e28f5f | /Obstacle.java | 82fce0fafcee09c5874807929d691df4282e85b0 | [] | no_license | cyvanoort/Flood-Control-2015 | 68dd4d2c244e934859e850a6b011efd71bbfdc76 | c2b619a57c7fa9c07859acf9c9f54a3ed9edb907 | refs/heads/master | 2020-04-06T08:36:25.300400 | 2014-03-28T09:56:46 | 2014-03-28T09:56:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class Obstacle extends Game3
{
private int snelheid;
public static int speed = -4;
public void act()
{
drive();
}
public void drive()
{move(snelheid);
}
public void setSnelheid(int x)
{ snelheid = x;
}
public int getSnelheid()
{ return snelheid;
}
}
| [
"cyvan@live.nl"
] | cyvan@live.nl |
1a36c8581b043c6410581e31f380fba23bf223c1 | 220f30c1619d3c0eae10ecb6b721dfb13b18bc23 | /app/src/main/java/com/cuileikun/androidbase/javaactivity/twenty/day20_DiGui/DiGuiDemo.java | 1e91bc33dbf692a2b7b09263e5e118af212a5347 | [] | no_license | cuileikun/AndroidBase | d07d484b7c84e3538baeb9bf9a58c063788fb7ea | 376e8f6f6d2b34c70167ea788dd67013db2cb306 | refs/heads/master | 2021-01-20T00:56:20.937349 | 2017-07-03T13:48:05 | 2017-07-03T13:48:05 | 89,213,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,603 | java | package com.cuileikun.androidbase.javaactivity.twenty.day20_DiGui;
/*
* 递归:方法定义中调用方法本身的现象
*
* 方法的嵌套调用,这不是递归。
* Math.max(Math.max(a,b),c);
*
* public void show(int n) {
* if(n <= 0) {
* System.exit(0);
* }
* System.out.println(n);
* show(--n);
* }
*
* 注意事项:
* A:递归一定要有出口,否则就是死递归
* B:递归的次数不能太多,否则就内存溢出
* C:构造方法不能递归使用
*
* 举例:
* A:从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚在给小和尚讲故事,故事是:
* 从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚在给小和尚讲故事,故事是:
* 从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚在给小和尚讲故事,故事是:
* 从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚在给小和尚讲故事,故事是:
* ...
* 庙挂了,或者山崩了
* B:学编程 -- 高薪就业 -- 挣钱 -- 娶媳妇 -- 生娃娃 -- 放羊 -- 挣学费
* 学编程 -- 高薪就业 -- 挣钱 -- 娶媳妇 -- 生娃娃 -- 放羊 -- 挣学费
* 学编程 -- 高薪就业 -- 挣钱 -- 娶媳妇 -- 生娃娃 -- 放羊 -- 挣学费
* 学编程 -- 高薪就业 -- 挣钱 -- 娶媳妇 -- 生娃娃 -- 放羊 -- 挣学费
* ...
* 娶不到媳妇或者生不了娃娃
*/
public class DiGuiDemo {
// public DiGuiDemo() {
// DiGuiDemo();
// }
}
| [
"583271702@qq.com"
] | 583271702@qq.com |
b45ab88e286c3f210c3411fb173d4c2e914e99ca | d0aca62ae8d4dc0aa22a9c7923d62bc10ae3c25f | /src/SpaceInvade/com/SpaceInvaders.java | ca81621dd9920ced324bf5f9ab96354821e3a268 | [] | no_license | okbarton/tictac | 98c429b167251b6fafebcbc7941565e59e4c339e | 0d404b7c36ec19ae77b6c72a6743cc66fe9feaed | refs/heads/master | 2020-12-30T06:52:55.807159 | 2020-06-19T02:11:21 | 2020-06-19T02:11:21 | 238,899,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package SpaceInvade.com;
import java.awt.EventQueue;
import javax.swing.JFrame;
public class SpaceInvaders extends JFrame {
public SpaceInvaders() {
initUI();
}
private void initUI() {
add(new Board());
setTitle("Space Invaders");
setSize(Commons.BOARD_WIDTH, Commons.BOARD_HEIGHT);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);
setLocationRelativeTo(null);
}
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
var ex = new SpaceInvaders();
ex.setVisible(true);
});
}
}
| [
"ingramkieran45@gmail.com"
] | ingramkieran45@gmail.com |
2f25e22f6e763faec2d275b5fc5281a8a31cc6a5 | 78c1564a351e35bad1abae4189ebcbb17c23d986 | /common/src/main/java/org/linfa/micro/common/msg/BaseResponse.java | 7a2fdee17916e23456c57521bf556f325a7e6c91 | [] | no_license | orglinfa/micro-security | 50a354e648aeb032686c8f32f9582fb109343fbe | c5e9f9aaf7ee16445be7ab39cffca96019a9de0f | refs/heads/master | 2020-03-16T20:54:23.532736 | 2018-05-11T02:23:41 | 2018-05-11T02:24:16 | 132,977,004 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | package org.linfa.micro.common.msg;
public class BaseResponse {
private int status = 200;
private String message;
public BaseResponse(int status, String message) {
this.status = status;
this.message = message;
}
public BaseResponse() {
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
| [
"lingfeian@aliyun.com"
] | lingfeian@aliyun.com |
c9915e29d052df8f5d775a0f64f695b51a0c410c | 12d02f6c5d5949941a6be39132495d59a4376de1 | /src/kh/com/a/dao/OrderDao.java | e1d611a429da5de88cc854695e130f68d1412c9b | [] | no_license | seongjincho/ikeyo | f0fc529cdb99548f394739c26b85f072a983812a | d91ea311a10b7010dd34a19fa421e62ad31e3cf0 | refs/heads/master | 2023-02-28T05:42:02.875205 | 2022-08-07T06:32:31 | 2022-08-07T06:32:31 | 189,535,095 | 0 | 0 | null | 2023-02-22T07:28:19 | 2019-05-31T05:49:08 | Java | UTF-8 | Java | false | false | 1,042 | java | package kh.com.a.dao;
import java.util.List;
import kh.com.a.model.CartDto;
import kh.com.a.model.Order_Dto;
import kh.com.a.model.Order_Sub_Dto;
import kh.com.a.model.ProductDto;
public interface OrderDao {
// 하나만 주문
public List<CartDto> oneOrderlist(int seq);
// p리스트
public List<ProductDto> orderpList();
// 선택 주문
int twoOrderlist(int seqq)throws Exception;
public CartDto getOrder(int seq);
// 주문정보
public void order(Order_Dto dto)throws Exception;
// 주문상세
public void orderdetail(Order_Sub_Dto sdto)throws Exception;
// 카트비우기
public void cartdelete(int sseq)throws Exception;
// 인벤토리 재고 내려주기
public boolean minusCountInven(Order_Sub_Dto sdto);
// 결제정보
// public List<Order_Dto> paymentlist(String id) throws Exception;
public List<Order_Dto> paymentlistto(String order_num) throws Exception;
// 결제완료 : deli_info -> 1 변경
public boolean dellinfo(int ord_seq);
}
| [
"jasonyp@daum.net"
] | jasonyp@daum.net |
e6195c4887b95bdc7ccbd7974d0560bf4cdfcb30 | 6fbcc1482880f94fd9cffaf680d963910290a1ec | /uitest/src/com/vaadin/tests/components/combobox/ComboBoxLargeIconsTest.java | 407ab7aa048ab38ab10a97a8d82841beba6251c6 | [
"Apache-2.0"
] | permissive | allanim/vaadin | 4cf4c6b51cd81cbcb265cdb0897aad92689aec04 | b7f9b2316bff98bc7d37c959fa6913294d9608e4 | refs/heads/master | 2021-01-17T10:17:00.920299 | 2015-09-04T02:40:29 | 2015-09-04T02:40:29 | 28,844,118 | 2 | 0 | Apache-2.0 | 2020-01-26T02:24:48 | 2015-01-06T03:04:44 | Java | UTF-8 | Java | false | false | 2,044 | java | package com.vaadin.tests.components.combobox;
import org.junit.Test;
import org.openqa.selenium.Keys;
import org.openqa.selenium.interactions.Actions;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.NativeSelectElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
import com.vaadin.tests.tb3.newelements.ComboBoxElement;
public class ComboBoxLargeIconsTest extends MultiBrowserTest {
@Override
protected Class<?> getUIClass() {
return com.vaadin.tests.components.combobox.Comboboxes.class;
}
@Test
public void testComboBoxIcons() throws Exception {
openTestURL();
NativeSelectElement iconSelect = $(NativeSelectElement.class).first();
iconSelect.selectByText("16x16");
ComboBoxElement cb = $(ComboBoxElement.class).caption(
"Undefined wide select with 50 items").first();
cb.openPopup();
compareScreen("icons-16x16-page1");
cb.openNextPage();
compareScreen("icons-16x16-page2");
cb.findElement(By.vaadin("#popup/item0")).click();
compareScreen("icons-16x16-selected-1-3-5-9");
iconSelect.selectByText("32x32");
cb.openPopup();
compareScreen("icons-32x32-page2");
// Closes the popup
cb.openPopup();
iconSelect.selectByText("64x64");
ComboBoxElement pageLength0cb = $(ComboBoxElement.class).caption(
"Pagelength 0").first();
pageLength0cb.openPopup();
pageLength0cb.findElement(By.vaadin("#popup/item1")).click();
ComboBoxElement cb200px = $(ComboBoxElement.class).caption(
"200px wide select with 50 items").first();
cb200px.openPopup();
cb200px.findElement(By.vaadin("#popup/item1")).click();
ComboBoxElement cb150px = $(ComboBoxElement.class).caption(
"150px wide select with 5 items").first();
new Actions(driver).sendKeys(cb150px, Keys.DOWN).perform();
compareScreen("icons-64x64-page1-highlight-first");
}
}
| [
"review@vaadin.com"
] | review@vaadin.com |
b9d542d55160379c30ef2f7f9e701e91b91bb648 | d16f17f3b9d0aa12c240d01902a41adba20fad12 | /src/leetcode/leetcode13xx/leetcode1310/Solution.java | 319747df2cb5c50a52fa1afbb4c5c6f36fa44abd | [] | no_license | redsun9/leetcode | 79f9293b88723d2fd123d9e10977b685d19b2505 | 67d6c16a1b4098277af458849d352b47410518ee | refs/heads/master | 2023-06-23T19:37:42.719681 | 2023-06-09T21:11:39 | 2023-06-09T21:11:39 | 242,967,296 | 38 | 3 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package leetcode.leetcode13xx.leetcode1310;
public class Solution {
public int[] xorQueries(int[] arr, int[][] queries) {
for (int i = 1; i < arr.length; i++) {
arr[i] ^= arr[i - 1];
}
int[] ans = new int[queries.length];
for (int i = 0; i < queries.length; i++) {
if (queries[i][0] != 0) ans[i] = arr[queries[i][0] - 1] ^ arr[queries[i][1]];
else ans[i] = arr[queries[i][1]];
}
return ans;
}
}
| [
"mokeev.vladimir@gmail.com"
] | mokeev.vladimir@gmail.com |
56a9407e720dd77fcfcc9e1e3554d573566fdf6f | d780010fdf0263f6355358823d2ee4db91760206 | /final/src/update.java | 0191b81fbfe834bac78e834f8c21b928776b6248 | [] | no_license | Acid23/jobportalmanagement | a0a94482ceb1fd3d33e7031b588e432ab7e294a8 | 012b2a9d660f8dc881ed33bff4092229a0afd347 | refs/heads/master | 2020-07-25T18:27:19.406507 | 2019-09-27T13:05:19 | 2019-09-27T13:05:19 | 208,385,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class update {
public static void main(String[] args) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
// TODO Auto-generated method stub
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","asif08");
Statement statement = connection.createStatement();
double update = statement.executeUpdate("UPDATE register SET 'username' = 'baba' WHERE 'username' = aba'");
System.out.println(update+"Updated Succesfully");
}catch(SQLException e) {
e.printStackTrace();
}
}
}
| [
"mdasifbaba23@gmail.com"
] | mdasifbaba23@gmail.com |
740f6dc39ddf317a7cad7d1dc230d01902810c60 | 933502518fb37f1c16c89210274deeef31b91949 | /src/main/java/servlet/CustomerServlet.java | c1ec76e17a13af231a9ffdf9a317370ea8af2268 | [] | no_license | IrinaMuimarova/web4 | 7d2a8ce51aedb0f0ee1fe62b4c2b4a45ce3ec3f9 | 5908fd8a3a1081a2fb9dd8b96bbc421953bee299 | refs/heads/master | 2022-08-01T02:07:45.451278 | 2019-12-19T15:23:42 | 2019-12-19T15:23:42 | 229,029,917 | 0 | 0 | null | 2022-07-07T22:12:03 | 2019-12-19T10:22:30 | Java | UTF-8 | Java | false | false | 1,091 | java | package servlet;
import com.google.gson.Gson;
import model.Car;
import service.CarService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
public class CustomerServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Gson gson = new Gson();
String json = gson.toJson(CarService.getInstance().getAllCars());
resp.getWriter().write(json);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
CarService.getInstance().sellCar(req.getParameter("brand")
, req.getParameter("model")
, req.getParameter("licensePlate"));
resp.setStatus(200);
} catch (SQLException e) {
resp.setStatus(403);
}
}
}
| [
"mui.irisa@gmail.ru"
] | mui.irisa@gmail.ru |
8a85926ec582af20a517e752658470ea594cc838 | e9d64b479a6800f5b7c6b2ff34377c083d767fde | /src/main/java/hwp/sqlte/Id.java | 33fecdd67763fbf4f50a34ffb16416adfeb6b191 | [] | no_license | hewuping/sqlte | 89bffd7b6b70640dcdcf8c24095e0acf55e128dd | 285db2453664fa85c6b5635522d62f8079470b78 | refs/heads/master | 2023-04-17T21:26:34.480681 | 2023-04-10T09:50:23 | 2023-04-10T09:50:23 | 81,050,404 | 3 | 1 | null | 2018-11-02T10:08:09 | 2017-02-06T05:16:34 | Java | UTF-8 | Java | false | false | 428 | java | package hwp.sqlte;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
/**
* @author Zero
* Created by Zero on 2017/8/13 0013.
*/
@Documented
@Target({FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Id {
boolean generate() default false;
}
| [
"897457487@qq.com"
] | 897457487@qq.com |
cb503dff3db94aee39194aef3d2eff92882bbb83 | 6590f0de2fd9fd23c9bae21913d26f78b0d9c433 | /shadowsocks-java-common/src/main/java/com/shadowsocks/common/encryption/impl/BlowFishCrypt.java | 38f7873ec0c0db1e414ea23aa64303ab5e774da7 | [
"MIT"
] | permissive | iceflag/shadowsocks-java | f424775f48b52fba5ba6069b38ac6129be1e5102 | 80cbb1cc774b1d273c6b71b8a5d45b040e6e2826 | refs/heads/master | 2020-03-10T16:23:24.899127 | 2018-04-12T15:42:19 | 2018-04-12T15:42:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,049 | java | package com.shadowsocks.common.encryption.impl;
import com.shadowsocks.common.encryption.CryptBase;
import org.bouncycastle.crypto.StreamBlockCipher;
import org.bouncycastle.crypto.engines.BlowfishEngine;
import org.bouncycastle.crypto.modes.CFBBlockCipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.ByteArrayOutputStream;
import java.security.InvalidAlgorithmParameterException;
import java.util.HashMap;
import java.util.Map;
/**
* Blow fish cipher implementation
*/
public class BlowFishCrypt extends CryptBase {
public final static String CIPHER_BLOWFISH_CFB = "bf-cfb";
public static Map<String, String> getCiphers() {
Map<String, String> ciphers = new HashMap<>();
ciphers.put(CIPHER_BLOWFISH_CFB, BlowFishCrypt.class.getName());
return ciphers;
}
public BlowFishCrypt(String name, String password) {
super(name, password);
}
@Override
public int getKeyLength() {
return 16;
}
@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
BlowfishEngine engine = new BlowfishEngine();
StreamBlockCipher cipher;
if (_name.equals(CIPHER_BLOWFISH_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else {
throw new InvalidAlgorithmParameterException(_name);
}
return cipher;
}
@Override
public int getIVLength() {
return 8;
}
@Override
protected SecretKey getKey() {
return new SecretKeySpec(_ssKey.getEncoded(), "AES");
}
@Override
protected void _encrypt(byte[] data, ByteArrayOutputStream stream) {
int noBytesProcessed;
byte[] buffer = new byte[data.length];
noBytesProcessed = encCipher.processBytes(data, 0, data.length, buffer, 0);
stream.write(buffer, 0, noBytesProcessed);
}
@Override
protected void _decrypt(byte[] data, ByteArrayOutputStream stream) {
int noBytesProcessed;
byte[] buffer = new byte[data.length];
noBytesProcessed = decCipher.processBytes(data, 0, data.length, buffer, 0);
stream.write(buffer, 0, noBytesProcessed);
}
}
| [
"0haizhu0@gmail.com"
] | 0haizhu0@gmail.com |
8e1f76de5033dcbe0e1d6492997cadf199e42d43 | 2a679e1fcf931961ffd7541bcac7797c77aa39f1 | /wf-iot-common/src/main/java/com/warpfuture/util/PageUtils.java | 743058065cb54ede4755a981daa2339e7a9cbb45 | [] | no_license | kmmao/wf-iot | a1163892d1e6038d72d6412c3e557bfc0a2d8160 | f9a5592bdc533030e062940eb439b99a2367817c | refs/heads/master | 2021-09-24T09:44:44.740167 | 2018-10-07T15:15:05 | 2018-10-07T15:15:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,886 | java | package com.warpfuture.util;
import com.warpfuture.constant.PageConstant;
import com.warpfuture.entity.HistoryDataPageModel;
import com.warpfuture.entity.PageModel;
/** Created by fido on 2018/4/19. 分页工具 */
public class PageUtils {
/**
* 用于计算mongodb分页时跳过的数据数量
*
* @param pageIndex
* @param pageSize
* @return
*/
public static Integer getSkip(Integer pageIndex, Integer pageSize) {
return (pageIndex - 1) * pageSize;
}
/**
* 设置页码请求极限值,防止错误页码
*
* @param pageModel
* @return
*/
public static PageModel dealPage(PageModel pageModel) {
if (pageModel != null) {
Integer pageIndex = pageModel.getPageIndex();
Integer pageSize = pageModel.getPageSize();
if (pageIndex < 1) {
pageModel.setPageIndex(1);
}
if (pageSize < PageConstant.MIN_PAGE_SIZE || pageSize > PageConstant.MAX_PAGE_SIZE) {
pageModel.setPageSize(PageConstant.APPLICATION_DEFAULT_PAGE_SIZE);
}
Integer rowCount = pageModel.getRowCount();
if (rowCount != null) {
Integer maxPageIndex = Integer.valueOf(String.valueOf(Math.ceil(rowCount / pageSize)));
if (pageIndex > maxPageIndex) {
pageModel.setPageIndex(maxPageIndex);
}
}
} else {
pageModel = new PageModel();
pageModel.setPageIndex(1);
pageModel.setPageSize(PageConstant.APPLICATION_DEFAULT_PAGE_SIZE);
}
return pageModel;
}
public static PageModel dealPage(Integer pageSize, Integer pageIndex, Integer defaultPageSize) {
PageModel pageModel = new PageModel();
if (pageSize != null && pageIndex != null) {
if (pageIndex < 1) {
pageModel.setPageIndex(1);
} else {
pageModel.setPageIndex(pageIndex);
}
if (pageSize < PageConstant.MIN_PAGE_SIZE || pageSize > PageConstant.MAX_PAGE_SIZE) {
pageModel.setPageSize(defaultPageSize);
} else {
pageModel.setPageSize(pageSize);
}
} else {
pageModel.setPageIndex(1);
pageModel.setPageSize(defaultPageSize);
}
return pageModel;
}
public static PageModel dealOverPage(Integer pageIndex, Integer pageSize, Integer rowCount) {
PageModel pageModel = new PageModel();
pageModel.setPageSize(pageSize);
pageModel.setRowCount(rowCount);
pageModel.setPageIndex(pageIndex);
if (pageIndex < 1) {
pageModel.setPageIndex(1);
}
if (pageSize < PageConstant.MIN_PAGE_SIZE || pageSize > PageConstant.MAX_PAGE_SIZE) {
pageModel.setPageSize(PageConstant.APPLICATION_DEFAULT_PAGE_SIZE);
}
if (rowCount != null) {
Integer maxPageIndex = 0;
if (rowCount % pageSize == 0) {
maxPageIndex = rowCount / pageSize;
} else maxPageIndex = (rowCount / pageSize) + 1;
if (pageIndex > maxPageIndex) {
pageModel.setPageIndex(maxPageIndex);
}
}
pageModel.setSkip(PageUtils.getSkip(pageModel.getPageIndex(), pageModel.getPageSize()));
return pageModel;
}
public static HistoryDataPageModel dealOverPage(
Integer pageIndex, Integer pageSize, Long rowCount) {
HistoryDataPageModel pageModel = new HistoryDataPageModel();
pageModel.setPageSize(pageSize);
pageModel.setRowCount(rowCount);
pageModel.setPageIndex(pageIndex);
if (pageIndex < 1) {
pageModel.setPageIndex(1);
}
if (pageSize < PageConstant.MIN_PAGE_SIZE || pageSize > PageConstant.MAX_PAGE_SIZE) {
pageModel.setPageSize(PageConstant.APPLICATION_DEFAULT_PAGE_SIZE);
}
if (rowCount != null) {
Integer maxPageIndex = (int) Math.ceil(rowCount / pageSize);
if (pageIndex > maxPageIndex) {
pageModel.setPageIndex(maxPageIndex);
}
}
pageModel.setSkip(PageUtils.getSkip(pageModel.getPageIndex(), pageModel.getPageSize()));
return pageModel;
}
}
| [
"xhhscau2015@163.com"
] | xhhscau2015@163.com |
d689c02cf98f1fbd53137c40f5c8d78d2f9cbb88 | cb8675e86443334a519fddfd5c976c7f5db04de8 | /core/src/com/microbasic/sm/part2/DepthMapShader.java | 7a7f90842e2825070c8ca20dc67f8399e5552e66 | [] | no_license | mumeka/shadow-mapping | 065700113080f2a9166bf928c24cf30f23270bcb | 030f14783b6a72adc3fdf0437b164634a60aad17 | refs/heads/master | 2021-01-17T09:09:35.943375 | 2015-07-07T17:15:32 | 2015-07-07T17:15:32 | 38,611,455 | 0 | 0 | null | 2015-07-06T10:08:05 | 2015-07-06T10:08:05 | null | UTF-8 | Java | false | false | 2,105 | java | package com.microbasic.sm.part2;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g3d.Attributes;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.Shader;
import com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute;
import com.badlogic.gdx.graphics.g3d.shaders.BaseShader;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.Inputs;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.Setters;
import com.badlogic.gdx.graphics.g3d.utils.RenderContext;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
public class DepthMapShader extends BaseShader
{
public Renderable renderable;
@Override
public void end()
{
super.end();
}
public DepthMapShader(final Renderable renderable, final ShaderProgram shaderProgramModelBorder)
{
this.renderable = renderable;
this.program = shaderProgramModelBorder;
register(Inputs.worldTrans, Setters.worldTrans);
register(Inputs.projViewTrans, Setters.projViewTrans);
register(Inputs.normalMatrix, Setters.normalMatrix);
}
@Override
public void begin(final Camera camera, final RenderContext context)
{
super.begin(camera, context);
context.setDepthTest(GL20.GL_LEQUAL);
context.setCullFace(GL20.GL_BACK);
}
@Override
public void render(final Renderable renderable)
{
if (!renderable.material.has(BlendingAttribute.Type))
{
context.setBlending(false, GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
else
{
context.setBlending(true, GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
super.render(renderable);
}
@Override
public void init()
{
final ShaderProgram program = this.program;
this.program = null;
init(program, renderable);
renderable = null;
}
@Override
public int compareTo(final Shader other)
{
return 0;
}
@Override
public boolean canRender(final Renderable instance)
{
return true;
}
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes)
{
super.render(renderable, combinedAttributes);
}
}
| [
"haedri@gmail.com"
] | haedri@gmail.com |
2bef6ecc635468f7b7af6a3352289baaf54f818d | ef2aaf0c359a9487f269d792c53472e4b41689a6 | /documentation/design/essn/SubjectRegistry/edu/duke/cabig/c3pr/webservice/iso21090/TELEmail.java | 4db9843cf8d79b61f74bba650e221172bc1d8e50 | [] | no_license | NCIP/c3pr-docs | eec40451ac30fb5fee55bb2d22c10c6ae400845e | 5adca8c04fcb47adecbb4c045be98fcced6ceaee | refs/heads/master | 2016-09-05T22:56:44.805679 | 2013-03-08T19:59:03 | 2013-03-08T19:59:03 | 7,276,330 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java |
package edu.duke.cabig.c3pr.webservice.iso21090;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for TEL.Email complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="TEL.Email">
* <complexContent>
* <restriction base="{uri:iso.org:21090}TEL.Person">
* <sequence>
* <element name="useablePeriod" type="{uri:iso.org:21090}QSET_TS" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TEL.Email")
public class TELEmail
extends TELPerson
{
}
| [
"kruttikagarwal@gmail.com"
] | kruttikagarwal@gmail.com |
02ffa5953cc9a2f742c2548caac520d69886519c | 450ba3d5fd973a8e0fb95be6eff9e728d27c1921 | /redis/src/main/java/com/redis/RedisJava.java | 31fdf90ec4b95b03f29c7a5b070b43e9435bc3da | [] | no_license | wdfwolf3/Program | 642e20d9ad0fba73fab9556a4bbdcf463f9a775e | b3bbc4f01d2273bd111da74aa6b2ae96c588f6f1 | refs/heads/master | 2021-03-16T05:40:35.036392 | 2017-10-31T06:25:26 | 2017-10-31T06:25:26 | 91,561,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package com.redis;
import redis.clients.jedis.Jedis;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class RedisJava {
public static void main(String[] args) {
//连接本地的 Redis 服务
Jedis jedis = new Jedis("localhost");
System.out.println("连接成功");
//查看服务是否运行
System.out.println("服务正在运行: " + jedis.ping());
jedis.set("runoobkey", "www.runoob.com");
// 获取存储的数据并输出
System.out.println("redis 存储的字符串为: " + jedis.get("runoobkey"));
//存储数据到列表中
jedis.lpush("site-list", "Runoob");
jedis.lpush("site-list", "Google");
jedis.lpush("site-list", "Taobao");
// 获取存储的数据并输出
List<String> list = jedis.lrange("site-list", 0, 2);
for (int i = 0; i < list.size(); i++) {
System.out.println("列表项为: " + list.get(i));
}
// 获取数据并输出
Set<String> keys = jedis.keys("*");
Iterator<String> it = keys.iterator();
while (it.hasNext()) {
String key = it.next();
System.out.println(key);
}
}
}
| [
"fwolff@vip.qq.com"
] | fwolff@vip.qq.com |
25dd16bb4d1196eec99c9dc7cb7508e5e2458369 | b2b0b3abcecde74006301d78f65d76709337a93f | /java-core/src/main/java/cn/van/kuang/java/core/thread/ThreadExecutor.java | 6f53d3d3ddd06a7ae7e2e01771c7c59d4fe010ef | [] | no_license | VanKuang/java-in-action | a124a43520e25f780281f605bece1278975ac9a7 | 04e4aad8522ef4d6e412a6ee77b32c65d17cebe1 | refs/heads/master | 2022-12-20T18:07:29.163087 | 2021-01-20T23:26:27 | 2021-06-27T01:46:09 | 60,387,728 | 9 | 3 | null | 2022-12-14T20:44:56 | 2016-06-04T01:42:33 | Java | UTF-8 | Java | false | false | 3,319 | java | package cn.van.kuang.java.core.thread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
public class ThreadExecutor {
private final static Logger logger = LoggerFactory.getLogger(ThreadExecutor.class);
private void tryGetResultFromThread() throws ExecutionException, InterruptedException {
ExecutorService executorService = Executors.newSingleThreadExecutor();
Future<String> future = executorService.submit(() -> "Hi");
logger.info(future.get());
executorService.shutdown();
}
private void tryCancelRunningThread() {
ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
ScheduledFuture<?> schedule = scheduledExecutorService.schedule(
(Runnable) () -> logger.info("DONE"),
2,
TimeUnit.SECONDS);
try {
Thread.sleep(1000L);
} catch (InterruptedException ignored) {
}
logger.info("{}", schedule.isDone());
if (!schedule.isDone()) {
schedule.cancel(true);
logger.info("Cancelled");
}
scheduledExecutorService.shutdown();
}
private void tryHandleTonsOfTasksWithLimitedThreadPool() throws ExecutionException, InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(5);
List<Future> futures = new ArrayList<>();
List<Runnable> tasks = collectTasks();
for (Runnable task : tasks) {
futures.add(executorService.submit(task));
logger.info("Submitted Task");
}
for (Future future : futures) {
future.get();
}
executorService.shutdown();
}
private List<Runnable> collectTasks() {
List<Runnable> tasks = new ArrayList<>();
for (int i = 0; i < 100; i++) {
final int count = i;
tasks.add(() -> {
try {
Thread.sleep(1000L);
} catch (InterruptedException ignored) {
}
logger.info("Task{} Done", count);
});
}
return tasks;
}
private void tryThreadLocal() {
final ThreadLocal<Long> threadLocal = new ThreadLocal<>();
ExecutorService executorService = Executors.newSingleThreadExecutor();
int count = 0;
while (count < 10) {
executorService.submit((Runnable) () -> {
logger.info("Inside threadlocal: {}", threadLocal.get());
Long aLong = System.nanoTime();
logger.info("Set {} to threadlocal", aLong);
threadLocal.set(aLong);
try {
Thread.sleep(1000L);
} catch (InterruptedException ignored) {
}
});
count++;
}
}
public static void main(String[] args) throws Exception {
ThreadExecutor threadExecutor = new ThreadExecutor();
threadExecutor.tryGetResultFromThread();
threadExecutor.tryCancelRunningThread();
threadExecutor.tryHandleTonsOfTasksWithLimitedThreadPool();
threadExecutor.tryThreadLocal();
}
}
| [
"vanchee@qq.com"
] | vanchee@qq.com |
28ca16ad965b714d8774d8162da844368239a2f5 | 7e6774d5c0f8513203eb952fe7c3856058607635 | /src/main/java/com/codegym/model/MusicForm.java | 6c2b940a79ee00d7ba9dd75fbc47d1169cf132a0 | [] | no_license | ngnganh2207/Module4.Bai5.BT.XayDungUngDungNgheNhacDonGian | 3f38906fba7c364a30f75a8a1e87c958f8ff1997 | 549702594a56000df079f6855292da7cb908b97c | refs/heads/master | 2023-08-05T01:36:49.283007 | 2021-09-21T01:35:39 | 2021-09-21T01:35:39 | 408,653,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,264 | java | package com.codegym.model;
import org.springframework.web.multipart.MultipartFile;
public class MusicForm {
private Long id;
private String nameMusic;
private String author;
private String category;
private MultipartFile music;
public MusicForm() {
}
public MusicForm(Long id, String nameMusic, String author, String category, MultipartFile music) {
this.id = id;
this.nameMusic = nameMusic;
this.author = author;
this.category = category;
this.music = music;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNameMusic() {
return nameMusic;
}
public void setNameMusic(String nameMusic) {
this.nameMusic = nameMusic;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public MultipartFile getMusic() {
return music;
}
public void setMusic(MultipartFile music) {
this.music = music;
}
}
| [
"ngocanhnguyen2207@gmail.com"
] | ngocanhnguyen2207@gmail.com |
26948984df709e87e850e0c1ee31fe6206286a1a | 333ade37fa73f481dbabde1bbc6e84db2909aa75 | /nqs-common/src/main/java/com/acsno/common/service/impl/ProbeUpgradePackageServiceImpl.java | 1df947604190f63a67a90254e7e6767dc619fcb7 | [] | no_license | sunjiyongtc0/cloud-nqs-web | 3eeba476c615a2513833396d30d37f908546fa47 | 1fd93ea34089114b9a160224e38bc71782c45150 | refs/heads/master | 2023-01-31T14:12:25.374502 | 2020-12-04T06:34:39 | 2020-12-04T06:34:39 | 304,198,315 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 952 | java |
package com.acsno.common.service.impl;
import com.acsno.common.dao.ProbeUpgradePackageDao;
import com.acsno.common.entity.ProbeUpgradePackageEntity;
import com.acsno.common.service.ProbeUpgradePackageService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 探针升级包
*
*/
@Service("ProbeUpgradePackageService")
public class ProbeUpgradePackageServiceImpl extends ServiceImpl<ProbeUpgradePackageDao, ProbeUpgradePackageEntity> implements ProbeUpgradePackageService {
public IPage<ProbeUpgradePackageEntity> findByPageService(Page<ProbeUpgradePackageEntity> page, QueryWrapper<ProbeUpgradePackageEntity> wrapper){
return baseMapper.findPage(page,wrapper);
}
}
| [
"315541219@qq.com"
] | 315541219@qq.com |
84a2a77ddea91afa52eb39edfd68a5b661e0ec52 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/facebook/ads/internal/view/C3377i.java | 13151e96bfc1ffa166c31a5fea26efc5c1b4aba7 | [] | 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 | 6,564 | java | package com.facebook.ads.internal.view;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.widget.RelativeLayout.LayoutParams;
import com.facebook.ads.AudienceNetworkActivity;
import com.facebook.ads.internal.adapters.C1352b;
import com.facebook.ads.internal.adapters.C3272q;
import com.facebook.ads.internal.adapters.C3273r;
import com.facebook.ads.internal.p034a.C1348a;
import com.facebook.ads.internal.p034a.C1349b;
import com.facebook.ads.internal.p041h.C1425f;
import com.facebook.ads.internal.p041h.C3288g;
import com.facebook.ads.internal.p047k.C1481b;
import com.facebook.ads.internal.p047k.C1481b.C1479a;
import com.facebook.ads.internal.p047k.C1482c;
import com.facebook.ads.internal.p047k.C1490h;
import com.facebook.ads.internal.p047k.C1491i;
import com.facebook.ads.internal.view.C1604d.C1603a;
import com.facebook.ads.internal.view.C3365c.C1560b;
import java.util.HashMap;
import java.util.Map;
/* renamed from: com.facebook.ads.internal.view.i */
public class C3377i implements C1604d {
/* renamed from: a */
private static final String f10265a = "i";
/* renamed from: b */
private final C1603a f10266b;
/* renamed from: c */
private final C3365c f10267c;
/* renamed from: d */
private final C3273r f10268d;
/* renamed from: e */
private C3272q f10269e;
/* renamed from: f */
private long f10270f = System.currentTimeMillis();
/* renamed from: g */
private long f10271g;
/* renamed from: h */
private C1479a f10272h;
/* renamed from: com.facebook.ads.internal.view.i$2 */
class C33762 extends C1352b {
/* renamed from: a */
final /* synthetic */ C3377i f10264a;
C33762(C3377i c3377i) {
this.f10264a = c3377i;
}
/* renamed from: d */
public void mo1683d() {
this.f10264a.f10266b.mo1646a("com.facebook.ads.interstitial.impression.logged");
}
}
public C3377i(final AudienceNetworkActivity audienceNetworkActivity, final C1425f c1425f, C1603a c1603a) {
this.f10266b = c1603a;
this.f10267c = new C3365c(audienceNetworkActivity, new C1560b(this) {
/* renamed from: c */
final /* synthetic */ C3377i f10262c;
/* renamed from: d */
private long f10263d = 0;
/* renamed from: a */
public void mo1651a() {
this.f10262c.f10268d.m12585b();
}
/* renamed from: a */
public void mo1652a(int i) {
}
/* renamed from: a */
public void mo1653a(String str, Map<String, String> map) {
Uri parse = Uri.parse(str);
if ("fbad".equals(parse.getScheme()) && "close".equals(parse.getAuthority())) {
audienceNetworkActivity.finish();
return;
}
long j = this.f10263d;
this.f10263d = System.currentTimeMillis();
if (this.f10263d - j >= 1000) {
if ("fbad".equals(parse.getScheme()) && C1349b.m4702a(parse.getAuthority())) {
this.f10262c.f10266b.mo1646a("com.facebook.ads.interstitial.clicked");
}
C1348a a = C1349b.m4701a(audienceNetworkActivity, c1425f, this.f10262c.f10269e.mo1728D(), parse, map);
if (a != null) {
try {
this.f10262c.f10272h = a.mo1717a();
this.f10262c.f10271g = System.currentTimeMillis();
a.mo1718b();
} catch (Throwable e) {
Log.e(C3377i.f10265a, "Error executing action", e);
}
}
}
}
/* renamed from: b */
public void mo1654b() {
this.f10262c.f10268d.m4716a();
}
}, 1);
this.f10267c.setLayoutParams(new LayoutParams(-1, -1));
this.f10268d = new C3273r(audienceNetworkActivity, this.f10267c, this.f10267c.getViewabilityChecker(), new C33762(this));
c1603a.mo1645a(this.f10267c);
}
/* renamed from: a */
public void mo1823a(Intent intent, Bundle bundle, AudienceNetworkActivity audienceNetworkActivity) {
if (bundle == null || !bundle.containsKey("dataModel")) {
this.f10269e = C3272q.m12568b(intent);
if (this.f10269e != null) {
this.f10268d.m12583a(this.f10269e);
this.f10267c.loadDataWithBaseURL(C1491i.m5258a(), this.f10269e.m12572a(), AudienceNetworkActivity.WEBVIEW_MIME_TYPE, AudienceNetworkActivity.WEBVIEW_ENCODING, null);
this.f10267c.m12960a(this.f10269e.m12577e(), this.f10269e.m12578f());
}
return;
}
this.f10269e = C3272q.m12566a(bundle.getBundle("dataModel"));
if (this.f10269e != null) {
this.f10267c.loadDataWithBaseURL(C1491i.m5258a(), this.f10269e.m12572a(), AudienceNetworkActivity.WEBVIEW_MIME_TYPE, AudienceNetworkActivity.WEBVIEW_ENCODING, null);
this.f10267c.m12960a(this.f10269e.m12577e(), this.f10269e.m12578f());
}
}
/* renamed from: a */
public void mo1824a(Bundle bundle) {
if (this.f10269e != null) {
bundle.putBundle("dataModel", this.f10269e.m12579g());
}
}
/* renamed from: h */
public void mo1825h() {
this.f10267c.onPause();
}
/* renamed from: i */
public void mo1826i() {
if (!(this.f10271g <= 0 || this.f10272h == null || this.f10269e == null)) {
C1482c.m5218a(C1481b.m5213a(this.f10271g, this.f10272h, this.f10269e.m12576d()));
}
this.f10267c.onResume();
}
public void onDestroy() {
if (this.f10269e != null) {
C1482c.m5218a(C1481b.m5213a(this.f10270f, C1479a.XOUT, this.f10269e.m12576d()));
if (!TextUtils.isEmpty(this.f10269e.mo1728D())) {
Map hashMap = new HashMap();
this.f10267c.getViewabilityChecker().m5350a(hashMap);
hashMap.put("touch", C1490h.m5244a(this.f10267c.getTouchData()));
C3288g.m12671a(this.f10267c.getContext()).mo1753g(this.f10269e.mo1728D(), hashMap);
}
}
C1491i.m5259a(this.f10267c);
this.f10267c.destroy();
}
public void setListener(C1603a c1603a) {
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
29931752afc7126af188d121167464f98b6d7b4c | b863cd353be42f5c43efcd8c7feeb1b883efcbdb | /cloud-be/src/main/java/rs/raf/cloud/controllers/AuthenticationController.java | 197d2e5fec3babc739db0d29bf42ae413b730ffc | [] | no_license | 555SSOO/RAFCloud | 7e48659c7d8b4b702402c465cc898fa21b1cac05 | fea4bca4f83345bdcaa4e219932f4b653bfd9c76 | refs/heads/master | 2023-01-09T17:23:09.971876 | 2019-12-29T19:28:52 | 2019-12-29T19:28:52 | 229,423,046 | 0 | 0 | null | 2023-01-07T13:03:54 | 2019-12-21T12:16:44 | Java | UTF-8 | Java | false | false | 1,078 | java | package rs.raf.cloud.controllers;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import rs.raf.cloud.controllers.constants.ControllerConstants;
import rs.raf.cloud.services.AuthenticationService;
@RestController
@CrossOrigin(origins = ControllerConstants.ANGULAR_URL)
@RequestMapping("/auth")
public class AuthenticationController {
@Autowired
@Getter
AuthenticationService authenticationService;
@RequestMapping(produces="text/plain")
@ResponseBody
public String authenticateUser(@RequestParam String username, @RequestParam String password) {
return "\""+getAuthenticationService().isPasswordCorrect(username, password)+"\"";
}
}
| [
"s.obradovic@msgnetconomy.net"
] | s.obradovic@msgnetconomy.net |
1fa88eae1715cad9f201cc6f4002b059e5fb94c1 | 0203c612b12f5247b05e8c575820de2a593212b7 | /Week12/Problem.11/src/p6/InsertionSort.java | a1bbf8f0693b06330425b348af135eb558f00e7c | [] | no_license | VeselinTodorov2000/Java-OOP-2021 | 72995291f00f22cc552c26abac093a2400bb669c | 98e4705de5e91bf9107d710f042fdc4b12cd064d | refs/heads/main | 2023-06-04T01:49:25.221947 | 2021-06-21T20:22:17 | 2021-06-21T20:22:17 | 342,679,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | package p6;
import java.awt.*;
import java.util.ArrayList;
import java.util.Random;
public class InsertionSort {
public static <E extends Comparable<E>> void sort(ArrayList<E> list)
{
for (int i = 1; i < list.size(); i++)
{
E currentElement = list.get(i);
int j;
for(j = i - 1; j >= 0 && list.get(j).compareTo(currentElement) > 0; j--)
{
list.set(j+1, list.get(j));
}
list.set(j+1, currentElement);
}
}
public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<>();
Random r = new Random();
for (int i = 0; i <= 30; i++)
{
list.add(r.nextInt(101));
}
System.out.println(list);
sort(list);
System.out.println(list);
}
}
| [
"slavovt@uni-sofia.bg"
] | slavovt@uni-sofia.bg |
93106787d0607ba037c54e9e238a4f52e44757a6 | f45437ae687e48e37e78cbfe7fba0ce0a112da2a | /src/main/java/esprima4java/ast/ThisExpression.java | fb35f3670b2a4cbd3db3b647d534a403ccaa9853 | [
"MIT"
] | permissive | qhanam/Esprima4Java | 13ee7a6f8d5bbaad74dcdddd66ab2c5307ce48ff | 88cc2633c8b3039f33fc5acb5a4ba855466e4235 | refs/heads/master | 2020-05-17T21:35:11.942937 | 2019-05-22T23:46:52 | 2019-05-22T23:46:52 | 183,975,923 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package esprima4java.ast;
import com.google.auto.value.AutoValue;
@AutoValue
public abstract class ThisExpression extends Node {
public static ThisExpression create() {
return new AutoValue_ThisExpression(NodeType.THIS_EXPRESSION);
}
@Override
public Node clone() {
return new AutoValue_ThisExpression(type());
}
}
| [
"qhanam@gmail.com"
] | qhanam@gmail.com |
3c53b8d4cec610fbaac737cd241d0512e351a83f | 10f9dfa99fbdc4172ad2b92101cc783e975fe732 | /src/main/java/com/zhlzzz/together/controllers/HomeController.java | c842ba5a8b1f706a56d66a97fe500922ed8cb305 | [] | no_license | liehuoren/together-api | d511c88445e79e0278440eb58fde9fef8ab3b587 | 0e4d0a54c0015d51bb5e102523c646f280dbedb1 | refs/heads/master | 2020-03-16T03:04:43.655287 | 2018-05-15T14:56:42 | 2018-05-15T14:56:42 | 132,479,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package com.zhlzzz.together.controllers;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@GetMapping(path = "/home")
@ResponseBody
public String home() {
return "here is api for together.";
}
}
| [
"1025798480@qq.com"
] | 1025798480@qq.com |
7a34b9b8aa8be253c4c304d4f951d6acad8917c2 | 8f5143154900dbb984b01c35dfcb5966e446d971 | /src/main/java/org/lanqiao/entity/Place.java | 46d6895a6cad84135cef575b7d33d7da89c32808 | [] | no_license | JacksonZhangHuaQuan/travel | c7dae57f9e998e8c4870bdd95b3aa2455837d4ec | e5aa65f9fca7fe440d58070923c730c7d2dd8316 | refs/heads/master | 2022-07-05T13:47:27.740673 | 2019-09-13T14:01:37 | 2019-09-13T14:01:37 | 208,279,449 | 0 | 0 | null | 2022-06-21T01:51:55 | 2019-09-13T14:19:06 | HTML | UTF-8 | Java | false | false | 1,583 | java | package org.lanqiao.entity;
public class Place {
private int place_id;
private int strategy_id;
private String place_name;
private String place_description;
public Place() {
}
public Place(int place_id, int strategy_id, String place_name, String place_description) {
this.place_id = place_id;
this.strategy_id = strategy_id;
this.place_name = place_name;
this.place_description = place_description;
}
public Place( int strategy_id, String place_name, String place_description) {
this.strategy_id = strategy_id;
this.place_name = place_name;
this.place_description = place_description;
}
public Place(String place_name, String place_description,int place_id) {
this.place_id = place_id;
this.place_name = place_name;
this.place_description = place_description;
}
public int getPlace_id() {
return place_id;
}
public void setPlace_id(int place_id) {
this.place_id = place_id;
}
public int getStrategy_id() {
return strategy_id;
}
public void setStrategy_id(int strategy_id) {
this.strategy_id = strategy_id;
}
public String getPlace_name() {
return place_name;
}
public void setPlace_name(String place_name) {
this.place_name = place_name;
}
public String getPlace_description() {
return place_description;
}
public void setPlace_description(String place_description) {
this.place_description = place_description;
}
}
| [
"867132963@qq.com"
] | 867132963@qq.com |
b2092b043d31d449b718e72830ff0cff2c03a77e | 6a7f18228f3315c04d50cfdf4a9f51c7ee802465 | /javaCourses/javaCourses/src/tp15_poo/Point.java | 72a9e82d421c102b7019cac72cdd9f9c4ec864c1 | [] | no_license | borisBelloc/Diginamic | 1815a449b5d166755dd9aa39531d13b6b15a3b10 | 075a7f2a4eab399b8ecd1bb27219203b6dfac23a | refs/heads/master | 2023-04-03T23:48:53.345171 | 2022-12-17T19:07:34 | 2022-12-17T19:07:34 | 212,615,191 | 0 | 0 | null | 2023-03-23T23:18:47 | 2019-10-03T15:35:20 | Java | UTF-8 | Java | false | false | 909 | java | package tp15_poo;
public class Point {
private final int INIT_X = 25;
private final int INIT_Y = 25;
private int x;
private int y;
public Point() {
super();
this.x = INIT_X;
this.y = INIT_Y;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
@Override
public String toString() {
return "[" + x + ";" + y + "]";
}
public void affiche() {
System.out.println( toString() );
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Point other = (Point) obj;
if (INIT_X != other.INIT_X)
return false;
if (INIT_Y != other.INIT_Y)
return false;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
}
}
| [
"bb.itwork@gmail.com"
] | bb.itwork@gmail.com |
79889ea4b9bdacb1115216e945a630a491fcad82 | 74be4acb41789917e7120556f699d962d002495b | /src/main/java/com/kalli/Main.java | b3fbd1f13e941a934128ad85026ae785b24ba1d7 | [] | no_license | krantou/spring-boot-app | 2b9a7a610c8d383219afef2bba44fab50950c523 | 90cc8809451cc5c54410a0e6b449ba5039c10bd6 | refs/heads/master | 2023-01-12T18:35:06.562015 | 2020-11-11T11:44:02 | 2020-11-11T11:44:02 | 311,916,597 | 0 | 2 | null | 2020-11-11T11:37:42 | 2020-11-11T09:04:46 | Java | UTF-8 | Java | false | false | 747 | java | package com.kalli;
import com.kalli.model.Profiles;
import javafx.application.Application;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@SpringBootApplication
public class Main {
// private static final Logger logger = LoggerFactory.getLogger(Main.class);
public static void main(String[] args) {
// Profiles profile = new Profiles("test");
//
// profile.devMethod();
SpringApplication.run(Main.class, args);
}
}
| [
"kallirant@gmail.com"
] | kallirant@gmail.com |
727ceac8e2415b573beac4c82c5b6103cd2236a6 | 952a5ab97f537ccbd808fd02b94d9c8387d599d2 | /app/src/main/java/com/example/tnp/Activities/Dialogpojo.java | d94130ce5488dd09c6ac666c0582d2428b38d903 | [] | no_license | raghavendra9511/TNP | a34894e8f743dadfbe16d5b7082b5cbc003513d7 | 2f60fa3d8bea7cd0ced434edd0cb1b58132aae97 | refs/heads/master | 2023-02-05T10:24:08.785937 | 2020-12-22T10:12:49 | 2020-12-22T10:12:49 | 323,588,907 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,515 | java | package com.example.tnp.Activities;
public class Dialogpojo {
private String titles;
private String subjects;
private String types;
private String duedates;
private String descripts;
private String attatchmentd;
private String sections;
private String classe;
public void setTitles(String titles) {
this.titles = titles;
}
public void setSubjects(String subjects) {
this.subjects = subjects;
}
public void setTypes(String types) {
this.types = types;
}
public void setDuedates(String duedates) {
this.duedates = duedates;
}
public void setDescripts(String descripts) {
this.descripts = descripts;
}
public void setAttatchmentd(String attatchmentd) {
this.attatchmentd = attatchmentd;
}
public String getTitles() {
return titles;
}
public String getSubjects() {
return subjects;
}
public String getTypes() {
return types;
}
public String getDuedates() {
return duedates;
}
public String getDescripts() {
return descripts;
}
public String getAttatchmentd() {
return attatchmentd;
}
public void setSections(String sections) {
this.sections = sections;
}
public void setClasse(String classe) {
this.classe = classe;
}
public String getClasse() {
return classe;
}
public String getSections() {
return sections;
}
}
| [
"raghavendrabhosale7273@gmail.com"
] | raghavendrabhosale7273@gmail.com |
d8abbe3171da0cce4dc77d8faccb6b281c08b2cd | 5ce71c5202e7c77c53d3fbc447912fe30ad3ccdc | /src/main/java/net/ymate/platform/module/wechat/message/MusicOutMessage.java | 0d5d26d435403a526610b1939430a579e41e1ace | [
"Apache-2.0"
] | permissive | suninformation/ymate-module-wechat | 4cb526214198f611cb28579f2d8690788782ea6d | 42e31e770d857f7f3cf3af3c7adfd5fe33c7cabf | refs/heads/master | 2021-01-18T22:09:25.664111 | 2017-07-27T03:18:42 | 2017-07-27T03:18:42 | 17,754,253 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,405 | java | /*
* Copyright 2007-2107 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.ymate.platform.module.wechat.message;
import net.ymate.platform.module.wechat.WeChat;
import com.alibaba.fastjson.JSONObject;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* <p>
* MusicOutMessage
* </p>
* <p>
*
* </p>
*
* @author 刘镇(suninformation@163.com)
* @version 0.0.0
* <table style="border:1px solid gray;">
* <tr>
* <th width="100px">版本号</th><th width="100px">动作</th><th
* width="100px">修改人</th><th width="100px">修改时间</th>
* </tr>
* <!-- 以 Table 方式书写修改历史 -->
* <tr>
* <td>0.0.0</td>
* <td>创建类</td>
* <td>刘镇</td>
* <td>2014年3月15日下午1:05:13</td>
* </tr>
* </table>
*/
@XStreamAlias("xml")
public class MusicOutMessage extends OutMessage {
/**
*
*/
private static final long serialVersionUID = 7875350513434771269L;
@XStreamAlias("Music")
private MediaId music;
/**
* 构造器
*
* @param toUserName
*/
public MusicOutMessage(String toUserName) {
super(toUserName, WeChat.WX_MESSAGE.TYPE_MUSIC);
}
public MediaId getMusic() {
return music;
}
public void setMusic(MediaId music) {
this.music = music;
}
@Override
protected void __doSetJsonContent(JSONObject parent) throws Exception {
JSONObject _music = new JSONObject();
if (this.getMusic() != null) {
_music.put("title", this.getMusic().getTitle());
_music.put("description", this.getMusic().getDescription());
_music.put("musicurl", this.getMusic().getMusicUrl());
_music.put("hqmusicurl", this.getMusic().getHqMusicUrl());
_music.put("thumb_media_id", this.getMusic().getThumbMediaId());
}
parent.put("music", _music);
}
}
| [
"suninformation@163.com"
] | suninformation@163.com |
37d50c78b5b28a048da6771ee88614eea6cf5ede | 4e504c9e317ba0cc96b54d1366dd425f8360f80c | /VideoSDK/facecal/src/androidTest/java/com/hyq/hm/videosdk/ExampleInstrumentedTest.java | 5c3bc462df77b9aa02bb740ebdb03094519d880b | [
"Apache-2.0"
] | permissive | ranchohxk/VideoSdk | 0928773f15765d193e5de8a1f1cc97a806fdad92 | d609b966916074f1b5b2c09c618707473fa83ea0 | refs/heads/master | 2020-06-11T02:36:17.940527 | 2019-07-03T10:02:49 | 2019-07-03T10:02:49 | 193,823,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package com.hyq.hm.videosdk;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.hyq.hm.videosdk.test", appContext.getPackageName());
}
}
| [
"15088133707@163.com"
] | 15088133707@163.com |
4362ddc3024c8a2da2542462c02ef68bd022545a | 377e5e05fb9c6c8ed90ad9980565c00605f2542b | /bin/platform/ext/platformservices/src/de/hybris/platform/order/daos/impl/DefaultZoneDeliveryModeDao.java | e06a9bac876b8abb9a59616fc0f5811fca82f079 | [] | no_license | automaticinfotech/HybrisProject | c22b13db7863e1e80ccc29774f43e5c32e41e519 | fc12e2890c569e45b97974d2f20a8cbe92b6d97f | refs/heads/master | 2021-07-20T18:41:04.727081 | 2017-10-30T13:24:11 | 2017-10-30T13:24:11 | 108,957,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,924 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*/
package de.hybris.platform.order.daos.impl;
import de.hybris.platform.core.model.ItemModel;
import de.hybris.platform.core.model.c2l.CountryModel;
import de.hybris.platform.core.model.c2l.CurrencyModel;
import de.hybris.platform.core.model.link.LinkModel;
import de.hybris.platform.deliveryzone.model.ZoneDeliveryModeModel;
import de.hybris.platform.deliveryzone.model.ZoneDeliveryModeValueModel;
import de.hybris.platform.deliveryzone.model.ZoneModel;
import de.hybris.platform.order.daos.ZoneDeliveryModeDao;
import de.hybris.platform.servicelayer.internal.dao.AbstractItemDao;
import de.hybris.platform.servicelayer.search.FlexibleSearchQuery;
import de.hybris.platform.servicelayer.search.SearchResult;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Default implementation of the {@link ZoneDeliveryModeDao}.
*/
public class DefaultZoneDeliveryModeDao extends AbstractItemDao implements ZoneDeliveryModeDao
{
@Override
public List<ZoneModel> findZonesByCode(final String code)
{
final StringBuilder query = new StringBuilder("SELECT {").append(ZoneModel.PK);
query.append("} FROM {").append(ZoneModel._TYPECODE);
query.append("} WHERE {").append(ZoneModel.CODE).append("}=?").append(ZoneModel.CODE);
query.append(" ORDER BY {").append(ZoneModel.CREATIONTIME).append("} ASC , {").append(ZoneModel.PK).append("} ASC");
final Map<String, Object> params = new HashMap<String, Object>();
params.put(ZoneModel.CODE, code);
final List<ZoneModel> zones = doSearch(query.toString(), params, null);
return zones;
}
@Override
public Collection<ZoneModel> findAllZones()
{
final StringBuilder query = new StringBuilder("SELECT {").append(ZoneModel.PK);
query.append("} FROM {").append(ZoneModel._TYPECODE);
query.append("} ORDER BY {").append(ZoneModel.CREATIONTIME).append("} DESC , {").append(ZoneModel.PK).append("} ASC");
final List<ZoneModel> zones = doSearch(query.toString(), null, null);
return zones;
}
@Override
public Collection<ZoneModel> findZonesByZoneDeliveryMode(final ZoneDeliveryModeModel zoneDeliveryMode)
{
final StringBuilder query = new StringBuilder("SELECT DISTINCT {").append(ZoneDeliveryModeValueModel.ZONE);
query.append("} FROM {").append(ZoneDeliveryModeValueModel._TYPECODE).append("} WHERE {");
query.append(ZoneDeliveryModeValueModel.DELIVERYMODE).append("}=?").append(ZoneDeliveryModeValueModel.DELIVERYMODE);
final Map<String, Object> params = new HashMap<String, Object>();
params.put(ZoneDeliveryModeValueModel.DELIVERYMODE, zoneDeliveryMode);
final List<ZoneModel> zones = doSearch(query.toString(), params, null);
return zones;
}
@Override
public List<List<ItemModel>> findZonesAndCountriesByZones(final Set<ZoneModel> zones)
{
final StringBuilder query = new StringBuilder("SELECT {").append(LinkModel.SOURCE).append("}, {");
query.append(LinkModel.TARGET).append("} FROM {").append(CountryModel._ZONECOUNTRYRELATION);
query.append("} WHERE {").append(LinkModel.SOURCE).append("} IN (?").append(CountryModel.ZONES).append(")");
final Map<String, Object> params = new HashMap<String, Object>();
params.put(CountryModel.ZONES, zones);
final List<Class> resultClasses = new ArrayList<Class>();
resultClasses.add(ZoneModel.class);
resultClasses.add(CountryModel.class);
final List<List<ItemModel>> zonesAndCountries = doSearch(query.toString(), params, resultClasses);
return zonesAndCountries;
}
@Override
public Collection<CurrencyModel> findCurrencies(final ZoneModel zone, final ZoneDeliveryModeModel zoneDeliveryMode)
{
final StringBuilder query = new StringBuilder("SELECT DISTINCT {").append(ZoneDeliveryModeValueModel.CURRENCY);
query.append("} FROM {").append(ZoneDeliveryModeValueModel._TYPECODE);
query.append("} WHERE {").append(ZoneDeliveryModeValueModel.DELIVERYMODE);
query.append("}=?").append(ZoneDeliveryModeValueModel.DELIVERYMODE).append(" AND {");
query.append(ZoneDeliveryModeValueModel.ZONE).append("}=?").append(ZoneDeliveryModeValueModel.ZONE);
final Map<String, Object> params = new HashMap<String, Object>();
params.put(ZoneDeliveryModeValueModel.ZONE, zone);
params.put(ZoneDeliveryModeValueModel.DELIVERYMODE, zoneDeliveryMode);
final List<CurrencyModel> currencies = doSearch(query.toString(), params, null);
return currencies;
}
@Override
public Map<Double, Double> findDeliveryValues(final CurrencyModel currency, final ZoneModel zone,
final ZoneDeliveryModeModel zoneDeliveryMode)
{
final StringBuilder query = new StringBuilder("SELECT {").append(ZoneDeliveryModeValueModel.MINIMUM);
query.append("}, {").append(ZoneDeliveryModeValueModel.VALUE).append("} FROM {");
query.append(ZoneDeliveryModeValueModel._TYPECODE).append("} WHERE {");
query.append(ZoneDeliveryModeValueModel.DELIVERYMODE).append("}=?").append(ZoneDeliveryModeValueModel.DELIVERYMODE);
query.append(" AND {").append(ZoneDeliveryModeValueModel.CURRENCY).append("}=?");
query.append(ZoneDeliveryModeValueModel.CURRENCY).append(" AND {").append(ZoneDeliveryModeValueModel.ZONE).append("}=?");
query.append(ZoneDeliveryModeValueModel.ZONE);
final Map<String, Object> params = new HashMap<String, Object>();
params.put(ZoneDeliveryModeValueModel.CURRENCY, currency);
params.put(ZoneDeliveryModeValueModel.ZONE, zone);
params.put(ZoneDeliveryModeValueModel.DELIVERYMODE, zoneDeliveryMode);
final List<Class> resultClasses = new ArrayList<Class>();
resultClasses.add(Double.class);
resultClasses.add(Double.class);
//rows consists of threshold value and delivery cost
final List<List<Double>> rows = doSearch(query.toString(), params, resultClasses);
if (rows.isEmpty())
{
return Collections.EMPTY_MAP;
}
else
{
final Map<Double, Double> deliveryValues = new HashMap<Double, Double>(rows.size());
for (final List<Double> row : rows)
{
deliveryValues.put(row.get(0), row.get(1));
}
return deliveryValues;
}
}
private <T> List<T> doSearch(final String query, final Map<String, Object> params, final List<Class> resultClasses)
{
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
if (params != null)
{
fQuery.addQueryParameters(params);
}
if (resultClasses != null)
{
fQuery.setResultClassList(resultClasses);
}
final SearchResult<T> result = getFlexibleSearchService().search(fQuery);
final List<T> elements = result.getResult();
return elements;
}
}
| [
"santosh.kshirsagar@automaticinfotech.com"
] | santosh.kshirsagar@automaticinfotech.com |
41bbe7f93b3edf7e8a76d921b9ed020900f03c7a | c92d53fb801b6c9ba721f8380320f6e609f496bc | /Ranger/src/mass/Ranger/Algorithm/DTW/FastDtw/DtwTest.java | 668ed1e118b5b81723b85d2ffea0bf6821617dfa | [
"MIT"
] | permissive | SilunWang/Ranger | 0d6977d787413a69928186c9a8ac67c2989fd889 | d0e9decf828afded57f41f648258182c48af0b00 | refs/heads/master | 2021-01-10T15:39:48.031282 | 2015-06-10T05:51:11 | 2015-06-10T05:51:11 | 36,784,591 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,519 | java | /*
* DtwTest.java Jul 14, 2004
*
* Copyright (c) 2004 Stan Salvador
* stansalvador@hotmail.com
*/
package mass.Ranger.Algorithm.DTW.FastDtw;
import mass.Ranger.Algorithm.DTW.FastDtw.dtw.DTW;
import mass.Ranger.Algorithm.DTW.FastDtw.dtw.TimeWarpInfo;
import mass.Ranger.Algorithm.DTW.FastDtw.timeseries.TimeSeries;
import mass.Ranger.Algorithm.DTW.FastDtw.util.DistanceFunction;
import mass.Ranger.Algorithm.DTW.FastDtw.util.DistanceFunctionFactory;
public class DtwTest {
// PUBLIC FUNCTIONS
public static void main(String[] args) {
if (args.length != 2 && args.length != 3) {
System.out.println("USAGE: java DtwTest timeSeries1 timeSeries2 [EuclideanDistance|ManhattanDistance|BinaryDistance]");
System.exit(1);
} else {
final TimeSeries tsI = new TimeSeries(args[0], false, false, ',');
final TimeSeries tsJ = new TimeSeries(args[1], false, false, ',');
final DistanceFunction distFn;
if (args.length < 3) {
distFn = DistanceFunctionFactory.getDistFnByName("EuclideanDistance");
} else {
distFn = DistanceFunctionFactory.getDistFnByName(args[2]);
} // end if
final TimeWarpInfo info = DTW.getWarpInfoBetween(tsI, tsJ, distFn);
System.out.println("Warp Distance: " + info.getDistance());
System.out.println("Warp Path: " + info.getPath());
} // end if
} // end main()
} // end class DtwTest
| [
"wangsl11@mails.tsinghua.edu.cn"
] | wangsl11@mails.tsinghua.edu.cn |
92819c8e0fcd13f961f042a786a894fb3b4e3c3a | f6bff6be2db811988fa9f5dc10b3ec01e1ed87e9 | /src/main/java/com/trixpert/beebbeeb/data/to/CustomerDTO.java | b0d883e11f6c31a9835e0e625030d4e5ad1550e5 | [] | no_license | ihabTawffiq/BeebBeebForBata | 0e94a313489075fff1655dc30b1f35c1d89dcf94 | d6bb994e52fb5a301d8c2d15dc555f9b85a9dc08 | refs/heads/main | 2023-06-23T20:56:22.089059 | 2021-05-03T23:05:52 | 2021-05-03T23:05:52 | 382,465,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package com.trixpert.beebbeeb.data.to;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CustomerDTO {
private Long id;
private UserDTO user;
private String preferredBank;
private String jobTitle;
private String jobAddress;
private long income;
private boolean active;
private List<AddressDTO> addresses;
}
| [
"maxmya@outlook.com"
] | maxmya@outlook.com |
06932ce284c4d0230265fa100b28efe87d2cb95d | aa124892657938d6acc92cd1cbd101d056478e1a | /src/com/minecraftdimensions/bungeesuite/configlibrary/MemoryConfigurationOptions.java | 7361946383ec812af4f341da03bc39d248754215 | [] | no_license | timderspieler/BugeeSuite_1.13 | ab3092450cbb04fa4b54e563f97aab574596a41f | ebad4667a1e0fdaccdd14969de3db20565ecdfdb | refs/heads/master | 2020-05-26T11:32:40.289150 | 2019-05-23T11:22:21 | 2019-05-23T11:22:21 | 188,218,636 | 4 | 4 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package com.minecraftdimensions.bungeesuite.configlibrary;
public class MemoryConfigurationOptions extends ConfigurationOptions {
protected MemoryConfigurationOptions(MemoryConfiguration configuration) {
super(configuration);
}
@Override
public MemoryConfiguration configuration() {
return (MemoryConfiguration) super.configuration();
}
@Override
public MemoryConfigurationOptions copyDefaults(boolean value) {
super.copyDefaults(value);
return this;
}
@Override
public MemoryConfigurationOptions pathSeparator(char value) {
super.pathSeparator(value);
return this;
}
} | [
"timderspieler@gmx.de"
] | timderspieler@gmx.de |
094c741787e2d19a6623e2564da9db12ddc155b6 | ba286d53520207ab25e782051190c4e0e0ca501e | /src/com/yanjin/demo2/Employee.java | 38a79708b945e84b4e077d7eb5ae80648db900e2 | [] | no_license | kaolajun/YanjinProject | ee60a5c90eb9d048a2d4d895878eede3ced06050 | a402d0171dbcd0e096ac768ae7de2d5e269533d0 | refs/heads/master | 2020-04-08T08:09:53.554225 | 2018-11-26T15:21:41 | 2018-11-26T15:21:41 | 159,167,785 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,629 | java | package com.yanjin.demo2;
class Employee {
private int number;
private Department department;
private String name;
private String position;
private Employee leader;
private double salary;
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public Employee getLeader() {
return leader;
}
public void setLeader(Employee leader) {
this.leader = leader;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public Employee() {};
public Employee(int number,Department department,String name,String position,Employee leader,double salary) {
this.number = number;
this.department = department;
this.name = name;
this.position = position;
this.leader = leader;
this.salary = salary;
}
@Override
public String toString() {
return "编号为: " + this.number + ",姓名: " + this.name + ",职位: " + this.position
+ ",领导: " + (this.leader != null?this.leader.getName():"无")
+ ",工资: " + this.salary + ",部门编号: " + this.department.getNumber();
}
}
| [
"143046586@qq.com"
] | 143046586@qq.com |
4648a57d7b31b997db9e8ae905c54f5aec8d2692 | e0b01ac6a9f2a618488123ca9f1cc0c74c0e18f4 | /src/java/dao/PdfDAO.java | bc3ce512688d5795bf10a34242488aaeb6b47613 | [] | no_license | MaribelRamirez/TutoriasUnsis | 55b92ee4b5b4f4cb7f2f1dc7dc07f370a38a6290 | 73944e223ef5f9adcedeb7638c48ad8cbe6d3890 | refs/heads/master | 2021-06-26T00:09:29.722915 | 2019-05-17T22:55:03 | 2019-05-17T22:55:03 | 144,615,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,652 | java | package dao;
import model.ConnectionClass;
import VO.PdfVO;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class PdfDAO {
/*Metodo listar*/
public ArrayList<PdfVO> Listar_PdfVOReportes() {
ArrayList<PdfVO> list = new ArrayList<PdfVO>();
ConnectionClass conec = new ConnectionClass();
String sql = "SELECT * FROM archivos where categoria='1';";
ResultSet rs = null;
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
PdfVO vo = new PdfVO();
vo.setCodigopdf(rs.getInt(1));
vo.setNombrepdf(rs.getString(2));
vo.setArchivopdf2(rs.getBytes(3));
list.add(vo);
}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
rs.close();
conec.desconectar();
} catch (Exception ex) {
}
}
return list;
}
public ArrayList<PdfVO> Listar_PdfVO() {
ArrayList<PdfVO> list = new ArrayList<PdfVO>();
ConnectionClass conec = new ConnectionClass();
String sql = "SELECT * FROM archivos;";
ResultSet rs = null;
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
PdfVO vo = new PdfVO();
vo.setCodigopdf(rs.getInt(1));
vo.setNombrepdf(rs.getString(2));
vo.setArchivopdf2(rs.getBytes(3));
list.add(vo);
}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
rs.close();
conec.desconectar();
} catch (Exception ex) {
}
}
return list;
}
public ArrayList<PdfVO> Listar_PdfVOMaterial() {
ArrayList<PdfVO> list = new ArrayList<PdfVO>();
ConnectionClass conec = new ConnectionClass();
String sql = "SELECT * FROM archivos where categoria='2';";
ResultSet rs = null;
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
PdfVO vo = new PdfVO();
vo.setCodigopdf(rs.getInt(1));
vo.setNombrepdf(rs.getString(2));
vo.setArchivopdf2(rs.getBytes(3));
list.add(vo);
}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
rs.close();
conec.desconectar();
} catch (Exception ex) {
}
}
return list;
}
/*Metodo agregar*/
public void Agregar_PdfVO(PdfVO vo) {
ConnectionClass conec = new ConnectionClass();
String sql = "INSERT INTO archivos (idArchivo, nombre, categoria, archivo) VALUES(?, ?, ?,? );";
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
ps.setInt(1, vo.getCodigopdf());
ps.setString(2, vo.getNombrepdf());
ps.setString(3, vo.getCategoria());
ps.setBlob(4, vo.getArchivopdf());
ps.executeUpdate();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
conec.desconectar();
} catch (Exception ex) {
}
}
}
/*Metodo Modificar*/
public void Modificar_PdfVO(PdfVO vo) {
ConnectionClass conec = new ConnectionClass();
String sql = "UPDATE pdf SET nombrepdf = ?, archivopdf = ? WHERE codigopdf = ?;";
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
ps.setString(1, vo.getNombrepdf());
ps.setBlob(2, vo.getArchivopdf());
ps.setInt(3, vo.getCodigopdf());
ps.executeUpdate();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
conec.desconectar();
} catch (Exception ex) {
}
}
}
/*Metodo Modificar*/
public void Modificar_PdfVO2(PdfVO vo) {
ConnectionClass conec = new ConnectionClass();
String sql = "UPDATE archivos SET nombrepdf = ? WHERE codigopdf = ?;";
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
ps.setString(1, vo.getNombrepdf());
ps.setInt(2, vo.getCodigopdf());
ps.executeUpdate();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
conec.desconectar();
} catch (Exception ex) {
}
}
}
/*Metodo Eliminar*/
public void Eliminar_PdfVO(int id) {
ConnectionClass conec = new ConnectionClass();
String sql = "DELETE FROM archivos WHERE idArchivo = ?;";
PreparedStatement ps = null;
try {
ps = conec.conectar().prepareStatement(sql);
ps.setInt(1, id);
ps.executeUpdate();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
ps.close();
conec.desconectar();
} catch (Exception ex) {
}
}
}
/*Metodo Consulta id*/
public PdfVO getPdfVOById(int studentId) {
PdfVO vo = new PdfVO();
ConnectionClass db = new ConnectionClass();
PreparedStatement preparedStatement = null;
ResultSet rs = null;
String query = "SELECT * FROM archivos WHERE idArchivo = ?;";
try {
preparedStatement = db.conectar().prepareStatement(query);
preparedStatement.setInt(1, studentId);
rs = preparedStatement.executeQuery();
while (rs.next()) {
vo.setCodigopdf(rs.getInt(1));
vo.setNombrepdf(rs.getString(2));
vo.setArchivopdf2(rs.getBytes(3));
}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
try {
rs.close();
preparedStatement.close();
db.desconectar();
} catch (Exception ex) {
}
}
return vo;
}
}
| [
"minemtza1401@gmail.com"
] | minemtza1401@gmail.com |
83669ce96548bed1d13cf3c3c12d14ed33c72e47 | 15a7b7a6dd66c8a6cde67f82a74f9fd8fe0b8208 | /DesignPatterns/PrototypeDesignPattern/src/com/sample/pp/runner/Runner.java | 2136728f34aa784945337b10f54471ab04395599 | [] | no_license | nonotOnanad/myRepo | 212cc423c92afb7be26dcc40fd47c0dfae9d2fe1 | 322845379ac2ae49ef4941747d3596cc104806cd | refs/heads/master | 2020-12-30T09:37:54.825111 | 2017-09-18T07:48:34 | 2017-09-18T07:48:34 | 20,316,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package com.sample.pp.runner;
import com.sample.pp.ShapeCache;
import com.sample.pp.abs.Shape;
public class Runner {
public static void main(String[] args) {
ShapeCache.loadCache();
Shape clonedShape = ShapeCache.getShape("1");
System.out.println("Shape : " + clonedShape.getType());
Shape clonedShape2 = ShapeCache.getShape("2");
System.out.println("Shape2 : " + clonedShape2.getType());
Shape clonedShape3 = ShapeCache.getShape("3");
System.out.println("Shape3 : " + clonedShape3.getType());
}
}
| [
"monanad@DPH01000823.corp.capgemini.com"
] | monanad@DPH01000823.corp.capgemini.com |
a2ad98fbb729f22901187022af0c3c7321ee0774 | 7ad843a5b11df711f58fdb8d44ed50ae134deca3 | /JDK/JDK1.8/src/javax/swing/plaf/nimbus/TabbedPaneTabPainter.java | 33bb5d9fa6051c12c41d6dbb0c43380781ccd522 | [
"MIT"
] | permissive | JavaScalaDeveloper/java-source | f014526ad7750ad76b46ff475869db6a12baeb4e | 0e6be345eaf46cfb5c64870207b4afb1073c6cd0 | refs/heads/main | 2023-07-01T22:32:58.116092 | 2021-07-26T06:42:32 | 2021-07-26T06:42:32 | 362,427,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 39,774 | java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.swing.plaf.nimbus;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.Painter;
final class TabbedPaneTabPainter extends AbstractRegionPainter {
//package private integers representing the available states that
//this painter will paint. These are used when creating a new instance
//of TabbedPaneTabPainter to determine which region/state is being painted
//by that instance.
static final int BACKGROUND_ENABLED = 1;
static final int BACKGROUND_ENABLED_MOUSEOVER = 2;
static final int BACKGROUND_ENABLED_PRESSED = 3;
static final int BACKGROUND_DISABLED = 4;
static final int BACKGROUND_SELECTED_DISABLED = 5;
static final int BACKGROUND_SELECTED = 6;
static final int BACKGROUND_SELECTED_MOUSEOVER = 7;
static final int BACKGROUND_SELECTED_PRESSED = 8;
static final int BACKGROUND_SELECTED_FOCUSED = 9;
static final int BACKGROUND_SELECTED_MOUSEOVER_FOCUSED = 10;
static final int BACKGROUND_SELECTED_PRESSED_FOCUSED = 11;
private int state; //refers to one of the static final ints above
private PaintContext ctx;
//the following 4 variables are reused during the painting code of the layers
private Path2D path = new Path2D.Float();
private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0);
private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0);
private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0);
//All Colors used for painting are stored here. Ideally, only those colors being used
//by a particular instance of TabbedPaneTabPainter would be created. For the moment at least,
//however, all are created for each instance.
private Color color1 = decodeColor("nimbusBase", 0.032459438f, -0.55535716f, -0.109803945f, 0);
private Color color2 = decodeColor("nimbusBase", 0.08801502f, 0.3642857f, -0.4784314f, 0);
private Color color3 = decodeColor("nimbusBase", 0.08801502f, -0.63174605f, 0.43921566f, 0);
private Color color4 = decodeColor("nimbusBase", 0.05468172f, -0.6145278f, 0.37647057f, 0);
private Color color5 = decodeColor("nimbusBase", 0.032459438f, -0.5953556f, 0.32549018f, 0);
private Color color6 = decodeColor("nimbusBase", 0.032459438f, -0.54616207f, -0.02352941f, 0);
private Color color7 = decodeColor("nimbusBase", 0.08801502f, -0.6317773f, 0.4470588f, 0);
private Color color8 = decodeColor("nimbusBase", 0.021348298f, -0.61547136f, 0.41960782f, 0);
private Color color9 = decodeColor("nimbusBase", 0.032459438f, -0.5985242f, 0.39999998f, 0);
private Color color10 = decodeColor("nimbusBase", 0.08801502f, 0.3642857f, -0.52156866f, 0);
private Color color11 = decodeColor("nimbusBase", 0.027408898f, -0.5847884f, 0.2980392f, 0);
private Color color12 = decodeColor("nimbusBase", 0.035931647f, -0.5553123f, 0.23137254f, 0);
private Color color13 = decodeColor("nimbusBase", 0.029681683f, -0.5281874f, 0.18039215f, 0);
private Color color14 = decodeColor("nimbusBase", 0.03801495f, -0.5456242f, 0.3215686f, 0);
private Color color15 = decodeColor("nimbusBase", 0.032459438f, -0.59181184f, 0.25490195f, 0);
private Color color16 = decodeColor("nimbusBase", 0.05468172f, -0.58308274f, 0.19607842f, 0);
private Color color17 = decodeColor("nimbusBase", 0.046348333f, -0.6006266f, 0.34509802f, 0);
private Color color18 = decodeColor("nimbusBase", 0.046348333f, -0.60015875f, 0.3333333f, 0);
private Color color19 = decodeColor("nimbusBase", 0.004681647f, -0.6197143f, 0.43137252f, 0);
private Color color20 = decodeColor("nimbusBase", 7.13408E-4f, -0.543609f, 0.34509802f, 0);
private Color color21 = decodeColor("nimbusBase", -0.0020751357f, -0.45610264f, 0.2588235f, 0);
private Color color22 = decodeColor("nimbusBase", 5.1498413E-4f, -0.43866998f, 0.24705881f, 0);
private Color color23 = decodeColor("nimbusBase", 5.1498413E-4f, -0.44879842f, 0.29019606f, 0);
private Color color24 = decodeColor("nimbusBase", 5.1498413E-4f, -0.08776909f, -0.2627451f, 0);
private Color color25 = decodeColor("nimbusBase", 0.06332368f, 0.3642857f, -0.4431373f, 0);
private Color color26 = decodeColor("nimbusBase", 0.004681647f, -0.6198413f, 0.43921566f, 0);
private Color color27 = decodeColor("nimbusBase", -0.0022627711f, -0.5335866f, 0.372549f, 0);
private Color color28 = decodeColor("nimbusBase", -0.0017285943f, -0.4608264f, 0.32549018f, 0);
private Color color29 = decodeColor("nimbusBase", 5.1498413E-4f, -0.4555341f, 0.3215686f, 0);
private Color color30 = decodeColor("nimbusBase", 5.1498413E-4f, -0.46404046f, 0.36470586f, 0);
private Color color31 = decodeColor("nimbusBase", -0.57865167f, -0.6357143f, -0.54901963f, 0);
private Color color32 = decodeColor("nimbusBase", -4.2033195E-4f, -0.38050595f, 0.20392156f, 0);
private Color color33 = decodeColor("nimbusBase", 0.0013483167f, -0.16401619f, 0.0745098f, 0);
private Color color34 = decodeColor("nimbusBase", -0.0010001659f, -0.01599598f, 0.007843137f, 0);
private Color color35 = decodeColor("nimbusBase", 0.0f, 0.0f, 0.0f, 0);
private Color color36 = decodeColor("nimbusBase", 0.0018727183f, -0.038398862f, 0.035294116f, 0);
private Color color37 = decodeColor("nimbusFocus", 0.0f, 0.0f, 0.0f, 0);
//Array of current component colors, updated in each paint call
private Object[] componentColors;
public TabbedPaneTabPainter(PaintContext ctx, int state) {
super();
this.state = state;
this.ctx = ctx;
}
@Override
protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
//populate componentColors array with colors calculated in getExtendedCacheKeys call
componentColors = extendedCacheKeys;
//generate this entire method. Each state/bg/fg/border combo that has
//been painted gets its own KEY and paint method.
switch(state) {
case BACKGROUND_ENABLED: paintBackgroundEnabled(g); break;
case BACKGROUND_ENABLED_MOUSEOVER: paintBackgroundEnabledAndMouseOver(g); break;
case BACKGROUND_ENABLED_PRESSED: paintBackgroundEnabledAndPressed(g); break;
case BACKGROUND_DISABLED: paintBackgroundDisabled(g); break;
case BACKGROUND_SELECTED_DISABLED: paintBackgroundSelectedAndDisabled(g); break;
case BACKGROUND_SELECTED: paintBackgroundSelected(g); break;
case BACKGROUND_SELECTED_MOUSEOVER: paintBackgroundSelectedAndMouseOver(g); break;
case BACKGROUND_SELECTED_PRESSED: paintBackgroundSelectedAndPressed(g); break;
case BACKGROUND_SELECTED_FOCUSED: paintBackgroundSelectedAndFocused(g); break;
case BACKGROUND_SELECTED_MOUSEOVER_FOCUSED: paintBackgroundSelectedAndMouseOverAndFocused(g); break;
case BACKGROUND_SELECTED_PRESSED_FOCUSED: paintBackgroundSelectedAndPressedAndFocused(g); break;
}
}
@Override
protected final PaintContext getPaintContext() {
return ctx;
}
private void paintBackgroundEnabled(Graphics2D g) {
path = decodePath1();
g.setPaint(decodeGradient1(path));
g.fill(path);
path = decodePath2();
g.setPaint(decodeGradient2(path));
g.fill(path);
}
private void paintBackgroundEnabledAndMouseOver(Graphics2D g) {
path = decodePath1();
g.setPaint(decodeGradient3(path));
g.fill(path);
path = decodePath2();
g.setPaint(decodeGradient4(path));
g.fill(path);
}
private void paintBackgroundEnabledAndPressed(Graphics2D g) {
path = decodePath3();
g.setPaint(decodeGradient5(path));
g.fill(path);
path = decodePath4();
g.setPaint(decodeGradient6(path));
g.fill(path);
}
private void paintBackgroundDisabled(Graphics2D g) {
path = decodePath5();
g.setPaint(decodeGradient7(path));
g.fill(path);
path = decodePath6();
g.setPaint(decodeGradient8(path));
g.fill(path);
}
private void paintBackgroundSelectedAndDisabled(Graphics2D g) {
path = decodePath7();
g.setPaint(decodeGradient7(path));
g.fill(path);
path = decodePath2();
g.setPaint(decodeGradient9(path));
g.fill(path);
}
private void paintBackgroundSelected(Graphics2D g) {
path = decodePath7();
g.setPaint(decodeGradient10(path));
g.fill(path);
path = decodePath2();
g.setPaint(decodeGradient9(path));
g.fill(path);
}
private void paintBackgroundSelectedAndMouseOver(Graphics2D g) {
path = decodePath8();
g.setPaint(decodeGradient11(path));
g.fill(path);
path = decodePath9();
g.setPaint(decodeGradient12(path));
g.fill(path);
}
private void paintBackgroundSelectedAndPressed(Graphics2D g) {
path = decodePath8();
g.setPaint(decodeGradient13(path));
g.fill(path);
path = decodePath9();
g.setPaint(decodeGradient14(path));
g.fill(path);
}
private void paintBackgroundSelectedAndFocused(Graphics2D g) {
path = decodePath1();
g.setPaint(decodeGradient10(path));
g.fill(path);
path = decodePath10();
g.setPaint(decodeGradient9(path));
g.fill(path);
path = decodePath11();
g.setPaint(color37);
g.fill(path);
}
private void paintBackgroundSelectedAndMouseOverAndFocused(Graphics2D g) {
path = decodePath12();
g.setPaint(decodeGradient11(path));
g.fill(path);
path = decodePath13();
g.setPaint(decodeGradient12(path));
g.fill(path);
path = decodePath14();
g.setPaint(color37);
g.fill(path);
}
private void paintBackgroundSelectedAndPressedAndFocused(Graphics2D g) {
path = decodePath12();
g.setPaint(decodeGradient13(path));
g.fill(path);
path = decodePath13();
g.setPaint(decodeGradient14(path));
g.fill(path);
path = decodePath14();
g.setPaint(color37);
g.fill(path);
}
private Path2D decodePath1() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeAnchorX(0.7142857313156128f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.71428573f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.7142857313156128f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.2857143878936768f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.2857144f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.2857143878936768f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeX(3.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(3.0f), decodeY(3.0f));
path.lineTo(decodeX(0.0f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeX(0.0f), decodeY(0.71428573f));
path.closePath();
return path;
}
private Path2D decodePath2() {
path.reset();
path.moveTo(decodeX(0.14285715f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.5555555555555536f), decodeX(0.14285715f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.5555555555555536f), decodeAnchorX(0.8571428656578064f, -3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(0.85714287f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(0.8571428656578064f, 3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.142857074737549f, -3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(2.142857f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(2.142857074737549f, 3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.277777777777777f), decodeX(2.857143f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.277777777777777f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(2.857143f), decodeY(2.0f));
path.lineTo(decodeX(0.14285715f), decodeY(2.0f));
path.closePath();
return path;
}
private Path2D decodePath3() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(0.0f, 0.05555555555555555f), decodeAnchorY(0.7142857313156128f, 2.6111111111111125f), decodeAnchorX(0.8333333134651184f, -2.5000000000000018f), decodeAnchorY(0.0f, 0.0f), decodeX(0.8333333f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.8333333134651184f, 2.5000000000000018f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.2857143878936768f, -2.7222222222222143f), decodeAnchorY(0.0f, 0.0f), decodeX(2.2857144f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.2857143878936768f, 2.7222222222222143f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, -0.055555555555557135f), decodeAnchorY(0.7142857313156128f, -2.722222222222223f), decodeX(3.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(3.0f, 0.055555555555557135f), decodeAnchorY(0.7142857313156128f, 2.722222222222223f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(3.0f), decodeY(3.0f));
path.lineTo(decodeX(0.0f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.0f, -0.05555555555555555f), decodeAnchorY(0.7142857313156128f, -2.6111111111111125f), decodeX(0.0f), decodeY(0.71428573f));
path.closePath();
return path;
}
private Path2D decodePath4() {
path.reset();
path.moveTo(decodeX(0.16666667f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.1666666716337204f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.1666666716337204f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.6666666666666643f), decodeX(0.16666667f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(0.1666666716337204f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.6666666666666643f), decodeAnchorX(1.0f, -3.5555555555555536f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(1.0f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(1.0f, 3.5555555555555536f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.142857074737549f, -3.500000000000014f), decodeAnchorY(0.1428571492433548f, 0.05555555555555558f), decodeX(2.142857f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(2.142857074737549f, 3.500000000000014f), decodeAnchorY(0.1428571492433548f, -0.05555555555555558f), decodeAnchorX(2.857142925262451f, 0.055555555555557135f), decodeAnchorY(0.8571428656578064f, -3.6666666666666643f), decodeX(2.857143f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(2.857142925262451f, -0.055555555555557135f), decodeAnchorY(0.8571428656578064f, 3.6666666666666643f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(2.857143f), decodeY(2.0f));
path.lineTo(decodeX(0.16666667f), decodeY(2.0f));
path.closePath();
return path;
}
private Path2D decodePath5() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.8333333f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.8333333134651184f, -3.0f), decodeAnchorX(0.7142857313156128f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.71428573f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.7142857313156128f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.2857143878936768f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.2857144f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.2857143878936768f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.8333333134651184f, -3.0f), decodeX(3.0f), decodeY(0.8333333f));
path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.8333333134651184f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(3.0f), decodeY(3.0f));
path.lineTo(decodeX(0.0f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.8333333134651184f, 3.0f), decodeX(0.0f), decodeY(0.8333333f));
path.closePath();
return path;
}
private Path2D decodePath6() {
path.reset();
path.moveTo(decodeX(0.14285715f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(1.0f, 3.5555555555555536f), decodeX(0.14285715f), decodeY(1.0f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(1.0f, -3.5555555555555536f), decodeAnchorX(0.8571428656578064f, -3.444444444444443f), decodeAnchorY(0.1666666716337204f, 0.0f), decodeX(0.85714287f), decodeY(0.16666667f));
path.curveTo(decodeAnchorX(0.8571428656578064f, 3.444444444444443f), decodeAnchorY(0.1666666716337204f, 0.0f), decodeAnchorX(2.142857074737549f, -3.333333333333343f), decodeAnchorY(0.1666666716337204f, 0.0f), decodeX(2.142857f), decodeY(0.16666667f));
path.curveTo(decodeAnchorX(2.142857074737549f, 3.333333333333343f), decodeAnchorY(0.1666666716337204f, 0.0f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(1.0f, -3.277777777777777f), decodeX(2.857143f), decodeY(1.0f));
path.curveTo(decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(1.0f, 3.277777777777777f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(2.857143f), decodeY(2.0f));
path.lineTo(decodeX(0.14285715f), decodeY(2.0f));
path.closePath();
return path;
}
private Path2D decodePath7() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeAnchorX(0.7142857313156128f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.71428573f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.7142857313156128f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.2857143878936768f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.2857144f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.2857143878936768f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeX(3.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(3.0f), decodeY(2.0f));
path.lineTo(decodeX(0.0f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeX(0.0f), decodeY(0.71428573f));
path.closePath();
return path;
}
private Path2D decodePath8() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeAnchorX(0.5555555820465088f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.5555556f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.5555555820465088f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.444444417953491f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.4444444f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.444444417953491f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeX(3.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(3.0f), decodeY(2.0f));
path.lineTo(decodeX(0.0f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeX(0.0f), decodeY(0.71428573f));
path.closePath();
return path;
}
private Path2D decodePath9() {
path.reset();
path.moveTo(decodeX(0.11111111f), decodeY(2.0f));
path.curveTo(decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.5555555555555536f), decodeX(0.11111111f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.5555555555555536f), decodeAnchorX(0.6666666865348816f, -3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(0.6666667f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(0.6666666865348816f, 3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.3333332538604736f, -3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(2.3333333f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(2.3333332538604736f, 3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.277777777777777f), decodeX(2.8888888f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.277777777777777f), decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(2.0f, 0.0f), decodeX(2.8888888f), decodeY(2.0f));
path.lineTo(decodeX(0.11111111f), decodeY(2.0f));
path.closePath();
return path;
}
private Path2D decodePath10() {
path.reset();
path.moveTo(decodeX(0.14285715f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.5555555555555536f), decodeX(0.14285715f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(0.1428571492433548f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.5555555555555536f), decodeAnchorX(0.8571428656578064f, -3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(0.85714287f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(0.8571428656578064f, 3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.142857074737549f, -3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(2.142857f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(2.142857074737549f, 3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.277777777777777f), decodeX(2.857143f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.277777777777777f), decodeAnchorX(2.857142925262451f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(2.857143f), decodeY(3.0f));
path.lineTo(decodeX(0.14285715f), decodeY(3.0f));
path.closePath();
return path;
}
private Path2D decodePath11() {
path.reset();
path.moveTo(decodeX(1.4638889f), decodeY(2.25f));
path.lineTo(decodeX(1.4652778f), decodeY(2.777778f));
path.lineTo(decodeX(0.3809524f), decodeY(2.777778f));
path.lineTo(decodeX(0.375f), decodeY(0.88095236f));
path.curveTo(decodeAnchorX(0.375f, 0.0f), decodeAnchorY(0.8809523582458496f, -2.2500000000000004f), decodeAnchorX(0.8452380895614624f, -1.9166666666666647f), decodeAnchorY(0.380952388048172f, 0.0f), decodeX(0.8452381f), decodeY(0.3809524f));
path.lineTo(decodeX(2.1011903f), decodeY(0.3809524f));
path.curveTo(decodeAnchorX(2.1011903285980225f, 2.124999999999986f), decodeAnchorY(0.380952388048172f, 0.0f), decodeAnchorX(2.6309525966644287f, 0.0f), decodeAnchorY(0.863095223903656f, -2.5833333333333317f), decodeX(2.6309526f), decodeY(0.8630952f));
path.lineTo(decodeX(2.625f), decodeY(2.7638886f));
path.lineTo(decodeX(1.4666667f), decodeY(2.777778f));
path.lineTo(decodeX(1.4638889f), decodeY(2.2361114f));
path.lineTo(decodeX(2.3869045f), decodeY(2.222222f));
path.lineTo(decodeX(2.375f), decodeY(0.86904764f));
path.curveTo(decodeAnchorX(2.375f, -7.105427357601002E-15f), decodeAnchorY(0.8690476417541504f, -0.9166666666666679f), decodeAnchorX(2.095238208770752f, 1.0833333333333357f), decodeAnchorY(0.6071428656578064f, -1.7763568394002505E-15f), decodeX(2.0952382f), decodeY(0.60714287f));
path.lineTo(decodeX(0.8333334f), decodeY(0.6130952f));
path.curveTo(decodeAnchorX(0.8333333730697632f, -1.0f), decodeAnchorY(0.613095223903656f, 0.0f), decodeAnchorX(0.625f, 0.04166666666666696f), decodeAnchorY(0.8690476417541504f, -0.9583333333333339f), decodeX(0.625f), decodeY(0.86904764f));
path.lineTo(decodeX(0.6130952f), decodeY(2.2361114f));
path.lineTo(decodeX(1.4638889f), decodeY(2.25f));
path.closePath();
return path;
}
private Path2D decodePath12() {
path.reset();
path.moveTo(decodeX(0.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeAnchorX(0.5555555820465088f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.5555556f), decodeY(0.0f));
path.curveTo(decodeAnchorX(0.5555555820465088f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.444444417953491f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.4444444f), decodeY(0.0f));
path.curveTo(decodeAnchorX(2.444444417953491f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeX(3.0f), decodeY(0.71428573f));
path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(3.0f), decodeY(3.0f));
path.lineTo(decodeX(0.0f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeX(0.0f), decodeY(0.71428573f));
path.closePath();
return path;
}
private Path2D decodePath13() {
path.reset();
path.moveTo(decodeX(0.11111111f), decodeY(3.0f));
path.curveTo(decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.5555555555555536f), decodeX(0.11111111f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(0.1111111119389534f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.5555555555555536f), decodeAnchorX(0.6666666865348816f, -3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(0.6666667f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(0.6666666865348816f, 3.444444444444443f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.3333332538604736f, -3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeX(2.3333333f), decodeY(0.14285715f));
path.curveTo(decodeAnchorX(2.3333332538604736f, 3.333333333333343f), decodeAnchorY(0.1428571492433548f, 0.0f), decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(0.8571428656578064f, -3.277777777777777f), decodeX(2.8888888f), decodeY(0.85714287f));
path.curveTo(decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(0.8571428656578064f, 3.277777777777777f), decodeAnchorX(2.8888888359069824f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(2.8888888f), decodeY(3.0f));
path.lineTo(decodeX(0.11111111f), decodeY(3.0f));
path.closePath();
return path;
}
private Path2D decodePath14() {
path.reset();
path.moveTo(decodeX(1.4583333f), decodeY(2.25f));
path.lineTo(decodeX(1.4599359f), decodeY(2.777778f));
path.lineTo(decodeX(0.2962963f), decodeY(2.777778f));
path.lineTo(decodeX(0.29166666f), decodeY(0.88095236f));
path.curveTo(decodeAnchorX(0.2916666567325592f, 0.0f), decodeAnchorY(0.8809523582458496f, -2.2500000000000004f), decodeAnchorX(0.6574074029922485f, -1.9166666666666647f), decodeAnchorY(0.380952388048172f, 0.0f), decodeX(0.6574074f), decodeY(0.3809524f));
path.lineTo(decodeX(2.3009257f), decodeY(0.3809524f));
path.curveTo(decodeAnchorX(2.3009257316589355f, 2.124999999999986f), decodeAnchorY(0.380952388048172f, 0.0f), decodeAnchorX(2.712963104248047f, 0.0f), decodeAnchorY(0.863095223903656f, -2.5833333333333317f), decodeX(2.712963f), decodeY(0.8630952f));
path.lineTo(decodeX(2.7083333f), decodeY(2.7638886f));
path.lineTo(decodeX(1.4615384f), decodeY(2.777778f));
path.lineTo(decodeX(1.4583333f), decodeY(2.2361114f));
path.lineTo(decodeX(2.523148f), decodeY(2.222222f));
path.lineTo(decodeX(2.5138888f), decodeY(0.86904764f));
path.curveTo(decodeAnchorX(2.5138888359069824f, -7.105427357601002E-15f), decodeAnchorY(0.8690476417541504f, -0.9166666666666679f), decodeAnchorX(2.2962963581085205f, 1.0833333333333357f), decodeAnchorY(0.6071428656578064f, -1.7763568394002505E-15f), decodeX(2.2962964f), decodeY(0.60714287f));
path.lineTo(decodeX(0.6481482f), decodeY(0.6130952f));
path.curveTo(decodeAnchorX(0.6481481790542603f, -1.0f), decodeAnchorY(0.613095223903656f, 0.0f), decodeAnchorX(0.4861111044883728f, 0.04166666666666696f), decodeAnchorY(0.8690476417541504f, -0.9583333333333339f), decodeX(0.4861111f), decodeY(0.86904764f));
path.lineTo(decodeX(0.47685182f), decodeY(2.2361114f));
path.lineTo(decodeX(1.4583333f), decodeY(2.25f));
path.closePath();
return path;
}
private Paint decodeGradient1(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color1,
decodeColor(color1,color2,0.5f),
color2});
}
private Paint decodeGradient2(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.1f,0.2f,0.6f,1.0f },
new Color[] { color3,
decodeColor(color3,color4,0.5f),
color4,
decodeColor(color4,color5,0.5f),
color5});
}
private Paint decodeGradient3(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color6,
decodeColor(color6,color2,0.5f),
color2});
}
private Paint decodeGradient4(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.1f,0.2f,0.6f,1.0f },
new Color[] { color7,
decodeColor(color7,color8,0.5f),
color8,
decodeColor(color8,color9,0.5f),
color9});
}
private Paint decodeGradient5(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color10,
decodeColor(color10,color2,0.5f),
color2});
}
private Paint decodeGradient6(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.1f,0.2f,0.42096776f,0.64193547f,0.82096773f,1.0f },
new Color[] { color11,
decodeColor(color11,color12,0.5f),
color12,
decodeColor(color12,color13,0.5f),
color13,
decodeColor(color13,color14,0.5f),
color14});
}
private Paint decodeGradient7(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color15,
decodeColor(color15,color16,0.5f),
color16});
}
private Paint decodeGradient8(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.1f,0.2f,0.6f,1.0f },
new Color[] { color17,
decodeColor(color17,color18,0.5f),
color18,
decodeColor(color18,color5,0.5f),
color5});
}
private Paint decodeGradient9(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.12419355f,0.2483871f,0.42580646f,0.6032258f,0.6854839f,0.7677419f,0.88387096f,1.0f },
new Color[] { color19,
decodeColor(color19,color20,0.5f),
color20,
decodeColor(color20,color21,0.5f),
color21,
decodeColor(color21,color22,0.5f),
color22,
decodeColor(color22,color23,0.5f),
color23});
}
private Paint decodeGradient10(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color24,
decodeColor(color24,color2,0.5f),
color2});
}
private Paint decodeGradient11(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color25,
decodeColor(color25,color2,0.5f),
color2});
}
private Paint decodeGradient12(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.12419355f,0.2483871f,0.42580646f,0.6032258f,0.6854839f,0.7677419f,0.86774194f,0.9677419f },
new Color[] { color26,
decodeColor(color26,color27,0.5f),
color27,
decodeColor(color27,color28,0.5f),
color28,
decodeColor(color28,color29,0.5f),
color29,
decodeColor(color29,color30,0.5f),
color30});
}
private Paint decodeGradient13(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.5f,1.0f },
new Color[] { color25,
decodeColor(color25,color31,0.5f),
color31});
}
private Paint decodeGradient14(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float x = (float)bounds.getX();
float y = (float)bounds.getY();
float w = (float)bounds.getWidth();
float h = (float)bounds.getHeight();
return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y,
new float[] { 0.0f,0.12419355f,0.2483871f,0.42580646f,0.6032258f,0.6854839f,0.7677419f,0.8548387f,0.9419355f },
new Color[] { color32,
decodeColor(color32,color33,0.5f),
color33,
decodeColor(color33,color34,0.5f),
color34,
decodeColor(color34,color35,0.5f),
color35,
decodeColor(color35,color36,0.5f),
color36});
}
}
| [
"panzha@dian.so"
] | panzha@dian.so |
8448030cfa6cb6e5e0efcbda37424f2b5eb818e0 | 3c73a700a7d89b1028f6b5f907d4d0bbe640bf9a | /android/src/main/kotlin/lib/org/bouncycastle/crypto/params/RSAKeyParameters.java | eaf48750637cc689477ac43f6345863bf82f6e28 | [] | no_license | afterlogic/flutter_crypto_stream | 45efd60802261faa28ab6d10c2390a84231cf941 | 9d5684d5a7e63d3a4b2168395d454474b3ca4683 | refs/heads/master | 2022-11-02T02:56:45.066787 | 2021-03-25T17:45:58 | 2021-03-25T17:45:58 | 252,140,910 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,791 | java | package lib.org.bouncycastle.crypto.params;
import java.math.BigInteger;
public class RSAKeyParameters
extends AsymmetricKeyParameter
{
private static final BigInteger ONE = BigInteger.valueOf(1);
private BigInteger modulus;
private BigInteger exponent;
public RSAKeyParameters(
boolean isPrivate,
BigInteger modulus,
BigInteger exponent)
{
super(isPrivate);
if (!isPrivate)
{
if ((exponent.intValue() & 1) == 0)
{
throw new IllegalArgumentException("RSA publicExponent is even");
}
}
this.modulus = validate(modulus);
this.exponent = exponent;
}
private BigInteger validate(BigInteger modulus)
{
if ((modulus.intValue() & 1) == 0)
{
throw new IllegalArgumentException("RSA modulus is even");
}
// the value is the product of the 132 smallest primes from 3 to 751
if (!modulus.gcd(new BigInteger("145188775577763990151158743208307020242261438098488931355057091965" +
"931517706595657435907891265414916764399268423699130577757433083166" +
"651158914570105971074227669275788291575622090199821297575654322355" +
"049043101306108213104080801056529374892690144291505781966373045481" +
"8359472391642885328171302299245556663073719855")).equals(ONE))
{
throw new IllegalArgumentException("RSA modulus has a small prime factor");
}
// TODO: add additional primePower/Composite test - expensive!!
return modulus;
}
public BigInteger getModulus()
{
return modulus;
}
public BigInteger getExponent()
{
return exponent;
}
}
| [
"princesakenny98@gmail.com"
] | princesakenny98@gmail.com |
374e92f8f95c47aba8f777025860f23f3bbd2770 | ebf9dce63d3328cd7ac74b5ed51821202e927049 | /app/src/main/java/com/example/tyson/transguard/About.java | 7d75606483adeca9077d9f464615c07834e48dac | [] | no_license | tysonseaborn/TransGuard | cc6f74b66657656c0dd7367b59acf77a4af4e633 | 69b746e9ea96ba1f5ecca74513fa63d8cae0e3ca | refs/heads/master | 2021-03-12T22:36:42.291913 | 2014-12-01T03:28:14 | 2014-12-01T03:28:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | package com.example.tyson.transguard;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class About extends TransGuard {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.about, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_about) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"tysonseaborn@gmail.com"
] | tysonseaborn@gmail.com |
6a4c6fe90fe53139be21d58a9a8e6d9ca14b1d4a | 021d29ff6b61ea83d9abac2df7f9e6a23870e2b6 | /plugins/electric-irsim/src/main/java/com/sun/electric/plugins/irsim/SStep.java | bed0b9abb8f399663bd0ddc2bce93288a3c91929 | [] | no_license | MocSemag/Electric-VLSI | fbda0859b7fe789d56ac9c405d412f2710a427e7 | 338c7f87811c5d595e3aedc33c6613a8fe324ef6 | refs/heads/master | 2021-12-02T01:48:49.899708 | 2011-02-19T20:54:40 | 2011-02-19T20:54:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,900 | java | /* -*- tab-width: 4 -*-
*
* Electric(tm) VLSI Design System
*
* File: SStep.java
* IRSIM simulator
* Translated by Steven M. Rubin, Sun Microsystems.
*
* Copyright (C) 1988, 1990 Stanford University.
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. Stanford University
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*/
package com.sun.electric.plugins.irsim;
public class SStep extends Eval
{
SStep(Sim sim)
{
super(sim);
}
/* event-driven switch-level simulation step Chris Terman 7/84 */
/* the following contains most of the declarations, conversion
* tables, etc, that depend on the particular representation chosen
* for node values. This info is automatically created for interval
* value sets (see Chapter 5 of my thesis) by gentbl.c. Except
* for the chargedState and thevValue arrays and their associated
* code, the rest of the code is independent of the value set details...
*/
/* index for each value interval */
private static final int EMPTY = 0;
private static final int DH = 1;
private static final int DHWH = 2;
private static final int DHCH = 3;
private static final int DHcH = 4;
private static final int DHZ = 5;
private static final int DHcL = 6;
private static final int DHCL = 7;
private static final int DHWL = 8;
private static final int DHDL = 9;
private static final int WH = 10;
private static final int WHCH = 11;
private static final int WHcH = 12;
private static final int WHZ = 13;
private static final int WHcL = 14;
private static final int WHCL = 15;
private static final int WHWL = 16;
private static final int WHDL = 17;
private static final int CH = 18;
private static final int CHcH = 19;
private static final int CHZ = 20;
private static final int CHcL = 21;
private static final int CHCL = 22;
private static final int CHWL = 23;
private static final int CHDL = 24;
private static final int cH = 25;
private static final int cHZ = 26;
private static final int cHcL = 27;
private static final int cHCL = 28;
private static final int cHWL = 29;
private static final int cHDL = 30;
private static final int Z = 31;
private static final int ZcL = 32;
private static final int ZCL = 33;
private static final int ZWL = 34;
private static final int ZDL = 35;
private static final int cL = 36;
private static final int cLCL = 37;
private static final int cLWL = 38;
private static final int cLDL = 39;
private static final int CL = 40;
private static final int CLWL = 41;
private static final int CLDL = 42;
private static final int WL = 43;
private static final int WLDL = 44;
private static final int DL = 45;
private static String [] nodeValues = new String[]
{
"EMPTY",
"DH",
"DHWH",
"DHCH",
"DHcH",
"DHZ",
"DHcL",
"DHCL",
"DHWL",
"DHDL",
"WH",
"WHCH",
"WHcH",
"WHZ",
"WHcL",
"WHCL",
"WHWL",
"WHDL",
"CH",
"CHcH",
"CHZ",
"CHcL",
"CHCL",
"CHWL",
"CHDL",
"cH",
"cHZ",
"cHcL",
"cHCL",
"cHWL",
"cHDL",
"Z",
"ZcL",
"ZCL",
"ZWL",
"ZDL",
"cL",
"cLCL",
"cLWL",
"cLDL",
"CL",
"CLWL",
"CLDL",
"WL",
"WLDL",
"DL"
};
/* conversion between interval and logic value */
private static byte [] logicState = new byte[]
{
0, /* EMPTY state */
Sim.HIGH, /* DH */
Sim.HIGH, /* DHWH */
Sim.HIGH, /* DHCH */
Sim.HIGH, /* DHcH */
Sim.X, /* DHZ */
Sim.X, /* DHcL */
Sim.X, /* DHCL */
Sim.X, /* DHWL */
Sim.X, /* DHDL */
Sim.HIGH, /* WH */
Sim.HIGH, /* WHCH */
Sim.HIGH, /* WHcH */
Sim.X, /* WHZ */
Sim.X, /* WHcL */
Sim.X, /* WHCL */
Sim.X, /* WHWL */
Sim.X, /* WHDL */
Sim.HIGH, /* CH */
Sim.HIGH, /* CHcH */
Sim.X, /* CHZ */
Sim.X, /* CHcL */
Sim.X, /* CHCL */
Sim.X, /* CHWL */
Sim.X, /* CHDL */
Sim.HIGH, /* cH */
Sim.X, /* cHZ */
Sim.X, /* cHcL */
Sim.X, /* cHCL */
Sim.X, /* cHWL */
Sim.X, /* cHDL */
Sim.X, /* Z */
Sim.X, /* ZcL */
Sim.X, /* ZCL */
Sim.X, /* ZWL */
Sim.X, /* ZDL */
Sim.LOW, /* cL */
Sim.LOW, /* cLCL */
Sim.LOW, /* cLWL */
Sim.LOW, /* cLDL */
Sim.LOW, /* CL */
Sim.LOW, /* CLWL */
Sim.LOW, /* CLDL */
Sim.LOW, /* WL */
Sim.LOW, /* WLDL */
Sim.LOW, /* DL */
};
/* transmit interval through switch */
private static byte [][] transmit = new byte[][]
{
new byte[] {0, 0, 0, 0}, /* EMPTY state */
new byte[] {Z, DH, DHZ, WH}, /* DH */
new byte[] {Z, DHWH, DHZ, WH}, /* DHWH */
new byte[] {Z, DHCH, DHZ, WHCH}, /* DHCH */
new byte[] {Z, DHcH, DHZ, WHcH}, /* DHcH */
new byte[] {Z, DHZ, DHZ, WHZ}, /* DHZ */
new byte[] {Z, DHcL, DHcL, WHcL}, /* DHcL */
new byte[] {Z, DHCL, DHCL, WHCL}, /* DHCL */
new byte[] {Z, DHWL, DHWL, WHWL}, /* DHWL */
new byte[] {Z, DHDL, DHDL, WHWL}, /* DHDL */
new byte[] {Z, WH, WHZ, WH}, /* WH */
new byte[] {Z, WHCH, WHZ, WHCH}, /* WHCH */
new byte[] {Z, WHcH, WHZ, WHcH}, /* WHcH */
new byte[] {Z, WHZ, WHZ, WHZ}, /* WHZ */
new byte[] {Z, WHcL, WHcL, WHcL}, /* WHcL */
new byte[] {Z, WHCL, WHCL, WHCL}, /* WHCL */
new byte[] {Z, WHWL, WHWL, WHWL}, /* WHWL */
new byte[] {Z, WHDL, WHDL, WHWL}, /* WHDL */
new byte[] {Z, CH, CHZ, CH}, /* CH */
new byte[] {Z, CHcH, CHZ, CHcH}, /* CHcH */
new byte[] {Z, CHZ, CHZ, CHZ}, /* CHZ */
new byte[] {Z, CHcL, CHcL, CHcL}, /* CHcL */
new byte[] {Z, CHCL, CHCL, CHCL}, /* CHCL */
new byte[] {Z, CHWL, CHWL, CHWL}, /* CHWL */
new byte[] {Z, CHDL, CHDL, CHWL}, /* CHDL */
new byte[] {Z, cH, cHZ, cH}, /* cH */
new byte[] {Z, cHZ, cHZ, cHZ}, /* cHZ */
new byte[] {Z, cHcL, cHcL, cHcL}, /* cHcL */
new byte[] {Z, cHCL, cHCL, cHCL}, /* cHCL */
new byte[] {Z, cHWL, cHWL, cHWL}, /* cHWL */
new byte[] {Z, cHDL, cHDL, cHWL}, /* cHDL */
new byte[] {Z, Z, Z, Z}, /* Z */
new byte[] {Z, ZcL, ZcL, ZcL}, /* ZcL */
new byte[] {Z, ZCL, ZCL, ZCL}, /* ZCL */
new byte[] {Z, ZWL, ZWL, ZWL}, /* ZWL */
new byte[] {Z, ZDL, ZDL, ZWL}, /* ZDL */
new byte[] {Z, cL, ZcL, cL}, /* cL */
new byte[] {Z, cLCL, ZCL, cLCL}, /* cLCL */
new byte[] {Z, cLWL, ZWL, cLWL}, /* cLWL */
new byte[] {Z, cLDL, ZDL, cLWL}, /* cLDL */
new byte[] {Z, CL, ZCL, CL}, /* CL */
new byte[] {Z, CLWL, ZWL, CLWL}, /* CLWL */
new byte[] {Z, CLDL, ZDL, CLWL}, /* CLDL */
new byte[] {Z, WL, ZWL, WL}, /* WL */
new byte[] {Z, WLDL, ZDL, WL}, /* WLDL */
new byte[] {Z, DL, ZDL, WL} /* DL */
};
/* tables for converting node value to corresponding charged state */
private static byte [] chargedState = new byte[] {CL, CHCL, CHCL, CH};
private static byte [] xChargedState = new byte[] {cL, cHcL, cHcL, cH};
/* table for converting node value to corresponding value state */
private static byte [] thevValue = new byte[] {DL, DHDL, DHDL, DH};
/* result of shorting two intervals */
private static byte [][] sMerge = new byte[][]
{
/* EMPTY state */
new byte[] {0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0},
/* DH */
new byte[] {0, DH, DH, DH, DH, DH, DH, DH,
DH, DHDL, DH, DH, DH, DH, DH, DH,
DH, DHDL, DH, DH, DH, DH, DH, DH,
DHDL, DH, DH, DH, DH, DH, DHDL, DH,
DH, DH, DH, DHDL, DH, DH, DH, DHDL,
DH, DH, DHDL, DH, DHDL, DHDL},
/* DHWH */
new byte[] {0, DH, DHWH, DHWH, DHWH, DHWH, DHWH, DHWH,
DHWL, DHDL, DHWH, DHWH, DHWH, DHWH, DHWH, DHWH,
DHWL, DHDL, DHWH, DHWH, DHWH, DHWH, DHWH, DHWL,
DHDL, DHWH, DHWH, DHWH, DHWH, DHWL, DHDL, DHWH,
DHWH, DHWH, DHWL, DHDL, DHWH, DHWH, DHWL, DHDL,
DHWH, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHCH */
new byte[] {0, DH, DHWH, DHCH, DHCH, DHCH, DHCH, DHCL,
DHWL, DHDL, DHWH, DHCH, DHCH, DHCH, DHCH, DHCL,
DHWL, DHDL, DHCH, DHCH, DHCH, DHCH, DHCL, DHWL,
DHDL, DHCH, DHCH, DHCH, DHCL, DHWL, DHDL, DHCH,
DHCH, DHCL, DHWL, DHDL, DHCH, DHCL, DHWL, DHDL,
DHCL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHcH */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHcH, DHcL, DHCL,
DHWL, DHDL, DHWH, DHCH, DHcH, DHcH, DHcL, DHCL,
DHWL, DHDL, DHCH, DHcH, DHcH, DHcL, DHCL, DHWL,
DHDL, DHcH, DHcH, DHcL, DHCL, DHWL, DHDL, DHcH,
DHcL, DHCL, DHWL, DHDL, DHcL, DHCL, DHWL, DHDL,
DHCL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHZ */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, DHCH, DHcH, DHZ, DHcL, DHCL, DHWL,
DHDL, DHcH, DHZ, DHcL, DHCL, DHWL, DHDL, DHZ,
DHcL, DHCL, DHWL, DHDL, DHcL, DHCL, DHWL, DHDL,
DHCL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHcL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, DHCH, DHcL, DHcL, DHcL, DHCL, DHWL,
DHDL, DHcL, DHcL, DHcL, DHCL, DHWL, DHDL, DHcL,
DHcL, DHCL, DHWL, DHDL, DHcL, DHCL, DHWL, DHDL,
DHCL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, DHCL, DHCL, DHCL, DHCL, DHCL, DHWL,
DHDL, DHCL, DHCL, DHCL, DHCL, DHWL, DHDL, DHCL,
DHCL, DHCL, DHWL, DHDL, DHCL, DHCL, DHWL, DHDL,
DHCL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHDL, DHWL, DHWL, DHWL, DHWL, DHWL, DHDL, DHWL,
DHWL, DHWL, DHWL, DHDL, DHWL, DHWL, DHWL, DHDL,
DHWL, DHWL, DHDL, DHWL, DHDL, DHDL},
/* DHDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DHDL, DHDL, DHDL, DHDL},
/* WH */
new byte[] {0, DH, DHWH, DHWH, DHWH, DHWH, DHWH, DHWH,
DHWL, DHDL, WH, WH, WH, WH, WH, WH,
WHWL, WHDL, WH, WH, WH, WH, WH, WHWL,
WHDL, WH, WH, WH, WH, WHWL, WHDL, WH,
WH, WH, WHWL, WHDL, WH, WH, WHWL, WHDL,
WH, WHWL, WHDL, WHWL, WHDL, DL},
/* WHCH */
new byte[] {0, DH, DHWH, DHCH, DHCH, DHCH, DHCH, DHCL,
DHWL, DHDL, WH, WHCH, WHCH, WHCH, WHCH, WHCL,
WHWL, WHDL, WHCH, WHCH, WHCH, WHCH, WHCL, WHWL,
WHDL, WHCH, WHCH, WHCH, WHCL, WHWL, WHDL, WHCH,
WHCH, WHCL, WHWL, WHDL, WHCH, WHCL, WHWL, WHDL,
WHCL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHcH */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHcH, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHcH, WHcL, WHCL,
WHWL, WHDL, WHCH, WHcH, WHcH, WHcL, WHCL, WHWL,
WHDL, WHcH, WHcH, WHcL, WHCL, WHWL, WHDL, WHcH,
WHcL, WHCL, WHWL, WHDL, WHcL, WHCL, WHWL, WHDL,
WHCL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHZ */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHZ, WHcL, WHCL,
WHWL, WHDL, WHCH, WHcH, WHZ, WHcL, WHCL, WHWL,
WHDL, WHcH, WHZ, WHcL, WHCL, WHWL, WHDL, WHZ,
WHcL, WHCL, WHWL, WHDL, WHcL, WHCL, WHWL, WHDL,
WHCL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHcL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcL, WHcL, WHcL, WHCL,
WHWL, WHDL, WHCH, WHcL, WHcL, WHcL, WHCL, WHWL,
WHDL, WHcL, WHcL, WHcL, WHCL, WHWL, WHDL, WHcL,
WHcL, WHCL, WHWL, WHDL, WHcL, WHCL, WHWL, WHDL,
WHCL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, WHCL, WHCL, WHCL, WHCL, WHCL, WHWL,
WHDL, WHCL, WHCL, WHCL, WHCL, WHWL, WHDL, WHCL,
WHCL, WHCL, WHWL, WHDL, WHCL, WHCL, WHWL, WHDL,
WHCL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHDL, WHWL,
WHWL, WHWL, WHWL, WHDL, WHWL, WHWL, WHWL, WHDL,
WHWL, WHWL, WHDL, WHWL, WHDL, DL},
/* WHDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, WHDL, WHDL, WHDL, DL},
/* CH */
new byte[] {0, DH, DHWH, DHCH, DHCH, DHCH, DHCH, DHCL,
DHWL, DHDL, WH, WHCH, WHCH, WHCH, WHCH, WHCL,
WHWL, WHDL, CH, CH, CH, CH, CHCL, CHWL,
CHDL, CH, CH, CH, CHCL, CHWL, CHDL, CH,
CH, CHCL, CHWL, CHDL, CH, CHCL, CHWL, CHDL,
CHCL, CHWL, CHDL, WL, WLDL, DL},
/* CHcH */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHcH, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHcH, WHcL, WHCL,
WHWL, WHDL, CH, CHcH, CHcH, CHcL, CHCL, CHWL,
CHDL, CHcH, CHcH, CHcL, CHCL, CHWL, CHDL, CHcH,
CHcL, CHCL, CHWL, CHDL, CHcL, CHCL, CHWL, CHDL,
CHCL, CHWL, CHDL, WL, WLDL, DL},
/* CHZ */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHZ, WHcL, WHCL,
WHWL, WHDL, CH, CHcH, CHZ, CHcL, CHCL, CHWL,
CHDL, CHcH, CHZ, CHcL, CHCL, CHWL, CHDL, CHZ,
CHcL, CHCL, CHWL, CHDL, CHcL, CHCL, CHWL, CHDL,
CHCL, CHWL, CHDL, WL, WLDL, DL},
/* CHcL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcL, WHcL, WHcL, WHCL,
WHWL, WHDL, CH, CHcL, CHcL, CHcL, CHCL, CHWL,
CHDL, CHcL, CHcL, CHcL, CHCL, CHWL, CHDL, CHcL,
CHcL, CHCL, CHWL, CHDL, CHcL, CHCL, CHWL, CHDL,
CHCL, CHWL, CHDL, WL, WLDL, DL},
/* CHCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, CHCL, CHCL, CHCL, CHCL, CHCL, CHWL,
CHDL, CHCL, CHCL, CHCL, CHCL, CHWL, CHDL, CHCL,
CHCL, CHCL, CHWL, CHDL, CHCL, CHCL, CHWL, CHDL,
CHCL, CHWL, CHDL, WL, WLDL, DL},
/* CHWL */
new byte[] { 0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHWL,
CHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHDL, CHWL,
CHWL, CHWL, CHWL, CHDL, CHWL, CHWL, CHWL, CHDL,
CHWL, CHWL, CHDL, WL, WLDL, DL},
/* CHDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, CHDL, CHDL, WLDL, WLDL, DL},
/* cH */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHcH, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHcH, WHcL, WHCL,
WHWL, WHDL, CH, CHcH, CHcH, CHcL, CHCL, CHWL,
CHDL, cH, cH, cHcL, cHCL, cHWL, cHDL, cH,
cHcL, cHCL, cHWL, cHDL, cHcL, cHCL, cHWL, cHDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cHZ */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHZ, WHcL, WHCL,
WHWL, WHDL, CH, CHcH, CHZ, CHcL, CHCL, CHWL,
CHDL, cH, cHZ, cHcL, cHCL, cHWL, cHDL, cHZ,
cHcL, cHCL, cHWL, cHDL, cHcL, cHCL, cHWL, cHDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cHcL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcL, WHcL, WHcL, WHCL,
WHWL, WHDL, CH, CHcL, CHcL, CHcL, CHCL, CHWL,
CHDL, cHcL, cHcL, cHcL, cHCL, cHWL, cHDL, cHcL,
cHcL, cHCL, cHWL, cHDL, cHcL, cHCL, cHWL, cHDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cHCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, CHCL, CHCL, CHCL, CHCL, CHCL, CHWL,
CHDL, cHCL, cHCL, cHCL, cHCL, cHWL, cHDL, cHCL,
cHCL, cHCL, cHWL, cHDL, cHCL, cHCL, cHWL, cHDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cHWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHWL,
CHDL, cHWL, cHWL, cHWL, cHWL, cHWL, cHDL, cHWL,
cHWL, cHWL, cHWL, cHDL, cHWL, cHWL, cHWL, cHDL,
CLWL, CLWL, CLDL, WL, WLDL, DL},
/* cHDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL,
cHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL,
CLDL, CLDL, CLDL, WLDL, WLDL, DL},
/* Z */
new byte[] {0, DH, DHWH, DHCH, DHcH, DHZ, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcH, WHZ, WHcL, WHCL,
WHWL, WHDL, CH, CHcH, CHZ, CHcL, CHCL, CHWL,
CHDL, cH, cHZ, cHcL, cHCL, cHWL, cHDL, Z,
ZcL, ZCL, ZWL, ZDL, cL, cLCL, cLWL, cLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* ZcL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcL, WHcL, WHcL, WHCL,
WHWL, WHDL, CH, CHcL, CHcL, CHcL, CHCL, CHWL,
CHDL, cHcL, cHcL, cHcL, cHCL, cHWL, cHDL, ZcL,
ZcL, ZCL, ZWL, ZDL, cL, cLCL, cLWL, cLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* ZCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, CHCL, CHCL, CHCL, CHCL, CHCL, CHWL,
CHDL, cHCL, cHCL, cHCL, cHCL, cHWL, cHDL, ZCL,
ZCL, ZCL, ZWL, ZDL, cLCL, cLCL, cLWL, cLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* ZWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHWL,
CHDL, cHWL, cHWL, cHWL, cHWL, cHWL, cHDL, ZWL,
ZWL, ZWL, ZWL, ZDL, cLWL, cLWL, cLWL, cLDL,
CLWL, CLWL, CLDL, WL, WLDL, DL},
/* ZDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL, ZDL,
ZDL, ZDL, ZDL, ZDL, cLDL, cLDL, cLDL, cLDL,
CLDL, CLDL, CLDL, WLDL, WLDL, DL},
/* cL */
new byte[] {0, DH, DHWH, DHCH, DHcL, DHcL, DHcL, DHCL,
DHWL, DHDL, WH, WHCH, WHcL, WHcL, WHcL, WHCL,
WHWL, WHDL, CH, CHcL, CHcL, CHcL, CHCL, CHWL,
CHDL, cHcL, cHcL, cHcL, cHCL, cHWL, cHDL, cL,
cL, cLCL, cLWL, cLDL, cL, cLCL, cLWL, cLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cLCL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, CHCL, CHCL, CHCL, CHCL, CHCL, CHWL,
CHDL, cHCL, cHCL, cHCL, cHCL, cHWL, cHDL, cLCL,
cLCL, cLCL, cLWL, cLDL, cLCL, cLCL, cLWL, cLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* cLWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHWL,
CHDL, cHWL, cHWL, cHWL, cHWL, cHWL, cHDL, cLWL,
cLWL, cLWL, cLWL, cLDL, cLWL, cLWL, cLWL, cLDL,
CLWL, CLWL, CLDL, WL, WLDL, DL},
/* cLDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cHDL, cLDL,
cLDL, cLDL, cLDL, cLDL, cLDL, cLDL, cLDL, cLDL,
CLDL, CLDL, CLDL, WLDL, WLDL, DL},
/* CL */
new byte[] {0, DH, DHWH, DHCL, DHCL, DHCL, DHCL, DHCL,
DHWL, DHDL, WH, WHCL, WHCL, WHCL, WHCL, WHCL,
WHWL, WHDL, CHCL, CHCL, CHCL, CHCL, CHCL, CHWL,
CHDL, CL, CL, CL, CL, CLWL, CLDL, CL,
CL, CL, CLWL, CLDL, CL, CL, CLWL, CLDL,
CL, CLWL, CLDL, WL, WLDL, DL},
/* CLWL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, CHWL, CHWL, CHWL, CHWL, CHWL, CHWL,
CHDL, CLWL, CLWL, CLWL, CLWL, CLWL, CLDL, CLWL,
CLWL, CLWL, CLWL, CLDL, CLWL, CLWL, CLWL, CLDL,
CLWL, CLWL, CLDL, WL, WLDL, DL},
/* CLDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, CHDL, CHDL, CHDL, CHDL, CHDL, CHDL,
CHDL, CLDL, CLDL, CLDL, CLDL, CLDL, CLDL, CLDL,
CLDL, CLDL, CLDL, CLDL, CLDL, CLDL, CLDL, CLDL,
CLDL, CLDL, CLDL, WLDL, WLDL, DL},
/* WL */
new byte[] {0, DH, DHWL, DHWL, DHWL, DHWL, DHWL, DHWL,
DHWL, DHDL, WHWL, WHWL, WHWL, WHWL, WHWL, WHWL,
WHWL, WHDL, WL, WL, WL, WL, WL, WL,
WLDL, WL, WL, WL, WL, WL, WLDL, WL,
WL, WL, WL, WLDL, WL, WL, WL, WLDL,
WL, WL, WLDL, WL, WLDL, DL},
/* WLDL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, WHDL, WHDL, WHDL, WHDL, WHDL, WHDL,
WHDL, WHDL, WLDL, WLDL, WLDL, WLDL, WLDL, WLDL,
WLDL, WLDL, WLDL, WLDL, WLDL, WLDL, WLDL, WLDL,
WLDL, WLDL, WLDL, WLDL, WLDL, WLDL, WLDL, WLDL,
WLDL, WLDL, WLDL, WLDL, WLDL, DL},
/* DL */
new byte[] {0, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL, DHDL,
DHDL, DHDL, DL, DL, DL, DL, DL, DL,
DL, DL, DL, DL, DL, DL, DL, DL,
DL, DL, DL, DL, DL, DL, DL, DL,
DL, DL, DL, DL, DL, DL, DL, DL,
DL, DL, DL, DL, DL, DL}
};
/**
* calculate new value for node and its electrical neighbor
*/
public void modelEvaluate(Sim.Node n)
{
if ((n.nFlags & Sim.VISITED) != 0)
theSim.buildConnList(n);
/* for each node on list we just built, recompute its value using a
* recursive tree walk. If logic state of new value differs from
* logic state of current value, node is added to the event list (or
* if it's already there, just the eval field is updated). If logic
* states do not differ, node's value is updated on the spot and any
* pending events removed.
*/
for(Sim.Node thisOne = n; thisOne != null; thisOne = thisOne.nLink)
{
int newVal = 0;
long tau = 0, delta = 0;
if ((thisOne.nFlags & Sim.INPUT) != 0)
newVal = thisOne.nPot;
else
{
newVal = logicState[scThev(thisOne, (thisOne.nFlags & Sim.WATCHED) != 0 ? 1 : 0)];
switch(newVal)
{
case Sim.LOW:
delta = thisOne.tpHL;
break;
case Sim.X:
delta = 0;
break;
case Sim.HIGH:
delta = thisOne.tpLH;
break;
}
tau = delta;
if (delta == 0) // no zero-delay events
delta = 1;
}
if ((thisOne.nFlags & Sim.INPUT) == 0)
{
// Check to see if this new value invalidates other events.
// Since this event has newer info about the state of the network,
// delete transitions scheduled to come after it.
Event e;
while((e = thisOne.events) != null && e.nTime >= theSim.curDelta + delta)
{
/*
* Do not try to kick the event scheduled at Sched.curDelta if
* newVal is equal to this.nPot because that event sets
* this.nPot, but its consequences has not been handled yet.
* Besides, this event will not be queued.
*
* However, if there is event scheduled now but driving to a
* different value, then kick it because we will enqueue this
* one, and source/drain of transistors controlled by this
* node will be re-evaluated. At worst, some extra computation
* will be carried out due to VISITED flags set previously.
*/
/* if (e.nTime == Sched.curDelta and newVal == thisOne.nPot) */
if (e.nTime == (theSim.curDelta + delta) && e.eval == newVal)
break;
puntEvent(thisOne, e);
}
// Now see if the new value is different from the last value
// scheduled for the node. If there are no pending events then
// just use the current value.
boolean queued = false;
if (newVal != ((e == null) ? thisOne.nPot : e.eval))
{
queued = true;
enqueueEvent(thisOne, newVal, delta, tau);
}
if ((thisOne.nFlags & Sim.WATCHED) != 0 && (theSim.irDebug & (Sim.DEBUG_DC | Sim.DEBUG_EV)) != 0)
{
System.out.println(" [event " + theSim.curNode.nName + "->" +
Sim.vChars.charAt(theSim.curNode.nPot) + " @ " +
Sim.deltaToNS(theSim.curDelta) + "] ");
System.out.println(queued ? "causes transition for" : "sets");
System.out.println(" " + thisOne.nName + ": " + Sim.vChars.charAt(thisOne.nPot) + " -> " +
Sim.vChars.charAt(newVal) + " (delay = " + Sim.deltaToNS(delta) + "ns)");
}
}
}
// undo connection list
Sim.Node next = null;
for(Sim.Node thisOne = n; thisOne != null; thisOne = next)
{
next = thisOne.nLink;
thisOne.nLink = null;
}
}
/**
* compute new value for a node using recursive tree walk. We start off by
* assuming that node is charged to whatever logic state it had last. The
* contribution of each path leading away from the node is computed
* recursively and merged with accumulated result. After all paths have been
* examined, return the answer!
*
* Notes: The node-visited flag is set during the computation of a node's
* value. This keeps the tree walk expanding outward; loops are avoided.
* Since the flag is cleared at the end of the computation, all paths
* through the network will eventually be explored. (If it had been
* left set, only a single path through a particular cycle would be
* explored).
*
* In order to speed up the computation, the result of each recursive
* call is cached. There are 2 caches associated with each transistor:
* the source cache remembers the value of the subnetwork that includes
* the transistor and everything attached to its drain. The drain cache
* is symmetrical. Use of these caches reduces the complexity of the
* new-value computation from O(n**2) to O(n) where n is the number of
* nodes in the connection list built in the new_value routine.
*/
private int scThev(Sim.Node n, int level)
{
int result = 0;
if ((n.nFlags & Sim.INPUT) != 0)
{
result = thevValue[n.nPot];
} else
{
// initial values and stuff...
n.nFlags |= Sim.VISITED;
result = (n.nGateList.size() == 0) ? xChargedState[n.nPot] : chargedState[n.nPot];
for(Sim.Trans t : n.nTermList)
{
// don't bother with off transistors
if (t.state == Sim.OFF) continue;
// for each non-off transistor, do nothing if node on other side has
// its visited flag set (this is how cycles are detected). Otherwise
// check cache and use value found there, if any. As a last resort,
// actually compute value for network on other side of transistor,
// transmit the value through the transistor, and save that result
// for later use.
if (n == t.source)
{
if ((t.drain.nFlags & Sim.VISITED) == 0)
{
if (t.getDI() == EMPTY)
t.setDI(transmit[scThev(t.drain, level != 0 ? level + 1 : 0)][t.state]);
result = sMerge[result][t.getDI()];
}
} else
{
if ((t.source.nFlags & Sim.VISITED) == 0)
{
if (t.getSI() == EMPTY)
t.setSI( transmit[scThev(t.source, level != 0 ? level + 1 : 0)][t.state]);
result = sMerge[result][t.getSI()];
}
}
}
n.nFlags &= ~Sim.VISITED;
}
if ((theSim.irDebug & (Sim.DEBUG_DC | Sim.DEBUG_TW)) != 0 && level > 0)
{
System.out.print(" ");
for(int i = level; --i > 0; )
System.out.print(" ");
System.out.println("scThev(" + n.nName + ") = " + nodeValues[result]);
}
return result;
}
}
| [
"nadezhin@b64ed6c1-75a8-e629-b1da-d0dae74a743a"
] | nadezhin@b64ed6c1-75a8-e629-b1da-d0dae74a743a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.