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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b2159a1cb62d7556315a8b18821967142d9fa8d9 | 44f788d5ac7b17b8898561f35c79fd4abea74c67 | /src/test/java/guru/qa/Utils.java | 6cc260bbcdcf14b1e2dfbd64df3a40ddee1a0786 | [] | no_license | daramirra/qaGuruHomeWork7 | c2199bfe29c22fde65c5e0cc3d60d8d6ebbea82a | e55df2f508efb32aa0c52c292a3f87e47ab55f5e | refs/heads/master | 2023-07-11T14:01:55.572017 | 2021-08-14T09:20:47 | 2021-08-14T09:20:47 | 389,720,090 | 0 | 1 | null | 2021-08-14T09:20:47 | 2021-07-26T17:44:18 | Java | UTF-8 | Java | false | false | 3,132 | java | package guru.qa;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.model.FileHeader;
import org.apache.commons.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.apache.pdfbox.text.PDFTextStripperByArea;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import static java.util.Objects.requireNonNull;
public final class Utils {
private Utils() {
}
public static InputStream getInputStreamForFileName(String fileName) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
return classLoader.getResourceAsStream(fileName);
}
public static String readFromDocx(String fileName) throws IOException, InvalidFormatException {
InputStream stream = getInputStreamForFileName(fileName);
XWPFDocument xdoc = new XWPFDocument(OPCPackage.open(stream));
XWPFWordExtractor extractor = new XWPFWordExtractor(xdoc);
return extractor.getText().trim();
}
public static String readFirstCellFromXlsx(String fileName) throws IOException {
InputStream stream = getInputStreamForFileName(fileName);
XSSFWorkbook workbook = new XSSFWorkbook(stream);
XSSFSheet sheet = workbook.getSheetAt(0);
XSSFRow row = sheet.getRow(0);
XSSFCell cell = row.getCell(row.getFirstCellNum());
return cell.getStringCellValue();
}
public static String readFirstLineFromPdf(String fileName) throws IOException {
InputStream stream = getInputStreamForFileName(fileName);
try (PDDocument document = PDDocument.load(stream)) {
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
stripper.setSortByPosition(true);
PDFTextStripper tStripper = new PDFTextStripper();
String pdfFileInText = tStripper.getText(document);
String[] lines = pdfFileInText.split("\\r?\\n");
return lines[0].trim();
}
}
public static String readFromZip(String fileName, String fileNameInZip, String password) throws URISyntaxException, IOException {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(requireNonNull(classLoader.getResource(fileName)).toURI());
ZipFile zipFile = new ZipFile(file, password.toCharArray());
FileHeader fileHeader = zipFile.getFileHeader(fileNameInZip);
InputStream inputStream = zipFile.getInputStream(fileHeader);
return IOUtils.toString(inputStream, StandardCharsets.UTF_8);
}
} | [
"linuxlinux"
] | linuxlinux |
49a98aa3db5e6e9c8e5aa9322c0c47d8496506d3 | 3ea8b400f7ceedae8ccb67f48ea76f4cf699a4de | /app/src/main/java/xzp/fsh/org/mytheme/WelActivity.java | 625061068cc644bea483a1d99e753bfb1d81ccf6 | [] | no_license | summerfsh/MyTheme | 4c8532fc02604c53c49e73b901c1d543d6ca1287 | edc26eab4efa58278ed296826e493af9e104f940 | refs/heads/master | 2021-01-20T15:33:47.196340 | 2016-08-05T03:44:39 | 2016-08-05T03:44:39 | 64,986,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package xzp.fsh.org.mytheme;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class WelActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wel);
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(3000);
WelActivity.this.startActivity(new Intent(WelActivity.this,MainActivity.class));
}catch (Exception e){
}
}
}).start();
}
}
| [
"v-shefan@microsoft.com"
] | v-shefan@microsoft.com |
1991c93328d0e6241620f13c53314bcc2abe1cb8 | 352a849fc9505f7a28c9188e9a28be5fa49073b9 | /fss-search-sdk/fss-search-server/es-plugin/face-retrieval-plugin/src/main/java/org/elasticsearch/index/query/image/AbstractFeatureScorer.java | 1fb16cc5cb797de1db293f86d877dc0925ceaa62 | [
"Apache-2.0"
] | permissive | SelinCao/MyThirdRepository20190322 | 975a41ab9f32051f0d456db296da1c9ca05f4872 | 00746d02e0b30384af92fd3e04678c0e16d06ce4 | refs/heads/master | 2020-04-30T20:08:25.081303 | 2019-03-22T02:46:44 | 2019-03-22T02:46:44 | 177,057,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,622 | java | package org.elasticsearch.index.query.image;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight;
import org.apache.lucene.store.ByteArrayDataInput;
import org.apache.lucene.util.*;
import org.elasticsearch.ElasticsearchImageProcessException;
import org.elasticsearch.index.fielddata.ScriptDocValues;
import org.elasticsearch.index.fielddata.SortedBinaryDocValues;
import org.elasticsearch.util.FeatureCompUtil;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS;
/**
* Calculate score for each image
* score = (1 / distance) * boost
*/
public abstract class AbstractFeatureScorer extends Scorer {
private static Logger logger = LogManager.getLogger(AbstractFeatureScorer.class.getName());
private final String luceneFieldName;
private final byte[] lireFeature;
private final LeafReaderContext context;
private final float boost;
private BinaryDocValues binaryDocValues;
private FeatureCompUtil fc = new FeatureCompUtil();
protected AbstractFeatureScorer(Weight weight, String luceneFieldName, byte[] lireFeature,
LeafReaderContext context, float boost) {
super(weight);
this.luceneFieldName = luceneFieldName;
this.lireFeature = lireFeature;
this.context = context;
this.boost = boost;
}
@Override
public float score() throws IOException {
assert docID() != NO_MORE_DOCS;
if (binaryDocValues == null) {
//AtomicReader atomicReader = (AtomicReader) reader;
binaryDocValues = context.reader().getBinaryDocValues(luceneFieldName);
}
try {
List<byte[]> refs = getBytesValues(binaryDocValues, docID());
byte[] docFeature = refs.get(0);
float score = 0f;
if (docFeature != null && lireFeature != null) {
score = fc.Normalize(fc.Dot(docFeature, lireFeature, 12));
}
/*if (Float.compare(distance, 1.0f) <= 0) { // distance less than 1, consider as same image
score = 2f - distance;
} else {
score = 1 / distance;
}*/
return score * boost;
} catch (Exception e) {
throw new ElasticsearchImageProcessException("Failed to calculate score", e);
}
}
@Override
public int freq() {
return 1;
}
//fieldmapper 类型为BinaryFieldMapper
//参考 org.elasticsearch.index.fielddata.plain.BytesBinaryDVAtomicFieldData.getBytesValues 函数
private List<byte[]> getBytesValues(BinaryDocValues values, int docId) {
int count;
List<byte[]> refs = new ArrayList<>(1);
final ByteArrayDataInput in = new ByteArrayDataInput();
final BytesRef bytes = values.get(docId);
in.reset(bytes.bytes, bytes.offset, bytes.length);
if (bytes.length == 0) {
count = 0;
} else {
count = in.readVInt();
for (int i = 0; i < count; ++i) {
final int length = in.readVInt();
final byte[] scratch = new byte[length];
in.readBytes(scratch, 0, length);
refs.add(scratch);
}
}
return refs;
}
}
| [
"czengling@163.com"
] | czengling@163.com |
103362527e01de82cf832a5325ed3ab19a7657ec | 6e949d17adc95460425f043d5b70cb14bd13ef95 | /service-fishing/src/main/java/com/tongzhu/fishing/config/JacksonConfig.java | 39b0ff5023ed1d88ad7cd07ae345a737d8fbb4e6 | [] | no_license | HuangRicher/tree | ca1397d6a74eb5d8e49697934c1077beb415d704 | 88d314cac28d3eea820addcd392ff2d01a74f320 | refs/heads/master | 2020-05-21T06:08:50.365919 | 2019-05-15T05:49:39 | 2019-05-15T05:49:39 | 185,935,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,785 | java | package com.tongzhu.fishing.config;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
/**
* 〈返回json空值去掉null和""〉
*/
@Configuration
public class JacksonConfig
{
@Bean
@Primary
@ConditionalOnMissingBean(ObjectMapper.class)
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
// 通过该方法对mapper对象进行设置,所有序列化的对象都将按改规则进行系列化
// Include.Include.ALWAYS 默认
// Include.NON_DEFAULT 属性为默认值不序列化
// Include.NON_EMPTY 属性为 空("") 或者为 NULL 都不序列化,则返回的json是没有这个字段的。这样对移动端会更省流量
// Include.NON_NULL 属性为NULL 不序列化,就是为null的字段不参加序列化
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
// 字段保留,将null值转为""
/*objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
@Override
public void serialize(Object o, JsonGenerator jsonGenerator,SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
jsonGenerator.writeString("");
}
});*/
return objectMapper;
}
}
| [
"huangweibiao@instoms.cn"
] | huangweibiao@instoms.cn |
9a59334bc59a5a605b629e2b72ae7ae2d8496ad1 | a181e404c0a7793783b6baecbce17b87e2339cb8 | /skadmin-tools/src/main/java/com/dxj/domain/vo/EmailVo.java | 94c8eef327f6288acae05b384844a616d5d41cee | [] | no_license | xiaobaolei/sk-admin | 8a25bd5afaccdf303f9ff1d2fd49f52b2f239560 | 3ddd52bf7dcf9bcec779507e6e6f2e031b079c53 | refs/heads/dev | 2020-05-29T20:36:05.930415 | 2019-05-30T06:14:17 | 2019-05-30T06:14:17 | 189,356,734 | 0 | 1 | null | 2019-05-30T06:16:06 | 2019-05-30T06:16:04 | null | UTF-8 | Java | false | false | 603 | java | package com.dxj.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 发送邮件时,接收参数的类
* @author 郑杰
* @date 2018/09/28 12:02:14
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EmailVo {
/**
* 收件人,支持多个收件人,用逗号分隔
*/
@NotEmpty
private List<String> tos;
@NotBlank
private String subject;
@NotBlank
private String content;
}
| [
"dengsinkiang@gmail.com"
] | dengsinkiang@gmail.com |
e6e83c4e7fff8286f339415f88cd9281ad692b04 | 3f2fd9e791ff2f7b8332d588bbe83ae999a8eed2 | /src/com/epam/konstantin_frolov/java/lesson4/task1/models/Something.java | ead59fff80a91018dd73d34cecb3e82885385700 | [] | no_license | FrolovKM/JavaTech4 | 7a008f3d79a7eb6a0d121f5639f1e6a897e058e3 | 14b5d219a4b66c607c4b8848d1d706992b479013 | refs/heads/master | 2020-03-19T02:58:51.180533 | 2018-06-01T10:42:54 | 2018-06-01T10:42:54 | 135,682,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package com.epam.konstantin_frolov.java.lesson4.task1.models;
import com.epam.konstantin_frolov.java.lesson4.task1.exceptions.NoPowerException;
import com.epam.konstantin_frolov.java.lesson4.task1.exceptions.NoWeightException;
public class Something {
private Integer power = null;
private Integer weight = null;
public Something(Integer power, Integer weight) throws NoPowerException, NoWeightException {
if (power < 0) {
throw new NoPowerException("Power is not exist");
}
if (weight < 0) {
throw new NoWeightException("Weight is negative!");
}
this.power = power;
this.weight = weight;
}
public Integer getPower() {
return power;
}
public void setPower(Integer power) {
this.power = power;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
@Override
public String toString() {
return "[Object] Something";
}
} | [
"frolov.kosta@yandex.ru"
] | frolov.kosta@yandex.ru |
a56cb7c15d5733639fa1b86b8bf35800cbd517e1 | 3249e577a594318cc267831e1f4dcbbe604cbb82 | /plugin/SpawnCreepers/src/me/aleksa/spawnCreepers/commands/ChickenCommand.java | 975dae46bb956d40155f2e6a734977ca503dff30 | [] | no_license | AleksaVukicevic/Fun-Admin-Tools-Minecraft-Plugin-1.16.4 | 7482c5cdeaa393d73992b5de94ead228b6e2c6d2 | 9d382d57a71cfe4dd01480660ec4b9e8f4d5461d | refs/heads/main | 2023-02-19T03:16:47.732926 | 2021-01-23T17:20:48 | 2021-01-23T17:20:48 | 329,022,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,242 | java | package me.aleksa.spawnCreepers.commands;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import me.aleksa.spawnCreepers.Main;
public class ChickenCommand implements CommandExecutor {
@SuppressWarnings("unused")
private Main plugin;
public ChickenCommand(Main plugin) {
this.plugin = plugin;
plugin.getCommand("chicken").setExecutor(this);
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player s = (Player) sender;
Player p = null;
if(!s.isOp()) {
s.sendMessage("Don't have Permission");
return true;
}
if(args.length == 1)
{
p = Bukkit.getPlayerExact(args[0]);
if(p == null) {
s.sendMessage("Player " + args[0] + " not found");
return true;
}
}
else
{
s.sendMessage("Error: /chicken takes max 1 args");
return false;
}
p.getWorld().spawnEntity(p.getLocation(), EntityType.CHICKEN).setCustomName(p.getName());;
p.setHealth(0);
p.sendMessage("You've been chickened!");
s.sendMessage("Chickened player!");
return true;
}
}
| [
"aleksamc1234@gmail.com"
] | aleksamc1234@gmail.com |
3d3e7214437e7f1d4be91c0911ff5fc11e815cd0 | e14c82cbe59b5725799643efda99f74b586da9ec | /programs/HbaseDemo/FilterDemo/src/com/anu/filter/FilterDemo.java | 52beb052fc3aaf6c5f22f9ff47af1ffcf3d95998 | [] | no_license | NiuCuiming/bigdata-notes | 0e5dd876a631e5a394c338df79ed3a4aa3248a7b | 617bd5d12840d781b3fd68c1164b2cedafe526b9 | refs/heads/master | 2021-09-01T05:12:30.851849 | 2017-12-25T01:48:34 | 2017-12-25T01:48:34 | 114,460,409 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,460 | java | package com.anu.filter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.filter.*;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;
import java.io.IOException;
public class FilterDemo {
//与连接相关的变量
static private Configuration configuration;
static private HBaseAdmin hBaseAdmin;
static private Connection connection;
static private Table table;
static {
//配置文件
configuration = HBaseConfiguration.create();
configuration.set("hbase.zookeeper.quorum","node01,node02,node03");
configuration.set("hbase.zookeeper.property","2181");
//获取操作的表和表管理类
try {
hBaseAdmin = new HBaseAdmin(configuration);
connection = ConnectionFactory.createConnection(configuration);
table = connection.getTable(TableName.valueOf("person"));
} catch (Exception e) {
e.printStackTrace();
}
}
public void showScanner(ResultScanner resultScanner) {
for(Result row:resultScanner) {
for (KeyValue kv: row.raw()) {
System.out.print(new String(kv.getRow())+" ");
System.out.print(new String(kv.getFamily())+ ":");
System.out.print(new String(kv.getQualifier())+"=");
System.out.print(new String(kv.getValue())+" ");
System.out.println("timeStamp:"+kv.getTimestamp());
}
}
System.out.println("over!");
}
/**
* 过滤器列表
*/
@Test
public void filterList() throws IOException {
//过滤器搭载在scan之上,san可以搭载过滤器,也可以搭载过滤器集合
Scan scan = new Scan();
SingleColumnValueExcludeFilter singleColumnValueExcludeFilter = null;
//1.过滤器列表,搭建在scan描述类上,table 获取 ResultScanner
FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
//过滤掉home_info:address 值为shanghai的行,和school_info 值为shanghai的hang
filterList.addFilter(new SingleColumnValueExcludeFilter(Bytes.toBytes("home_info"),Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL,Bytes.toBytes("shanghai")));
filterList.addFilter(new SingleColumnValueExcludeFilter(Bytes.toBytes("school_info"),Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL,Bytes.toBytes("shanghai")));
//scan.setFilter(filterList);
//2.通过正则表达式过滤掉 列族 home_info:address 值以shang开头的行。
RegexStringComparator rsc = new RegexStringComparator("shang.");
singleColumnValueExcludeFilter = new SingleColumnValueExcludeFilter(Bytes.toBytes("home_info"), Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL, rsc);
//scan.setFilter(singleColumnValueExcludeFilter);
//SubStringComparator
//用于监测一个子串是否存在于值中,并且不区分大小写
//示例:过滤掉school_info:address 包含 an 的行。
SubstringComparator ssc = new SubstringComparator("an");
singleColumnValueExcludeFilter = new SingleColumnValueExcludeFilter(Bytes.toBytes("school_info"), Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL, ssc);
//scan.setFilter(singleColumnValueExcludeFilter);
//BinaryComparator
//二进制比较器,用于按字典顺序比较 Byte 数据值。
// 为什么没出来key为002的值??
BinaryComparator bc = new BinaryComparator(Bytes.toBytes("taiyuan"));
singleColumnValueExcludeFilter = new SingleColumnValueExcludeFilter(Bytes.toBytes("school_info"), Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL, bc);
//scan.setFilter(singleColumnValueExcludeFilter);
//BinaryPrefixComparator
//前缀二进制比较器。与二进制比较器不同的是,只比较前缀是否相同。
// 为什么没出来key为002的值??
BinaryPrefixComparator bpc = new BinaryPrefixComparator(Bytes.toBytes("tai"));
singleColumnValueExcludeFilter = new SingleColumnValueExcludeFilter(Bytes.toBytes("school_info"), Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL, bpc);
//scan.setFilter(singleColumnValueExcludeFilter);
//SingleColumnValueExcludeFilter
//跟 SingleColumnValueFilter 功能一样,只是不查询出该列的值。
//过滤过程。
SingleColumnValueExcludeFilter sce = new SingleColumnValueExcludeFilter(Bytes.toBytes("home_info"),Bytes.toBytes("address"),
CompareFilter.CompareOp.EQUAL,Bytes.toBytes("shanghai"));
//scan.setFilter(sce);
ResultScanner scanner = table.getScanner(scan);
showScanner(scanner);
}
/**
* 测试二
*/
@Test
public void filterTest() throws IOException {
//过滤器搭载在scan之上,san可以搭载过滤器,也可以搭载过滤器集合
Scan scan = new Scan();
//SingleColumnValueFilter:列值过滤器,下面示例过滤留下home_info:address = shanghai 的row
SingleColumnValueFilter singleColumnValueFilter = new SingleColumnValueFilter(Bytes.toBytes("home_info"),
Bytes.toBytes("address"), CompareFilter.CompareOp.EQUAL,Bytes.toBytes("shanghai"));
//列值排除过滤器,和上面过滤器相反,过滤排除 home_info:address = shanghai 的行
SingleColumnValueExcludeFilter singleColumnValueExcludeFilter = new SingleColumnValueExcludeFilter(Bytes.toBytes("home_info"),
Bytes.toBytes("address"), CompareFilter.CompareOp.EQUAL,Bytes.toBytes("shanghai"));
/**
* 结果:
* 0002 school_info:address=shanghai timeStamp:1513149581179
* 0003 home_info:numberCount=4 timeStamp:1513149594707
* 0003 school_info:address=taiyuan timeStamp:1513149594707
*/
singleColumnValueFilter.setFilterIfMissing(false);
scan.setFilter(singleColumnValueExcludeFilter);
ResultScanner scanner = table.getScanner(scan);
showScanner(scanner);
}
}
| [
"578277507@qq.com"
] | 578277507@qq.com |
219666ec758b552e670e9d5df015ffc0e38cf170 | 3d62a60e086a6a30665977813d368ac7a2237efe | /lab3/src/Simulation/Developer.java | c68517a5be35dde605bee7073f5fe7570b2ebaa2 | [] | no_license | SpiderCh/Java-Labs | c7db0f2a5c768cf3e97ba8b9011e8ff7fd405bfb | a692f92bf77ac5412755b8ce5f57469808fa5eeb | refs/heads/master | 2021-01-01T15:44:21.985871 | 2014-05-12T17:25:06 | 2014-05-12T17:25:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | 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 Simulation;
public class Developer extends Human {
public Developer(String path)
{
super();
}
public Developer(int id, String path)
{
super(id);
}
public Developer(int x, int y)
{
super(x, y);
}
public Developer(int x, int y, String Path)
{
super(x, y);
}
public Developer(int id, int x, int y, String Path)
{
super(id, x, y);
}
public Developer(int id, int x, int y, int current_time)
{
super(id, x, y, current_time);
m_type = PersonalType.Developer;
}
@Override
public void update(int time)
{}
}
| [
"spider.ch@gmail.com"
] | spider.ch@gmail.com |
44812497aa5122089dd9690a4d35e587e8be226f | 78fbaaae95af368e6524e6a0a8978079b7d0f5f4 | /src/views/Drawable.java | 4a6d3d773d9cbcc3531c9c1cc333884d4ca8b3c2 | [] | no_license | propra13-orga/gruppe46 | 5892c0c6cc095fda50aa20d8615ae192a2e429e4 | fc121a354962a4335a012512ee2cb3032109aa76 | refs/heads/master | 2020-06-04T09:02:21.326855 | 2013-07-15T23:03:56 | 2013-07-15T23:03:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | /*
* We use this interface for the View* classes.
* This is an abstract interface we need for the draw method.
*/
package views;
/**
*
*/
import java.awt.Graphics;
public abstract interface Drawable {
public abstract void draw(Graphics g);
} | [
"info@gerhard-klassen.de"
] | info@gerhard-klassen.de |
67b49ac578b29a063963b8137912854dcfcb1809 | c7390f25bd33853ac598b36c4cd421a201214b69 | /app/src/main/java/com/example/BasicActivity/FirstFragment.java | a5875073da616a4a61e0d17784eec74d8633748e | [] | no_license | RMSchreiner/AndroidLaunchIconProjectTemplates | 7847189e7649bb8831735b8417de7ae0977107e9 | eda0e5cc1b8c059a53c88963883c883c8c7696fd | refs/heads/main | 2022-12-25T08:37:50.516423 | 2020-10-08T01:56:59 | 2020-10-08T01:56:59 | 302,206,595 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,089 | java | package com.example.BasicActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.navigation.fragment.NavHostFragment;
public class FirstFragment extends Fragment {
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState
) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_first, container, false);
}
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
view.findViewById(R.id.button_first).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
NavHostFragment.findNavController(FirstFragment.this)
.navigate(R.id.action_FirstFragment_to_SecondFragment);
}
});
}
} | [
"Rschreiner83@gmail.com"
] | Rschreiner83@gmail.com |
45b06c13d165c76996ad15e8dfdda549cb76b1bd | acb09f398782c5e4136e7369061bce6f81ef005d | /app/src/main/java/com/example/roadreview/MainActivity.java | e77a34d7b23ab7919ee3b62727a50cc51c5eaef8 | [] | no_license | rockeypandit/RoadReview | 4d4ab8d984027ade3644cb9e8888200a9219ef5e | d69140f325129ad2e92e5b7156d8b35adf203416 | refs/heads/master | 2020-04-25T08:29:59.844092 | 2019-02-27T04:34:03 | 2019-02-27T04:34:03 | 172,649,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,217 | java | package com.example.roadreview;
import android.Manifest;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.drawable.BitmapDrawable;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
import com.akhgupta.easylocation.EasyLocationAppCompatActivity;
import com.akhgupta.easylocation.EasyLocationRequest;
import com.akhgupta.easylocation.EasyLocationRequestBuilder;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.tasks.Continuation;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public class MainActivity extends EasyLocationAppCompatActivity {
private static final int CAMERA_REQUEST = 1888;
private ImageView imageView;
private static final int MY_CAMERA_PERMISSION_CODE = 100;
Double myLatitude, myLongitude;
FirebaseUser currentuser;
private ProgressDialog mProgressDialog;
double lat, lng;
Uri downloadUri;
Uri uri;
private DatabaseReference mDatabase, mDatabaseUser, mDatabaseList;
String place;
StorageReference imageRef;
Geocoder geo;
Bitmap photo;
boolean gps_enabled;
StorageReference filePath;
private LocationManager locationManager;
private LocationListener locationListener;
Button sendButton,gotoMap,gotoAcc;
private Bitmap oldDrawable;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
sendButton = (Button) this.findViewById(R.id.send);
oldDrawable = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
mProgressDialog = new ProgressDialog(this);
currentuser = FirebaseAuth.getInstance().getCurrentUser();
mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabaseUser = FirebaseDatabase.getInstance().getReference().child("User").child(currentuser.getUid()).push();
mDatabaseList = FirebaseDatabase.getInstance().getReference().child("List").push();
gotoMap = findViewById(R.id.map);
gotoMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, MapsActivity.class);
Bundle b = new Bundle();
b.putString("lat", myLatitude.toString());
b.putString("lng", myLongitude.toString());
intent.putExtras(b);
startActivity(intent);
finish();
}
});
gotoAcc = findViewById(R.id.acc);
gotoAcc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this,AccelerometerMap.class);
Bundle b = new Bundle();
b.putString("lat", myLatitude.toString());
b.putString("lng", myLongitude.toString());
intent.putExtras(b);
startActivity(intent);
finish();
}
});
photoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkSelfPermission(Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{Manifest.permission.CAMERA},
MY_CAMERA_PERMISSION_CODE);
} else {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
}
});
locationRequest();
filePath = FirebaseStorage.getInstance().getReference().child("Images " + System.currentTimeMillis());
Log.i("IMAGE", imageView.getDrawable().toString());
final HashMap<String, Object> result = new HashMap<>();
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mProgressDialog.setMessage("UPLOADING");
mProgressDialog.show();
filePath.putFile(uri).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {
if (!task.isSuccessful()) {
throw task.getException();
}
return filePath.getDownloadUrl();
}
}).addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
if (task.isSuccessful()) {
downloadUri = task.getResult();
Log.i("LINK " ,downloadUri.toString());
// FriendlyMessage friendlyMessage = new FriendlyMessage(null, mUsername, downloadUri.toString());
// mMessagesDatabaseReference.push().setValue(friendlyMessage);
mProgressDialog.dismiss();
Toast.makeText(MainActivity.this, "UPLOAD SUCCESS", Toast.LENGTH_LONG).show();
result.put("Image",downloadUri.toString());
mDatabaseUser.setValue(result);
mDatabaseList.setValue(result);
} else {
Toast.makeText(MainActivity.this, "upload failed: " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
result.put("Image",downloadUri);
result.put("lat", myLatitude);
result.put("lng", myLongitude);
mDatabaseUser.setValue(result);
//mDatabaseUser.push();
mDatabaseList.setValue(result);
}
});
}
@Override
public void onLocationPermissionGranted() {
}
@Override
public void onLocationPermissionDenied() {
}
@Override
public void onLocationReceived(Location location) {
String text = "try";
try {
Geocoder geo = new Geocoder(this.getApplicationContext(), Locale.getDefault());
List<Address> addresses = geo.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
if (addresses.isEmpty()) {
// locationTextBox.setText("Waiting for Location");
} else {
if (addresses.size() > 0) {
text = (addresses.get(0).getFeatureName() + "," + addresses.get(0).getLocality() + "," + addresses.get(0).getAdminArea() + ", " + addresses.get(0).getCountryName());
}
}
} catch (Exception e) {
e.printStackTrace();
}
myLatitude = location.getLatitude();
myLongitude = location.getLongitude();
// System.out.println("coordinates:"+"lat="+location.getLatitude()+" lon="+location.getLongitude()+" accuracy="+location.getAccuracy());
// Log.i("PLACE ",text);
}
@Override
public void onLocationProviderEnabled() {
}
@Override
public void onLocationProviderDisabled() {
}
public void locationRequest() {
LocationRequest locationRequest = new LocationRequest()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setInterval(5000)
.setFastestInterval(5000);
EasyLocationRequest easyLocationRequest = new EasyLocationRequestBuilder()
.setLocationRequest(locationRequest)
.setFallBackToLastLocationTime(3000)
.build();
requestLocationUpdates(easyLocationRequest);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
}
}
if (requestCode == MY_CAMERA_PERMISSION_CODE) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, "camera permission granted", Toast.LENGTH_LONG).show();
Intent cameraIntent = new
Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
} else {
Toast.makeText(this, "camera permission denied", Toast.LENGTH_LONG).show();
}
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
//data.getData();
// ByteArrayOutputStream bytes = new ByteArrayOutputStream();
// photo.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
// String path = MediaStore.Images.Media.insertImage(MainActivity.this.getContentResolver(), photo, "Title", null);
// uri = Uri.parse(path);
// uri = getImageUri(getApplicationContext(), imageBitmap);
Uri tempUri = getImageUri(getApplicationContext(), photo);
File finalFile = new File(getRealPathFromURI(tempUri));
uri = tempUri;
Log.i("URI", tempUri.toString());
Bitmap newDrawable = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
if (newDrawable != oldDrawable) {
sendButton.setVisibility(View.VISIBLE);
}
}
}
public Uri getImageUri(Context inContext, Bitmap inImage) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
return Uri.parse(path);
}
public String getRealPathFromURI(Uri uri) {
String path = "";
if (getContentResolver() != null) {
Cursor cursor = getContentResolver().query(uri, null, null, null, null);
if (cursor != null) {
cursor.moveToFirst();
int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
path = cursor.getString(idx);
cursor.close();
}
}
return path;
}
// public Uri getImageUri(Context inContext, Bitmap inImage) {
// ByteArrayOutputStream bytes = new ByteArrayOutputStream();
// inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
// String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
// return Uri.parse(path);
// }
}
| [
"rockey.pandit98@gmail.com"
] | rockey.pandit98@gmail.com |
033ef04689f6ea848eea6775d75c574cf828045e | 14e73a5f60a5ead3e1a3df0e35a63fa819713806 | /src/BizException.java | f353b7370c38c982028f056ee41f84b04ed45feb | [] | no_license | sio129/hello-world | 0f256bcca4635e687e341fbac868d3e8f028f05a | 42fc28c638c346f5c96669558524b0dab4fa3cf5 | refs/heads/master | 2020-03-10T11:02:22.728216 | 2018-04-13T04:50:34 | 2018-04-13T04:50:34 | 129,346,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java |
public class BizException extends RuntimeException {
public BizException(String msg) {
super(msg);
}
public BizException(Exception ex) {
super(ex);
}
}
| [
"Administrator@220.93.13.189"
] | Administrator@220.93.13.189 |
0c13621e501a954d2f4c784b0470bde7ca697bd6 | 3fb5fc1f889d1011b304d86e6a17e4151d185a7c | /src/re_emp_manager_example/src/main/java/com/res_system/re_emp_manager/controller/SelectGroupController.java | 783ea1cc527ed369ca0bef555cfd0455c8ea89a6 | [
"Apache-2.0"
] | permissive | res-system/Boot-Camp | 3949dfb5bc9591f036171f07574ce95a5eb6d98d | 5561a79d12d81ea4a6b8fafd5c52a759ff2ba68b | refs/heads/master | 2021-05-09T07:20:18.272198 | 2020-12-25T01:29:17 | 2020-12-25T01:29:17 | 119,354,629 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,699 | java | package com.res_system.re_emp_manager.controller;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import com.res_system.commons.mvc.model.form.FormUtil;
import com.res_system.re_emp_manager.commons.controller.interceptor.Controller;
import com.res_system.re_emp_manager.commons.controller.interceptor.LoginAuth;
import com.res_system.re_emp_manager.commons.data.AjaxResponse;
import com.res_system.re_emp_manager.model.select_group.SelectGroupForm;
import com.res_system.re_emp_manager.model.select_group.SelectGroupModel;
/**
* グループ選択ダイアログ コントローラークラス.
* @author res.
*/
@Controller
@Path("/select_group")
@LoginAuth
@RequestScoped
public class SelectGroupController {
//---------------------------------------------- [private] モデルクラス.
/** メイン業務処理. */
@Inject
private SelectGroupModel model;
//---------------------------------------------- [public] アクション.
/** リスト検索. */
@Path("/find_list")
@POST
@Produces(MediaType.APPLICATION_JSON)
public AjaxResponse doFindList(MultivaluedMap<String, String> params) throws Exception {
SelectGroupForm form = FormUtil.make(SelectGroupForm.class, params);
String status;
if (model.findList(form))
{ status = AjaxResponse.OK; } else { status = AjaxResponse.NG; }
return new AjaxResponse(status).setForm(form).setMessageList(model.getMessageList());
}
/** チェック. */
@Path("/check")
@POST
@Produces(MediaType.APPLICATION_JSON)
public AjaxResponse doCheck(MultivaluedMap<String, String> params) throws Exception {
SelectGroupForm form = FormUtil.make(SelectGroupForm.class, params);
String status;
if (model.checkInput(form))
{ status = AjaxResponse.OK; } else { status = AjaxResponse.NG; }
return new AjaxResponse(status).setForm(form).setMessageList(model.getMessageList());
}
/** 新規追加. */
@Path("/insert")
@POST
@Produces(MediaType.APPLICATION_JSON)
public AjaxResponse doInsert(MultivaluedMap<String, String> params) throws Exception {
SelectGroupForm form = FormUtil.make(SelectGroupForm.class, params);
String status;
if (model.checkInput(form) && model.insertData(form))
{ status = AjaxResponse.OK; } else { status = AjaxResponse.NG; }
return new AjaxResponse(status).setForm(form).setMessageList(model.getMessageList());
}
}
| [
"res@localhost.localdomain"
] | res@localhost.localdomain |
620c711cefb5f521fce0318aff8e0deb1b9e4067 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/actorapp--actor-platform/b56fe5b77d5f3d39968080b62825c765cf192fbf/after/ConversationState.java | e15562cc063b2ccf0cfc71237eae973c87f5d672 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,194 | java | package im.actor.core.entity;
import java.io.IOException;
import im.actor.runtime.bser.Bser;
import im.actor.runtime.bser.BserCreator;
import im.actor.runtime.bser.BserObject;
import im.actor.runtime.bser.BserValues;
import im.actor.runtime.bser.BserWriter;
import im.actor.runtime.mvvm.ValueDefaultCreator;
import im.actor.runtime.storage.KeyValueItem;
public class ConversationState extends BserObject implements KeyValueItem {
public static ConversationState fromBytes(byte[] data) throws IOException {
return Bser.parse(new ConversationState(), data);
}
public static BserCreator<ConversationState> CREATOR = ConversationState::new;
public static ValueDefaultCreator<ConversationState> DEFAULT_CREATOR = id ->
new ConversationState(Peer.fromUniqueId(id), false, 0, 0, 0, 0, 0);
public static final String ENTITY_NAME = "ConversationState";
private Peer peer;
private boolean isLoaded;
private int unreadCount;
private long inMaxMessageDate;
private long inReadDate;
private long outReadDate;
private long outReceiveDate;
public ConversationState(Peer peer, boolean isLoaded,
int unreadCount,
long inMaxMessageDate,
long inReadDate,
long outReadDate,
long outReceiveDate) {
this.peer = peer;
this.isLoaded = isLoaded;
this.unreadCount = unreadCount;
this.inMaxMessageDate = inMaxMessageDate;
this.inReadDate = inReadDate;
this.outReadDate = outReadDate;
this.outReceiveDate = outReceiveDate;
}
private ConversationState() {
}
public Peer getPeer() {
return peer;
}
public boolean isLoaded() {
return isLoaded;
}
public long getInMaxMessageDate() {
return inMaxMessageDate;
}
public long getInReadDate() {
return inReadDate;
}
public long getOutReadDate() {
return outReadDate;
}
public long getOutReceiveDate() {
return outReceiveDate;
}
public int getUnreadCount() {
return unreadCount;
}
public ConversationState changeIsLoaded(boolean isLoaded) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
public ConversationState changeInReadDate(long inReadDate) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
public ConversationState changeInMaxDate(long inMaxMessageDate) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
public ConversationState changeOutReceiveDate(long outReceiveDate) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
public ConversationState changeOutReadDate(long outReadDate) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
public ConversationState changeCounter(int unreadCount) {
return new ConversationState(peer, isLoaded, unreadCount, inMaxMessageDate, inReadDate, outReadDate, outReceiveDate);
}
@Override
public void parse(BserValues values) throws IOException {
peer = Peer.fromBytes(values.getBytes(1));
isLoaded = values.getBool(2, false);
inReadDate = values.getLong(3, 0);
outReceiveDate = values.getLong(4, 0);
outReadDate = values.getLong(5, 0);
unreadCount = values.getInt(6);
}
@Override
public void serialize(BserWriter writer) throws IOException {
writer.writeBytes(1, peer.toByteArray());
writer.writeBool(2, isLoaded);
writer.writeLong(3, inReadDate);
writer.writeLong(4, outReceiveDate);
writer.writeLong(5, outReadDate);
writer.writeInt(6, unreadCount);
}
@Override
public long getEngineId() {
return peer.getUnuqueId();
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
6683f05a03a417246fe2781f94a47f0ef3134995 | 7bbc806193820f39f846d6381d10366f187e3dfc | /edi/WEB-INF/src/ecom/action/ECom002Action.java | bc7738d97a17f49df998b9ce58f997c45e414168 | [] | no_license | artmalling/artmalling | fc45268b7cf566a2bc2de0549581eeb96505968a | 0dd2d495d0354a38b05f7986bfb572d7d7dd1b08 | refs/heads/master | 2020-03-07T07:55:07.111863 | 2018-03-30T06:51:35 | 2018-03-30T06:51:35 | 127,362,251 | 0 | 0 | null | 2018-03-30T01:05:05 | 2018-03-30T00:45:52 | null | UTF-8 | Java | false | false | 3,561 | java | /*
* Copyright (c) 2010 한국후지쯔. All rights reserved.
*
* This software is the confidential and proprietary information of 한국후지쯔.
* 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 한국후지쯔
*/
package ecom.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import kr.fujitsu.ffw.control.ActionForm;
import kr.fujitsu.ffw.control.ActionForward;
import kr.fujitsu.ffw.control.ActionMapping;
import kr.fujitsu.ffw.control.ActionUtil;
import kr.fujitsu.ffw.control.DispatchAction;
import org.apache.log4j.Logger;
import ecom.dao.ECom002DAO;
public class ECom002Action extends DispatchAction {
/*
* Java Pattern 에서 지원하는 logger를 사용할 수 있도록 객체를 선언
*/
private Logger logger = Logger.getLogger(ECom002Action.class);
/**
* 로그 아웃을 하는 경우
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward logout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
HttpSession session = request.getSession();
session.removeAttribute("sessionInfo");
session.invalidate();
response.getWriter().println("<script>");
response.getWriter().println("window.open('/edi/jsp/login.jsp', '', 'width=1024-10, height=768-55, status=1, resizable=1, titlebar=1, location=1, toolbar=1, menubar=1, scrollbars=1');");
response.getWriter().println("parent.close();");
response.getWriter().println("</script>");
} catch (Exception e) {
e.printStackTrace();
logger.error("", e);
throw e;
}
return mapping.findForward("logout");
}
/**
* 메인페이지로 이동
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward goMain(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
return mapping.findForward("goMain");
}
/**
* 매출정보조회
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward getSale(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
StringBuffer sb = null;
ECom002DAO dao = null;
String strGoto = form.getParam("goTo");
try{
dao = new ECom002DAO();
sb = dao.getSale(form);
}catch(Exception e){
e.printStackTrace();
}
ActionUtil.sendAjaxResponse(response, sb);
return mapping.findForward(strGoto);
}
/**
* 대금정보조회
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward getbillmst(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
StringBuffer sb = null;
ECom002DAO dao = null;
String strGoto = form.getParam("goTo");
try{
dao = new ECom002DAO();
sb = dao.getbillmst(form);
}catch(Exception e){
e.printStackTrace();
}
ActionUtil.sendAjaxResponse(response, sb);
return mapping.findForward(strGoto);
}
}
| [
"HP@HP-PC0000a"
] | HP@HP-PC0000a |
54130b7c237f1840edeaf3f60acf6e49806105b3 | 9d9abf80dab655c762b8d96204721b93e4acc854 | /PWEB/PrjFinal/src/main/java/servico/Servico.java | c7149448187ccb9672058dab1546e92ddb57904f | [] | no_license | julliasaad/fatec | 36fabc857ba5aab34d6876d8dfbf06149a1ec8df | 2e423202a928ae45c6f6bb5fd0fef47e2ee1159b | refs/heads/master | 2020-06-15T11:52:17.084768 | 2017-10-23T11:42:13 | 2017-10-23T11:42:13 | 75,296,505 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,178 | java | package servico;
import java.util.List;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import modelos.Aluno;
import modelos.Curso;
import modelos.Professor;
@ManagedBean(name = "servico", eager = true)
@ApplicationScoped
public class Servico {
private static EntityManagerFactory emf = Persistence.createEntityManagerFactory("PrjFinal");
public Servico() {
}
// operacoes Aluno
public void saveAluno(Aluno aluno) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(aluno);
em.getTransaction().commit();
em.close();
}
public void removeAluno(Aluno aluno) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Aluno a = em.find(Aluno.class, aluno.getMatricula());
em.remove(a);
em.getTransaction().commit();
em.close();
}
public List<Aluno> getAlunos() {
List<Aluno> alunos;
EntityManager em = emf.createEntityManager();
Query q = em.createQuery("Select a From Aluno a", Aluno.class);
alunos = q.getResultList();
em.close();
return alunos;
}
public void upDateAluno(Aluno a) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.merge(a);
em.getTransaction().commit();
em.close();
}
//opercoes Curso
public List<Curso> getCursos() {
List<Curso> cursos;
EntityManager em = emf.createEntityManager();
Query q = em.createQuery("Select c From Curso c", Curso.class);
cursos = q.getResultList();
em.close();
return cursos;
}
public void saveCurso(Curso curso) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(curso);
em.getTransaction().commit();
em.close();
}
public void upDateCurso(Curso c) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.merge(c);
em.getTransaction().commit();
em.close();
}
public boolean removeCurso(Curso curso) {
boolean sucesso = false;
try {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Curso f = em.find(Curso.class, curso.getCodigo());
em.remove(f);
em.getTransaction().commit();
em.close();
sucesso = true;
} catch (Exception e) {
}
return sucesso;
}
//operacoes professor
public List<Professor> getProfessores() {
List<Professor> professores;
EntityManager em = emf.createEntityManager();
Query q = em.createQuery("Select p From Professor p", Professor.class);
professores = q.getResultList();
em.close();
return professores;
}
public void saveProfessor(Professor professor) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(professor);
em.getTransaction().commit();
em.close();
}
public void upDateProfessor(Professor p) {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.merge(p);
em.getTransaction().commit();
em.close();
}
public Professor upDateProf(Professor p){
EntityManager em = emf.createEntityManager();
Professor prof = em.find(Professor.class, p.getNumero());
em.refresh(prof);
em.close();
return prof;
}
public boolean removeProfessor(Professor professor) {
boolean sucesso = false;
try {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Professor p = em.find(Professor.class, professor.getNumero());
em.remove(p);
em.getTransaction().commit();
em.close();
sucesso = true;
} catch (Exception e) {
}
return sucesso;
}
public List<Curso> getCursosProfessor(Professor professorSelecionado){
List<Curso> cursos = null;
EntityManager em = emf.createEntityManager();
Professor p = em.find(Professor.class, professorSelecionado.getNumero());
em.refresh(p);
cursos = p.getCursos();
em.close();
return cursos;
}
}
| [
"julliasaad01@gmail.com"
] | julliasaad01@gmail.com |
67c6e28938a04ded905c841054d65095f6c06d9c | ea8cba523fe3f2be232431aa6282e91acd1829b7 | /ecp-starter-data-service/src/main/java/id/org/test/data/service/ProductMobileService.java | 6ad28391a536bf7c3debaea70dc61a287da6c8ae | [] | no_license | adinunu/eCommercePlatform | 3c4867ba2e927045a82540b8962a903187dc52c6 | a28ea464e3a0f64394de82d492ffa6b64fb93b96 | refs/heads/master | 2022-12-17T04:23:33.215265 | 2020-09-23T19:09:27 | 2020-09-23T19:09:27 | 296,675,074 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | package id.org.test.data.service;
import java.util.List;
import org.springframework.data.domain.Sort;
import id.org.test.common.service.CommonService;
import id.org.test.data.service.wrapper.ProductMobileWrapper;
public interface ProductMobileService extends CommonService<ProductMobileWrapper, Long>{
List<ProductMobileWrapper> getListByMember(Long aLong)throws Exception;
List<ProductMobileWrapper> getPageableListByMember(Long memberId, Long categoryId,String status, String param, int startPage, int pageSize, Sort sort) throws Exception;
List<ProductMobileWrapper> findAll();
}
| [
"adinunu.persada@gmail.com"
] | adinunu.persada@gmail.com |
e909cd556118ae655e5181f5d0f262463b85972b | 67f988dedfd8ae049d982d1a8213bb83233d90de | /external/chromium/content/public/android/java/src/org/chromium/content/browser/CursorController.java | 6e572c8a5e32a8f67b64f0e75f29c0a4fcbdf3e5 | [
"BSD-3-Clause"
] | permissive | opensourceyouthprogramming/h5vcc | 94a668a9384cc3096a365396b5e4d1d3e02aacc4 | d55d074539ba4555e69e9b9a41e5deb9b9d26c5b | refs/heads/master | 2020-04-20T04:57:47.419922 | 2019-02-12T00:56:14 | 2019-02-12T00:56:14 | 168,643,719 | 1 | 1 | null | 2019-02-12T00:49:49 | 2019-02-01T04:47:32 | C++ | UTF-8 | Java | false | false | 1,151 | java | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.content.browser;
import android.view.ViewTreeObserver;
/**
* A CursorController instance can be used to control a cursor in the text.
*/
interface CursorController extends ViewTreeObserver.OnTouchModeChangeListener {
/**
* Hide the cursor controller from screen.
*/
void hide();
/**
* @return true if the CursorController is currently visible
*/
boolean isShowing();
/**
* Called when the handle is about to start updating its position.
* @param handle
*/
void beforeStartUpdatingPosition(HandleView handle);
/**
* Update the controller's position.
*/
void updatePosition(HandleView handle, int x, int y);
/**
* Called when the view is detached from window. Perform house keeping task, such as
* stopping Runnable thread that would otherwise keep a reference on the context, thus
* preventing the activity to be recycled.
*/
void onDetached();
}
| [
"rjogrady@google.com"
] | rjogrady@google.com |
4eefad01dbf2879989da4ece22ccea0219bfba59 | 1da33456bc529f2c2bda8efc4468f1d673ba8f7c | /sim-domain/src/main/java/com/sim/dao/ItemDAO.java | c51c2e61423cc4d4819d9dcf2f3ac94d098e24ac | [] | no_license | hakimsaifee/stock-invoice-manager | 2518532975f858617698ddbdb79de5421c9298d5 | 8433871cced4fc67db40b055a9ec391918c73d1e | refs/heads/master | 2018-12-08T23:58:28.698897 | 2018-09-11T18:05:07 | 2018-09-11T18:05:07 | 113,746,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 152 | java | package com.sim.dao;
import com.sim.domain.Item;
public interface ItemDAO extends DAO<Item, Integer>{
Item findByBarcode(String barcode);
}
| [
"hakimsaifee08@gmail.com"
] | hakimsaifee08@gmail.com |
3f848ce36fbe182098704103695c50aa93215b25 | 770a9c017b87cb2e36b2dcde726a62a70700888e | /src/main/java/datastructure/string/codinginterviewguide/chapter_5_stringproblem/Problem_06_ReplaceString.java | 0ca95afdd6c859bed3378821a8976aeb9c3d1984 | [] | no_license | wz3118103/algorithm | 1cabcf4461d2dfea924adf8070c415a2852e92a1 | f812370316a96757f5e5c62d2783b5ff618644a2 | refs/heads/master | 2020-06-27T06:36:40.567939 | 2019-11-14T03:15:57 | 2019-11-14T03:15:57 | 199,841,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,321 | java | package datastructure.string.codinginterviewguide.chapter_5_stringproblem;
public class Problem_06_ReplaceString {
public static String replace(String str, String from, String to) {
if (str == null || from == null || str.equals("") || from.equals("")) {
return str;
}
char[] chas = str.toCharArray();
char[] chaf = from.toCharArray();
int match = 0;
for (int i = 0; i < chas.length; i++) {
if (chas[i] == chaf[match++]) {
if (match == chaf.length) {
clear(chas, i, chaf.length);
match = 0;
}
} else {
if (chas[i] == chaf[0]) {
i--;
}
match = 0;
}
}
String res = "";
String cur = "";
for (int i = 0; i < chas.length; i++) {
if (chas[i] != 0) {
cur = cur + String.valueOf(chas[i]);
}
if (chas[i] == 0 && (i == 0 || chas[i - 1] != 0)) {
res = res + cur + to;
cur = "";
}
}
if (!cur.equals("")) {
res = res + cur;
}
return res;
}
public static void clear(char[] chas, int end, int len) {
while (len-- != 0) {
chas[end--] = 0;
}
}
public static void main(String[] args) {
String str = "abc1abcabc1234abcabcabc5678";
String from = "abc";
String to = "XXXXX";
System.out.println(replace(str, from, to));
str = "abc";
from = "123";
to = "X";
System.out.println(replace(str, from, to));
}
}
| [
"296215200@qq.com"
] | 296215200@qq.com |
92b843aab951029370d90e66f13d526b60c6e686 | 98b89273888f95161e08e5858b0c3d94d41961b6 | /src/main/java/io/github/craftizz/mbank/managers/UserManager.java | dfd475c6227b05663f7871c8b72621730183b349 | [] | no_license | Craftizz/mBank | 6fffb568aaa2743c5fd203e6f2a1b07693e8752b | d796ab2ec336d0a2c2d7d55981a010a058f4b8e4 | refs/heads/master | 2023-07-26T22:08:32.139343 | 2021-09-08T01:02:07 | 2021-09-08T01:02:07 | 397,965,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,556 | java | package io.github.craftizz.mbank.managers;
import io.github.craftizz.mbank.MBank;
import io.github.craftizz.mbank.bank.user.User;
import io.github.craftizz.mbank.database.DatabaseHandler;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Optional;
import java.util.UUID;
public class UserManager {
private final MBank plugin;
private final HashMap<UUID, User> users;
public UserManager(final @NotNull MBank plugin) {
this.plugin = plugin;
this.users = new HashMap<>();
}
/**
* Get the user from the cachedUsers. If missing, we will
* attempt to load it from the database.
*
* @param uniqueId is the UniqueId of the user
* @return the cachedUser
*/
public User getUser(final @NotNull UUID uniqueId) {
final Optional<User> user = Optional.ofNullable(users.get(uniqueId));
return user.orElseGet(() -> {
final User loadedUser = plugin.getDatabaseHandler().loadUserByUniqueIdUrgently(uniqueId);
users.put(uniqueId, loadedUser);
return loadedUser;
});
}
public User getUser(final @NotNull Player player) {
return getUser(player.getUniqueId());
}
public User getUser(final @NotNull OfflinePlayer offlinePlayer) {
return getUser(offlinePlayer.getUniqueId());
}
/**
* Loads user to the database. This uses an asynchronous method.
*
* @param uniqueId the uniqueId of the user
* @return the cachedUser
*/
public User loadUser(final @NotNull UUID uniqueId) {
final Optional<User> user = Optional.ofNullable(users.get(uniqueId));
return user.orElseGet(() -> {
final User loadedUser = plugin.getDatabaseHandler().loadUserByUniqueId(uniqueId);
users.put(uniqueId, loadedUser);
return loadedUser;
});
}
/**
* Unloads the user from the cache
*
* @param uniqueId the UUID of {@link User}
*/
public void unloadUser(final @NotNull UUID uniqueId) {
users.remove(uniqueId);
}
public void unloadUser(final @NotNull User user) {
users.remove(user.getUniqueId());
}
/**
* Saves user to the database asynchronously
*
* @param user the user to be saved
*/
public void saveUser(final @NotNull User user) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> plugin.getDatabaseHandler().saveUser(user));
}
/**
* @return the hashmap of users
*/
public HashMap<UUID, User> getUsers() {
return users;
}
/**
* Saves all of the loaded users to the database asynchronously
*/
public void saveAllUsers() {
final long startTime = System.currentTimeMillis();
plugin.getLogger().warning("Saving Users Bank Data...");
final DatabaseHandler databaseHandler = plugin.getDatabaseHandler();
final Iterator<User> userIterator = users.values().iterator();
while (userIterator.hasNext()) {
final User user = userIterator.next();
databaseHandler.saveUser(user);
if (user.getPlayer() == null) {
userIterator.remove();
}
}
databaseHandler.unloadUnusedUserFile();
plugin.getLogger().warning("Finished Saving Users Bank Data in " + (System.currentTimeMillis() - startTime) + "ms");
}
}
| [
"johnlexter22@gmail.com"
] | johnlexter22@gmail.com |
88060c67b1c7a89b54ec3d265defd12de1fd0d67 | 08b8d598fbae8332c1766ab021020928aeb08872 | /src/gcom/gerencial/micromedicao/hidrometro/GHidrometroDiametro.java | 2698d865addb80d330c7a0e342b181be11829d7c | [] | no_license | Procenge/GSAN-CAGEPA | 53bf9bab01ae8116d08cfee7f0044d3be6f2de07 | dfe64f3088a1357d2381e9f4280011d1da299433 | refs/heads/master | 2020-05-18T17:24:51.407985 | 2015-05-18T23:08:21 | 2015-05-18T23:08:21 | 25,368,185 | 3 | 1 | null | null | null | null | WINDOWS-1252 | Java | false | false | 6,119 | java | /*
* Copyright (C) 2007-2007 the GSAN – Sistema Integrado de Gestão de Serviços de Saneamento
*
* This file is part of GSAN, an integrated service management system for Sanitation
*
* GSAN is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* GSAN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA
*/
/*
* GSAN – Sistema Integrado de Gestão de Serviços de Saneamento
* Copyright (C) <2007>
* Adriano Britto Siqueira
* Alexandre Santos Cabral
* Ana Carolina Alves Breda
* Ana Maria Andrade Cavalcante
* Aryed Lins de Araújo
* Bruno Leonardo Rodrigues Barros
* Carlos Elmano Rodrigues Ferreira
* Cláudio de Andrade Lira
* Denys Guimarães Guenes Tavares
* Eduardo Breckenfeld da Rosa Borges
* Fabíola Gomes de Araújo
* Flávio Leonardo Cavalcanti Cordeiro
* Francisco do Nascimento Júnior
* Homero Sampaio Cavalcanti
* Ivan Sérgio da Silva Júnior
* José Edmar de Siqueira
* José Thiago Tenório Lopes
* Kássia Regina Silvestre de Albuquerque
* Leonardo Luiz Vieira da Silva
* Márcio Roberto Batista da Silva
* Maria de Fátima Sampaio Leite
* Micaela Maria Coelho de Araújo
* Nelson Mendonça de Carvalho
* Newton Morais e Silva
* Pedro Alexandre Santos da Silva Filho
* Rafael Corrêa Lima e Silva
* Rafael Francisco Pinto
* Rafael Koury Monteiro
* Rafael Palermo de Araújo
* Raphael Veras Rossiter
* Roberto Sobreira Barbalho
* Rodrigo Avellar Silveira
* Rosana Carvalho Barbosa
* Sávio Luiz de Andrade Cavalcante
* Tai Mu Shih
* Thiago Augusto Souza do Nascimento
* Tiago Moreno Rodrigues
* Vivianne Barbosa Sousa
*
* Este programa é software livre; você pode redistribuí-lo e/ou
* modificá-lo sob os termos de Licença Pública Geral GNU, conforme
* publicada pela Free Software Foundation; versão 2 da
* Licença.
* Este programa é distribuído na expectativa de ser útil, mas SEM
* QUALQUER GARANTIA; sem mesmo a garantia implícita de
* COMERCIALIZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM
* PARTICULAR. Consulte a Licença Pública Geral GNU para obter mais
* detalhes.
* Você deve ter recebido uma cópia da Licença Pública Geral GNU
* junto com este programa; se não, escreva para Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
package gcom.gerencial.micromedicao.hidrometro;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class GHidrometroDiametro
implements Serializable {
private static final long serialVersionUID = 1L;
/** identifier field */
private Integer id;
/** persistent field */
private String descricaoHidrometroDiametro;
/** persistent field */
private String descricaoAbreviadaHidrometroDiametro;
/** nullable persistent field */
private Short indicadorUso;
/** persistent field */
private Date ultimaAlteracao;
/** nullable persistent field */
private Short numeroOrdem;
/** persistent field */
private Set resumoHidrometros;
/** full constructor */
public GHidrometroDiametro(Integer id, String descricaoHidrometroDiametro, String descricaoAbreviadaHidrometroDiametro,
Short indicadorUso, Date ultimaAlteracao, Short numeroOrdem, Set resumoHidrometros) {
this.id = id;
this.descricaoHidrometroDiametro = descricaoHidrometroDiametro;
this.descricaoAbreviadaHidrometroDiametro = descricaoAbreviadaHidrometroDiametro;
this.indicadorUso = indicadorUso;
this.ultimaAlteracao = ultimaAlteracao;
this.numeroOrdem = numeroOrdem;
this.resumoHidrometros = resumoHidrometros;
}
/** default constructor */
public GHidrometroDiametro() {
}
/** minimal constructor */
public GHidrometroDiametro(Integer id, String descricaoHidrometroDiametro, String descricaoAbreviadaHidrometroDiametro,
Date ultimaAlteracao, Set resumoHidrometros) {
this.id = id;
this.descricaoHidrometroDiametro = descricaoHidrometroDiametro;
this.descricaoAbreviadaHidrometroDiametro = descricaoAbreviadaHidrometroDiametro;
this.ultimaAlteracao = ultimaAlteracao;
this.resumoHidrometros = resumoHidrometros;
}
public Integer getId(){
return this.id;
}
public void setId(Integer id){
this.id = id;
}
public String getDescricaoHidrometroDiametro(){
return this.descricaoHidrometroDiametro;
}
public void setDescricaoHidrometroDiametro(String descricaoHidrometroDiametro){
this.descricaoHidrometroDiametro = descricaoHidrometroDiametro;
}
public String getDescricaoAbreviadaHidrometroDiametro(){
return this.descricaoAbreviadaHidrometroDiametro;
}
public void setDescricaoAbreviadaHidrometroDiametro(String descricaoAbreviadaHidrometroDiametro){
this.descricaoAbreviadaHidrometroDiametro = descricaoAbreviadaHidrometroDiametro;
}
public Short getIndicadorUso(){
return this.indicadorUso;
}
public void setIndicadorUso(Short indicadorUso){
this.indicadorUso = indicadorUso;
}
public Date getUltimaAlteracao(){
return this.ultimaAlteracao;
}
public void setUltimaAlteracao(Date ultimaAlteracao){
this.ultimaAlteracao = ultimaAlteracao;
}
public Short getNumeroOrdem(){
return this.numeroOrdem;
}
public void setNumeroOrdem(Short numeroOrdem){
this.numeroOrdem = numeroOrdem;
}
public Set getResumoHidrometros(){
return this.resumoHidrometros;
}
public void setResumoHidrometros(Set resumoHidrometros){
this.resumoHidrometros = resumoHidrometros;
}
public String toString(){
return new ToStringBuilder(this).append("id", getId()).toString();
}
}
| [
"Yara.Souza@procenge.com.br"
] | Yara.Souza@procenge.com.br |
c1f86fbc555a2452d2b470e9f285b102f803db5b | 8ee8310fcc8e16103f36dd2a5de8f66aef097524 | /src/cn/itcast/ssm/validator/ValidGroup2.java | 7b9b1bc3ec6fdd82e1ee0c1dc7d0205bb9ce29d2 | [] | no_license | HouXueFeng/ssm_project_2017 | 58e80ea68f756d681522923cb5de47993b423404 | e092cf4d1595012699ec91e2961aff118f4b3849 | refs/heads/master | 2021-01-20T02:12:15.211348 | 2017-03-15T12:03:07 | 2017-03-15T12:03:07 | 83,813,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 104 | java | package cn.itcast.ssm.validator;
/**
Byhouxuefeng
2017年3月9日
*/
public interface ValidGroup2 {
}
| [
"m18821753787_1@163.com"
] | m18821753787_1@163.com |
dc71492bded9c9b6a75eee5da61dd7d304633752 | 72175324d6e64ea53cf81227cb06a308544bf789 | /spring-integration-aws/src/test/java/org/springframework/integration/aws/config/xml/AbstractAWSOutboundChannelAdapterParserTests.java | 45fb3d72182981391b6a67cff49d6d44d86bd4ff | [
"Apache-2.0"
] | permissive | nayyab07/spring-integration-extensions | 7237a5abf5eae91295ad90fd4aa04a00b7414dc1 | 7d81ee80aba4da0b271836e032be06428662d01b | refs/heads/master | 2020-04-09T03:45:51.927884 | 2013-02-22T21:34:15 | 2013-02-22T21:34:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,754 | java | /*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.aws.config.xml;
import junit.framework.Assert;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.aws.core.AWSCredentials;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.test.util.TestUtils;
/**
* The Abstract test class for the AWS outbound adapter parsers
*
* @author Amol Nayak
*
* @since 0.5
*
*/
public abstract class AbstractAWSOutboundChannelAdapterParserTests<T extends MessageHandler> {
protected static ClassPathXmlApplicationContext ctx;
private static boolean isInitialized;
/**
* The bean name expected to be present in the context which would be used when the
* element is defined with the propertiesFile attribute
*/
private final String CREDENTIALS_TEST_ONE = "credentialsTestOne";
/**
* The bean name expected to be present in the context which would be used when the
* element is defined with the accessKey and the secretKey definition
*/
private final String CREDENTIALS_TEST_TWO = "credentialsTestTwo";
@Before
public void setup() {
if(!isInitialized) {
String contextLocation = getConfigFilePath();
Assert.assertNotNull("Non null path value expected", contextLocation);
ctx = new ClassPathXmlApplicationContext(contextLocation);
Assert.assertTrue("Bean with id " + CREDENTIALS_TEST_ONE
+ " expected to be present in the context for credentials test",
ctx.containsBean(CREDENTIALS_TEST_ONE));
Assert.assertTrue("Bean with id " + CREDENTIALS_TEST_TWO
+ " expected to be present in the context for credentials test",
ctx.containsBean(CREDENTIALS_TEST_TWO));
isInitialized = true;
}
}
@AfterClass
public static void destroy() {
ctx.close();
}
/**
* Gets the Message handler implementation for the given bean id
* @param beanId
* @return
*/
@SuppressWarnings("unchecked")
protected T getMessageHandlerForBeanDefinition(String beanId) {
AbstractEndpoint endpoint = (AbstractEndpoint)ctx.getBean(beanId);
return (T)TestUtils.getPropertyValue(endpoint, "handler");
}
/**
* Gets the config file path that would be used to create the {@link ApplicationContext} instance
* sub class should implement this method to return a value of the config to be used to create the
* context
*
* @return
*/
protected abstract String getConfigFilePath();
/**
* The subclass should return the {@link AmazonWSCredentials} instance that is being used
* to configure the adapters
*
* @return
*/
protected abstract AWSCredentials getCredentials();
/**
* The test class for the AWS Credentials test that used property files
*/
@Test
public final void awsCredentialsTestWithPropFiles() {
MessageHandler handler = getMessageHandlerForBeanDefinition(CREDENTIALS_TEST_ONE);
AWSCredentials credentials = getCredentials();
String accessKey = credentials.getAccessKey();
String secretKey = credentials.getSecretKey();
AWSCredentials configuredCredentials =
TestUtils.getPropertyValue(handler, "credentials",AWSCredentials.class);
Assert.assertEquals(accessKey, configuredCredentials.getAccessKey());
Assert.assertEquals(secretKey, configuredCredentials.getSecretKey());
}
/**
* The test class for the AWS Credentials test that used accessKey and secretKey elements
*/
@Test
public final void awsCredentialsTestWithoutPropFiles() {
MessageHandler handler = getMessageHandlerForBeanDefinition(CREDENTIALS_TEST_TWO);
AWSCredentials credentials = getCredentials();
String accessKey = credentials.getAccessKey();
String secretKey = credentials.getSecretKey();
AWSCredentials configuredCredentials =
TestUtils.getPropertyValue(handler, "credentials",AWSCredentials.class);
Assert.assertEquals(accessKey, configuredCredentials.getAccessKey());
Assert.assertEquals(secretKey, configuredCredentials.getSecretKey());
}
}
| [
"ghillert@vmware.com"
] | ghillert@vmware.com |
5304b7646688dac6f33c92c803890d1c699b5d90 | 3b6a37e4ce71f79ae44d4b141764138604a0f2b9 | /phloc-commons/src/test/java/com/phloc/commons/io/file/filter/FileFilterToIFilterAdapterTest.java | db7243f7cdf7decd375ed91195c7e36198f066d5 | [
"Apache-2.0"
] | permissive | lsimons/phloc-schematron-standalone | b787367085c32e40d9a4bc314ac9d7927a5b83f1 | c52cb04109bdeba5f1e10913aede7a855c2e9453 | refs/heads/master | 2021-01-10T21:26:13.317628 | 2013-09-13T12:18:02 | 2013-09-13T12:18:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,941 | java | /**
* Copyright (C) 2006-2013 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* 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.phloc.commons.io.file.filter;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import org.junit.Test;
import com.phloc.commons.filter.IFilter;
import com.phloc.commons.mock.PhlocTestUtils;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Test class for class {@link FileFilterToIFilterAdapter}.
*
* @author Philip Helger
*/
public final class FileFilterToIFilterAdapterTest
{
@Test
@SuppressFBWarnings (value = "NP_NONNULL_PARAM_VIOLATION")
public void testAll ()
{
try
{
new FileFilterToIFilterAdapter ((FilenameFilter) null);
fail ();
}
catch (final NullPointerException ex)
{}
try
{
new FileFilterToIFilterAdapter ((FileFilter) null);
fail ();
}
catch (final NullPointerException ex)
{}
IFilter <File> aFilter = new FileFilterToIFilterAdapter (FileFilterParentDirectoryPublic.getInstance ());
// file
assertTrue (aFilter.matchesFilter (new File ("pom.xml")));
// not existing file
assertTrue (aFilter.matchesFilter (new File ("file.htm")));
// directory
assertTrue (aFilter.matchesFilter (new File ("src")));
// null
assertFalse (aFilter.matchesFilter (null));
PhlocTestUtils.testToStringImplementation (aFilter);
aFilter = FileFilterToIFilterAdapter.getANDChained (FileFilterParentDirectoryPublic.getInstance (),
FileFilterFileOnly.getInstance ());
assertNotNull (aFilter);
// file
assertTrue (aFilter.matchesFilter (new File ("pom.xml")));
// not existing file
assertFalse (aFilter.matchesFilter (new File ("file.htm")));
// directory
assertFalse (aFilter.matchesFilter (new File ("src")));
// null
assertFalse (aFilter.matchesFilter (null));
PhlocTestUtils.testToStringImplementation (aFilter);
aFilter = FileFilterToIFilterAdapter.getORChained (FileFilterParentDirectoryPublic.getInstance (),
FileFilterFileOnly.getInstance ());
assertNotNull (aFilter);
// file
assertTrue (aFilter.matchesFilter (new File ("pom.xml")));
// not existing file
assertTrue (aFilter.matchesFilter (new File ("file.htm")));
// directory
assertTrue (aFilter.matchesFilter (new File ("src")));
// null
assertFalse (aFilter.matchesFilter (null));
PhlocTestUtils.testToStringImplementation (aFilter);
try
{
FileFilterToIFilterAdapter.getANDChained ((FileFilter []) null);
fail ();
}
catch (final IllegalArgumentException ex)
{}
try
{
FileFilterToIFilterAdapter.getANDChained (new FileFilter [0]);
fail ();
}
catch (final IllegalArgumentException ex)
{}
try
{
FileFilterToIFilterAdapter.getORChained ((FileFilter []) null);
fail ();
}
catch (final IllegalArgumentException ex)
{}
try
{
FileFilterToIFilterAdapter.getORChained (new FileFilter [0]);
fail ();
}
catch (final IllegalArgumentException ex)
{}
}
}
| [
"mail@leosimons.com"
] | mail@leosimons.com |
41ff5a40b7151dd7cd08c5a80a3a2902ca15c928 | 5e2fa9976df1f10e36596e2723ce9317c81472d0 | /JDBC/测试JDBC源代码/src/com/bjsxt/jdbc/Demo10.java | 0d112fbe0951733b713993dfd508cc8081da4595 | [] | no_license | kontai/java | e9b664756f99c5db70021626990e9266018f0d0a | 50aa496bcdb3fd4c17485e3350f6a0a6ea8ca182 | refs/heads/master | 2023-04-30T11:41:56.068502 | 2023-04-08T12:34:12 | 2023-04-08T12:34:12 | 188,186,671 | 0 | 0 | null | 2023-04-17T17:46:55 | 2019-05-23T07:48:07 | HTML | UTF-8 | Java | false | false | 1,867 | java | package com.bjsxt.jdbc;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* 测试BLOB 二进制大对象的使用
* @author 高淇 www.sxt.cn
*
*/
public class Demo10 {
public static void main(String[] args) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
InputStream is = null;
OutputStream os = null;
try {
//加载驱动类
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/testjdbc","root","123456");
// ps = conn.prepareStatement("insert into t_user (username,headImg) values (?,?) ");
// ps.setString(1, "高淇");
// ps.setBlob(2, new FileInputStream("d:/icon.jpg"));
// ps.execute();
ps = conn.prepareStatement("select * from t_user where id=?");
ps.setObject(1, 101026);
rs = ps.executeQuery();
while(rs.next()){
Blob b = rs.getBlob("headImg");
is = b.getBinaryStream();
os = new FileOutputStream("d:/a.jpg");
int temp = 0;
while((temp=is.read())!=-1){
os.write(temp);
}
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(is!=null){
is.close();
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if(os!=null){
os.close();
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if(ps!=null){
ps.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
try {
if(conn!=null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
| [
"cho.kontai@gmail.com"
] | cho.kontai@gmail.com |
deef8a4c98d8541e3f249a1d4e9f11dc8727074f | 78c18aab31a7f36848ea03de53f975e3f5ead74e | /Libr/src/main/java/com/softserve/spring/library/dao/impl/ReadSessionDAOImpl.java | 7badccc746536ee2b238acd7262b487847b64d4e | [] | no_license | YuriiMalyi/library | 062a8682303d13be673f6904a64e2e7043544f5c | 17675462a32de0259226bcf2178afc6ebb42c714 | refs/heads/master | 2021-09-03T07:02:22.514315 | 2017-03-05T13:15:47 | 2017-03-05T13:15:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 618 | java | package com.softserve.spring.library.dao.impl;
import com.softserve.spring.library.entity.ReadSession;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.softserve.spring.library.dao.interfaces.ReadSessionDAO;
@Repository
@Transactional
public class ReadSessionDAOImpl extends GenericDAOImpl<ReadSession, Integer> implements ReadSessionDAO {
public ReadSessionDAOImpl() {
super(ReadSession.class);
}
public ReadSessionDAOImpl(Class<ReadSession> genericClass) {
super(genericClass);
// TODO Auto-generated constructor stub
}
}
| [
"malyiyura@gmail.com"
] | malyiyura@gmail.com |
b5484650ceaeb9bbee13d911961174c399c508da | 63fe6518a14074c7615967b33118b960a5d56ee6 | /Practice/src/backjoon/step03/Problem11.java | 12ec50cfc9c35cc8d8312617048681f96b292c9f | [] | no_license | hwans21/CodingTest | cdc5f0a130c057bf796f9419bf5699ef1e80e478 | 608f5917553eacd32f4870671a8205b4053a933c | refs/heads/master | 2023-08-22T03:23:43.778571 | 2021-10-17T15:10:14 | 2021-10-17T15:10:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,542 | java | package backjoon.step03;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
public class Problem11 {
/*
*
* 첫째 줄에 N과 X가 주어진다. (1 ≤ N, X ≤ 10,000)
*
* 둘째 줄에 수열 A를 이루는 정수 N개가 주어진다.
* 주어지는 정수는 모두 1보다 크거나 같고, 10,000보다 작거나 같은 정수이다.
*
* X보다 작은 수를 입력받은 순서대로 공백으로 구분해 출력한다. X보다 작은 수는 적어도 하나 존재한다.
*
* 입력
* 10 5
* 1 10 4 9 2 3 8 5 7 6
*
* 출력
* 1 4 2 3
*
*/
public static void main(String[] args) {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
List<Integer> list = new ArrayList<>();
try {
String line1 = br.readLine();
int n = Integer.parseInt(line1.split(" ")[0]);
int x = Integer.parseInt(line1.split(" ")[1]);
String line2 = br.readLine();
for(int i=0;i<n;i++) {
list.add(Integer.parseInt(line2.split(" ")[i]));
}
for(int a : list) {
if(a < x)
bw.write(a+" ");
}
} catch (Exception e) {
// TODO: handle exception
} finally {
try {
bw.close();
br.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
| [
"hwanseo3747@gmail.com"
] | hwanseo3747@gmail.com |
7af2e413ecc8c29c72c42c69778846e3417ead30 | 10d27d5205e15315c5c595f3d9da5121b460118e | /app/build/generated/source/apt/debug/com/hazem/hovosouq/activity/Selected_Category_ViewBinding.java | f43c12a3ff605a4659aa5c7d928408382edf4d84 | [] | no_license | islamghr/HoVoSouq | c9284f6b5c7d28a4bf121beb0acc871017dc28a4 | 81d42ce9093a0ea22fad7c342f4acca18cc9160a | refs/heads/master | 2020-04-02T22:28:04.224846 | 2018-10-26T11:47:47 | 2018-10-26T11:47:47 | 154,742,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,809 | java | // Generated code from Butter Knife. Do not modify!
package com.hazem.hovosouq.activity;
import android.support.annotation.CallSuper;
import android.support.annotation.UiThread;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageButton;
import butterknife.Unbinder;
import butterknife.internal.DebouncingOnClickListener;
import butterknife.internal.Utils;
import com.hazem.hovosouq.R;
import java.lang.IllegalStateException;
import java.lang.Override;
public class Selected_Category_ViewBinding implements Unbinder {
private Selected_Category target;
private View view2131230755;
@UiThread
public Selected_Category_ViewBinding(Selected_Category target) {
this(target, target.getWindow().getDecorView());
}
@UiThread
public Selected_Category_ViewBinding(final Selected_Category target, View source) {
this.target = target;
View view;
target.all_cateogories = Utils.findRequiredViewAsType(source, R.id.all_categories_recyclerview, "field 'all_cateogories'", RecyclerView.class);
view = Utils.findRequiredView(source, R.id.back_arrow, "field 'back_button' and method 'Seeall'");
target.back_button = Utils.castView(view, R.id.back_arrow, "field 'back_button'", ImageButton.class);
view2131230755 = view;
view.setOnClickListener(new DebouncingOnClickListener() {
@Override
public void doClick(View p0) {
target.Seeall();
}
});
}
@Override
@CallSuper
public void unbind() {
Selected_Category target = this.target;
if (target == null) throw new IllegalStateException("Bindings already cleared.");
this.target = null;
target.all_cateogories = null;
target.back_button = null;
view2131230755.setOnClickListener(null);
view2131230755 = null;
}
}
| [
"mieibrahim15@gmail.com"
] | mieibrahim15@gmail.com |
1f2efb9b596676409c6782ddd68ac4759ee1a187 | bec6178ac8efa870bee0a30b3a788105e50271ed | /heatmap/src/main/java/heatmap/topology/Checkins.java | 7ddcaf9af9a8161eb5f84ea6a4ec0f4782ce7ec0 | [
"MIT"
] | permissive | bibekshakya35/data-analytics | 7bcb041e95003ee8f3e67231933dc4825af0482b | a28075a08fb33a21e92aa4d138c1fa5bd9389181 | refs/heads/master | 2020-03-13T07:55:58.237522 | 2018-12-04T05:31:33 | 2018-12-04T05:31:33 | 131,034,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,201 | java | package heatmap.topology;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichSpout;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Values;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
public class Checkins extends BaseRichSpout {
//store the static check-ins from a file in List
private List<String> checkins;
//nextEmitIndex will keep track of our
//current position in the list as we'll
//recycle the static list of checkins
private int nextEmitIndex;
private SpoutOutputCollector outputCollector;
public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) {
this.outputCollector = spoutOutputCollector;
this.nextEmitIndex = 0;
try {
checkins = IOUtils.readLines(ClassLoader.getSystemResourceAsStream("checkins.txt"),
Charset.defaultCharset().name());
}catch (IOException io){
throw new RuntimeException(io);
}
}
public void nextTuple() {
//when storm requests the next tuple from the spout,look up
//the next check-in from our in-memory List and parse it into time and address components
String checkin =checkins.get(nextEmitIndex);
String[] parts =checkin.split(",");
Long time =Long.valueOf(parts[0]);
String address =parts[1];
//use the SpoutOutputCollector provided in the spout open method to emit the relevant fields
outputCollector.emit(new Values(time,address));
//advance the index of the next item to be emitted (recycling if at the end of the list)
nextEmitIndex = (nextEmitIndex+1)%checkins.size();
}
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
//let storm know that this spout will emit a tuple
//containing two fields named time and address
outputFieldsDeclarer.declare(new Fields("time","address"));
}
}
| [
"bibekshakyanp@gmail.com"
] | bibekshakyanp@gmail.com |
188146d78c09bad48d794a246947eb67bc348b4d | e4dcdb5cab48181f7b71b2dbd088aede497ebf5b | /turma21/bloco1/java/AULAS/src/lista3laços/tarefa4.java | d1eaf5430aced774617cbffe167ff9f6a4b7193b | [] | no_license | whateus/Generation | e02d715299f5cdbcef20cd31caace3c7fd7da794 | 9c53de7d426bc8c7c04b0d1a6cf0fcadfdfa9a93 | refs/heads/main | 2023-06-22T19:50:46.083851 | 2021-07-26T21:26:31 | 2021-07-26T21:26:31 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,116 | java | package lista3laços;
import java.util.Locale;
import java.util.Scanner;
public class tarefa4 {
public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner leia = new Scanner(System.in);
int idade = 0;
int sexo = 0;
int cont = 0;
int caract = 0;
int mNervosas = 0;
int hAgressivos = 0;
int pCalmas = 0;
int oCalmos = 0;
int pNervosas40 = 0;
int pCalmas18 = 0;
while(cont < 5) {
System.out.println("idade:");
idade =leia.nextInt();
System.out.println("Sexo(1-Feminino/2-Maculino/3-Outros):");
sexo =leia.nextInt();
if (sexo == 1) {
System.out.println("Você é uma pessoa 1-Calma, 2-Nervosa ou 3-Agressiva?");
caract = leia.nextInt();
if( caract == 1) {
pCalmas++;
if(idade < 18) pCalmas18++;
}
else if(caract == 2) {
mNervosas++;
if(idade > 40)pNervosas40++;
}
System.out.println();
}
else if(sexo == 2) {
System.out.println("Você é uma pessoa 1-Calma, 2-Nervosa ou 3-Agressiva?");
caract = leia.nextInt();
if( caract == 1) {
pCalmas++;
if(idade < 18) pCalmas18++;
}
else if(caract == 2) {
if(idade > 40) pNervosas40++;
}
else if(caract == 3) hAgressivos++;
System.out.println();
}
else if (sexo == 3) {
System.out.println("Você é uma pessoa 1-Calma, 2-Nervosa ou 3-Agressiva?");
caract = leia.nextInt();
if( caract == 1) {
pCalmas++;
oCalmos++;
if(idade < 18) pCalmas18++;
}
else if(caract == 2) {
if(idade > 40) pNervosas40++;
}
System.out.println();
}
cont++;
}
System.out.printf("\nO número de pessoas calmas é: %d",pCalmas);
System.out.printf("\nO número de mulheres nervosas é: %d",mNervosas);
System.out.printf("\nO número de homens agressivos é: %d",hAgressivos);
System.out.printf("\nO número de outros calmos é: %d",oCalmos);
System.out.printf("\nO número de pessoas nervosas com mais de 40 anos é: %d",pNervosas40);
System.out.printf("\nO número de pessoas calmas com menos de 18 anos é: %d",pCalmas18);
}
}
| [
"mat.oliver.strong@gmail.com"
] | mat.oliver.strong@gmail.com |
d7fded58576138e0269f2ed69465a65f05475c53 | 81719679e3d5945def9b7f3a6f638ee274f5d770 | /aws-java-sdk-codecommit/src/main/java/com/amazonaws/services/codecommit/model/transform/UpdatePullRequestTitleRequestMarshaller.java | 9676674ec4a4d03efe9d386120410b02b70fc98d | [
"Apache-2.0"
] | permissive | ZeevHayat1/aws-sdk-java | 1e3351f2d3f44608fbd3ff987630b320b98dc55c | bd1a89e53384095bea869a4ea064ef0cf6ed7588 | refs/heads/master | 2022-04-10T14:18:43.276970 | 2020-03-07T12:15:44 | 2020-03-07T12:15:44 | 172,681,373 | 1 | 0 | Apache-2.0 | 2019-02-26T09:36:47 | 2019-02-26T09:36:47 | null | UTF-8 | Java | false | false | 2,410 | 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.codecommit.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.codecommit.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* UpdatePullRequestTitleRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class UpdatePullRequestTitleRequestMarshaller {
private static final MarshallingInfo<String> PULLREQUESTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("pullRequestId").build();
private static final MarshallingInfo<String> TITLE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("title").build();
private static final UpdatePullRequestTitleRequestMarshaller instance = new UpdatePullRequestTitleRequestMarshaller();
public static UpdatePullRequestTitleRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(UpdatePullRequestTitleRequest updatePullRequestTitleRequest, ProtocolMarshaller protocolMarshaller) {
if (updatePullRequestTitleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updatePullRequestTitleRequest.getPullRequestId(), PULLREQUESTID_BINDING);
protocolMarshaller.marshall(updatePullRequestTitleRequest.getTitle(), TITLE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| [
""
] | |
95d29376233d20b9e879528adfd244b65251ae06 | 016e59390010938eabcff43bf18dcb7031b2f7da | /src/exception/modelexception/HeapAllocationException.java | d75404a7b097e92a810516c5d8e52749c9e31d44 | [] | no_license | ian-chelaru/Interpreter | 6bfd50228d09b70a41cb9bbcacfb0e352905daed | b11c784577b77c6f0ab5cbaa085790ef806e40dc | refs/heads/master | 2020-05-03T03:24:53.882947 | 2019-03-29T14:49:18 | 2019-03-29T14:49:18 | 178,397,168 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package exception.modelexception;
public class HeapAllocationException extends Exception
{
public HeapAllocationException()
{
super("HeapLocationIsNotAllocated");
}
}
| [
"ianchelaru@yahoo.com"
] | ianchelaru@yahoo.com |
be54610cc94f9d15c15d9f9cf146e7e896defe62 | db3e5334189c7840e0a036064bd755236538d120 | /srcFor1.7.10/src(GVCmobFixed)20160222/main/java/gvcguns/GVCEntityBulletDart.java | 687ca454229133534068e75f2e6af619c2d2253a | [] | no_license | AsakaHikari/m | 0011bb617e655443cb3970f0994d5399e9ddc9a5 | 19680d4757fd6848bf716181cd0b18a06d08b22d | refs/heads/master | 2022-01-18T19:35:30.258085 | 2019-07-22T02:17:44 | 2019-07-22T02:17:44 | 198,129,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,310 | java | package gvcguns;
import java.util.List;
import littleMaidMobX.LMM_EntityLittleMaid;
import littleMaidMobX.LMM_EntityLittleMaidAvatar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class GVCEntityBulletDart extends EntityThrowable
{
public EntityLivingBase thrower;
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private Block inTile;
protected boolean inGround;
public int throwableShake;
protected int knockbackStrength = 1;
public boolean isInfinity;
protected double damage;
//public int fuse;
/**
* Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion)
*/
private String throwerName;
private int ticksInGround;
private int ticksInAir;
private int field_145788_c;
private int field_145786_d;
private int field_145787_e;
private Block field_145785_f;
private int Bdamege;
private float Bspeed;
private float Bure;
//int i = mod_IFN_GuerrillaVsCommandGuns.RPGExplosiontime;
@Override
protected void entityInit() {
if (worldObj != null) {
isImmuneToFire = !worldObj.isRemote;
}
}
public GVCEntityBulletDart(World par1World)
{
super(par1World);
//this.fuse = 30;
}
public GVCEntityBulletDart(World par1World, EntityLivingBase par2EntityLivingBase, int damege, float bspeed, float bure)
{
super(par1World, par2EntityLivingBase);
//this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F);
//this.fuse = 30;
this.Bdamege = damege;
//this.Bspeed = bspeed;
//this.Bure = bure;
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, bspeed, bure);
}
public GVCEntityBulletDart(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
//this.fuse = 30;
}
public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8)
{
float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
par1 /= (double)var9;
par3 /= (double)var9;
par5 /= (double)var9;
par1 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.001499999832361937D * (double)par8;
par3 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.001499999832361937D * (double)par8;
par5 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.001499999832361937D * (double)par8;
par1 *= (double)par7;
par3 *= (double)par7;
par5 *= (double)par7;
this.motionX = par1;
this.motionY = par3;
this.motionZ = par5;
float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI);
this.ticksInGround = 0;
}
@Override
public void setVelocity(double par1, double par3, double par5) {
this.motionX = par1;
this.motionY = par3;
this.motionZ = par5;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI);
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
this.ticksInGround = 0;
}
}
/*protected float func_70182_d()
{
return 5F;
}*/
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float par1)
{
return 15728880;
}
public float getBrightness(float par1)
{
return 1.0F;
}
protected boolean isValidLightLevel()
{
return true;
}
public void onUpdate()
{
this.lastTickPosX = this.posX;
this.lastTickPosY = this.posY;
this.lastTickPosZ = this.posZ;
super.onUpdate();
this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
if (this.throwableShake > 0)
{
--this.throwableShake;
}
if (this.inGround)
{
if (this.worldObj.getBlock(this.field_145788_c, this.field_145786_d, this.field_145787_e) == this.field_145785_f)
{
++this.ticksInGround;
if (this.ticksInGround == 1200)
{
this.setDead();
}
return;
}
this.inGround = false;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}
else
{
++this.ticksInAir;
}
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{
vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
if (!this.worldObj.isRemote)
{
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
EntityLivingBase entitylivingbase = this.getThrower();
for (int j = 0; j < list.size(); ++j)
{
Entity entity1 = (Entity)list.get(j);
if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || this.ticksInAir >= 5))
{
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null)
{
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
}
if (movingobjectposition != null)
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.portal)
{
this.setInPortal();
}
else
{
this.onImpact(movingobjectposition);
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float var17 = 0.99F;
//float var18 = this.getGravityVelocity();
float var18 = 0.02F;
if (this.isInWater())
{
for (int var7 = 0; var7 < 4; ++var7)
{
float var19 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var19, this.posY - this.motionY * (double)var19, this.posZ - this.motionZ * (double)var19, this.motionX, this.motionY, this.motionZ);
}
var17 = 0.8F;
}
this.motionX *= (double)var17;
this.motionY *= (double)var17;
this.motionZ *= (double)var17;
this.motionY += (double)var18;
this.setPosition(this.posX, this.posY, this.posZ);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
int var2 = this.Bdamege;
if(GVCGunsPlus.cfg_FriendFireLMM == true){
if (par1MovingObjectPosition.entityHit instanceof LMM_EntityLittleMaid)
{
var2 = 0;
}
if (par1MovingObjectPosition.entityHit instanceof LMM_EntityLittleMaidAvatar)
{
var2 = 0;
}
}
par1MovingObjectPosition.entityHit.hurtResistantTime = 0;
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2);
Entity lel = (Entity)par1MovingObjectPosition.entityHit;
// ノックバック
/*lel.addVelocity((motionX/200D),
(-motionY-2D),
(motionZ/200D));*/
/*float lfd = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ);
int ldam = (int)Math.ceil((double)lfd * damage * 0.1D * (isInfinity ? 0.5D : 1D));
if (par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), ldam)) {
if (par1MovingObjectPosition.entityHit instanceof EntityLivingBase) {
EntityLivingBase lel = (EntityLivingBase)par1MovingObjectPosition.entityHit;
if (knockbackStrength > 0) {
if (lfd > 0.0F) {
lel.addVelocity(
(motionX * (double)knockbackStrength * 0D) / (double)lfd,
(motionY * (double)knockbackStrength * 0D) / (double)lfd + 0D,
(motionZ * (double)knockbackStrength * 0D) / (double)lfd);
}
}
}
}*/
}else {
xTile = par1MovingObjectPosition.blockX;
yTile = par1MovingObjectPosition.blockY;
zTile = par1MovingObjectPosition.blockZ;
inTile = worldObj.getBlock(xTile, yTile, zTile);
if (inTile == Blocks.glass_pane || inTile == Blocks.flower_pot || inTile == Blocks.glass || inTile == Blocks.tallgrass || inTile == Blocks.double_plant) {
motionX *= 0.8;
motionY *= 0.8;
motionZ *= 0.8;
onBlockDestroyed(xTile, yTile, zTile);
} else {
}
motionX = par1MovingObjectPosition.hitVec.xCoord - posX;
motionY = par1MovingObjectPosition.hitVec.yCoord - posY;
motionZ = par1MovingObjectPosition.hitVec.zCoord - posZ;
inGround = true;
if (!worldObj.isRemote) {
//worldObj.playSoundAtEntity(this, "FN5728.bullethitBlock", 1.0F, rand.nextFloat() * 0.2F + 0.9F);
//this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
// this.playSound("FN5728.fnP90_s", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
}
for (int j = 0; j < 8; ++j)
{
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
}
if (!this.worldObj.isRemote)
{
this.setDead();
//this.explode();
}
}
//
isAirBorne = true;
velocityChanged = true;
}
public void onBlockDestroyed(int blockX, int blockY, int blockZ) {
//int bid = worldObj.getBlock(blockX, blockY, blockZ);
int bmd = worldObj.getBlockMetadata(blockX, blockY, blockZ);
Block block = worldObj.getBlock(blockX, blockY, blockZ);
if(block == null) {
return;
}
worldObj.playAuxSFX(2001, blockX, blockY, blockZ, (bmd << 12));
boolean flag = worldObj.setBlockToAir(blockX, blockY, blockZ);
if (block != null && flag) {
block.onBlockDestroyedByPlayer(worldObj, blockX, blockY, blockZ, bmd);
}
}
private void explode()
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.5F, false);
}
}
| [
"namakeya5@gmail.com"
] | namakeya5@gmail.com |
e97529f045340501a6793663d13ce4c9dfcaa28b | c216eda30594e14e2a79111ff33ea007aa2374ca | /common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/RelationshipUR.java | 45da77ad5f93a7cc133675af3d4f62a9eaae65e2 | [
"Apache-2.0"
] | permissive | apache/syncope | e027b60dfd50309c7d5a54fbcbc642a1be21b12f | ec54d59f6a44701ff2383d5729b54a4a07917f06 | refs/heads/master | 2023-08-31T11:11:36.107226 | 2023-08-29T09:17:46 | 2023-08-29T09:29:31 | 25,623,942 | 233 | 333 | Apache-2.0 | 2023-09-14T08:07:44 | 2014-10-23T07:00:10 | Java | UTF-8 | Java | false | false | 2,478 | 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.syncope.common.lib.request;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.syncope.common.lib.to.RelationshipTO;
public class RelationshipUR extends AbstractPatch {
private static final long serialVersionUID = 1314175521205206511L;
public static class Builder extends AbstractPatch.Builder<RelationshipUR, Builder> {
public Builder(final RelationshipTO relationshipTO) {
super();
getInstance().setRelationshipTO(relationshipTO);
}
@Override
protected RelationshipUR newInstance() {
return new RelationshipUR();
}
}
private RelationshipTO relationshipTO;
public RelationshipTO getRelationshipTO() {
return relationshipTO;
}
public void setRelationshipTO(final RelationshipTO relationshipTO) {
this.relationshipTO = relationshipTO;
}
@Override
public int hashCode() {
return new HashCodeBuilder().
appendSuper(super.hashCode()).
append(relationshipTO).
build();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final RelationshipUR other = (RelationshipUR) obj;
return new EqualsBuilder().
appendSuper(super.equals(obj)).
append(relationshipTO, other.relationshipTO).
build();
}
}
| [
"ilgrosso@apache.org"
] | ilgrosso@apache.org |
42f95a203376e13187bbdcb9b3928656022c88ec | d2e737c077e9afb19b0d230c07e7828eb45a0691 | /00_leetcode/src/com/jms/动态规划/_714_买卖股票的最佳时机含手续费.java | e4977193df6e3639c203d78c564f6577e8428dd7 | [] | no_license | superJamison/algorithm | 5a78ac7c623cdf7a344d6494e39d2b97adb3cfb3 | 236c1500cf8a7d5c27327020b7505bec578e0359 | refs/heads/main | 2023-08-23T14:45:42.953098 | 2021-11-07T08:01:53 | 2021-11-07T08:01:53 | 352,030,810 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,023 | java | package com.jms.动态规划;
/**
* @author Jamison
* @version 1.0
* @date 2021/11/5 20:42
*/
public class _714_买卖股票的最佳时机含手续费 {
// 空间优化
public int maxProfit(int[] prices, int fee) {
if (prices.length < 2) return 0;
// no不持有,have持有
int no = 0, have = -prices[0];
for (int i = 1; i < prices.length; i++) {
no = Math.max(no, have + prices[i] - fee);
have = Math.max(have, no - prices[i]);
}
return no;
}
// 未做空间优化
public int maxProfit1(int[] prices, int fee) {
if (prices.length < 2) return 0;
int[][] dp = new int[prices.length][2];
dp[0][0] = 0;
dp[0][1] = -prices[0];
for (int i = 1; i < prices.length; i++) {
dp[i][0] = Math.max(dp[i - 1][0], dp[i - 1][1] + prices[i] - fee);
dp[i][1] = Math.max(dp[i - 1][1], dp[i - 1][0] - prices[i]);
}
return dp[prices.length - 1][0];
}
}
| [
"2982935350@qq.com"
] | 2982935350@qq.com |
77d11c55fb09e34ab02c684d5e7b464b798d3ac2 | c44d412910752b3a2fbfc4a53bc42c02bdfb1136 | /seleniumAutomation/src/main/java/com/tricon/seleniumAutomation/App.java | 06dbacb547deed243205ecd00220c422f9f07eff | [] | no_license | mihirvilasshah/SeleniumAutomation | b09523ca93324b5d1ee19ebaf658dcfd874f7999 | 6c7bd4e0f2098ef0f07f7fd13459fff21eab523f | refs/heads/master | 2020-03-27T01:49:30.519801 | 2018-08-22T18:09:58 | 2018-08-22T18:09:58 | 145,745,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,500 | java | package com.tricon.seleniumAutomation;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.WebElement;
public class App
{
public static void main( String[] args ) throws InterruptedException
{
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\mihir\\Desktop\\Tricon\\mWork\\Selenium\\\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String baseUrl = "http://a.testaddressbook.com/";
driver.manage().window().maximize();
driver.get(baseUrl);
driver.findElement(By.id("sign-in")).click();
WebDriverWait wait1 = new WebDriverWait(driver, 100);
//WebElement element1 =
wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("session_email")));
driver.findElement(By.xpath("//a[@data-test='sign-up']")).click();
WebDriverWait wait2 = new WebDriverWait(driver, 100);
wait2.until(ExpectedConditions.presenceOfElementLocated(By.id("user_email")));
driver.findElement(By.name("user[email]")).sendKeys("mihir6@company.com");
driver.findElement(By.id("user_password")).sendKeys("mihir");
driver.findElement(By.xpath("//input[@value='Sign up']")).click();
WebDriverWait wait3 = new WebDriverWait(driver, 100);
wait3.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//a[contains(text(),'Addresses')]")));
// driver.findElement(By.name("session[email]")).sendKeys("mihir@comp.com");
// driver.findElement(By.id("session_password")).sendKeys("mihir");
// driver.findElement(By.xpath("//input[@value='Sign in']")).click();
driver.findElement(By.xpath("//a[contains(text(),'Addresses')]")).click();
WebDriverWait wait4 = new WebDriverWait(driver, 100);
wait4.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//a[@class='row justify-content-center']")));
driver.findElement(By.xpath("//a[@class='row justify-content-center']")).click();
WebDriverWait wait5 = new WebDriverWait(driver, 100);
wait5.until(ExpectedConditions.presenceOfElementLocated(By.id("address_first_name")));
driver.findElement(By.id("address_first_name")).sendKeys("Mihir");
driver.findElement(By.id("address_last_name")).sendKeys("Shah");
driver.findElement(By.id("address_street_address")).sendKeys("M.G.Road");
driver.findElement(By.id("address_secondary_address")).sendKeys("Kandivali");
driver.findElement(By.id("address_city")).sendKeys("Mumbai");
driver.findElement(By.id("address_state")).click();
driver.findElement(By.xpath("//option[text()='Iowa']")).click();
Thread.sleep(1000);
driver.findElement(By.id("address_zip_code")).sendKeys("400001");
driver.findElement(By.xpath("//input[@value='Create Address']")).click();
WebDriverWait wait6 = new WebDriverWait(driver, 100);
wait6.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//a[@data-test='list']")));
driver.findElement(By.xpath("//a[@data-test='list']")).click();
//driver.close();
}
}
| [
"mihirhero2008@gmail.com"
] | mihirhero2008@gmail.com |
f2434d4175bb71912d1a68ed0c73dc4c900289e4 | 8305a32acd9e25890dab57d8f8e334894fc48a7a | /webui/src/main/java/com/seger/lagou/webui/service/JobTypeProvinceCityService.java | a9889c182e24ecac60de9347db81cc1e38500aee | [] | no_license | segerLin/RecruitmentInfoAnalysis | da16a26f4e8119d0c70f9f4851126a15785a59a3 | 0821ec9fa290a8a11d9eedd9ca427864ef01c431 | refs/heads/master | 2020-03-17T21:26:04.922419 | 2018-05-18T13:28:54 | 2018-05-18T13:28:54 | 133,957,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 294 | java | package com.seger.lagou.webui.service;
import com.seger.lagou.webui.dataobject.JobTypeProvinceCity;
import java.util.List;
/**
* @author: seger.lin
*/
public interface JobTypeProvinceCityService {
List<JobTypeProvinceCity> findByJobProvinceAndJobCity(String province, String city);
}
| [
"seger@lindeMacBook-Pro.local"
] | seger@lindeMacBook-Pro.local |
2aee4cb5e92dcbdb1b47e478b781ad2207299f17 | eee43cf8282c9528b7108729971bf438a1bf8584 | /app/src/main/java/com/unithon/openplaces/network/Constant.java | 209d1f1cfd2e76ba63bf1d90bca42ac0947aa0eb | [] | no_license | terrykwon/OpenPlaces | 873d572f7e3f5b7b32d2ed955bf5e3895f865a23 | 979e911f9af50cfc30657bcbc631930f2edc70eb | refs/heads/master | 2021-01-19T04:34:15.342563 | 2016-08-03T06:05:54 | 2016-08-03T06:05:54 | 64,521,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package com.unithon.openplaces.network;
/**
* Created by choi on 2016-07-30.
*/
public class Constant {
public static final String SEARCH_API_URL = "http://172.29.93.224:8080";
}
| [
"globaldev@coupang.com"
] | globaldev@coupang.com |
526e55f87c0d9826c76ea497cea0be149111b909 | 5920e3151c49131b20286bd07e054198d71d9877 | /src/main/java/com/flagstone/transform/as3/abcfile/instruction/control_transfer/InstructionIfeq.java | 8fdcf7183c3e96973191e73d0334d9aac9c4fb51 | [
"MIT"
] | permissive | jguyet/ABCFile | df225ca8321196b7ac0bd08da07eec2417857e05 | 29ad85ef170a268a008faa49e4ff12f4668a9c15 | refs/heads/master | 2020-03-27T12:03:02.559452 | 2018-08-29T00:55:42 | 2018-08-29T00:55:42 | 146,522,371 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,825 | java | package com.flagstone.transform.as3.abcfile.instruction.control_transfer;
import com.flagstone.transform.as3.abcfile.instruction.IInstructionBaseJump;
import com.flagstone.transform.as3.abcfile.instruction.Instruction;
import com.flagstone.transform.as3.abcfile.instruction.Opcode;
import com.flagstone.transform.as3.abcfile.stack.IStackInt;
import com.flagstone.transform.as3.abcfile.stack.StackFactory;
import com.flagstone.transform.as3.abcfile.utils.ByteBufferFlash;
public class InstructionIfeq
extends InstructionJumpBase
implements IInstructionBaseJump {
public static final Opcode opcode = Opcode.OP_ifeq;
public InstructionIfeq(ByteBufferFlash date, int position) {
super(opcode, date, position);
}
public InstructionIfeq() {
super(opcode);
}
public InstructionIfeq(int offset, int position) {
super(opcode, offset, position);
}
@Deprecated
public InstructionIfeq(Opcode opcode, byte[] date, int position, int jump, int offset) {
super(opcode, date, position, jump, offset);
}
@Deprecated
public InstructionIfeq(Opcode opcode, byte[] date, int position, Instruction target) {
super(opcode, date, position, target);
}
public Object runInstruction() throws Exception, VerifyError {
IStackInt < Object > stack = StackFactory.getStack();
IStackInt < Object > scopeStack = StackFactory.getScopeStack();
Object value2 = stack.pop();
Object value1 = stack.pop();
if (((value2 instanceof Integer)) && ((value1 instanceof Integer))) {
if ((Integer) value2 == (Integer) value1) {
return Boolean.valueOf(true);
}
return Boolean.valueOf(false);
}
throw new Exception("not implemented yet InstructionIfeq");
}
} | [
"jguyet@student.42.fr"
] | jguyet@student.42.fr |
c4520820b2bde029b287f0d4332f3cfc8555d799 | cbae8573bba42969db4c845e0aa64b38e1ad583b | /app/src/main/java/com/example/kinder/MainActivity.java | 3445a63a0bb167877291eb2c7a509a052941d542 | [] | no_license | Verrol-IKONIC/Kinder | d98e951ea2b29c37af3e9ef132fbe9475af851f6 | 86e217e9368de77af990efb3254d29cde6c04a07 | refs/heads/master | 2023-02-19T05:52:20.994885 | 2021-01-19T23:10:16 | 2021-01-19T23:10:16 | 331,132,699 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.example.kinder;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
} | [
"verrol_twince@yahoo.com"
] | verrol_twince@yahoo.com |
316659119c6a144a0b70ad7537cd0ab103e7361a | 88c6aadba664338244e483cd4b6b44cf125f7120 | /src/Models/Cards/Classes/monsterCards/normalCards/OgreFrontliner.java | 1968e2ed1be8d0ba57bd3e9757937cffaea65b28 | [] | no_license | armagg/APProject | be46da57ba4f3c26fd3872210a2a43f2e473e887 | c654cb1a65dd43ae52bbdcdd2577ec5b5403e52c | refs/heads/master | 2020-03-11T19:24:38.066181 | 2018-07-14T11:39:26 | 2018-07-14T11:39:39 | 130,206,750 | 0 | 0 | null | 2018-04-20T18:13:32 | 2018-04-19T11:39:39 | Java | UTF-8 | Java | false | false | 289 | java | package Models.Cards.Classes.monsterCards.normalCards;
import Models.Cards.Classes.Normal;
import Models.Cards.Classes.Race;
public final class OgreFrontliner extends Normal {
public OgreFrontliner() {
super("Orge Frontliner", 1800, 600, 5, Race.ORGES, false, true);
}
}
| [
"hasansendani1@gmail.com"
] | hasansendani1@gmail.com |
4646bea4c02583befec06bf297aa25967308bad8 | 806d921412535b8d91beebb3635c9747e475a8fb | /src/main/java/wrapper/Erailnew.java | bed398669dfc856ff6e65015a405d05ce71df4d3 | [] | no_license | AruviPrakash/SampleProject | e0080e62be27df3eaa3323477cb4e64be450c098 | f7aec549c959df7d4f36ea33bf200df8a859fb0a | refs/heads/master | 2020-12-24T19:46:49.702423 | 2016-04-22T11:41:51 | 2016-04-22T11:41:51 | 56,089,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | package wrapper;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Erailnew extends Wrapper {
@Test
public void login() throws IOException {
LaunchApp("chrome", "http://erail.in/");
driver.findElementById("txtStationFrom").sendKeys("MAS",Keys.TAB);
driver.findElementById("txtStationTo").sendKeys("ERS",Keys.TAB);
WebElement traintable = driver.findElementByClassName("DataTable TrainList");
//(By.className("DataTable DataTableHeader TrainList"));
List<WebElement> allrows = traintable.findElements(By.tagName("tr"));
int rows= allrows.size();
XSSFWorkbook wbook = new XSSFWorkbook();
XSSFSheet sheet = wbook.createSheet("webtable");
System.out.println(rows);
for (int i=0;i<=rows;i++)
{
XSSFRow row = sheet.createRow(i);
List<WebElement> allcolumns = traintable.findElements(By.tagName("td"));
int columns = allcolumns.size();
System.out.println(columns);
for (int j=0;j<=columns;j++)
{
WebElement value= allcolumns.get(j);
String cellvalue= value.getText();
sheet.getRow(i).createCell(j).setCellValue(cellvalue);
}
}
FileOutputStream file = new FileOutputStream(new File("./data/sampletrain.xlsx"));
wbook.write(file);
wbook.close();
}
}
| [
"[aruvi.v55@gmail.com]"
] | [aruvi.v55@gmail.com] |
f1b5b95f5c0c72e50c0ed01e30edb7e22dce3882 | 36fcbfcf1d01ab70a2256d5cba0a2f3b466a47db | /app/build/generated/source/r/androidTest/debug/com/hdpsolution/cotuong/test/R.java | be7468b24e5295f064a0cc51e087cd8405716f5e | [] | no_license | nsh96hp/ChessHDP | 126180805394155e7f3d0aa958366c20fe161bc0 | 161de3d000f18c2dc1e023f0f2a0b21f707c6f0c | refs/heads/master | 2020-03-22T04:35:22.838904 | 2018-07-03T00:23:00 | 2018-07-03T00:23:00 | 135,418,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.hdpsolution.cotuong.test;
public final class R {
} | [
"34828185+nsh96hp@users.noreply.github.com"
] | 34828185+nsh96hp@users.noreply.github.com |
26ccca91bb26b1966837c46f0b3f05741fb491fc | ffed7d3e2efaaf913c4e94f1849e3d0d76e4a271 | /moa/src/main/java/moa/controller/TestCtrl.java | 783c441c5b147115bd4ceeecd197eb9ad117f940 | [] | no_license | w516656295/Development | a7044fac38c918b7012d6b2505ee50bdef787781 | a4a4adbbacf1e69997782ddbd288779a459b2040 | refs/heads/master | 2021-01-13T12:51:43.379659 | 2017-03-13T10:24:13 | 2017-03-13T10:24:13 | 78,340,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package moa.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping
public class TestCtrl {
@RequestMapping("/name")
@ResponseBody
public String getName(){
return "ggggggg";
}
}
| [
"516656295@qq.com"
] | 516656295@qq.com |
3b54360c6e123be38dfdf573d502904b5b5ab143 | 98ff10871c967b660c9879f5d0e981a10743c053 | /JavaEfrainOviedo/Num43.java | 8bed48f653c4a3ed82b87d437ed808f639fd02c5 | [] | no_license | Emmanuel-Astaroth/java | 09dd6d74e56d1373b7acc83ef89c8257dee7c201 | 9e8166db2f646ba83515a85a1e7a729ffb6b85d8 | refs/heads/master | 2020-05-19T07:43:21.567229 | 2018-11-28T06:14:49 | 2018-11-28T06:14:49 | null | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 1,191 | java | /**
* EJERCICIO RESUELTO No. 43
* @autor Efrain Oviedo
* @libro Logica de Programación
*
*/
import java.io.*;//LIBRERIA NECESARIA PARA EL BUFFERED READER
public class Num43
{
//CODIFICACION DE LA FUNCION
static double mayor(float N1,float N2, double N3)
{
double VALMAY;
if((N1>N2) && (N1>N3))
VALMAY=N1;
else
if(N2>N3)
VALMAY=N2;
else
VALMAY=N3;
return VALMAY;
}
public static void main(String ar[])
throws IOException//MANEJA LAS EXEPCIONES DEL READLINE
{
BufferedReader lector = new BufferedReader(new InputStreamReader(System.in));
String temporal;
Number f;
Num43 objeto=new Num43();
float NUM1,NUM2;
double NUM90=90.5;
System.out.println("ENTRE EL PRIMER VALOR :");
temporal=lector.readLine();f=Float.valueOf(temporal);NUM1=f.floatValue();
System.out.println("ENTRE EL SEGUNDO VALOR:");
temporal=lector.readLine();f=Float.valueOf(temporal);NUM2=f.floatValue();
double resultado=objeto.mayor(NUM1,NUM2,NUM90);
System.out.println("EL VALOR MAYOR ENTRE: "+NUM1+" , "+NUM2+" Y 90.5 ES: "+resultado);
System.out.println("PRESIONE TECLA PARA TERMINAR");
}
}
| [
"jegiraldp@gmail.com"
] | jegiraldp@gmail.com |
74009e31207f7bf3263b5a8f3f4ab4f2496c65ce | 9952860744ca13e8af822744a29c4eca03969334 | /src/main/java/az/none/javalessons/lesson_7/inner_outer_nested_anonymus/Ability.java | 06eb35551d95b2b4a3beb19d18e77a3d6295dd8b | [] | no_license | khayalfarzi/java-se-group | ca87ee74bf7940cf52373fa8c990d21614634618 | 6125be97863a0295ae4379aaf94efbc9b25856ad | refs/heads/master | 2023-05-12T09:02:51.250519 | 2021-06-02T17:51:22 | 2021-06-02T17:51:22 | 353,427,361 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 114 | java | package az.none.javalessons.lesson_7.inner_outer_nested_anonymus;
public interface Ability {
void read();
}
| [
"xeyalferziyev9@gmail.com"
] | xeyalferziyev9@gmail.com |
dcbdbe524acf4a643546d6940e3bdc217ac17461 | b755a269f733bc56f511bac6feb20992a1626d70 | /qiyun-lottery/lottery-model/src/main/java/com/qiyun/model2/FootballTeam2.java | 6266a73dd5c80e4529cc9a46fca57fdceaa5b082 | [] | no_license | yysStar/dubbo-zookeeper-SSM | 55df313b58c78ab2eaa3d021e5bb201f3eee6235 | e3f85dea824159fb4c29207cc5c9ccaecf381516 | refs/heads/master | 2022-12-21T22:50:33.405116 | 2020-05-09T09:20:41 | 2020-05-09T09:20:41 | 125,301,362 | 2 | 0 | null | 2022-12-16T10:51:09 | 2018-03-15T02:27:17 | Java | UTF-8 | Java | false | false | 1,418 | java | package com.qiyun.model2;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FootballTeam2 {
private Integer id;
private String standardName;
private String dc;
private String jc;
private String fb;
private String dyj;
private Integer pm;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getStandardName() {
return standardName;
}
public void setStandardName(String standardName) {
this.standardName = standardName == null ? null : standardName.trim();
}
public String getDc() {
return dc;
}
public void setDc(String dc) {
this.dc = dc == null ? null : dc.trim();
}
public String getJc() {
return jc;
}
public void setJc(String jc) {
this.jc = jc == null ? null : jc.trim();
}
public String getFb() {
return fb;
}
public void setFb(String fb) {
this.fb = fb == null ? null : fb.trim();
}
public String getDyj() {
return dyj;
}
public void setDyj(String dyj) {
this.dyj = dyj == null ? null : dyj.trim();
}
public Integer getPm() {
return pm;
}
public void setPm(Integer pm) {
this.pm = pm;
}
} | [
"qawsed1231010@126.com"
] | qawsed1231010@126.com |
221ed955b6a71b0e606c74659d815d91dc40b4c5 | 48587cfdada22c7580bd5b95dd2db8cf139b7015 | /src/main/java/com/goodsoft/yuanlin/YlcxptApplication.java | 3f872af3958eb9b02efd92c4a12aacc28ae18da2 | [] | no_license | MANJUSAK/ylcx | 1cf7c948f56b1789d779266a9338a13f22da7af3 | 65175964d69bf92125cadb3849acdedf6cc7eb14 | refs/heads/master | 2021-01-22T07:31:53.100219 | 2017-09-04T10:11:27 | 2017-09-04T10:11:27 | 102,305,878 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.goodsoft.yuanlin;
import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
/**
* function 系统启动程序入口
* Created by 严彬荣 on 2017/8/4.
*/
@ComponentScan(basePackages = "com.goodsoft.yuanlin")
@ServletComponentScan(basePackages = "com.goodsoft.yuanlin.config")
@SpringBootApplication
public class YlcxptApplication {
private Logger logger = Logger.getLogger(YlcxptApplication.class);
public static void main(String[] args) {
SpringApplication.run(YlcxptApplication.class, args);
}
}
| [
"453420698@qq.com"
] | 453420698@qq.com |
d72f0149e1ef7823317700f316db37aff75e0c8b | bdfb4879de27cfd8a16b1ea733e8a4ac33c85402 | /TestGithubapp/app/src/main/java/com/example/munchado/testgithubapp/MainActivity.java | a18671fbe9ea69ff93c22e941fcf4489bdcd979e | [] | no_license | pkhare-munchado/Test-Github | 6550106b8f26fb4a6ae23a7ce2b3a5bb482b1e63 | f4dcca716a4976c41e1ac34446339ab1af3a3128 | refs/heads/master | 2020-04-09T11:55:49.089263 | 2016-11-16T11:28:50 | 2016-11-16T11:28:50 | 68,001,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,212 | java | package com.example.munchado.testgithubapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("=====","========== onCreate");
finish();
}
@Override
protected void onStart() {
super.onStart();
Log.d("=====","========== onStart");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("=====","========== onRestart");
}
@Override
protected void onResume() {
super.onResume();
Log.d("=====","========== onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.d("=====","========== onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.d("=====","========== onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.d("=====","========== onDestroy");
}
}
| [
"pkhare@munchao.in"
] | pkhare@munchao.in |
f4c995aa3bd167c5152edc7d90320378dc186d2b | f27cd4d70db09e1727f0d2ccfcd84bdd6dd38ed4 | /redis-stream-producer/src/main/java/br/com/itau/rsp/config/RedisConfig.java | 9e9ed7986a839d768ec82a84afcac8bac2196a9d | [] | no_license | alebarbieri1/redis-streams | db30c414cd81d32946ce89fb72ab59f71a3e5e8a | 578ca72f00c9886adefb9492d2e963617bcc1ce3 | refs/heads/master | 2022-12-01T12:26:26.993914 | 2020-08-20T18:10:04 | 2020-08-20T18:10:04 | 288,449,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,410 | java | package br.com.itau.rsp.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
public class RedisConfig {
@Bean
public RedisStandaloneConfiguration redisStandaloneConfiguration() {
return new RedisStandaloneConfiguration("localhost", 6379);
}
@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(redisStandaloneConfiguration());
}
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory);
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new StringRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}
| [
"alebarbieri09@gmail.com"
] | alebarbieri09@gmail.com |
f73ea0981eb92289dfed9193671a334ba760c444 | 648ccdeec61a8223cc524d5733d2701e7631e76e | /src/main/java/br/lumis/repository/ICandidatoRepository.java | 0675c0f9aeb004c263ecd25fc61a22e9b46c7d8b | [] | no_license | Sharpista/Desafio-Lumis | 144c11ecaa9427d773a226e3509c62a8bf65b9c8 | 2a81680c43b2c7c985c9db1ca5e72dbc2798c9f2 | refs/heads/master | 2022-12-05T17:58:55.496291 | 2020-08-28T13:36:32 | 2020-08-28T13:36:32 | 289,906,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package br.lumis.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import br.lumis.model.Candidato;
@Repository
public interface ICandidatoRepository extends JpaRepository<Candidato, Long> {
}
| [
"alexandrerobertofilho@gmail.com"
] | alexandrerobertofilho@gmail.com |
86821a6b6df1e53843ae99e0054bd53fa096e634 | d434c827f2a83c006948d638d52404323d28b1e0 | /Backend - Arquitectura de microservicios/springboot-servicio-moveratras/src/main/java/com/titulacion/springboot/app/moveratras/controllers/MoverAtrasController.java | 860cf0d978beb5d721d9f03b0427ca615e131218 | [] | no_license | nmcoboj/Degree-Project | e725b75f4701eb738d1d114d48468cb184724871 | e03f67df63bef0ea78243b252397f748f4dafb78 | refs/heads/main | 2023-07-18T04:42:59.093792 | 2021-09-02T06:30:29 | 2021-09-02T06:30:29 | 402,236,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,763 | java | package com.titulacion.springboot.app.moveratras.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.titulacion.springboot.app.moveratras.models.entity.Accion;
import com.titulacion.springboot.app.moveratras.models.entity.MoverAtras;
import com.titulacion.springboot.app.moveratras.models.service.IMoverAtrasService;
@CrossOrigin
@RefreshScope
@RestController
public class MoverAtrasController {
Accion accion = new Accion();
@Autowired
@Qualifier("serviceRestTemplate")
private IMoverAtrasService moverAtrasService;
@GetMapping("/lista_local")
public List<MoverAtras> detalleLocal(){
return moverAtrasService.findAll();
}
@GetMapping("/listar_acciones")
public List<Accion> detalle() {
return moverAtrasService.listarAccionesMotorIzquierdo();
}
// @HystrixCommand(fallbackMethod = "metodoAlternativoDerecho")
// @PostMapping("/enviar")
// @ResponseStatus(HttpStatus.OK)
// public Accion guardar(@RequestBody MoverAtras moverAtras) {
// Accion accion = new Accion(moverAtras);
// Accion respuesta_motorderecho = enviar_motorderecho(accion);
// Accion respuesta_izquierdo = enviar_motorizquierdo(accion);
// if ("true".equals(respuesta_motorderecho.getMovimiento()) || "full".equals(respuesta_motorderecho.getMovimiento())) {
// moverAtrasService.save(moverAtras);
// }
// return respuesta_motorderecho;
// }
@HystrixCommand(fallbackMethod = "metodoAlternativoDerecho")
@PostMapping("/enviar_derecho")
@ResponseStatus(HttpStatus.OK)
public Accion guardar_derecho(@RequestBody MoverAtras moverAtras) {
Accion accion = new Accion(moverAtras);
Accion respuesta_motorderecho = enviar_motorderecho(accion);
if ("true".equals(respuesta_motorderecho.getMovimiento())) {
moverAtrasService.save(moverAtras);
}
return respuesta_motorderecho;
}
@HystrixCommand(fallbackMethod = "metodoAlternativoIzquierdo")
@PostMapping("/enviar_izquierdo")
@ResponseStatus(HttpStatus.OK)
public Accion guardar_izquierdo(@RequestBody MoverAtras moverAtras) {
Accion accion = new Accion(moverAtras);
Accion respuesta_motorizquierdo = enviar_motorizquierdo(accion);
if ("true".equals(respuesta_motorizquierdo.getMovimiento())) {
moverAtrasService.save(moverAtras);
}
return respuesta_motorizquierdo;
}
public Accion enviar_motorizquierdo(@RequestBody Accion accion) {
Accion respuesta = moverAtrasService.enviar_motorizquierdo(accion);
return respuesta;
}
public Accion enviar_motorderecho(@RequestBody Accion accion) {
Accion respuesta = moverAtrasService.enviar_motorderecho(accion);
return respuesta;
}
public Accion metodoAlternativoIzquierdo(@RequestBody MoverAtras moverAtras) {
Accion accionError = new Accion();
accionError.setId(moverAtras.getId());
accionError.setFecha(moverAtras.getFecha());
accionError.setMovimiento("Error: El motor izquierdo del robot no pudo moverse atras.");
MoverAtras moverAtrasIzquierdoError = new MoverAtras(accionError);
moverAtrasService.save(moverAtrasIzquierdoError);
enviar_motorIzquierdoFallback(moverAtras);
return accionError;
}
public Accion metodoAlternativoDerecho(@RequestBody MoverAtras moverAtras) {
Accion accionError = new Accion();
accionError.setId(moverAtras.getId());
accionError.setFecha(moverAtras.getFecha());
accionError.setMovimiento("Error: El motor derecho del robot no pudo moverse atras.");
MoverAtras moverAtrasDerechoError = new MoverAtras(accionError);
moverAtrasService.save(moverAtrasDerechoError);
enviar_motorDerechoFallback(moverAtras);
return accionError;
}
public void enviar_motorDerechoFallback(@RequestBody MoverAtras moverAtras){
Accion accionFallback = new Accion();
accionFallback.setId(moverAtras.getId());
accionFallback.setFecha(moverAtras.getFecha());
if ("Atras0".equals(moverAtras.getMovimiento())){
accionFallback.setMovimiento("Adelante0");
}
else if ("Atras50".equals(moverAtras.getMovimiento())) {
accionFallback.setMovimiento("Adelante50");
}
else {
accionFallback.setMovimiento("Adelante100");
}
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
enviar_motorizquierdo(accionFallback);
//MoverAtras moverAtrasDerechoError = new MoverAtras(accionFallback);
//moverAtrasService.save(moverAtrasDerechoError);
}
public void enviar_motorIzquierdoFallback(@RequestBody MoverAtras moverAtras){
Accion accionFallback = new Accion();
accionFallback.setId(moverAtras.getId());
accionFallback.setFecha(moverAtras.getFecha());
if ("Atras0".equals(moverAtras.getMovimiento())){
accionFallback.setMovimiento("Adelante0");
}
else if ("Atras50".equals(moverAtras.getMovimiento())) {
accionFallback.setMovimiento("Adelante50");
}
else {
accionFallback.setMovimiento("Adelante100");
}
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
enviar_motorderecho(accionFallback);
//MoverAtras moverAtrasDerechoError = new MoverAtras(accionFallback);
//moverAtrasService.save(moverAtrasDerechoError);
}
}
| [
"nmcobo.jaramillo@gmail.com"
] | nmcobo.jaramillo@gmail.com |
6bf2f91aab3f384462cba680434cb416c9c393f8 | 6fbf9c7baab675e3b19fd149fbd7ae02cffbeac6 | /src/classes/Student.java | 61fc54eb8d6c1bd0807338d02f2da1cd08eff9ff | [] | no_license | StanleyNyadzayo/LockerManagementSystem | d8927410f9e67f2b6acc2ca90ae14142655b6570 | d62c97627c4f17315315d96d5da870ca8606408a | refs/heads/master | 2021-06-14T07:29:31.655351 | 2017-03-04T16:44:13 | 2017-03-04T16:44:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,147 | java | package classes;
import java.util.Calendar;
public class Student extends Person {
//instance variable
public static String lno;
public static String course;
public static int year;
public static String paymentStatus;
public static double quotaBalance;
public static int number = 10600;
// Constructors to initialize the Instance Variables
// Default Constructor
// ==> Called when a Name object is created as follows -
// Name n1 = new Name();
public Student() {
super();
lno = "L00" + number++;
course = paymentStatus = "";
year = 0;
//holdDate = Calendar.getInstance();
quotaBalance = 0.0;
}
// Initialization Constructor
// ==> Called when a Name object is created as follows -
// Name n2 = new Name("Mr","Joe","Cole");
public Student(String firstName, String surname, int age, String address, String lno, String course, int year, String paymentStatus, double quotaBalance) throws IllegalArgumentException {
super(firstName, surname, age, address);
lno = "L00" + number++;
setCourse(course);
setYear(year);
//holdDate = Calendar.getInstance();
setPaymentStatus(paymentStatus);
setQuotaBalance(quotaBalance);
}
/**
* @return the LNumber
*/
public static String getLno() {
return lno;
}
/**
* @param course the course to set
*/
public void setCourse(String course) throws IllegalArgumentException {
if (course.equals("null") || (course.isEmpty() == true))
throw new IllegalArgumentException("Input is Invalid. Please enter again");
Student.course = course;
}
/**
* @return the course
*/
public String getCourse() {
return course;
}
/**
* @param year the year to set
*/
public void setYear(int year) throws IllegalArgumentException {
if (year < Calendar.YEAR)
throw new IllegalArgumentException("Input is Invalid. Please enter again");
Student.year = year;
}
/**
* @return the year
*/
public int getYear() {
return year;
}
/**
* @param paymentStatus the paymentStatus to set
*/
public void setPaymentStatus(String paymentStatus) throws IllegalArgumentException {
if (paymentStatus.equals("null") || (paymentStatus.isEmpty() == true))
throw new IllegalArgumentException("Input is Invalid. Please enter again");
Student.paymentStatus = paymentStatus;
}
/**
* @return the paymentStatus
*/
public String getPaymentStatus() {
return paymentStatus;
}
/**
* @param quotaBalance the quotaBalance to set
*/
public void setQuotaBalance(double quotaBalance) throws IllegalArgumentException {
if (quotaBalance <= 0.0)
throw new IllegalArgumentException("Quota is too low");
Student.quotaBalance = quotaBalance;
}
/**
* @return the QuotaBalance
*/
public double getQuotaBalance() {
return quotaBalance;
}
}
| [
"l00113337@student.lyit.ie"
] | l00113337@student.lyit.ie |
b0209f2fde3f9536ec1eaa633f93d56a650a85d9 | c19bb4dccf39a138e3da82a6e453ae47bfa3cc11 | /springdemo/src/main/java/com/example/demo/curator/LockPathPrefix.java | 1d36c32aa937cf91c0584dfacd2fb49c619c2789 | [] | no_license | TomousLSH/git_repository | cdc1410e84119c066379ec51af0fae0a710a5437 | 18a2293235f7274a0f673e606d9c75afc11a8278 | refs/heads/master | 2022-08-09T22:05:00.415446 | 2020-03-06T10:04:23 | 2020-03-06T10:04:23 | 173,983,156 | 1 | 0 | null | 2022-06-21T01:02:43 | 2019-03-05T16:36:31 | Java | UTF-8 | Java | false | false | 211 | java | package com.example.demo.curator;
public class LockPathPrefix {
//商品锁
public static final String GOODS = "/zrx/goods/id_";
//用户锁
public static final String USER = "/zrx/user/id_";
}
| [
"lishuaihao@transinfo.com.cn"
] | lishuaihao@transinfo.com.cn |
c4f114744ece1f0450598555993605dde8a6367e | 0cb617f4a019bb11a0de300d3209c0b1f416e5b8 | /Kapitel_26/StringBsp6.java | 062f8e2921cd740725c7d60282b39f27006ee773 | [] | no_license | wschaefer91/Java-Tutorial_20200325 | 1aec9d2ebd6c40b0c17294b46a2a9fee92a800ef | 1b32f8be9c1440969f7ea36917e8f54fd3665de7 | refs/heads/master | 2021-04-23T16:03:41.027387 | 2020-04-07T14:34:28 | 2020-04-07T14:34:28 | 249,938,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | class StringBsp6
{
public static void main(String[] args)
{
String strA; // Referenz auf das erste Objekt
String strB; // Referenz auf das zweite Objekt
strA = new String("Der Gingham Hund"); // das erste Objekt erzeugen
// seine Referenz speichern
System.out.println(strA);
strB = new String("Der Gingham Hund"); // das zweite Objekt erzeugen
// seine Referenz speichern
System.out.println(strB);
if (strA == strB)
System.out.println("Dies wird nicht ausgegeben werden.");
}
} | [
"62543069+wschaefer91@users.noreply.github.com"
] | 62543069+wschaefer91@users.noreply.github.com |
c842051495dd535857f8a2e9552203b4759b83e1 | 8e6b5960ddaa1f2191ac1516076e2e9b3c0bbd6b | /src/main/java/com/abkm/mall/demo/module/ums/dto/UmsAdminExportVo.java | 2cef8a65f8cd92b166349a0f5fc1ce9243ad7ecc | [] | no_license | lbw1997/mall-demo | acb76825c33760cce05a27193ec6d06a47dde667 | 85731d28d6acc6701ab0dd3747e20d65c7a4685e | refs/heads/master | 2022-12-24T09:24:33.172211 | 2020-10-01T15:09:47 | 2020-10-01T15:09:47 | 295,296,910 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,429 | java | package com.abkm.mall.demo.module.ums.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* description: UmsAdminExportVo <br>
* date: 2020/10/1 15:31 <br>
* author: libowen <br>
* version: 1.0 <br>
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class UmsAdminExportVo implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty
@ApiModelProperty(value = "用户名", required = true)
@Excel(name = "用户名",orderNum = "0",width = 15)
private String username;
@NotEmpty
@ApiModelProperty(value = "密码", required = true)
@Excel(name = "密码",orderNum = "1",width = 70)
private String password;
@ApiModelProperty(value = "用户头像")
@Excel(name = "用户头像",orderNum = "2",width = 15)
private String icon;
@Email
@ApiModelProperty(value = "邮箱")
@Excel(name = "邮箱",orderNum = "3",width = 30)
private String email;
@ApiModelProperty(value = "用户昵称")
@Excel(name = "用户昵称",orderNum = "4",width = 15)
private String nickName;
@ApiModelProperty(value = "备注")
@Excel(name = "备注",orderNum = "6",width = 30)
private String note;
}
| [
"524557469@qq.com"
] | 524557469@qq.com |
0d84e13277f43bc73f9347e32262c2f0fe122d07 | b4c47b649e6e8b5fc48eed12fbfebeead32abc08 | /android/app/backup/WallpaperBackupHelper.java | 91fddc89895e0f6bef5c8d9a8c089fe24345aacd | [] | no_license | neetavarkala/miui_framework_clover | 300a2b435330b928ac96714ca9efab507ef01533 | 2670fd5d0ddb62f5e537f3e89648d86d946bd6bc | refs/heads/master | 2022-01-16T09:24:02.202222 | 2018-09-01T13:39:50 | 2018-09-01T13:39:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,946 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
package android.app.backup;
import android.app.WallpaperManager;
import android.content.Context;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.util.Slog;
import java.io.*;
// Referenced classes of package android.app.backup:
// FileBackupHelperBase, BackupHelper, BackupDataInputStream, BackupDataOutput
public class WallpaperBackupHelper extends FileBackupHelperBase
implements BackupHelper
{
public WallpaperBackupHelper(Context context, String as[])
{
super(context);
mContext = context;
mKeys = as;
mWpm = (WallpaperManager)context.getSystemService("wallpaper");
}
public void performBackup(ParcelFileDescriptor parcelfiledescriptor, BackupDataOutput backupdataoutput, ParcelFileDescriptor parcelfiledescriptor1)
{
}
public void restoreEntity(BackupDataInputStream backupdatainputstream)
{
Object obj;
Object obj1;
Object obj3;
obj = null;
obj1 = null;
obj3 = backupdatainputstream.getKey();
if(!isKeyInList(((String) (obj3)), mKeys) || !((String) (obj3)).equals("/data/data/com.android.settings/files/wallpaper")) goto _L2; else goto _L1
_L1:
File file = new File(STAGE_FILE);
boolean flag = writeFile(file, backupdatainputstream);
if(!flag) goto _L4; else goto _L3
_L3:
Object obj4;
obj4 = null;
obj3 = null;
backupdatainputstream = JVM INSTR new #101 <Class FileInputStream>;
backupdatainputstream.FileInputStream(file);
mWpm.setStream(backupdatainputstream);
obj3 = obj1;
if(backupdatainputstream == null)
break MISSING_BLOCK_LABEL_97;
backupdatainputstream.close();
obj3 = obj1;
_L7:
if(obj3 == null) goto _L6; else goto _L5
_L5:
try
{
throw obj3;
}
// Misplaced declaration of an exception variable
catch(BackupDataInputStream backupdatainputstream) { }
_L8:
obj3 = JVM INSTR new #113 <Class StringBuilder>;
((StringBuilder) (obj3)).StringBuilder();
Slog.e("WallpaperBackupHelper", ((StringBuilder) (obj3)).append("Unable to set restored wallpaper: ").append(backupdatainputstream.getMessage()).toString());
_L6:
file.delete();
_L2:
return;
obj3;
goto _L7
backupdatainputstream;
_L12:
throw backupdatainputstream;
obj;
obj1 = backupdatainputstream;
backupdatainputstream = ((BackupDataInputStream) (obj));
_L11:
obj = obj1;
if(obj3 == null)
break MISSING_BLOCK_LABEL_173;
((FileInputStream) (obj3)).close();
obj = obj1;
_L9:
if(obj == null)
break MISSING_BLOCK_LABEL_223;
try
{
throw obj;
}
// Misplaced declaration of an exception variable
catch(BackupDataInputStream backupdatainputstream) { }
goto _L8
obj3;
label0:
{
if(obj1 != null)
break label0;
obj = obj3;
}
goto _L9
obj = obj1;
if(obj1 == obj3) goto _L9; else goto _L10
_L10:
((Throwable) (obj1)).addSuppressed(((Throwable) (obj3)));
obj = obj1;
goto _L9
backupdatainputstream;
file.delete();
throw backupdatainputstream;
throw backupdatainputstream;
_L4:
Slog.e("WallpaperBackupHelper", "Unable to save restored wallpaper");
goto _L6
backupdatainputstream;
obj3 = obj4;
obj1 = obj;
goto _L11
Object obj2;
obj2;
obj3 = backupdatainputstream;
backupdatainputstream = ((BackupDataInputStream) (obj2));
obj2 = obj;
goto _L11
obj2;
obj3 = backupdatainputstream;
backupdatainputstream = ((BackupDataInputStream) (obj2));
goto _L12
}
public volatile void writeNewStateDescription(ParcelFileDescriptor parcelfiledescriptor)
{
super.writeNewStateDescription(parcelfiledescriptor);
}
private static final boolean DEBUG = false;
private static final String STAGE_FILE = (new File(Environment.getUserSystemDirectory(0), "wallpaper-tmp")).getAbsolutePath();
private static final String TAG = "WallpaperBackupHelper";
public static final String WALLPAPER_IMAGE_KEY = "/data/data/com.android.settings/files/wallpaper";
public static final String WALLPAPER_INFO_KEY = "/data/system/wallpaper_info.xml";
private final String mKeys[];
private final WallpaperManager mWpm;
}
| [
"hosigumayuugi@gmail.com"
] | hosigumayuugi@gmail.com |
6af56e3a37e048ea82a2ab20c8543968a6fb2d77 | 197f696f843e90ae67773681a7c4884cc4063fa6 | /MiniGithub/app/src/main/java/com/vishnus1224/minigithub/interactor/UserInteractor.java | 499c1e655320b427dc4080a199fbc8ca76948ddf | [] | no_license | vishnus1224/MiniGithub | ec21a6603a1357248013aed8ee32fa6df900f045 | 3530d008e2b65e1df32b2f25df7d4cce6f138fb9 | refs/heads/master | 2021-01-21T13:03:32.640350 | 2016-04-24T15:53:13 | 2016-04-24T15:53:13 | 51,196,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 814 | java | package com.vishnus1224.minigithub.interactor;
import com.vishnus1224.minigithub.model.User;
import java.util.List;
/**
* Created by Vishnu on 2/14/2016.
*/
public interface UserInteractor {
/**
* Fetch list of users from the data store.
* @param username Name of the user.
* @param userInteractionListener Callback.
*/
void fetchUsers(String username, UserInteractionListener userInteractionListener);
/**
* Load more users from the data store.
* @param username The name of the user.
* @param userInteractionListener Callback.
*/
void loadMoreUsers(String username, UserInteractionListener userInteractionListener);
interface UserInteractionListener{
void onSuccess(List<User> users);
void onFailure(String message);
}
}
| [
"vishnus1224@gmail.com"
] | vishnus1224@gmail.com |
dafa1685e0fbd8559da9e926ad5c7fb1997d0591 | 246f0901812c58bc2c2538b55ce314d5b82c335d | /imood-news-dev-common/src/main/java/com/dexlace/common/exception/MyCustomException.java | bbc71b02d475e5f0887c338134da465da90caf5d | [] | no_license | dexlace/imood-news-dev | 9337ca574af34b81159a2c148dbae8efa18f6396 | 3e13a7bea43f872e5e5b98ac3b0f4f930c5d309b | refs/heads/master | 2023-06-18T00:03:37.378034 | 2021-07-14T09:10:28 | 2021-07-14T09:10:28 | 368,825,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | package com.dexlace.common.exception;
/**
* @Author: xiaogongbing
* @Description:
* @Date: 2021/4/30
*/
import com.dexlace.common.result.ResponseStatusEnum;
/**
* 自定义异常
* 目的:1. 统一异常处理和管理
* 2. service与controller错误解耦,不会被service返回的类型而限制
*
* RuntimeException: 没有侵入性,如果继承Exception,则代码中需要使用try/catch
*/
public class MyCustomException extends RuntimeException {
private ResponseStatusEnum responseStatus;
public MyCustomException(ResponseStatusEnum responseStatus) {
super("异常状态码: " + responseStatus.status() + "; 异常信息: " + responseStatus.msg());
this.responseStatus = responseStatus;
}
public ResponseStatusEnum getResponseStatus() {
return responseStatus;
}
public void setResponseStatus(ResponseStatusEnum responseStatus) {
this.responseStatus = responseStatus;
}
}
| [
"13265317096@163.com"
] | 13265317096@163.com |
a8c2ab3f339db8f5a65e11dcc0bc3644f5d031a1 | 1e9eee721b72b5e2cc1b0c04e8703639b5d93202 | /src/BDMetodosJSON/MetodosUsuariosJSON.java | 7a5d63d071ea1ed91d69799d3facd59081c15983 | [] | no_license | Babel78/Projects | d3353562c10ab027a1856c371194c551937c708a | 5334752d0dc1403138e2c82132987033be3a0f5d | refs/heads/master | 2021-06-18T21:44:56.335621 | 2017-06-11T21:17:52 | 2017-06-11T21:17:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,406 | java | package BDMetodosJSON;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import jsong.Usuario;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class MetodosUsuariosJSON {
JSONArray array;
public void Actualizar(Usuario nuevo) throws ParseException{
if(Existe(nuevo)){
array=ObtenerArray();
int in=Indice(nuevo, array);
AuxActualizar(nuevo,in);
}
else{
System.out.println("Usuario no encontrado");
}
}
private void AuxActualizar(Usuario nuevo,int indice){
JSONObject obj=new JSONObject();
obj.put("Nombre", nuevo.getNombre());
obj.put("DNI", nuevo.getDni());
obj.put("Telefono", nuevo.getTelefono());
array.remove(indice);
array.add(indice, obj);
try {
FileWriter f=new FileWriter("Usuarios.json");
f.write(array.toJSONString());
f.flush();
} catch (IOException e) {
System.out.println(e);
}
}
public void Guardar(Usuario nuevo) throws ParseException{
JSONObject obj=new JSONObject();
obj.put("Nombre", nuevo.getNombre());
obj.put("DNI", nuevo.getDni());
obj.put("Telefono", nuevo.getTelefono());
array=ObtenerArray();
if(array==null){
array=new JSONArray();
array.add(obj);
}
else{
if(Existe(nuevo)){
System.out.println("DNI se encuentra registrado!");
}
else{
array.add(obj);
try {
FileWriter f=new FileWriter("Usuarios.json");
f.write(array.toJSONString());
f.flush();
} catch (IOException e) {
System.out.println(e);
}
}
}
}
private JSONArray ObtenerArray() throws ParseException{
JSONArray jarray=null;
JSONParser parser = new JSONParser();
try {
Object obj=parser.parse(new FileReader("Usuarios.json"));
jarray=(JSONArray) obj;
//System.out.println(jarray);
} catch (IOException e) {
System.out.println(e);
}
return jarray;
}
public void Mostrar() throws ParseException{
JSONArray msg=ObtenerArray();
if(msg==null){
System.out.println("No existe el archivo");
}
else{
for (int i = 0; i < msg.size(); i++) {
JSONObject obj = (JSONObject) msg.get(i);
Usuario nuevo=new Usuario((String)obj.get("Nombre"),(String)obj.get("DNI"),(String)obj.get("Telefono"));
System.out.println(nuevo.toString());
}
}
}
public Usuario ObtenerPorDNI(String dni) throws ParseException{
JSONArray msg=ObtenerArray();
Usuario nuevo=null;
if(msg==null){
System.out.println("No existe el archivo");
}
else{
int i=0;
while(i<msg.size()){
JSONObject obj = (JSONObject) msg.get(i);
if((obj.get("DNI")).equals(dni)){
nuevo=new Usuario((String)obj.get("Nombre"),(String)obj.get("DNI"),(String)obj.get("Telefono"));
break;
}
else{
i++;
}
}
}
return nuevo;
}
public boolean Existe(Usuario us) throws ParseException{
boolean existe=false;
int i=0;
JSONArray arr=ObtenerArray();
while(i<arr.size() && !existe){
JSONObject o=(JSONObject) arr.get(i);
if(o.get("DNI").equals(us.getDni())){
existe=true;
}
else{
i++;
}
}
return existe;
}
private int Indice(Usuario us,JSONArray arr) throws ParseException{
int i=0;
int indice = 0;
while (i<arr.size()) {
JSONObject get = (JSONObject) arr.get(i);
if(get.get("DNI").equals(us.getDni())){
indice=i;
break;
}
else{
i++;
}
}
return indice;
}
}
| [
"theprox.1590@gmail.com"
] | theprox.1590@gmail.com |
8fcf37e48d4aa23b6b811d06e767bbbf6c3adfd3 | da8e3ffebbce201976a2ce05445ee9cf17c253d8 | /src/test/java/map/Map03Test.java | 046ca86570bead1c59086584285473d34ce69707 | [] | no_license | luchuanyou/commonUtil | 5febdd1cf2c79e53dfbad764e8479b9ea2a190e8 | fab0e189312a7763b54c0aec853c36a788f2bdde | refs/heads/master | 2022-10-27T04:03:36.224430 | 2019-08-25T17:31:51 | 2019-08-25T17:31:51 | 156,321,772 | 0 | 0 | null | 2022-10-05T19:14:38 | 2018-11-06T03:39:59 | Java | UTF-8 | Java | false | false | 443 | java | package map;
import java.util.HashMap;
import java.util.Map;
/**
* @Description:
* @Author: lucy
* @date: 2019/07/16
*/
public class Map03Test {
public static void main(String[] args) {
initMap();
}
private static void initMap() {
Map map = new HashMap<>(16);
System.out.println("start");
map.forEach((key, val) -> System.out.println(key+":"+val));
System.out.println("end");
}
}
| [
"lucy@253.com"
] | lucy@253.com |
3a91b2ffc1dc637af3887419c22ae57a7693f3d2 | 0fa28354a25df8ea3ec06b65e65337063ce873ee | /jo.ar.gen/src/jo/util/utils/obj/BooleanUtils.java | 278b494bb136c3e903c2e3284ba1612c2e24ab39 | [] | no_license | Jorch72/JoAdvancedRocketry | bd1944b7f16b193e4a1055af77fb2fc3c2bd4b32 | d3c2d7b9e472946b514b70dc8029d885b8998eb8 | refs/heads/master | 2020-03-29T11:22:17.329044 | 2018-02-01T03:22:15 | 2018-02-01T03:22:15 | 149,848,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,763 | java | package jo.util.utils.obj;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class BooleanUtils
{
public static Object[] toArray(boolean[] booleanArray)
{
if (booleanArray == null)
return null;
Boolean[] objArray = new Boolean[booleanArray.length];
for (int i = 0; i < booleanArray.length; i++)
objArray[i] = new Boolean(booleanArray[i]);
return objArray;
}
public static boolean parseBoolean(String v)
{
return parseBoolean(v, false);
}
public static boolean parseBoolean(Object v)
{
if (v instanceof Boolean)
return ((Boolean)v).booleanValue();
if (v instanceof Number)
return ((Number)v).intValue() != 0;
return parseBoolean(v, false);
}
public static boolean parseBoolean(String v, boolean def)
{
if (StringUtils.isTrivial(v))
return def;
return v.equalsIgnoreCase("true") || v.equalsIgnoreCase("yes") || v.equalsIgnoreCase("y")
|| v.equalsIgnoreCase("1") || v.equalsIgnoreCase("-1");
}
public static boolean parseBoolean(Object v, boolean def)
{
if (v == null)
return def;
if (v instanceof Boolean)
return ((Boolean)v).booleanValue();
if (v instanceof String)
return parseBoolean((String)v);
if (v instanceof Number)
return Math.abs(((Number)v).doubleValue()) < 0.0001;
return def;
}
public static boolean[] fromBytes(byte[] bytes)
{
try
{
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
int len = ois.readInt();
boolean[] ret = new boolean[len];
for (int i = 0; i < len; i++)
ret[i] = (ois.readInt() != 0);
return ret;
}
catch (IOException e)
{
e.printStackTrace();
return null;
}
}
public static byte[] toBytes(boolean[] vals)
{
try
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeInt(vals.length);
for (int i = 0; i < vals.length; i++)
oos.writeInt(vals[i] ? 1 : 0);
oos.flush();
return baos.toByteArray();
}
catch (IOException e)
{
e.printStackTrace();
return null;
}
}
}
| [
"jo@111george.com"
] | jo@111george.com |
e6c8a6ec7e9285d768de802000f15ca4ec1df1b2 | 217b6ca03aae468cbae64b519237044cd3178b33 | /olyo/src/net/java/sip/communicator/service/systray/SystrayService.java | ee7c51f3cec2b268ce2e5c8f178af5ddeea6399f | [] | no_license | lilichun/olyo | 41778e668784ca2fa179c65a67d99f3b94fdbb45 | b3237b7d62808a5b1d059a8dd426508e6e4af0b9 | refs/heads/master | 2021-01-22T07:27:30.658459 | 2008-06-19T09:57:36 | 2008-06-19T09:57:36 | 32,123,461 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,493 | java | /*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.systray;
import net.java.sip.communicator.service.systray.event.*;
/**
* The <tt>SystrayService</tt> manages the system tray icon, menu and messages.
* It is meant to be used by all bundles that want to show a system tray message.
*
* @author Yana Stamcheva
*/
public interface SystrayService
{
/**
* Message type corresponding to an error message.
*/
public static final int ERROR_MESSAGE_TYPE = 0;
/**
* Message type corresponding to an information message.
*/
public static final int INFORMATION_MESSAGE_TYPE = 1;
/**
* Message type corresponding to a warning message.
*/
public static final int WARNING_MESSAGE_TYPE = 2;
/**
* Message type is not accessible.
*/
public static final int NONE_MESSAGE_TYPE = -1;
/**
* Image type corresponding to the sip-communicator icon
*/
public static final int SC_IMG_TYPE = 0;
/**
* Image type corresponding to the envelope icon
*/
public static final int ENVELOPE_IMG_TYPE = 1;
/**
* Shows a system tray message with the given title and message content. The
* message type will affect the icon used to present the message.
*
* @param title the title, which will be shown
* @param messageContent the content of the message to display
* @param messageType the message type; one of XXX_MESSAGE_TYPE constants
* declared in this class
*/
public void showPopupMessage(String title,
String messageContent, int messageType);
/**
* Adds a listener for <tt>SystrayPopupMessageEvent</tt>s posted when user
* clicks on the system tray popup message.
*
* @param listener the listener to add
*/
public void addPopupMessageListener(SystrayPopupMessageListener listener);
/**
* Removes a listener previously added with <tt>addPopupMessageListener</tt>.
*
* @param listener the listener to remove
*/
public void removePopupMessageListener(SystrayPopupMessageListener listener);
/**
* Sets a new icon to the systray.
*
* @param imageType the type of the image to set
*/
public void setSystrayIcon(int imageType);
}
| [
"dongfengyu20032045@1a5f2d27-d927-0410-a143-5778ce1304a0"
] | dongfengyu20032045@1a5f2d27-d927-0410-a143-5778ce1304a0 |
8762e5ae683d94ceae9dae393555f339dbdd1ce8 | bcaadf9cbd03a01b0cc1964363be07489b720e7f | /app/src/main/java/com/melodyxxx/surfaceviewdemo/DynamicWeatherView.java | f05c0d5485630f904fdfdda4ad06156ee065673f | [] | no_license | imhanjie/SurfaceViewDemo | 96f15aa5f9d1d1c19d5583655d02649301a86057 | 7f7992309c1a00dc564049da9b64f14a101ade50 | refs/heads/master | 2022-03-30T21:55:02.529030 | 2020-01-13T14:17:54 | 2020-01-13T14:17:54 | 84,189,008 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,311 | java | package com.melodyxxx.surfaceviewdemo;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
/**
* Author: Melodyxxx
* Email: 95hanjie@gmail.com
* Created at: 17/03/06.
* Description:
*/
public class DynamicWeatherView extends SurfaceView implements SurfaceHolder.Callback {
public interface WeatherType {
void onDraw(Canvas canvas);
void onSizeChanged(Context context, int w, int h);
}
private Context mContext;
private DrawThread mDrawThread;
private SurfaceHolder mHolder;
private WeatherType mType;
private int mViewWidth;
private int mViewHeight;
public void setType(WeatherType type) {
mType = type;
}
public int getViewWidth() {
return mViewWidth;
}
public int getViewHeight() {
return mViewHeight;
}
public DynamicWeatherView(Context context) {
this(context, null);
}
public DynamicWeatherView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public DynamicWeatherView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
mHolder = getHolder();
mHolder.addCallback(this);
mHolder.setFormat(PixelFormat.TRANSPARENT);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mViewWidth = w;
mViewHeight = h;
if (mType != null) {
mType.onSizeChanged(mContext, w, h);
}
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
mDrawThread = new DrawThread();
mDrawThread.setRunning(true);
mDrawThread.start();
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
mDrawThread.setRunning(false);
}
/**
* 绘制线程
*/
private class DrawThread extends Thread {
// 用来停止线程的标记
private boolean isRunning = false;
public void setRunning(boolean running) {
isRunning = running;
}
@Override
public void run() {
Canvas canvas;
// 无限循环绘制
while (isRunning) {
if (mType != null && mViewWidth != 0 && mViewHeight != 0) {
canvas = mHolder.lockCanvas();
if (canvas != null) {
mType.onDraw(canvas);
if (isRunning) {
mHolder.unlockCanvasAndPost(canvas);
} else {
// 停止线程
break;
}
// sleep
SystemClock.sleep(1);
}
}
}
}
}
}
| [
"95hanjie@gmail.com"
] | 95hanjie@gmail.com |
c0bf2cec5c9a42bb121be55b8356e78f135b01dc | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/18/18_0f9b43a209ac3dc49e7bfd8324d24ec63cf11ee7/ProjectileMovement/18_0f9b43a209ac3dc49e7bfd8324d24ec63cf11ee7_ProjectileMovement_s.java | 6cb3becd5a95beaf014ec631d14fa2d4c99e1c7a | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,091 | java | package qp.main.threads;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import qp.main.entity.Enemy;
import qp.main.entity.Projectile;
import qp.main.gui.frame.Frame;
public class ProjectileMovement implements Runnable{
private Projectile p;
public ProjectileMovement(Projectile p){
this.p = p;
}
public void run(){
try{
while(p.exists){
if(!(p.x - p.width > 0 && p.x< Frame.WIDTH && p.y + p.height < Frame.HEIGHT && p.y > 0 )){
p.remove();
p.exists = false;
}
try{
if(!Enemy.getEnemies().isEmpty()){
for(Enemy e: (ArrayList<Enemy>) Enemy.getEnemies().clone()){
if(e.intersects(p.x,p.y,p.width,p.height)){
e.remove();
p.remove();
}
}
}
}catch(Exception e){
if (e instanceof NullPointerException || e instanceof ConcurrentModificationException)
break;
e.printStackTrace();
}
Thread.sleep(2);
p.move();
}
}catch(Exception e){
e.printStackTrace();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
e5b2f7e57df7ea79d34d783c9f83aae58afd2a52 | 7c3c321e06347fc3f33335a6982b8705a1c8b081 | /src/com/olivia/leetcode/Q005_LongestPalindromicSubstring.java | f9719a820d6b85aeb5d423c082c9a198d4cafbe3 | [] | no_license | Jingyi3/algorithms-training | 3d276be35d9f745530a870be602faec082236d01 | e22828defc6d4a7a82f6d5ee1ab276354d72fb05 | refs/heads/master | 2020-07-30T13:43:31.595156 | 2020-01-12T03:25:42 | 2020-01-12T03:25:42 | 210,253,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,413 | java | package com.olivia.leetcode;
/**
* Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
* <p>
* Example 1:
* <p>
* Input: "babad"
* Output: "bab"
* Note: "aba" is also a valid answer.
* Example 2:
* <p>
* Input: "cbbd"
* Output: "bb"
* <p>
* 动态规划的方法解
*/
public class Q005_LongestPalindromicSubstring {
public String longestPalindrome(String s) {
if (s == null || s.length() == 0) return s;
int len = s.length();
char[] sChar = s.toCharArray();
int start = 0;
int length = 1;
boolean[][] isPalindrome = new boolean[len][len];
for (int i = 0; i < len; i++) {
isPalindrome[i][i] = true;
}
for (int i = 0; i < len-1; i++) {
if (sChar[i] == sChar[i + 1]) {
isPalindrome[i][i + 1] = true;
start = i;
length = 2;
}
}
for (int i = 3; i <= len; i++) {//i is the length of the current substring
for (int j = 0; j + i - 1 < len; j++) {
if (sChar[j] == sChar[j + i - 1] && isPalindrome[j + 1][j + i - 2]) {
isPalindrome[j][j + i - 1] = true;
start = j;
length = i;
}
}
}
return s.substring(start, start + length);
}
}
| [
"oliz0991@gmail.com"
] | oliz0991@gmail.com |
7783ce3d5be699c67dd53eb4b6646525f40fe90c | 26b7f30c6640b8017a06786e4a2414ad8a4d71dd | /src/number_of_direct_superinterfaces/i61726.java | 67cdec548b6a836980c9165e59b250a1ce600885 | [] | no_license | vincentclee/jvm-limits | b72a2f2dcc18caa458f1e77924221d585f23316b | 2fd1c26d1f7984ea8163bc103ad14b6d72282281 | refs/heads/master | 2020-05-18T11:18:41.711400 | 2014-09-14T04:25:18 | 2014-09-14T04:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package number_of_direct_superinterfaces;
public interface i61726 {} | [
"vincentlee.dolbydigital@yahoo.com"
] | vincentlee.dolbydigital@yahoo.com |
37f71d60331a727ff25b43494c92541be2154ed7 | 8d98e24fbc2b59b9c6f59ffa8b8619097494d073 | /gnutella6/src/main/java/org/protobee/gnutella/messages/decoding/GGEPDecoder.java | 7c167983935db2f6673c366743df33852d0edf0e | [
"BSD-2-Clause"
] | permissive | dmurph/protobee | 9c0380405d77398860bae42c1a62c99b6fdb8c3d | af82be69ad7d02fc59ec68e31f9e2eb1c5f13ba6 | refs/heads/master | 2021-01-02T22:50:58.077670 | 2015-04-09T05:21:24 | 2015-04-09T05:21:24 | 33,649,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,105 | java | package org.protobee.gnutella.messages.decoding;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;
import org.jboss.netty.buffer.ChannelBuffer;
import org.protobee.annotation.InjectLogger;
import org.protobee.gnutella.extension.BadGGEPBlockException;
import org.protobee.gnutella.extension.GGEP;
import org.protobee.gnutella.extension.GGEP.NeedsCompression;
import org.protobee.util.ByteUtils;
import org.protobee.util.IOUtils;
import org.slf4j.Logger;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
public class GGEPDecoder implements PartDecoder<GGEP> {
@InjectLogger
private Logger log;
private final IOUtils ioUtils;
@Inject
public GGEPDecoder(IOUtils ioUtils) {
this.ioUtils = ioUtils;
}
@Override
public GGEP decode(ChannelBuffer buffer) throws DecodingException {
try {
if (buffer.readableBytes() < 4) {
throw new BadGGEPBlockException();
}
byte ggepMagic = buffer.readByte();
if (ggepMagic != GGEP.GGEP_PREFIX_MAGIC_NUMBER) {
throw new BadGGEPBlockException();
}
Map<String, Object> properties = Maps.newHashMap();
boolean onLastExtension = false;
while (!onLastExtension) {
// process extension header flags
// bit order is interpreted as 76543210
byte currByte = buffer.readByte();
try {
sanityCheck(currByte);
} catch (ArrayIndexOutOfBoundsException malformedInput) {
throw new BadGGEPBlockException();
}
onLastExtension = isLastExtension(currByte);
boolean encoded = isEncoded(currByte);
boolean compressed = isCompressed(currByte);
int headerLen = deriveHeaderLength(currByte);
// get the extension header
String extensionHeader =
buffer.toString(buffer.readerIndex(), headerLen, Charset.forName("UTF-8"));
buffer.readerIndex(buffer.readerIndex() + headerLen);
final int dataLength = deriveDataLength(buffer);
byte[] extensionData = null;
if (dataLength > 0) {
// ok, data is present, get it....
byte[] data = null;
if (encoded) {
try {
data = cobsDecode(buffer, dataLength);
} catch (IOException badCobsEncoding) {
throw new BadGGEPBlockException("Bad COBS Encoding");
}
}
if (compressed) {
try {
data = data != null ? ioUtils.inflate(data) : ioUtils.inflate(buffer, dataLength);
} catch (IOException badData) {
throw new BadGGEPBlockException("Bad compressed data");
}
}
if (data == null) {
data = new byte[dataLength];
buffer.readBytes(data);
}
extensionData = data;
}
if (compressed)
properties.put(extensionHeader, new NeedsCompression(extensionData));
else
properties.put(extensionHeader, extensionData);
}
return new GGEP(properties);
} catch (BadGGEPBlockException e) {
log.error("Bad ggep block");
throw new DecodingException(e);
}
}
private void sanityCheck(byte headerFlags) throws BadGGEPBlockException {
// the 4th bit in the header's first byte must be 0.
if ((headerFlags & 0x10) != 0) throw new BadGGEPBlockException();
}
private boolean isLastExtension(byte headerFlags) {
boolean retBool = false;
// the 8th bit in the header's first byte, when set, indicates that
// this header is the last....
if ((headerFlags & 0x80) != 0) retBool = true;
return retBool;
}
private boolean isEncoded(byte headerFlags) {
boolean retBool = false;
// the 7th bit in the header's first byte, when set, indicates that
// this header is the encoded with COBS
if ((headerFlags & 0x40) != 0) retBool = true;
return retBool;
}
private boolean isCompressed(byte headerFlags) {
boolean retBool = false;
// the 6th bit in the header's first byte, when set, indicates that
// this header is the compressed with deflate
if ((headerFlags & 0x20) != 0) retBool = true;
return retBool;
}
private int deriveHeaderLength(byte headerFlags) throws BadGGEPBlockException {
int retInt = 0;
// bits 0-3 give the length of the extension header (1-15)
retInt = headerFlags & 0x0F;
if (retInt == 0) throw new BadGGEPBlockException();
return retInt;
}
private int deriveDataLength(ChannelBuffer buffer) throws BadGGEPBlockException {
int length = 0, iterations = 0;
// the length is stored in at most 3 bytes....
final int MAX_ITERATIONS = 3;
byte currByte;
do {
currByte = buffer.readByte();
length = (length << 6) | (currByte & 0x3f);
if (++iterations > MAX_ITERATIONS) throw new BadGGEPBlockException();
} while (0x40 != (currByte & 0x40));
return length;
}
/*
* COBS implementation.... For implementation details, please see:
* http://www.acm.org/sigcomm/sigcomm97/papers/p062.pdf
*/
/**
* Decode a COBS-encoded byte array. The non-allowable byte value is 0.
*
* @return the original COBS decoded string
*/
static byte[] cobsDecode(ChannelBuffer buffer, int length) throws IOException {
int currIndex = 0;
int code = 0;
ByteArrayOutputStream sink = new ByteArrayOutputStream();
while (currIndex < length) {
code = ByteUtils.ubyte2int(buffer.readByte());
currIndex++;
if ((currIndex + (code - 2)) >= length) throw new IOException();
for (int i = 1; i < code; i++) {
sink.write(buffer.readByte());
currIndex++;
}
if (currIndex < length) // don't write this last one, it isn't used
if (code < 0xFF) sink.write(0);
}
return sink.toByteArray();
}
}
| [
"toucansam99@gmail.com"
] | toucansam99@gmail.com |
ef4bdfc75398c7592680967aa43e170573cf99c5 | 71a309da8af7e269009a97479a0f1352c400d9b4 | /src/main/java/Todo/list/Todo/list/controller/TaskController.java | cfddcffee0065036c09951422832c8f5c4d7939b | [] | no_license | kuzuks/TodoListFinal | 4f67d05e3bacc983bfb0378efb07db3c7c95bae4 | c850dfc913e8a072a873d5f13c568469186315a2 | refs/heads/master | 2021-09-04T12:44:16.175715 | 2018-01-18T21:00:46 | 2018-01-18T21:00:46 | 118,037,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,513 | java | package Todo.list.Todo.list.controller;
import Todo.list.Todo.list.entity.Task;
import Todo.list.Todo.list.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.crossstore.ChangeSetPersister;
import org.springframework.web.bind.annotation.*;
import java.sql.SQLException;
import java.util.List;
import java.util.NoSuchElementException;
@RestController
public class TaskController {
@Autowired
private TaskService taskService;
@GetMapping("/tasks/{todoId}")
public List<Task> getAllTasks(@PathVariable Integer todoId) throws SQLException {
return taskService.getAllTasks(todoId);
}
@GetMapping("/tasks/{todoId}/{id}")
public Task getTask(@PathVariable("todoId") Integer todoId, @PathVariable("id") Integer id) throws NoSuchElementException {
return taskService.getTask(todoId,id);
}
@PostMapping("/tasks/{id}")
public void addTask(@RequestBody Task task, @PathVariable Integer id) throws SQLException {
Task tempTask = new Task( task.getTitle(), task.getStatus() ,task.getDescription(),id);
taskService.addTask(tempTask);
}
@PutMapping("/tasks/{id}")
public void updateTask(@RequestBody Task task, @PathVariable Integer id) throws SQLException{
taskService.updateTask(task,id);
}
@DeleteMapping("/tasks/{id}")
public void deleteTask(@PathVariable("id") Integer id) throws NoSuchElementException{
taskService.deleteTask(id);
}
}
| [
"charlieeweed@hotmail.com"
] | charlieeweed@hotmail.com |
de52920e9c9f5e9296661822bdabbc4760d6e063 | d40b228a3fa3480fc6a0c8a15e6ddbd3ae825f0d | /fleetap/src/main/java/com/kindsonthegenius/fleetap/services/ClientService.java | d254c56dac4409c76fd6295c8c2ca25e9fc487c5 | [] | no_license | Akif-jpg/FirstSpringApp | 3f61a3bfa0501eec3901a848d92f408bb74ebce7 | 533497e915ca6ce4bd4c5051585a996db977e08b | refs/heads/main | 2023-06-19T11:52:18.493935 | 2021-07-17T12:48:33 | 2021-07-17T12:48:33 | 385,668,567 | 0 | 0 | null | 2021-07-17T12:48:33 | 2021-07-13T16:29:39 | HTML | UTF-8 | Java | false | false | 800 | java | package com.kindsonthegenius.fleetap.services;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kindsonthegenius.fleetap.models.Client;
import com.kindsonthegenius.fleetap.repositories.ClientRepository;
@Service
public class ClientService {
@Autowired
private ClientRepository clientRepository;
//Get list of all clients
public List<Client> getClients(){
return clientRepository.findAll();
}
//Save new client
public void save(Client client) {
clientRepository.save(client);
}
//get by id
public Optional<Client> findById(int id) {
return clientRepository.findById(id);
}
public void delete(Integer id) {
clientRepository.deleteById(id);
}
} | [
"akifesadi193@gmail.com"
] | akifesadi193@gmail.com |
18fdff0037d65e91c0424fd1b93ff814a966f52a | c2aa801fd15f9c3bf2569a28bfe5d75da7d43f0e | /DB/app/src/main/java/com/example/db/MapActivity.java | 2b4bccb5ef065de597dd508a0bb37a848662dc6e | [] | no_license | Ryzhaya98/AndroidPetProjects | 374ec45a06000743a7405f21193f1821bdabd18b | cf048a71d14b402291ebefe5c376e1a9cbfe42b3 | refs/heads/master | 2023-08-24T08:48:41.267476 | 2021-09-28T14:23:01 | 2021-09-28T14:23:01 | 260,714,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.example.db;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MapActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
}
}
| [
"38052977+Ryzhaya98@users.noreply.github.com"
] | 38052977+Ryzhaya98@users.noreply.github.com |
1130a16a32697a6f632e3857ecca047c803813db | 0b7bc5a2fa9100b2b785ae8471d589cad78ec032 | /Runnable/src/main/java/de/rub/nds/tlsattacker/Main.java | efd94140e9b7c994cf49aee8339be4503d97ee8c | [
"Apache-2.0"
] | permissive | Frankz/TLS-Attacker | aeb610a54d0c9b3d3bb67da92f27282039fcd1d4 | cd59995ab6acc3333be1952239e593c88e4cbc76 | refs/heads/master | 2020-12-24T20:33:51.271351 | 2016-05-31T11:29:55 | 2016-05-31T11:29:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,126 | java | /**
* TLS-Attacker - A Modular Penetration Testing Framework for TLS
*
* Copyright 2014-2016 Ruhr University Bochum / Hackmanit GmbH
*
* Licensed under Apache License 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package de.rub.nds.tlsattacker;
import com.beust.jcommander.JCommander;
import de.rub.nds.tlsattacker.attacks.config.BleichenbacherCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.DtlsPaddingOracleAttackCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.InvalidCurveAttackCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.InvalidCurveAttackFullCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.HeartbleedCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.ManInTheMiddleAttackCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.PaddingOracleCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.PoodleCommandConfig;
import de.rub.nds.tlsattacker.attacks.config.WinshockCommandConfig;
import de.rub.nds.tlsattacker.attacks.impl.BleichenbacherAttack;
import de.rub.nds.tlsattacker.attacks.impl.DtlsPaddingOracleAttack;
import de.rub.nds.tlsattacker.attacks.impl.InvalidCurveAttack;
import de.rub.nds.tlsattacker.attacks.impl.InvalidCurveAttackFull;
import de.rub.nds.tlsattacker.attacks.impl.HeartbleedAttack;
import de.rub.nds.tlsattacker.attacks.impl.ManInTheMiddleAttack;
import de.rub.nds.tlsattacker.attacks.impl.PaddingOracleAttack;
import de.rub.nds.tlsattacker.attacks.impl.PoodleAttack;
import de.rub.nds.tlsattacker.attacks.impl.WinshockAttack;
import de.rub.nds.tlsattacker.fuzzer.config.MultiFuzzerConfig;
import de.rub.nds.tlsattacker.fuzzer.impl.MultiFuzzer;
import de.rub.nds.tlsattacker.testsuite.config.ServerTestConfig;
import de.rub.nds.tlsattacker.testsuite.impl.ServerTestSuite;
import de.rub.nds.tlsattacker.tls.Attacker;
import de.rub.nds.tlsattacker.tls.config.ClientCommandConfig;
import de.rub.nds.tlsattacker.tls.config.CommandConfig;
import de.rub.nds.tlsattacker.tls.config.ConfigHandler;
import de.rub.nds.tlsattacker.tls.config.ConfigHandlerFactory;
import de.rub.nds.tlsattacker.tls.config.GeneralConfig;
import de.rub.nds.tlsattacker.tls.config.ServerCommandConfig;
import de.rub.nds.tlsattacker.tls.config.WorkflowTraceSerializer;
import de.rub.nds.tlsattacker.tls.exceptions.ConfigurationException;
import de.rub.nds.tlsattacker.tls.exceptions.WorkflowExecutionException;
import de.rub.nds.tlsattacker.tls.util.LogLevel;
import de.rub.nds.tlsattacker.tls.workflow.TlsContext;
import de.rub.nds.tlsattacker.tls.workflow.WorkflowExecutor;
import de.rub.nds.tlsattacker.transport.TransportHandler;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import javax.xml.bind.JAXBException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
*
* @author Juraj Somorovsky <juraj.somorovsky@rub.de>
*/
public class Main {
private static final Logger LOGGER = LogManager.getLogger(Main.class);
public static void main(String[] args) throws Exception {
GeneralConfig generalConfig = new GeneralConfig();
JCommander jc = new JCommander(generalConfig);
MultiFuzzerConfig cmconfig = new MultiFuzzerConfig();
jc.addCommand(MultiFuzzerConfig.COMMAND, cmconfig);
BleichenbacherCommandConfig bleichenbacherTest = new BleichenbacherCommandConfig();
jc.addCommand(BleichenbacherCommandConfig.ATTACK_COMMAND, bleichenbacherTest);
DtlsPaddingOracleAttackCommandConfig dtlsPaddingOracleAttackTest = new DtlsPaddingOracleAttackCommandConfig();
jc.addCommand(DtlsPaddingOracleAttackCommandConfig.ATTACK_COMMAND, dtlsPaddingOracleAttackTest);
InvalidCurveAttackCommandConfig ellipticTest = new InvalidCurveAttackCommandConfig();
jc.addCommand(InvalidCurveAttackCommandConfig.ATTACK_COMMAND, ellipticTest);
InvalidCurveAttackFullCommandConfig elliptic = new InvalidCurveAttackFullCommandConfig();
jc.addCommand(InvalidCurveAttackFullCommandConfig.ATTACK_COMMAND, elliptic);
HeartbleedCommandConfig heartbleed = new HeartbleedCommandConfig();
jc.addCommand(HeartbleedCommandConfig.ATTACK_COMMAND, heartbleed);
PaddingOracleCommandConfig paddingOracle = new PaddingOracleCommandConfig();
jc.addCommand(PaddingOracleCommandConfig.ATTACK_COMMAND, paddingOracle);
PoodleCommandConfig poodle = new PoodleCommandConfig();
jc.addCommand(PoodleCommandConfig.ATTACK_COMMAND, poodle);
WinshockCommandConfig winshock = new WinshockCommandConfig();
jc.addCommand(WinshockCommandConfig.ATTACK_COMMAND, winshock);
ServerCommandConfig server = new ServerCommandConfig();
jc.addCommand(ServerCommandConfig.COMMAND, server);
ClientCommandConfig client = new ClientCommandConfig();
jc.addCommand(ClientCommandConfig.COMMAND, client);
ManInTheMiddleAttackCommandConfig MitM_Attack = new ManInTheMiddleAttackCommandConfig();
jc.addCommand(ManInTheMiddleAttackCommandConfig.ATTACK_COMMAND, MitM_Attack);
ServerTestConfig stconfig = new ServerTestConfig();
jc.addCommand(ServerTestConfig.COMMAND, stconfig);
jc.parse(args);
if (generalConfig.isHelp() || jc.getParsedCommand() == null) {
jc.usage();
return;
}
Attacker attacker;
switch (jc.getParsedCommand()) {
case MultiFuzzerConfig.COMMAND:
startMultiFuzzer(cmconfig, generalConfig, jc);
return;
case ServerCommandConfig.COMMAND:
startSimpleTls(generalConfig, server, jc);
return;
case ClientCommandConfig.COMMAND:
startSimpleTls(generalConfig, client, jc);
return;
case ServerTestConfig.COMMAND:
ServerTestSuite st = new ServerTestSuite(stconfig, generalConfig);
st.startTests();
return;
case BleichenbacherCommandConfig.ATTACK_COMMAND:
attacker = new BleichenbacherAttack(bleichenbacherTest);
break;
case InvalidCurveAttackCommandConfig.ATTACK_COMMAND:
attacker = new InvalidCurveAttack(ellipticTest);
break;
case InvalidCurveAttackFullCommandConfig.ATTACK_COMMAND:
attacker = new InvalidCurveAttackFull(elliptic);
break;
case HeartbleedCommandConfig.ATTACK_COMMAND:
attacker = new HeartbleedAttack(heartbleed);
break;
case PoodleCommandConfig.ATTACK_COMMAND:
attacker = new PoodleAttack(poodle);
break;
case PaddingOracleCommandConfig.ATTACK_COMMAND:
attacker = new PaddingOracleAttack(paddingOracle);
break;
case WinshockCommandConfig.ATTACK_COMMAND:
attacker = new WinshockAttack(winshock);
break;
case DtlsPaddingOracleAttackCommandConfig.ATTACK_COMMAND:
attacker = new DtlsPaddingOracleAttack(dtlsPaddingOracleAttackTest);
break;
case ManInTheMiddleAttackCommandConfig.ATTACK_COMMAND:
attacker = new ManInTheMiddleAttack(MitM_Attack);
break;
default:
throw new ConfigurationException("No command found");
}
ConfigHandler configHandler = ConfigHandlerFactory.createConfigHandler("client");
configHandler.initialize(generalConfig);
if (configHandler.printHelpForCommand(jc, attacker.getConfig())) {
return;
}
attacker.executeAttack(configHandler);
CommandConfig config = attacker.getConfig();
if (config.getWorkflowOutput() != null && !config.getWorkflowOutput().isEmpty()) {
logWorkflowTraces(attacker.getTlsContexts(), config.getWorkflowOutput());
}
}
private static void startMultiFuzzer(MultiFuzzerConfig fuzzerConfig, GeneralConfig generalConfig, JCommander jc) {
MultiFuzzer fuzzer = new MultiFuzzer(fuzzerConfig, generalConfig);
if (fuzzerConfig.isHelp()) {
jc.usage(MultiFuzzerConfig.COMMAND);
return;
}
fuzzer.startFuzzer();
}
private static void startSimpleTls(GeneralConfig generalConfig, CommandConfig config, JCommander jc)
throws JAXBException, IOException {
ConfigHandler configHandler = ConfigHandlerFactory.createConfigHandler(jc.getParsedCommand());
configHandler.initialize(generalConfig);
if (configHandler.printHelpForCommand(jc, config)) {
return;
}
TransportHandler transportHandler = configHandler.initializeTransportHandler(config);
TlsContext tlsContext = configHandler.initializeTlsContext(config);
WorkflowExecutor workflowExecutor = configHandler.initializeWorkflowExecutor(transportHandler, tlsContext);
try {
workflowExecutor.executeWorkflow();
} catch (WorkflowExecutionException ex) {
LOGGER.info(ex.getLocalizedMessage(), ex);
LOGGER.log(LogLevel.CONSOLE_OUTPUT,
"The TLS protocol flow was not executed completely, follow the debug messages for more information.");
}
transportHandler.closeConnection();
if (config.getWorkflowOutput() != null && !config.getWorkflowOutput().isEmpty()) {
FileOutputStream fos = new FileOutputStream(config.getWorkflowOutput());
WorkflowTraceSerializer.write(fos, tlsContext.getWorkflowTrace());
}
}
private static void logWorkflowTraces(List<TlsContext> tlsContexts, String fileName) throws JAXBException,
FileNotFoundException, IOException {
int i = 0;
for (TlsContext context : tlsContexts) {
i++;
FileOutputStream fos = new FileOutputStream(fileName + i);
WorkflowTraceSerializer.write(fos, context.getWorkflowTrace());
}
}
}
| [
"juraj.somorovsky@gmail.com"
] | juraj.somorovsky@gmail.com |
e96003a9fc1f6aa593c906e6522a06387c44f503 | 168b98689d9b3706cd8d969f833c6ee773545369 | /ThreeElevs_UnitTest/src/JUnitTest/test_Floor.java | 770dd73a7841310df5c62fb332fda824e4888dbf | [
"MIT"
] | permissive | bowenyango/Object-Oriented-Java | ad22664ca3c60a2592a3970ce57bd02d7e8df04b | 83e8875fa8255ef5d74ef3c01b9d6dc0ab87cf93 | refs/heads/master | 2023-04-15T12:28:02.934509 | 2020-01-15T06:55:52 | 2020-01-15T06:55:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package JUnitTest;
import static org.junit.Assert.*;
import org.junit.Test;
import Elev.Element;
import Elev.Floor;
public class test_Floor {
@Test
public void testMake_Request() {
int sym = Element.Floor;
int des = 5;
int dir = Element.Floor_down;
long tim = 10;
Floor floor = new Floor();
floor.make_Request(sym, des, dir, tim);
}
}
| [
"ybw@YBWdeMacBook-Pro.local"
] | ybw@YBWdeMacBook-Pro.local |
1ef2cd3a72665260706bbe7b1a054cd06e454f18 | a989a89a204b2e6882ba9575daece947feac05a7 | /app/src/main/java/com/garmadell/videoplayer/view/bean/EsperandoOponente.java | 34de6bc6fb1049e4a6745fbe7be034cf857db23f | [] | no_license | abeteta/Game | d1bafe8eabfac320a27dbcd370916dcaa9364dc2 | 45c221867091be396a732c18eac96b4c6daccbd5 | refs/heads/master | 2021-08-16T17:37:48.091148 | 2017-11-20T06:25:05 | 2017-11-20T06:25:05 | 110,389,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package com.garmadell.videoplayer.view.bean;
import java.io.Serializable;
/**
* Created by Michael Estrada on 11/19/17.
*/
public class EsperandoOponente implements Serializable {
private Integer id_jugador_secundario;
private Integer estado_versus;
public EsperandoOponente () {super();}
public EsperandoOponente(Integer id_jugador_secundario, Integer estado_versus) {
this.id_jugador_secundario = id_jugador_secundario;
this.estado_versus = estado_versus;
}
public Integer getId_jugador_secundario() {
return id_jugador_secundario;
}
public void setId_jugador_secundario(Integer id_jugador_secundario) {
this.id_jugador_secundario = id_jugador_secundario;
}
public Integer getEstado_versus() {
return estado_versus;
}
public void setEstado_versus(Integer estado_versus) {
this.estado_versus = estado_versus;
}
}
| [
"abeteta@bytesw.com"
] | abeteta@bytesw.com |
097ca1c50732a1f50d28d62af0d32289cff45ca8 | ea65352c3cc9288eb66a5c1c98a2de7a6a7f6a4b | /src/main/java/net/simpleframework/lib/org/mvel2/templates/res/TerminalExpressionNode.java | 802078db1749fafe541ac5ca960cb345d4bffc73 | [] | no_license | simpleframework/simple-common | 5c95611bc48d9c82a9c81976c44c24024fe933db | 97a5c1954eaa2519629c39b7da0c2e1a1453b116 | refs/heads/master | 2021-07-13T03:55:25.417762 | 2021-07-01T07:06:58 | 2021-07-01T07:06:58 | 14,333,099 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java | /**
* MVEL 2.0
* Copyright (C) 2007 The Codehaus
* Mike Brock, Dhanji Prasanna, John Graham, Mark Proctor
*
* 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.simpleframework.lib.org.mvel2.templates.res;
import net.simpleframework.lib.org.mvel2.MVEL;
import net.simpleframework.lib.org.mvel2.integration.VariableResolverFactory;
import net.simpleframework.lib.org.mvel2.templates.TemplateRuntime;
import net.simpleframework.lib.org.mvel2.templates.util.TemplateOutputStream;
public class TerminalExpressionNode extends Node {
public TerminalExpressionNode() {
}
public TerminalExpressionNode(final Node node) {
this.begin = node.begin;
this.name = node.name;
this.contents = node.contents;
this.cStart = node.cStart;
this.cEnd = node.cEnd;
}
@Override
public Object eval(final TemplateRuntime runtime, final TemplateOutputStream appender,
final Object ctx, final VariableResolverFactory factory) {
return MVEL.eval(contents, cStart, cEnd - cStart, ctx, factory);
}
@Override
public boolean demarcate(final Node terminatingNode, final char[] template) {
return false;
}
}
| [
"cknet@126.com"
] | cknet@126.com |
1e7743c7846738ab4b62813c725d91a10cfbe74d | 1bb211e7b8dd25b95b7949713403c595e81898f4 | /src/main/java/com/local/site/dao/FilledCartridgeDao.java | ce0f5c68a568d1ef7a0a6ab3c40f8c73549ef4b6 | [] | no_license | domestos/localSite | c8cda37339685369a3a47652cfea8e5100ffd017 | dea214f9c659d4e5841d881f9d451ead239c0722 | refs/heads/master | 2021-01-25T08:29:51.933200 | 2015-09-07T11:28:25 | 2015-09-07T11:29:21 | 40,757,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | package com.local.site.dao;
import com.local.site.model.FilledCartridge;
public interface FilledCartridgeDao extends RepositoryDao<FilledCartridge> {
}
| [
"v.pelenskyi@VWS04.dzk.lan"
] | v.pelenskyi@VWS04.dzk.lan |
7482f38b93ed044af10b02c1684d3c53474bcd07 | f91c968377eb88d329d36b19417383173f9afa65 | /app/src/main/java/com/bgs/chat/services/ChatClientService.java | e56996a9f393c0ac964b0b479c6d5f3a635b6aaf | [] | no_license | sudi305/dheket_merchant | 42ef8fa7ce10ceb342be28fc9333a09e7b8d89e2 | f6146a6296c505f7687335234009bfe5e2182dd3 | refs/heads/master | 2020-04-06T07:12:54.300652 | 2016-08-17T17:54:18 | 2016-08-17T17:54:18 | 51,751,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,184 | java | package com.bgs.chat.services;
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.os.NetworkOnMainThreadException;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.bgs.chat.viewmodel.ChatHelper;
import com.bgs.common.Constants;
import com.bgs.dheket.App;
import com.bgs.dheket.viewmodel.UserApp;
import com.bgs.domain.chat.model.ChatContact;
import com.bgs.domain.chat.model.ChatMessage;
import com.bgs.domain.chat.model.MessageSendStatus;
import com.bgs.domain.chat.model.MessageType;
import com.bgs.domain.chat.model.UserType;
import com.bgs.domain.chat.repository.ContactRepository;
import com.bgs.domain.chat.repository.IContactRepository;
import com.bgs.domain.chat.repository.IMessageRepository;
import com.bgs.domain.chat.repository.MessageRepository;
import com.facebook.AccessToken;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Created by zhufre on 6/26/2016.
*/
public class ChatClientService extends Service {
private ChatEngine chatEngine;
private IMessageRepository messageRepository;
private IContactRepository contactRepository;
private static Map<String, BroadcastReceiver> mReceivers = new HashMap<String, BroadcastReceiver>();
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(Constants.TAG_CHAT, getClass().getName() + " => onStartCommand");
messageRepository = new MessageRepository(getApplicationContext());
contactRepository = new ContactRepository(getApplicationContext());
chatEngine = App.getChatEngine();
chatEngine.registerReceivers( makeReceivers());
return START_STICKY;
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
public Map<String, BroadcastReceiver> makeReceivers(){
Map<String, BroadcastReceiver> map = new HashMap<String, BroadcastReceiver>();
map.put(ChatEngine.SocketEvent.CONNECT, onConnectReceiver);
map.put(ChatEngine.SocketEvent.LOGIN, onLoginReceiver);
map.put(ChatEngine.SocketEvent.USER_JOIN, userJoinReceiver);
map.put(ChatEngine.SocketEvent.NEW_MESSAGE, newMessageReceiver);
map.put(ChatEngine.SocketEvent.DELIVERY_STATUS, deliveryStatusReceiver);
map.put(ChatEngine.SocketEvent.LIST_CONTACT, listContactReceiver);
return map;
}
public void loginWithFbAccount() {
if ( AccessToken.getCurrentAccessToken() == null ) return;
try {
GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
JSONObject json = response.getJSONObject();
try {
if (json != null) {
Log.d(Constants.TAG, "json fb = " + json.toString());
String id = json.getString("id");
String name = json.getString("name");
String gender = json.getString("gender");
String email = json.getString("email");
String imageUsr = json.getString("picture");
String profilePicUrl = "";
if (json.has("picture")) {
profilePicUrl = json.getJSONObject("picture").getJSONObject("data").getString("url");
}
//update user app
//add by supri 2016/6/16
UserApp userApp = App.getUserApp();
if (userApp == null) userApp = new UserApp();
userApp.setName(name);
userApp.setEmail(email);
userApp.setId(id);
userApp.setPicture(profilePicUrl);
userApp.setType(Constants.USER_TYPE);
App.updateUserApp(userApp);
Log.d(Constants.TAG, "App.getInstance().getUserApp()=" + App.getUserApp());
//DO LOGIN
chatEngine.emitDoLogin(App.getUserApp());
}
} catch (JSONException e) {
Log.e(Constants.TAG, e.getMessage(), e);
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,link,email,gender,picture.type(large)");
request.setParameters(parameters);
request.executeAsync();
} catch (NetworkOnMainThreadException ne) {
Log.e(Constants.TAG_CHAT, ne.getMessage(), ne);
}
}
public void emitDoLogin() {
loginWithFbAccount();
}
private BroadcastReceiver onConnectReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(Constants.TAG_CHAT , getClass().getName() + " => EMIT DO LOGIN ");
emitDoLogin();
}
};
private BroadcastReceiver onLoginReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(Constants.TAG_CHAT , getClass().getName() + " => EMIT GET CONTACTS ");
chatEngine.emitGetContacts();
}
};
private BroadcastReceiver newMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent){
String data = intent.getStringExtra("data");
String msgid, text, email, name, phone, picture, type;
try {
JSONObject joData = new JSONObject(data);
Log.d(Constants.TAG_CHAT, "::::" + getClass().getName() + " => new message = " + joData);
JSONObject joFrom = joData.getJSONObject("from");
name = joFrom.getString("name");
email = joFrom.getString("email");
phone = joFrom.getString("phone");
picture = joFrom.getString("picture");
type = joFrom.getString("type");
JSONObject joMsg = joData.getJSONObject("msg");
msgid = joMsg.getString("msgid");
text = joMsg.getString("text");
} catch (JSONException e) {
Log.e(Constants.TAG_CHAT, e.getMessage(), e);
return;
}
ChatContact contact = contactRepository.getContactByEmail(email, UserType.parse(type));
if ( contact == null) {
contact = new ChatContact(name, picture, email, phone, UserType.parse(type));
} else {
contact.setName(name);
contact.setPicture(picture);
contact.setPhone(phone);
contact.setUserType(UserType.parse(type));
}
contactRepository.createOrUpdate(contact);
//check existing before save
ChatMessage msg = messageRepository.getMessageInByContactAndMsgid(contact.getId(), msgid);
if ( msg == null ) {
msg = ChatHelper.createMessageIn(msgid, contact.getId(), text);
messageRepository.createOrUpdate(msg);
}
//update reply status latest out message
final ChatMessage repliedMsg = messageRepository.getLastMessageOutByContact(contact.getId());
//if exist
if ( repliedMsg != null ) {
repliedMsg.setMessageSendStatus(MessageSendStatus.REPLIED);
messageRepository.createOrUpdate(repliedMsg);
}
sendNewMessageEventBroadcast(contact, repliedMsg, msg);
//send delivery status to sender
try {
final JSONObject joTo = new JSONObject();
joTo.put("email", contact.getEmail());
joTo.put("type", contact.getUserType());
final JSONObject joMsg = new JSONObject();
joMsg.put("msgid", msgid);
joMsg.put("status", MessageSendStatus.DELIVERED.ordinal());
JSONObject joData = new JSONObject() {{
put("to", joTo);
put("msg", joMsg);
}};
chatEngine.emitDeliveryStatus(joData);
} catch (JSONException e) {
Log.e(Constants.TAG_CHAT, e.getMessage(), e);
}
}
};
private BroadcastReceiver deliveryStatusReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent){
String data = intent.getStringExtra("data");
String msgid, email, type;
int status = 0;
try {
JSONObject joData = new JSONObject(data);
Log.d(Constants.TAG_CHAT, "::::" + getClass().getName() + " <= delivery status = " + joData);
JSONObject joTo = joData.getJSONObject("to");
email = joTo.getString("email");
type = joTo.getString("type");
JSONObject joMsg = joData.getJSONObject("msg");
msgid = joMsg.getString("msgid");
status = joMsg.getInt("status");
} catch (JSONException e) {
Log.e(Constants.TAG_CHAT, e.getMessage(), e);
return;
}
ChatContact contact = contactRepository.getContactByEmail(email, UserType.parse(type));
if ( contact != null ) {
ChatMessage msg = messageRepository.getMessageOutByContactAndMsgid(contact.getId(), msgid);
Log.d(Constants.TAG_CHAT, getClass().getName() + String.format(" => DELIVERED STATUS MSGID=%s, MSG=%s, FROM=%s-%s", msgid, msg, contact.getId(), contact.getUserType() ));
if ( msg != null ) {
//jika sudah replied tidak update
if ( MessageSendStatus.REPLIED.equals(msg.getMessageSendStatus()) == false ) {
msg.setMessageSendStatus(MessageSendStatus.parse(status));
messageRepository.createOrUpdate(msg);
//broadcast delivery status to activity
sendDeliveryStatusEventBroadcast(contact, msg);
}
}
}
}
};
private BroadcastReceiver listContactReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent){
String data = intent.getStringExtra("data");
//Log.d(getResources().getString(R.string.app_name), "list contact ");
JSONArray contacts = new JSONArray();
try {
JSONObject joData = new JSONObject(data);
contacts = joData.getJSONArray("contacts");
//Toast.makeText(getApplicationContext(), "Login1 " + isLogin, Toast.LENGTH_SHORT).show();
} catch (JSONException e) {
Log.e(Constants.TAG_CHAT, e.getMessage(), e);
return;
}
Log.d(Constants.TAG_CHAT, "::::" + getClass().getName() + " => list contacts = " + contacts);
//Toast.makeText(getApplicationContext(), "Login2 " + isLogin, Toast.LENGTH_SHORT).show();
final ArrayList<ChatContact> contactList = new ArrayList<ChatContact>();
for(int i = 0; i < contacts.length(); i++) {
try {
JSONObject joContact = contacts.getJSONObject(i);
String id = joContact.getString("id");
String name = joContact.getString("name");
String email = joContact.getString("email");
String phone = joContact.getString("phone");
String picture = joContact.getString("picture");
String type = joContact.getString("type");
//skip contact for current app user
//if ( email.equalsIgnoreCase(app.getUserApp().getEmail())) continue;
ChatContact contact = contactRepository.getContactByEmail(email, UserType.parse(type));
if ( contact == null ) {
contact = new ChatContact(name, picture, email, phone, UserType.parse(type));
} else {
contact.setName(name);
contact.setPicture(picture);
contact.setPhone(phone);
}
//save new or update
contactRepository.createOrUpdate(contact);
contactList.add(contact);
} catch (JSONException e) {
Log.d(Constants.TAG_CHAT,e.getMessage(), e);
}
}
sendListContactEventBroadcast(contactList);
}
};
private BroadcastReceiver userJoinReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String data = intent.getStringExtra("data");
try {
JSONObject joData = new JSONObject(data);
JSONObject user = joData.getJSONObject("user");
Log.d(Constants.TAG_CHAT, "::::" + getClass().getCanonicalName() + " => User Join = " + user.getString("email"));
} catch (JSONException e) {
Log.e(Constants.TAG_CHAT, e.getMessage(), e);
return;
}
//retrive contact
chatEngine.emitGetContacts();
//ChatTaskService.startActionGetContacts(getActivity());
}
};
private void sendListContactEventBroadcast(ArrayList<ChatContact> contactList){
Intent intent = new Intent(ActivityEvent.LIST_CONTACT);
if ( contactList != null ) intent.putExtra("contactList", contactList);
LocalBroadcastManager.getInstance(App.getInstance()).sendBroadcast(intent);
}
private void sendNewMessageEventBroadcast(ChatContact contact, ChatMessage repliedMsg, ChatMessage msg){
Intent intent = new Intent(ActivityEvent.NEW_MESSAGE);
if ( contact != null ) intent.putExtra("contact", contact);
if ( msg != null ) intent.putExtra("msg", msg);
if ( repliedMsg != null) intent.putExtra("repliedMsg", repliedMsg);
LocalBroadcastManager.getInstance(App.getInstance()).sendBroadcast(intent);
}
private void sendDeliveryStatusEventBroadcast(ChatContact contact, ChatMessage msg){
Intent intent = new Intent(ActivityEvent.DELIVERY_STATUS);
if ( contact != null ) intent.putExtra("contact", contact);
if ( msg != null ) intent.putExtra("msg", msg);
LocalBroadcastManager.getInstance(App.getInstance()).sendBroadcast(intent);
}
public static void registerReceivers(Map<String, BroadcastReceiver> receivers) {
synchronized (mReceivers) {
unregisterReceivers();
mReceivers = receivers;
//re-register
for (String event : mReceivers.keySet()) {
LocalBroadcastManager.getInstance(App.getInstance()).registerReceiver(mReceivers.get(event), new IntentFilter(event));
}
}
}
private static void unregisterReceivers() {
//Log.d(Constants.TAG_CHAT, "unregisterReceivers()=>mRegistered=" + mRegistered);
for (String event : mReceivers.keySet()) {
LocalBroadcastManager.getInstance(App.getInstance()).unregisterReceiver(mReceivers.get(event));
}
}
public static class ActivityEvent
{
public final static String LOGIN = "activity login";
public final static String USER_JOIN = "activity user join";
public final static String USER_LEFT = "activity user left";
public final static String NEW_MESSAGE = "activity new message";
public final static String DELIVERY_STATUS = "activity delivery status";
public final static String TYPING = "activity typing";
public final static String STOP_TYPING = "activity stop typing";
public final static String LIST_CONTACT = "activity list contact";
public final static String UPDATE_CONTACT = "activity update contact";
private static String[] EVENTS = {
LOGIN, USER_JOIN,
USER_LEFT, NEW_MESSAGE, DELIVERY_STATUS,
TYPING, STOP_TYPING,
LIST_CONTACT, UPDATE_CONTACT
};
}
}
| [
"rainfallindecember@gmail.com"
] | rainfallindecember@gmail.com |
d3d059b04942c8ff3ce2d1d9459ab43cdf4118a9 | cad2fa82852ca6c60c87b407fd15ef0cdd932adc | /core/src/main/java/com/sequenceiq/cloudbreak/service/cluster/NotEnoughNodeException.java | a847662ce7200d62cf115427dd501d1cf1afb8fc | [
"LicenseRef-scancode-warranty-disclaimer",
"ANTLR-PD",
"CDDL-1.0",
"bzip2-1.0.6",
"Zlib",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-jdbm-1.00",
"Apache-2.0"
] | permissive | bazaarvoice/cloudbreak | 41d16df3c043072cbf47558618b276baaddc39f6 | 749b6b1719ed5dd9f7287e0e64205565fd971e59 | refs/heads/master | 2023-04-28T14:26:39.555312 | 2023-01-05T04:12:39 | 2023-01-05T04:12:39 | 131,363,855 | 0 | 0 | Apache-2.0 | 2020-11-04T20:07:12 | 2018-04-28T02:23:40 | Java | UTF-8 | Java | false | false | 200 | java | package com.sequenceiq.cloudbreak.service.cluster;
public class NotEnoughNodeException extends RuntimeException {
public NotEnoughNodeException(String message) {
super(message);
}
}
| [
"fschneider@hortonworks.com"
] | fschneider@hortonworks.com |
78bb46dd19ba2ba9e1698ebb7c4b6c7aac1d7c27 | 7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b | /Crawler/data/AnnotationMapper.java | 98e9e024f37ce3b7ded99d0b1a1dcc717de8379b | [] | no_license | NayrozD/DD2476-Project | b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0 | 94dfb3c0a470527b069e2e0fd9ee375787ee5532 | refs/heads/master | 2023-03-18T04:04:59.111664 | 2021-03-10T15:03:07 | 2021-03-10T15:03:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,403 | java | 15
https://raw.githubusercontent.com/zjjxxlgb/mybatis2sql/master/src/test/java/org/apache/ibatis/submitted/global_variables/AnnotationMapper.java
/**
* Copyright ${license.git.copyrightYears} the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.global_variables;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Property;
import org.apache.ibatis.annotations.Select;
@CacheNamespace(implementation = CustomCache.class, properties = {
@Property(name = "stringValue", value = "${stringProperty}"),
@Property(name = "integerValue", value = "${integerProperty}"),
@Property(name = "longValue", value = "${longProperty}")
})
public interface AnnotationMapper {
@Select("select * from ${table} where id = #{id}")
User getUser(Integer id);
}
| [
"veronika.cucorova@gmail.com"
] | veronika.cucorova@gmail.com |
25f6e1087eb767dffd459f6f9b81823a8f1bb881 | b6d52cbcaf3eb9531e74defaf078cce2034df22e | /app/src/main/java/yswl/com/testmvp/base/BaseRecyclerAdapter.java | 85d0e86d16eddce1d158abe0bb9f954ad454c52b | [] | no_license | yunshuwanli/TestMVP | f7d285669c5deefa0b364c47b7eb716e6f7ee2e5 | 3d55bb63d7e39c922e4613faa4bd335365e7794f | refs/heads/master | 2021-01-02T08:17:44.439021 | 2017-09-30T09:09:00 | 2017-09-30T09:09:00 | 98,988,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,477 | java | package yswl.com.testmvp.base;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import yswl.com.testmvp.R;
/**
* base RecyclerView 适合加载如listview的数据 适配器
* 上拉加载更多。
*/
public abstract class BaseRecyclerAdapter<T> extends RecyclerView.Adapter<BaseRecyclerHolder> {
private static final String TAG = "BaseRecyclerAdapter";
private Context context;//上下文
private List<T> list;//数据源
public List<T> getList() {
return list;
}
private LayoutInflater inflater;//布局器
private int itemLayoutId;//布局id
private OnItemClickListener listener;
private OnLoaderMoreListener loaderMoreListener;
private OnItemLongClickListener longClickListener;//长按监听器
private RecyclerView recyclerView;
//上拉加载更多
public static final int PULLUP_LOAD_MORE = 0;
//正在加载中
public static final int LOADING_MORE = 1;
//上拉加载更多状态-默认为0
private int load_more_status = PULLUP_LOAD_MORE;
public void setOnItemClickListener(OnItemClickListener listener) {
this.listener = listener;
}
public void setOnLoaderMoreListener(OnLoaderMoreListener listener) {
this.loaderMoreListener = listener;
}
public void setOnItemLongClickListener(OnItemLongClickListener longClickListener) {
this.longClickListener = longClickListener;
}
public LayoutInflater getInflater() {
return inflater;
}
public interface OnItemClickListener {
void onItemClick(RecyclerView parent, View view, int position);
}
public interface OnLoaderMoreListener {
void onLoadermore();
}
public interface OnItemLongClickListener {
boolean onItemLongClick(RecyclerView parent, View view, int position);
}
//在RecyclerView提供数据的时候调用
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
Log.e(TAG, "onAttachedToRecyclerView" );
super.onAttachedToRecyclerView(recyclerView);
this.recyclerView = recyclerView;
}
@Override
public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
Log.e(TAG, "onDetachedFromRecyclerView" );
super.onDetachedFromRecyclerView(recyclerView);
this.recyclerView = null;
}
// public abstract List<T> initData();
public void setList(List<T> list) {
this.list = list;
}
public void setItemLayoutId(int itemLayoutId) {
this.itemLayoutId = itemLayoutId;
}
public BaseRecyclerAdapter(Context context, List<T> list) {
Log.e(TAG, "BaseRecyclerAdapter" );
this.context = context;
this.list = list;
inflater = LayoutInflater.from(context);
}
@Override
public BaseRecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Log.e(TAG, "onCreateViewHolder viewType:" + viewType);
View view = null;
if (viewType == TYPE_NORMAL) {
view = inflater.inflate(itemLayoutId, parent, false);
}
if (viewType == TYPE_FOOT) {
view = inflater.inflate(R.layout.recycle_item_foot, parent, false);
}
return BaseRecyclerHolder.getRecyclerHolder(context, view);
}
@Override
public void onBindViewHolder(final BaseRecyclerHolder holder, final int position) {
Log.e(TAG, "onBindViewHolder position:" + position);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getItemViewType(position) == TYPE_NORMAL) {
if (listener != null && view != null && recyclerView != null) {
int position = recyclerView.getChildAdapterPosition(view);
listener.onItemClick(recyclerView, view, position);
}
} else if (getItemViewType(position) == TYPE_FOOT) {
if (loaderMoreListener != null)
loaderMoreListener.onLoadermore();
}
}
});
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (getItemViewType(position) == TYPE_NORMAL) {
if (longClickListener != null && view != null && recyclerView != null) {
int position = recyclerView.getChildAdapterPosition(view);
longClickListener.onItemLongClick(recyclerView, view, position);
return true;
}
} else if (getItemViewType(position) == TYPE_FOOT) {
}
return false;
}
});
if (getItemViewType(position) == TYPE_NORMAL) {
convert(holder, position);
}else if (getItemViewType(position) == TYPE_FOOT) {
switch (load_more_status) {
case PULLUP_LOAD_MORE:
holder.setText(R.id.loader_more_tip, "上拉加载更多...");
holder.setProgress(R.id.loader_more_pb, View.GONE);
break;
case LOADING_MORE:
holder.setText(R.id.loader_more_tip, "正在加载中...");
holder.setProgress(R.id.loader_more_pb, View.VISIBLE);
if (loaderMoreListener != null)
loaderMoreListener.onLoadermore();
break;
}
}
}
/**
* 填充RecyclerView适配器的方法,子类需要重写
*
* @param holder ViewHolder
* @param position 位置
*/
public abstract void convert(BaseRecyclerHolder holder, int position);
@Override
public int getItemCount() {
return list == null ? 0 : list.size()+1;
}
public static final int TYPE_TOP = 0;
public static final int TYPE_FOOT = 2;
public static final int TYPE_NORMAL = 1;
@Override
public int getItemViewType(int position) {
Log.e(TAG, "getItemViewType position:" + position);
if (position == getItemCount()-1) {
return TYPE_FOOT;
} else {
return TYPE_NORMAL;
}
}
/**
* 插入一项
*
* @param item
* @param position
*/
public void insert(T item, int position) {
list.add(position, item);
notifyItemInserted(position);
}
//添加多条数据
public void addItem(List<T> newDatas) {
newDatas.addAll(list);
list.clear();
list.addAll(newDatas);
notifyDataSetChanged();
}
//上拉加载更多
public void addMoreItem(List<T> newDatas) {
list.addAll(newDatas);
// notifyDataSetChanged();
}
/**
* 删除一项
*
* @param position 删除位置
*/
public void delete(int position) {
list.remove(position);
notifyItemRemoved(position);
}
public void loaderComplete() {
load_more_status = PULLUP_LOAD_MORE;
notifyDataSetChanged();
}
public void loading() {
load_more_status = LOADING_MORE;
notifyDataSetChanged();
}
} | [
"yunshuwanli@foxmail.com"
] | yunshuwanli@foxmail.com |
162aad24ee1fb718aeab6909833047a4ef8c76a5 | 93d06d6b9657cf4ce8fb7583f30615ddc2851c95 | /ssaw-me-helper/src/test/java/com/ssaw/ssawmehelper/SsawMeHelperApplicationTests.java | 48914b34dd2b52732adfe2eea33179d5a7452b09 | [] | no_license | IsSenHu/sapache2 | 89f532fc0353dc5639c1c30ac59a83dae6f35b47 | f563bf69449af827b6b0163a67c2ec39f5873164 | refs/heads/master | 2023-08-05T05:45:34.448788 | 2019-07-26T11:56:11 | 2019-07-26T11:56:11 | 187,483,694 | 2 | 1 | null | 2023-07-22T06:17:33 | 2019-05-19T13:58:44 | Java | UTF-8 | Java | false | false | 4,327 | java | package com.ssaw.ssawmehelper;
import com.ssaw.redis.lock.RedisLock;
import com.ssaw.redis.lock.RedisSemaphore;
import com.ssaw.ssawmehelper.dao.redis.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SsawMeHelperApplicationTests {
@Autowired
private KaoQinDao kaoQinDao;
@Autowired
private MyCollectionDao myCollectionDao;
@Autowired
private GoodsDemoDao goodsDemoDao;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private MarketDao marketDao;
@Autowired
private LogDao logDao;
@Autowired
private AutoCompletionDao autoCompletionDao;
@Autowired
private LockDao lockDao;
@Test
public void contextLoads() {
stringRedisTemplate.opsForValue().set("sentinel", "test");
System.out.println(stringRedisTemplate.opsForValue().get("sentinel"));
}
@Test
public void demo2() {
marketDao.watch("你好");
}
@Test
public void demo3() {
autoCompletionDao.get("ac");
}
@Test
public void demo4() throws InterruptedException {
lockDao.lock("husen");
lockDao.unlock("husen");
}
@Test
public void demo5() throws InterruptedException {
lockDao.lock("husen");
lockDao.unlock("husen");
}
@Test
public void demo6() throws InterruptedException {
RedisSemaphore semaphore = new RedisSemaphore(stringRedisTemplate, 2);
for (int i = 0; i < 3; i++) {
new Thread(() -> {
String acquire = semaphore.acquire("semaphore:key");
System.out.println(acquire);
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (Objects.nonNull(acquire)) {
semaphore.release("semaphore:key", acquire);
}
}).start();
}
Thread.sleep(1000000L);
}
@Test
public void demo7() {
stringRedisTemplate.executePipelined((RedisCallback<Object>) connection -> {
connection.zAdd("233".getBytes(), System.currentTimeMillis(), "333".getBytes());
Long aLong = connection.zRank("233".getBytes(), "333".getBytes());
List<Object> objects = connection.closePipeline();
return null;
});
}
@Test
public void demo8() throws InterruptedException {
RedisLock redisLock = new RedisLock(stringRedisTemplate);
boolean asdedddd = redisLock.lock("asdedddd", 100, TimeUnit.SECONDS);
System.out.println(asdedddd);
redisLock.unlock("asdedddd");
Thread.sleep(1000000L);
}
@Test
public void demo9() throws InterruptedException {
RedisLock redisLock = new RedisLock(stringRedisTemplate);
boolean asdedddd = redisLock.lock("asdedddd", 100, TimeUnit.SECONDS);
System.out.println(asdedddd);
redisLock.unlock("asdedddd");
Thread.sleep(1000000L);
}
@Test
public void demo10() {
ListOperations<String, String> list = stringRedisTemplate.opsForList();
list.rightPushAll("queue1", "husen", "senhu");
list.rightPushAll("queue2", "husen2", "senhu2");
list.rightPushAll("queue3", "husen3", "senhu3");
}
@Test
public void demo11() {
while (true) {
Object execute = stringRedisTemplate.execute((RedisCallback<String>) connection -> {
List<byte[]> bytes = connection.bLPop(30, "queue1".getBytes(), "queue2".getBytes(), "queue3".getBytes());
return new String(bytes.get(1));
});
System.out.println(execute);
}
}
}
| [
"1178515826@qq.com"
] | 1178515826@qq.com |
5baf1f7be1afcca93c0030a1eece1e3041a1a3af | 16f9ef6936a8dc5e5c71b112069ed18b3b52a134 | /src/main/java/br/org/libros/biblioteca/model/persistence/entity/package-info.java | 55c14ab24e2a7a886e4afb833635cfbac52929d7 | [
"MIT"
] | permissive | alissonwilker/br.org.libros | 9b35f23c41f638df6f184ab723d3bdb230ba54aa | e6459141ab4784a6e29d8d07e04e7d1865df8a1a | refs/heads/master | 2021-06-24T20:14:53.642938 | 2017-09-06T02:01:51 | 2017-09-06T02:01:51 | 100,613,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | /**
* Este pacote contém os tipos referentes à camada Persistence do módulo Biblioteca.
*
* @see br.org.arquitetura.model.persistence.entity
* @since 0.0.1
*/
package br.org.libros.biblioteca.model.persistence.entity;
| [
"alissonwilker@gmail.com"
] | alissonwilker@gmail.com |
d891ebee4427190711ac7061290793fb7002f4fd | 81857efe99bf0e1f1abe59d695e370fb125f7065 | /src/main/java/com/chenjj/java8/lambda/BlocklambdaDemo.java | 175bb3fce634b98c5d5983c6a6afa4f80cd6ae66 | [] | no_license | chenjunjiang/java8 | df47e57685b1adaf142bda1fb1cd548ade7f4c39 | 364b89ae7e9a30984e21f07b3a84a99a6762d05b | refs/heads/master | 2021-06-07T21:45:00.578233 | 2021-02-07T06:48:01 | 2021-02-07T06:48:01 | 42,872,930 | 0 | 0 | null | 2020-10-13T05:47:45 | 2015-09-21T14:52:26 | Java | UTF-8 | Java | false | false | 372 | java | package com.chenjj.java8.lambda;
public class BlocklambdaDemo {
public static void main(String[] args) {
NumericFunc numericFunc = (n) -> {
int result = 1;
for (int i = 1; i < n; i++) {
result = i * result;
}
return result;
};
System.out.println(numericFunc.func(10));
}
}
| [
"chenjunjiang1988@126.com"
] | chenjunjiang1988@126.com |
859f6087cc70040443ab0342f21451fbb3965d65 | 10f2b1cb54397b44017d99af4d778749c1525d78 | /read-model/src/main/java/com/yvant/model/product/entity/Brand.java | 8f6b09c2e096034f03b24c9313904da9935dc9f4 | [] | no_license | YvantYun/read | 8d756dc5c7a48880d6d6c34b3ed7bc508823e2a3 | e8a4ceb3a09ec7adc587ac8ffbcf3080f4a09fb6 | refs/heads/master | 2023-08-09T11:49:22.915294 | 2020-06-28T02:33:11 | 2020-06-28T02:33:11 | 180,115,986 | 1 | 0 | null | 2023-07-22T02:31:37 | 2019-04-08T09:32:05 | Java | UTF-8 | Java | false | false | 1,161 | java | package com.yvant.model.product.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yvant.common.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 品牌表 实体类
*
* @author yunfeng
* @Description Created on 2020-03-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_brand")
public class Brand extends BaseEntity<Long> {
/**
* 品牌名称
*/
private String name;
/**
* 首字母
*/
private String firstLetter;
/**
* 排序
*/
private Integer sort;
/**
* 是否为品牌制造商:0->不是;1->是
*/
private Integer factoryStatus;
/**
*
*/
private Integer showStatus;
/**
* 产品数量
*/
private Integer productCount;
/**
* 产品评论数量
*/
private Integer productCommentCount;
/**
* 品牌logo
*/
private String logo;
/**
* 专区大图
*/
private String bigPic;
/**
* 品牌故事
*/
private String brandStory;
}
| [
"374932573@qq.com"
] | 374932573@qq.com |
5e27dc2cbbdfcbb9eeb8586a52aa5c1031902470 | e1feb82d55edab3825e748113b3672174dcf1ed3 | /app/src/main/java/com/lntu/online/activity/CrashShowActivity.java | 0028a960a0bae752789a110bde66068c565b8c0f | [] | no_license | qq24090467/LntuOnline-Android | ef7b95be8e08a1687747f4ffa5af2b9eeddf48d9 | 030a7f2cb6d9bee4feb68f6bd15567c71235b969 | refs/heads/master | 2021-01-16T01:07:20.728796 | 2015-03-27T12:52:17 | 2015-03-27T12:52:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,864 | java | package com.lntu.online.activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.text.format.Time;
import android.view.View;
import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
import com.lntu.online.R;
import com.lntu.online.http.HttpUtil;
import com.lntu.online.http.NormalAuthListener;
import com.lntu.online.info.NetworkConfig;
import com.loopj.android.http.RequestParams;
import com.takwolf.android.util.AppUtils;
import org.apache.http.Header;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
public class CrashShowActivity extends ActionBarActivity {
@InjectView(R.id.toolbar)
protected Toolbar toolbar;
@InjectView(R.id.crash_show_tv_info)
protected TextView tvInfo;
private String sorry = "" +
"非常抱歉,程序运行过程中出现了一个无法避免的错误。" +
"您可以将该问题发送给我们,此举将有助于我们改善应用体验。" +
"由此给您带来的诸多不便,我们深表歉意,敬请谅解。\n" +
"----------------\n";
private String crashLog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crash_show);
ButterKnife.inject(this);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_error_white_24dp);
//接收异常对象
Intent intent = getIntent();
Throwable e = (Throwable) intent.getSerializableExtra("e");
//构建字符串
StringBuffer sb = new StringBuffer();
sb.append("生产厂商:\n");
sb.append(Build.MANUFACTURER + "\n\n");
sb.append("手机型号:\n");
sb.append(Build.MODEL + "\n\n");
sb.append("系统版本:\n");
sb.append(Build.VERSION.RELEASE + "\n\n");
sb.append("异常时间:\n");
Time time = new Time();
time.setToNow();
sb.append(time.toString() + "\n\n");
sb.append("异常类型:\n");
sb.append(e.getClass().getName() + "\n\n");
sb.append("异常信息:\n");
sb.append(e.getMessage() + "\n\n");
sb.append("异常堆栈:\n" );
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
e.printStackTrace(printWriter);
Throwable cause = e.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
printWriter.close();
sb.append(writer.toString());
crashLog = sb.toString();
//显示信息
tvInfo.setText(sorry + crashLog);
}
@OnClick(R.id.crash_show_btn_send)
public void onBtnSend(final View view) {
RequestParams params = new RequestParams();
params.put("info", crashLog);
params.put("platform", "android");
params.put("version", AppUtils.getVersionCode(this));
params.put("osVer", Build.VERSION.RELEASE);
params.put("manufacturer", Build.MANUFACTURER);
params.put("model", Build.MODEL);
HttpUtil.post(this, NetworkConfig.serverUrl + "feedback/crashLog", params, new NormalAuthListener(this) {
@Override
public void onSuccess(int statusCode, Header[] headers, String responseString) {
if (view == null) {
return; //强制提交的不提示
}
if ((responseString + "").equals("OK")) {
new MaterialDialog.Builder(getContext())
.title("提示")
.content("问题已经提交,非常感谢")
.cancelable(false)
.positiveText("确定")
.positiveColorRes(R.color.colorPrimary)
.callback(new MaterialDialog.ButtonCallback() {
@Override
public void onPositive(MaterialDialog dialog) {
finish();
}
})
.show();
} else {
String[] msgs = responseString.split("\n");
showErrorDialog("提示", msgs[0], msgs[1]);
}
}
});
}
@Override
public void onBackPressed() {
finish();
}
}
| [
"takwolf@foxmail.com"
] | takwolf@foxmail.com |
73d014412045a567a264fb9ce3e0a106583d12a5 | bb321906bfc13da49e36bb5b5b960fb97c404789 | /src/main/java/com/sos/shanks/service/FournisseurFacade.java | 67a190e449d9fa709c6491c5ad4cb83d24a66498 | [] | no_license | sos-hard-soft/shanks | 402a2a4bd7737c7b2a52dba961e0750d2f91d4d7 | 37be6574288d9dd8e35175b176fb32deecc2c2e3 | refs/heads/master | 2020-05-29T17:59:53.605481 | 2014-03-09T23:13:37 | 2014-03-09T23:13:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.sos.shanks.service;
import com.sos.shanks.domain.Fournisseur;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author mab.salhi
*/
@Stateless
public class FournisseurFacade extends AbstractFacade<Fournisseur> {
@PersistenceContext(unitName = "shanksPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public FournisseurFacade() {
super(Fournisseur.class);
}
}
| [
"mab.salhi@infolp.fso.ump.ma"
] | mab.salhi@infolp.fso.ump.ma |
2d58c103a150b54ec7c48d6195f45f48e5409fe4 | f7ede4fc653eecd13c017a619fc56077ea580a8e | /TestingShastraFramework_SP/src/main/java/com/testingshastra/keyword/BrowserInstance.java | b805abe10f1e3f96ab8b59b46170999f4c33f15b | [] | no_license | priyankadeosarkar91/FrameworkRockers | 24be9d03175088be84034fccf89df982c3771898 | b07376455c4f3e7a07e0c41ad491d500b27129c9 | refs/heads/master | 2021-05-22T16:45:37.077481 | 2020-05-08T10:59:40 | 2020-05-08T10:59:40 | 253,008,271 | 0 | 4 | null | 2020-10-13T21:28:24 | 2020-04-04T13:47:23 | HTML | UTF-8 | Java | false | false | 143 | java | package com.testingshastra.keyword;
import org.openqa.selenium.WebDriver;
public class BrowserInstance {
public static WebDriver driver;
}
| [
"swapnayawalkar@gmail.com"
] | swapnayawalkar@gmail.com |
19693f9857141e421093dfac26e436eb753fd436 | 04bfec01e8699fbe655d1695930c3e5d2b61905c | /mybatis/src/main/java/com/albenyuan/mybatis/Application.java | 8a395f43a35b3923a5f88bb0bb4b959510938c87 | [] | no_license | albenyuan/knowledge | 8104806b79db85238bbf2bb85d88897d9c440ab0 | d7067d6524db008e817018a5cde5067b6cc7a2e3 | refs/heads/master | 2021-03-31T00:54:05.174660 | 2019-01-01T11:33:28 | 2019-01-01T11:33:28 | 125,023,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.albenyuan.mybatis;
import org.springframework.context.annotation.Configuration;
/**
* @Author Alben Yuan
* @Date 2018-07-20 16:08
*/
//@Configuration
public class Application {
}
| [
"albenyuan@aliyun.com"
] | albenyuan@aliyun.com |
c4327f99c39d211785260fef96514982ad97f165 | 12acdd08319bd2d69152b14bf43b99e479c81ae7 | /src/main/java/neobank/backend/persistence/entity/Cart.java | 3b8f9579841a98bc2c3d902177a61b334c6780f6 | [] | no_license | Deviad/interview-code-challenge | cbbfdd9f2a0f7d482a3336979a302e68d9811586 | 1eff93e1b0e246b673ce750e881d395f9589c7ee | refs/heads/master | 2023-04-10T16:45:14.655650 | 2021-04-26T05:53:49 | 2021-04-26T05:56:00 | 361,406,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,398 | java | package neobank.backend.persistence.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import neobank.backend.domain.valueobject.CartStatus;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.HashSet;
import java.util.Set;
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table(name = "carts")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@ToString(onlyExplicitlyIncluded = true)
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EqualsAndHashCode.Include
@ToString.Include
Long id;
@OneToMany(mappedBy = "cart")
private Set<CartProduct> cartProducts = new HashSet<>();
@ManyToOne(targetEntity = User.class)
@JoinColumn(name = "user_id", nullable = false)
private User user;
@Column(name = "cart_status")
@Enumerated(EnumType.STRING)
private CartStatus cartStatus;
@Column(name = "total_final_price")
private double totalFinalPrice;
}
| [
"deviad@gmail.com"
] | deviad@gmail.com |
cd72db398ba19bc59f25aef01502299935084a20 | 092006101387a145b83fbe9dd8f4fdf8d7cdadea | /app/src/main/java/com/abhinav/newsfeed/InternationalNewsFragment.java | 5cc7a5ab321daabbad1f27c8463c7ab604098ec8 | [] | no_license | amrita41/News-Feed-Mini-Project | 88b8c70bd060700dcc5913fab5f491213ec72b9c | f6aa4480ca3cb42d045b171984588853704a4694 | refs/heads/master | 2022-07-21T19:15:16.626105 | 2020-05-20T00:30:44 | 2020-05-20T00:30:44 | 264,569,927 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,422 | java | package com.abhinav.newsfeed;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class InternationalNewsFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_international_news, container, false);
RecyclerView recyclerView = root.findViewById(R.id.internationalrcView);
recyclerView.setLayoutManager( new LinearLayoutManager(root.getContext()));
ArrayList<News> internationalNewsList = new ArrayList<>();
NewsCardAdapter adapter = new NewsCardAdapter(getContext(), internationalNewsList);
recyclerView.setAdapter(adapter);
NewsDownloadHelper downloadHelper = new NewsDownloadHelper(root.getContext());
for( int i = 1; i < ResourceHelper.countryCodes.size()-1; i++ ) {
downloadHelper.setNewsList(recyclerView, internationalNewsList, ResourceHelper.countryCodes.get(i), null);
}
return root;
}
}
| [
"abhinav.cs2201@gmail.com"
] | abhinav.cs2201@gmail.com |
2313d50c4fe7639350aff00552890d4246b0f057 | 09972b9c7bcef99d5165ade9243afcffc7e2dc73 | /valeet1/src/main/java/bo/com/edu/ucb/valeet1/repositorio/RepositorioUsuario.java | 0ac277d9332da2d3ec5365164c1813939b0365ef | [] | no_license | SigmaZX30/Valeet | dcd35adee0ff691c2cd91f93ad8e6b2a0fac92b7 | e1ebc89abc306816de629a9ba4eb0eae2fc4c491 | refs/heads/master | 2020-08-30T14:12:29.005960 | 2019-11-26T02:32:28 | 2019-11-26T02:32:28 | 218,405,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package bo.edu.ucb.valeet.repositorio;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;
import bo.edu.ucb.valeet.entidad.Usuario;
public interface RepositorioUsuario extends CrudRepository<Usuario, Long>{
List<Usuario> findByUsername(String nombre);
@Transactional
void deleteByUsername(String nombre);
}
| [
"ignaciosalgado30@gmail.com"
] | ignaciosalgado30@gmail.com |
92d991976ebc22991f993a3915066de8e78ac0e4 | a48b86b3dd9a768d5db8dec33bed6a596306377f | /src/cn/oa/model/SocialSecurityRuleItem.java | 254b1531f81a0b92b5a9532334e9449954ca8251 | [] | no_license | daren990/EOA | 4c210df7ed9092a4edadd0b666056db950f23940 | 6696072ee34c7f0b563805661082273c9ba413db | refs/heads/master | 2020-03-22T10:42:52.721725 | 2017-12-07T09:07:56 | 2017-12-07T09:07:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,124 | java | package cn.oa.model;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;
@Table("conf_social_security_rule_item")
public class SocialSecurityRuleItem {
@Id
@Column("id")
private Integer id;
@Column("name")
private String name;
@Column("rule")
private String rule;
@Column("conf_social_security_rule_id")
private Integer socialSecurityRuleId;
@Column("status")
private Integer status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRule() {
return rule;
}
public void setRule(String rule) {
this.rule = rule;
}
public Integer getSocialSecurityRuleId() {
return socialSecurityRuleId;
}
public void setSocialSecurityRuleId(Integer socialSecurityRuleId) {
this.socialSecurityRuleId = socialSecurityRuleId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
| [
"2415156870@qq.com"
] | 2415156870@qq.com |
36907e9aab8a019753ea44864474ef698039d608 | d6cadbced883030388697976fb2e5031bd64d12f | /commandfamily-system/src/main/java/com/taptrack/tcmptappy2/commandfamilies/systemfamily/SystemCommandResolver.java | a628f011c074e1559ea97228086236aed178bfd4 | [
"Apache-2.0"
] | permissive | TapTrack/System-Command-Family | 150a116755c0566b79b32bec645ba364631a2b3b | f7e4dafdf8414cf9608e33869dcb070377ce1d4a | refs/heads/master | 2021-05-04T10:29:22.186861 | 2019-09-23T21:14:50 | 2019-09-23T21:14:50 | 54,070,230 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 11,874 | java | package com.taptrack.tcmptappy2.commandfamilies.systemfamily;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.Size;
import com.taptrack.tcmptappy2.CommandFamilyMessageResolver;
import com.taptrack.tcmptappy2.MalformedPayloadException;
import com.taptrack.tcmptappy2.TCMPMessage;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateBlueLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateBlueLEDForDurationCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateBuzzerCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateBuzzerForDurationCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateGreenLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateGreenLEDForDurationCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateRedLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ActivateRedLEDForDurationCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ConfigureKioskModeCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.ConfigureOnboardScanCooldownCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.DeactivateBlueLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.DeactivateBuzzerCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.DeactivateGreenLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.DeactivateRedLEDCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.DisableHostHeartbeatTransmissionCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.GetBatteryLevelCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.GetFirmwareVersionCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.GetHardwareVersionCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.GetIndicatorStatusCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.PingCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.commands.SetConfigItemCommand;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.BlueLEDActivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.BlueLEDDeactivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.BuzzerActivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.BuzzerDeactivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.ConfigItemResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.ConfigureKioskModeResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.ConfigureOnboardScanCooldownResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.CrcMismatchErrorResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.DisableHostHeartbeatTransmissionResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.FirmwareVersionResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.GetBatteryLevelResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.GreenLEDActivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.GreenLEDDeactivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.HardwareVersionResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.ImproperMessageFormatResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.IndicatorStatusResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.LcsMismatchErrorResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.LengthMismatchErrorResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.PingResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.RedLEDActivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.RedLEDDeactivatedResponse;
import com.taptrack.tcmptappy2.commandfamilies.systemfamily.responses.SystemErrorResponse;
import java.util.Arrays;
public class SystemCommandResolver implements CommandFamilyMessageResolver {
public static final byte[] FAMILY_ID = new byte[]{0x00,0x00};
private static void assertFamilyMatches(@NonNull TCMPMessage message) {
if (!Arrays.equals(message.getCommandFamily(),FAMILY_ID)) {
throw new IllegalArgumentException("Specified message is for a different command family");
}
}
@Override
@Nullable
public TCMPMessage resolveCommand(@NonNull TCMPMessage message) throws MalformedPayloadException {
assertFamilyMatches(message);
TCMPMessage parsedMessage;
switch(message.getCommandCode()) {
case GetHardwareVersionCommand.COMMAND_CODE:
parsedMessage = new GetHardwareVersionCommand();
break;
case GetFirmwareVersionCommand.COMMAND_CODE:
parsedMessage = new GetFirmwareVersionCommand();
break;
case GetBatteryLevelCommand.COMMAND_CODE:
parsedMessage = new GetBatteryLevelCommand();
break;
case PingCommand.COMMAND_CODE:
parsedMessage = new PingCommand();
break;
case SetConfigItemCommand.COMMAND_CODE:
parsedMessage = new SetConfigItemCommand();
break;
case ConfigureKioskModeCommand.COMMAND_CODE:
parsedMessage = new ConfigureKioskModeCommand();
break;
case ConfigureOnboardScanCooldownCommand.COMMAND_CODE:
parsedMessage = new ConfigureOnboardScanCooldownCommand();
break;
case ActivateBlueLEDCommand.COMMAND_CODE:
parsedMessage = new ActivateBlueLEDCommand();
break;
case ActivateRedLEDCommand.COMMAND_CODE:
parsedMessage = new ActivateRedLEDCommand();
break;
case ActivateGreenLEDCommand.COMMAND_CODE:
parsedMessage = new ActivateGreenLEDCommand();
break;
case ActivateBuzzerCommand.COMMAND_CODE:
parsedMessage = new ActivateBuzzerCommand();
break;
case DeactivateBlueLEDCommand.COMMAND_CODE:
parsedMessage = new DeactivateBlueLEDCommand();
break;
case DeactivateRedLEDCommand.COMMAND_CODE:
parsedMessage = new DeactivateRedLEDCommand();
break;
case DeactivateGreenLEDCommand.COMMAND_CODE:
parsedMessage = new DeactivateGreenLEDCommand();
break;
case DeactivateBuzzerCommand.COMMAND_CODE:
parsedMessage = new DeactivateBuzzerCommand();
break;
case ActivateBlueLEDForDurationCommand.COMMAND_CODE:
parsedMessage = new ActivateBlueLEDForDurationCommand();
break;
case ActivateRedLEDForDurationCommand.COMMAND_CODE:
parsedMessage = new ActivateRedLEDForDurationCommand();
break;
case ActivateGreenLEDForDurationCommand.COMMAND_CODE:
parsedMessage = new ActivateGreenLEDForDurationCommand();
break;
case ActivateBuzzerForDurationCommand.COMMAND_CODE:
parsedMessage = new ActivateBuzzerForDurationCommand();
break;
case GetIndicatorStatusCommand.COMMAND_CODE:
parsedMessage = new GetIndicatorStatusCommand();
break;
case DisableHostHeartbeatTransmissionCommand.COMMAND_CODE:
parsedMessage = new DisableHostHeartbeatTransmissionCommand();
break;
default:
return null;
}
parsedMessage.parsePayload(message.getPayload());
return parsedMessage;
}
@Override
@Nullable
public TCMPMessage resolveResponse(@NonNull TCMPMessage message) throws MalformedPayloadException {
assertFamilyMatches(message);
TCMPMessage parsedMessage;
switch(message.getCommandCode()) {
case ConfigItemResponse.COMMAND_CODE:
parsedMessage = new ConfigItemResponse();
break;
case ConfigureKioskModeResponse.COMMAND_CODE:
parsedMessage = new ConfigureKioskModeResponse();
break;
case CrcMismatchErrorResponse.COMMAND_CODE:
parsedMessage = new CrcMismatchErrorResponse();
break;
case FirmwareVersionResponse.COMMAND_CODE:
parsedMessage = new FirmwareVersionResponse();
break;
case GetBatteryLevelResponse.COMMAND_CODE:
parsedMessage = new GetBatteryLevelResponse();
break;
case HardwareVersionResponse.COMMAND_CODE:
parsedMessage = new HardwareVersionResponse();
break;
case ImproperMessageFormatResponse.COMMAND_CODE:
parsedMessage = new ImproperMessageFormatResponse();
break;
case LcsMismatchErrorResponse.COMMAND_CODE:
parsedMessage = new LcsMismatchErrorResponse();
break;
case LengthMismatchErrorResponse.COMMAND_CODE:
parsedMessage = new LengthMismatchErrorResponse();
break;
case PingResponse.COMMAND_CODE:
parsedMessage = new PingResponse();
break;
case SystemErrorResponse.COMMAND_CODE:
parsedMessage = new SystemErrorResponse();
break;
case ConfigureOnboardScanCooldownResponse.COMMAND_CODE:
parsedMessage = new ConfigureOnboardScanCooldownResponse();
break;
case BlueLEDActivatedResponse.COMMAND_CODE:
parsedMessage = new BlueLEDActivatedResponse();
break;
case RedLEDActivatedResponse.COMMAND_CODE:
parsedMessage = new RedLEDActivatedResponse();
break;
case GreenLEDActivatedResponse.COMMAND_CODE:
parsedMessage = new GreenLEDActivatedResponse();
break;
case BuzzerActivatedResponse.COMMAND_CODE:
parsedMessage = new BuzzerActivatedResponse();
break;
case BlueLEDDeactivatedResponse.COMMAND_CODE:
parsedMessage = new BlueLEDDeactivatedResponse();
break;
case RedLEDDeactivatedResponse.COMMAND_CODE:
parsedMessage = new RedLEDDeactivatedResponse();
break;
case GreenLEDDeactivatedResponse.COMMAND_CODE:
parsedMessage = new GreenLEDDeactivatedResponse();
break;
case BuzzerDeactivatedResponse.COMMAND_CODE:
parsedMessage = new BuzzerDeactivatedResponse();
break;
case IndicatorStatusResponse.COMMAND_CODE:
parsedMessage = new IndicatorStatusResponse();
break;
case DisableHostHeartbeatTransmissionResponse.COMMAND_CODE:
parsedMessage = new DisableHostHeartbeatTransmissionResponse();
break;
default:
return null;
}
parsedMessage.parsePayload(message.getPayload());
return parsedMessage;
}
@Override
@NonNull
@Size(2)
public byte[] getCommandFamilyId() {
return FAMILY_ID;
}
}
| [
"johnvanoort@gmail.com"
] | johnvanoort@gmail.com |
0205611e8d7caafbc97a4bdae4b8d17c17df68ec | b7aff63b8a97f99949edabafdd8ef637bcfe3dc5 | /common/src/com/hex/bigdata/udsp/common/controller/ComPropertiesController.java | d31feca9d12502115b5ec69efa143f47b3cf522f | [] | no_license | dfhao/boracay | 432c60301d9e82337f46eea89ffc1f8dc28c1371 | b317a2fb69aed8f217c1ab0dbff585549b29f62b | refs/heads/master | 2021-09-04T03:30:31.226691 | 2017-12-28T11:16:05 | 2017-12-28T11:16:05 | 116,001,453 | 1 | 0 | null | 2018-01-04T09:54:57 | 2018-01-02T10:03:48 | Java | UTF-8 | Java | false | false | 1,895 | java | package com.hex.bigdata.udsp.common.controller;
import com.hex.bigdata.udsp.common.model.ComProperties;
import com.hex.bigdata.udsp.common.service.ComPropertiesService;
import com.hex.goframe.controller.BaseController;
import com.hex.goframe.model.MessageResult;
import com.hex.goframe.model.PageListResult;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 公共配置控制层
* Created by tomnic on 2017/2/27.
*/
@RequestMapping("/com/props/")
@Controller
public class ComPropertiesController extends BaseController {
private static Logger logger = LogManager.getLogger(ComPropertiesController.class);
@Autowired
private ComPropertiesService comPropertiesService;
@RequestMapping({"/select/{fkId}"})
@ResponseBody
public MessageResult select(@PathVariable("fkId") String fkId) {
boolean status = true;
String message = "查询成功";
List<ComProperties> list = null;
if (StringUtils.isBlank(fkId)) {
status = false;
message = "请求参数为空";
} else {
try {
list = this.comPropertiesService.selectByFkId(fkId);
} catch (Exception e) {
e.printStackTrace();
status = false;
message = "系统异常:" + e;
}
}
if (status) {
logger.debug(message);
} else {
logger.info(message);
}
return new PageListResult(list);
}
}
| [
"junjie.miao@goupwith.com"
] | junjie.miao@goupwith.com |
19680e77fd0e6e067e66b0e81430ea07a65d65e0 | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /java/java-impl-refactorings/src/com/intellij/refactoring/extractMethodObject/ExtractGeneratedClassUtil.java | 5faa29237443da82f12f309bc0e49f201aff44b9 | [
"Apache-2.0"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 6,793 | java | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.refactoring.extractMethodObject;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiTypesUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
final class ExtractGeneratedClassUtil {
private static final String GENERATED_CLASS_PACKAGE = "idea.debugger.rt";
private static final Logger LOG = Logger.getInstance(ExtractGeneratedClassUtil.class);
static PsiClass extractGeneratedClass(@NotNull PsiClass generatedInnerClass,
@NotNull PsiElementFactory elementFactory,
@NotNull PsiElement anchor) {
Project project = generatedInnerClass.getProject();
PsiClass extractedClass = elementFactory.createClass("GeneratedEvaluationClass");
for (PsiField field : generatedInnerClass.getAllFields()) {
extractedClass.add(elementFactory.createFieldFromText(field.getText(), anchor)); // TODO: check if null is OK
}
for (PsiMethod psiMethod : generatedInnerClass.getMethods()) {
extractedClass.add(elementFactory.createMethodFromText(psiMethod.getText(), anchor));
}
PsiJavaFile generatedFile = (PsiJavaFile)PsiFileFactory.getInstance(project)
.createFileFromText(extractedClass.getName() + ".java", JavaFileType.INSTANCE, extractedClass.getContainingFile().getText());
// copy.getModificationStamp(),
//false, false);
generatedFile.setPackageName(GENERATED_CLASS_PACKAGE);
extractedClass = PsiTreeUtil.findChildOfType(generatedFile, PsiClass.class);
copyStaticImports(generatedInnerClass, generatedFile, elementFactory);
assert extractedClass != null;
PsiElement codeBlock = PsiTreeUtil.findFirstParent(anchor, false, element -> element instanceof PsiCodeBlock);
if (codeBlock == null) {
codeBlock = anchor.getParent();
}
addGeneratedClassInfo(codeBlock, generatedInnerClass, extractedClass);
return extractedClass;
}
private static void copyStaticImports(@NotNull PsiElement from,
@NotNull PsiJavaFile destFile,
@NotNull PsiElementFactory elementFactory) {
PsiJavaFile fromFile = PsiTreeUtil.getParentOfType(from, PsiJavaFile.class);
if (fromFile != null) {
PsiImportList sourceImportList = fromFile.getImportList();
if (sourceImportList != null) {
PsiImportList destImportList = destFile.getImportList();
LOG.assertTrue(destImportList != null, "import list of destination file should not be null");
for (PsiImportStatementBase importStatement : sourceImportList.getAllImportStatements()) {
if (importStatement instanceof PsiImportStaticStatement && isPublic((PsiImportStaticStatement)importStatement)) {
PsiElement importStatementCopy = copy((PsiImportStaticStatement)importStatement, elementFactory);
if (importStatementCopy != null) {
destImportList.add(importStatementCopy);
}
else {
LOG.warn("Unable to copy static import statement: " + importStatement.getText());
}
}
}
}
}
}
@Nullable
private static PsiElement copy(@NotNull PsiImportStaticStatement importStatement,
@NotNull PsiElementFactory elementFactory) {
PsiClass targetClass = importStatement.resolveTargetClass();
String memberName = importStatement.getReferenceName();
if (targetClass != null && memberName != null) {
return elementFactory.createImportStaticStatement(targetClass, memberName);
}
return null;
}
private static boolean isPublic(@NotNull PsiImportStaticStatement staticImport) {
PsiClass targetClass = staticImport.resolveTargetClass();
if (targetClass != null && isPublicClass(targetClass)) {
PsiElement importedElement = staticImport.resolve();
if (importedElement instanceof PsiModifierListOwner) {
return ((PsiModifierListOwner)importedElement).hasModifierProperty(PsiModifier.PUBLIC);
}
}
return false;
}
private static boolean isPublicClass(@NotNull PsiClass psiClass) {
while (psiClass != null) {
if (!psiClass.hasModifierProperty(PsiModifier.PUBLIC)) {
return false;
}
psiClass = psiClass.getContainingClass();
}
return true;
}
private static void addGeneratedClassInfo(@NotNull PsiElement element,
@NotNull PsiClass generatedClass,
@NotNull PsiClass extractedClass) {
generatedClass.putUserData(LightMethodObjectExtractedData.REFERENCED_TYPE, PsiTypesUtil.getClassType(extractedClass));
element.accept(new JavaRecursiveElementVisitor() {
@Override
public void visitNewExpression(@NotNull PsiNewExpression expression) {
super.visitNewExpression(expression);
PsiMethod constructor = expression.resolveConstructor();
if (constructor != null && generatedClass.equals(constructor.getContainingClass())) {
List<PsiMethod> methods = ContainerUtil.filter(extractedClass.getConstructors(), x -> isSameMethod(x, constructor));
if (methods.size() == 1) {
LOG.info("Replace constructor: " + constructor.getName());
constructor.putUserData(LightMethodObjectExtractedData.REFERENCE_METHOD, methods.get(0));
}
}
}
@Override
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) {
super.visitMethodCallExpression(expression);
PsiMethod method = expression.resolveMethod();
if (method != null && generatedClass.equals(method.getContainingClass())) {
List<PsiMethod> methods = ContainerUtil.filter(extractedClass.getMethods(), x -> isSameMethod(x, method));
if (methods.size() == 1) {
LOG.info("Replace method: " + method.getName());
method.putUserData(LightMethodObjectExtractedData.REFERENCE_METHOD, methods.get(0));
}
}
}
private static boolean isSameMethod(@NotNull PsiMethod first, @NotNull PsiMethod second) {
if (first.getName().equals(second.getName())) {
return first.getParameterList().getParametersCount() == second.getParameterList().getParametersCount();
}
return false;
}
});
}
}
| [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
3c9340b40670f7e534d1e0cbc2f31634957c5fbc | a2efff8e07366dc637467d13af3ade3c399dcea4 | /src/mymath/Sudo2.java | 239ae7087b98e3f29a332cf686f4836f2a6178a6 | [] | no_license | swiftma/sudo | 9dd779a78410b61d8248507572d9b527facbe971 | a657a1d04a9d6499531044f261971812f18e3bee | refs/heads/master | 2021-04-10T21:51:28.040903 | 2020-03-25T08:04:37 | 2020-03-25T08:04:37 | 248,969,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,100 | java | package mymath;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class Sudo2 {
// {0, 0, 0, 0, 0, 0, 0, 0, 0},//1
// {0, 0, 0, 0, 0, 0, 0, 0, 0},//2
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //3
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //4
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //5
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //6
// {0, 0, 0, 0, 0, 0, 0, 0, 0},//7
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //8
// {0, 0, 0, 0, 0, 0, 0, 0, 0}, //9
//
static class Position {
int row;
int col;
public Position(int row, int col) {
super();
this.row = row;
this.col = col;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + col;
result = prime * result + row;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Position other = (Position) obj;
if (col != other.col)
return false;
if (row != other.row)
return false;
return true;
}
}
static class Cell implements Comparable<Cell> {
int row;
int col;
Set<Integer> options;
public Cell(int row, int col, Set<Integer> options) {
super();
this.row = row;
this.col = col;
this.options = options;
}
@Override
public int compareTo(Cell o) {
if (this.options.size() != o.options.size()) {
return this.options.size() - o.options.size();
}
if (this.row != o.row) {
return this.row - o.row;
}
return this.col - o.col;
}
@Override
public String toString() {
return "[row=" + row + ", col=" + col + ", options=" + options + "]";
}
}
public static Set<Integer> availableNumbers(int[][] arr, int row, int col) {
Set<Integer> set = new HashSet<>();
if (arr[row][col] != 0) {
// 已填充
return set;
}
set.addAll(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));
// 同一行不能有相同的
for (int a : arr[row]) {
if (a != 0) {
set.remove(a);
}
}
// 同一列不能有相同的
for (int i = 0; i < arr[0].length; i++) {
int num = arr[i][col];
if (num != 0) {
set.remove(num);
}
}
// 同一个宫里不能有相同的
int startRow = (row / 3) * 3;
int startCol = (col / 3) * 3;
for (int i = startRow; i < startRow + 3; i++) {
for (int j = startCol; j < startCol + 3; j++) {
set.remove(arr[i][j]);
}
}
return set;
}
// 返回填充的个数
private static int fillUnique(int[][] arr, List<Cell> sortedCells) {
int uniqueNumbers = 0;
Map<Position, Cell> map = new HashMap<>();
while (true) {
int found = 0;
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
if (arr[i][j] == 0){
Set<Integer> nums = availableNumbers(arr, i, j);
if (nums.size() == 1) {
arr[i][j] = nums.iterator().next();
System.out.println("填充行:" + (i + 1) + ",列:" + (j + 1) + ",值为:" + arr[i][j]);
found++;
}
map.put(new Position(i,j), new Cell(i,j, nums));
}
}
}
if (found == 0) {
break;
}
uniqueNumbers += found;
}
for(Entry<Position, Cell> kv : map.entrySet()) {
sortedCells.add(kv.getValue());
}
Collections.sort(sortedCells);
return uniqueNumbers;
}
private static boolean tryFill(int[][] arr, int row, int col){
Set<Integer> options = null;
if(arr[row][col] == 0){
options = availableNumbers(arr, row, col);
}
//最后一个元素
if(row==arr.length-1 && col==arr[0].length-1){
if(options==null) {
return true;
}
if(options.size()>0){
arr[row][col] = options.iterator().next();
return true;
}
return false;
}
int nextCol = col + 1;
int nextRow = row;
if(nextCol >= arr[0].length){
nextCol = 0;
nextRow ++;
}
if(arr[row][col] != 0){
//已填充,填充下一个
return tryFill(arr, nextRow, nextCol);
}
//未填充,没有可选项
if(options.isEmpty()){
return false;
}
for(Integer option : options){
arr[row][col] = option;
boolean result = tryFill(arr, nextRow, nextCol);
if(result){
return result;
}
}
//还原
arr[row][col] = 0;
return false;
}
private static boolean tryFill(int[][] arr){
return tryFill(arr, 0, 0);
}
private static int missingNumbers(int[][] arr) {
int missing = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[0].length; j++) {
if (arr[i][j] == 0) {
missing++;
}
}
}
return missing;
}
public static void main(String[] args) {
int[][] arr = new int[][] {
// {0, 6, 0, 0, 1, 0, 0, 7, 0},//1
// {0, 7, 3, 0, 0, 4, 1, 0, 0},//2
// {8, 0, 0, 0, 6, 0, 9, 0, 0}, //3
// {3, 0, 0, 0, 5, 1, 0, 0, 2}, //4
// {0, 9, 0, 2, 0, 6, 0, 0, 7}, //5
// {0, 0, 6, 0, 0, 0, 8, 1, 0}, //6
// {0, 0, 2, 6, 0, 0, 4, 0, 1},//7
// {1, 8, 0, 9, 2, 0, 0, 0, 0}, //8
// {6, 0, 0, 0, 0, 0, 0, 5, 9}, //9
{0, 2, 0, 0, 5, 0, 0, 0, 1},//1
{3, 0, 0, 7, 9, 0, 8, 0, 0},//2
{0, 8, 4, 0, 0, 0, 3, 0, 0}, //3
{0, 0, 0, 0, 0, 1, 0, 7, 2}, //4
{4, 0, 0, 0, 0, 5, 0, 0, 0}, //5
{0, 7, 6, 0, 0, 0, 0, 0, 0}, //6
{6, 0, 2, 0, 0, 0, 0, 1, 0},//7
{0, 4, 0, 0, 0, 0, 0, 0, 3}, //8
{0, 3, 0, 1, 0, 0, 0, 0, 0}, //9
};
System.out.println("没有确定的个数:" + missingNumbers(arr));
// 先把哪些能唯一确定的空添上
List<Cell> sortedOptions = new ArrayList<>();
int uniqueNumbers = fillUnique(arr, sortedOptions);
System.out.println("唯一确定的个数:" + uniqueNumbers);
System.out.println("剩余没有确定的个数:" + missingNumbers(arr));
System.out.println("顺序考虑元素");
// for (Cell o : sortedOptions) {
// System.out.println(o);
// }
boolean result = tryFill(arr);
if(!result){
System.out.println("Failed to try fill");
return;
}
for(int[] row : arr) {
System.out.println(Arrays.toString(row));
}
}
}
| [
"swiftma@sina.com"
] | swiftma@sina.com |
3cd96225bd6debd5fef3dd29c04404d66f2aac03 | c7ff3b60022aa8c39c4fe21db09d4ff165323983 | /src/main/java/com/example/train/dao/BookDao.java | b41c84bebf7ddebf4ddede91580c611befad3a72 | [] | no_license | Aisw/OnlineTraining | a6faa907a61dfcd4822bff521e3441b6548c9144 | e270886384523162affccab7023b3194d8a47107 | refs/heads/master | 2023-06-17T17:04:27.694653 | 2021-07-17T09:10:04 | 2021-07-17T09:10:04 | 386,885,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package com.example.train.dao;
import com.example.train.pojo.Book;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.stereotype.Repository;
import java.sql.Date;
import java.util.List;
@Repository
public interface BookDao {
/**
* 获取电子书列表
* @return
*/
List<Book> selectAll();
// /**
// * 根据id查询电子书
// * @param id
// * @return
// */
// Book selectById(Integer id);
/**
* 根据名称和时间模糊查询
* @param name
* @param time
* @return
*/
List<Book> selectByNameAndTime(String name,String time);
/**
* 添加电子书
* @param book
* @return
*/
boolean insertBook(Book book);
/**
* 通过id删除电子书
* @param id
* @return
*/
boolean deleteBookById(Integer id);
/**
* 修改电子书
* @param book
* @return
*/
Integer updateBook(Book book);
/**
* 根据id获取文件路径
* @param id
* @return
*/
String selectPathById(Integer id);
/**
* 通过文件id查询绑定的电子书
* @param docId
* @return
*/
List<Book> selectByDocId(Integer docId);
}
| [
"1493881416@qq.com"
] | 1493881416@qq.com |
f66610317076aa1f095106046acc070cd9a7059a | b60db6d5b65796710ba0e7e3caaec9fed244f4e8 | /OSalesSystem/src/cn/zying/osales/service/stocks/imples/StockReturnServiceImple.java | c9a1fd272d40c04dc0aa4e42116831d1002c9b21 | [] | no_license | pzzying20081128/OSales_System | cb5e56ed9d096bfb3f3915bd280732f5f16ffb3b | ed5a1cd53c68460653f82c2c6bdff24bea5db9e4 | refs/heads/master | 2021-01-10T04:47:46.861972 | 2016-01-23T17:33:59 | 2016-01-23T17:33:59 | 50,175,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,075 | java | package cn.zying.osales.service.stocks.imples ;
import java.util.List ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Qualifier ;
import org.springframework.stereotype.Component ;
import cn.zy.apps.tools.units.CommSearchBean ;
import cn.zy.apps.tools.web.SelectPage ;
import cn.zying.osales.OSalesConfigProperties.OptType ;
import cn.zying.osales.pojos.StockReturn ;
import cn.zying.osales.service.ABCommonsService ;
import cn.zying.osales.service.SystemOptServiceException ;
import cn.zying.osales.service.stocks.IStockReturnService ;
import cn.zying.osales.service.stocks.units.StockReturnCheckUnits ;
import cn.zying.osales.service.stocks.units.StockReturnRemoveUnits ;
import cn.zying.osales.service.stocks.units.StockReturnSaveUpdateUnits ;
import cn.zying.osales.service.stocks.units.StockReturnSearchUnits ;
import cn.zying.osales.units.search.bean.StockReturnSearchBean ;
@Component(IStockReturnService.name)
public class StockReturnServiceImple extends ABCommonsService implements IStockReturnService {
//@Resource(name="StockReturnSearchUnits")
@Autowired
@Qualifier("StockReturnSearchUnits")
private StockReturnSearchUnits iStockReturnSearchUnits ;
@Autowired
@Qualifier("StockReturnCheckUnits")
private StockReturnCheckUnits iStockReturnCheckUnits ;
//@Resource(name=" StockReturnSaveUpdateUnits")
@Autowired
@Qualifier("StockReturnSaveUpdateUnits")
private StockReturnSaveUpdateUnits iStockReturnSaveUpdateUnits ;
@Autowired
@Qualifier("StockReturnRemoveUnits")
private StockReturnRemoveUnits iStockReturnRemoveUnits ;
@Override
public StockReturn saveUpdate(OptType optType, StockReturn optStockReturn, int optUserId) throws SystemOptServiceException {
optStockReturn.setRecordManId(optUserId) ;
return iStockReturnSaveUpdateUnits.saveUpdate(optType, optStockReturn) ;
}
@Override
public SelectPage<StockReturn> search(OptType optType, StockReturnSearchBean searchBean, CommSearchBean commSearchBean, int... startLimit) throws SystemOptServiceException {
return iStockReturnSearchUnits.search(optType, searchBean, commSearchBean, startLimit) ;
}
@Override
public List<StockReturn> searchList(OptType optType, StockReturnSearchBean searchBean, CommSearchBean commSearchBean, int... startLimit) throws SystemOptServiceException {
return iStockReturnSearchUnits.list(optType, searchBean, commSearchBean, startLimit) ;
}
@Override
public StockReturn remove(OptType optType, StockReturn optStockReturn) throws SystemOptServiceException {
return iStockReturnRemoveUnits.remove(optType, optStockReturn) ;
}
@Override
public StockReturn get(Integer id) throws SystemOptServiceException {
return baseService.get(id, StockReturn.class) ;
}
@Override
public void check(Integer stockReturnId, int optUser) throws SystemOptServiceException {
iStockReturnCheckUnits.check(stockReturnId, optUser) ;
}
}
| [
"pzzying20081128@163.com"
] | pzzying20081128@163.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.