blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41f4e1e037fd42711a7ba8d01da8ceec9785c2fa | 4a82776d4aceaadf629eba5a4310d393f08fe1fb | /ms-authentication/src/test/java/com/mediscreen/msauthentication/model/JwtTest.java | 55864f546dd354f1ee875dfb4b7200d557f2d569 | [] | no_license | bamamoudou/medis-projectMB | 0acc94dbbaf53abeda6c4f1825406b30987e33c4 | d46bf656f7388e92b6864bd71e5c2461c547d613 | refs/heads/master | 2023-04-04T05:15:35.717929 | 2021-04-09T13:43:30 | 2021-04-09T13:43:30 | 349,380,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | package com.mediscreen.msauthentication.model;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import java.time.LocalDateTime;
import static org.assertj.core.api.Assertions.assertThat;
class JwtTest {
private Jwt jwt;
private LocalDateTime generationDate = LocalDateTime.now();
private LocalDateTime expirationDate = LocalDateTime.now();
@BeforeEach
void init_test(){
jwt = new Jwt("token", generationDate, expirationDate);
}
@Tag("JwtTest")
@Test
void get_test(){
assertThat(jwt.getToken()).isEqualTo("token");
assertThat(jwt.getGenerationDate()).isEqualTo(generationDate);
assertThat(jwt.getExpirationDate()).isEqualTo(expirationDate);
}
@Tag("JwtTest")
@Test
void set_test(){
assertThat(jwt.getToken()).isEqualTo("token");
assertThat(jwt.getGenerationDate()).isEqualTo(generationDate);
assertThat(jwt.getExpirationDate()).isEqualTo(expirationDate);
LocalDateTime newGenerationDate = LocalDateTime.now();
LocalDateTime newExpirationDate = LocalDateTime.now();
jwt.setToken("newToken");
jwt.setGenerationDate(newGenerationDate);
jwt.setExpirationDate(newExpirationDate);
assertThat(jwt.getToken()).isEqualTo("newToken");
assertThat(jwt.getGenerationDate()).isEqualTo(newGenerationDate);
assertThat(jwt.getExpirationDate()).isEqualTo(newExpirationDate);
}
} | [
"mamoudouba8787@gmail.com"
] | mamoudouba8787@gmail.com |
5bb37b3a7da7fdf417fa5d365ad5993c225ea707 | 323df4e6b3bae1f524efca2d2616f3e41fe07f02 | /cp/src/main/java/cp/composition/FourVoiceComposition.java | cde04bbfd9fd2eb7830bdff5cf377c0cdb7771ae | [] | no_license | patrom/cp | 8fa9ca317567409e4c4cb6032da921dd6310db5d | 497665eb8b8d9a56639f9be72e4d890b82b08e40 | refs/heads/master | 2022-09-15T06:03:44.739116 | 2020-09-26T08:29:23 | 2020-09-26T08:29:23 | 41,491,861 | 2 | 0 | null | 2022-09-01T22:20:24 | 2015-08-27T14:34:22 | Java | UTF-8 | Java | false | false | 7,833 | java | package cp.composition;
import cp.model.melody.MelodyBlock;
import cp.model.melody.Operator;
import cp.model.rhythm.DurationConstants;
import cp.nsga.operator.relation.OperatorRelation;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
/**
* Created by prombouts on 18/10/2016.
*/
@Component(value="fourVoiceComposition")
@ConditionalOnProperty(name = "composition.voices", havingValue = "4")
public class FourVoiceComposition extends Composition {
@PostConstruct
public void initInstruments(){
if(instrumentConfig.getSize() < 4){
throw new IllegalStateException("Set instrument config to correct instrument");
}
instrument1 = instrumentConfig.getInstrumentForVoice(voice0);
instrument2 = instrumentConfig.getInstrumentForVoice(voice1);
instrument3 = instrumentConfig.getInstrumentForVoice(voice2);
instrument4 = instrumentConfig.getInstrumentForVoice(voice3);
}
public List<MelodyBlock> canonA3(){
List<MelodyBlock> melodyBlocks = new ArrayList<>();
// cello.setKeySwitch(new KontactStringsKeySwitch());
MelodyBlock melodyBlock = melodyGenerator.generateMelodyBlockConfig(voice0, instrument1.pickRandomOctaveFromRange());
melodyBlocks.add(melodyBlock);
MelodyBlock melodyBlock4 = melodyGenerator.generateMelodyBlockConfig(voice3, instrument4.pickRandomOctaveFromRange());
melodyBlocks.add(melodyBlock4);
MelodyBlock melodyBlock2 = melodyGenerator.generateEmptyBlock(instrument2, voice1);
melodyBlock2.setMutable(false);
melodyBlocks.add(melodyBlock2);
OperatorRelation operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice3);
operatorRelation.setTarget(voice1);
operatorRelation.setSteps(5);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.HALF);
operatorConfig.addOperatorRelations(operatorRelation::execute);
MelodyBlock melodyBlock3 = melodyGenerator.generateEmptyBlock(instrument3, voice2);
melodyBlock3.setMutable(false);
melodyBlocks.add(melodyBlock3);
operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice3);
operatorRelation.setTarget(voice2);
operatorRelation.setSteps(0);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(getTimeConfig().getOffset());
operatorConfig.addOperatorRelations(operatorRelation::execute);
return melodyBlocks;
}
public List<MelodyBlock> canonA4(){
List<MelodyBlock> melodyBlocks = new ArrayList<>();
MelodyBlock melodyBlock = melodyGenerator.generateMelodyBlockConfig(voice0, instrument1.pickRandomOctaveFromRange());
melodyBlocks.add(melodyBlock);
MelodyBlock melodyBlock2 = melodyGenerator.generateEmptyBlock(instrument2, voice1);
melodyBlock2.setMutable(false);
melodyBlocks.add(melodyBlock2);
OperatorRelation operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice0);
operatorRelation.setTarget(voice1);
operatorRelation.setSteps(1);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.HALF);
operatorConfig.addOperatorRelations(operatorRelation::execute);
MelodyBlock melodyBlock3 = melodyGenerator.generateEmptyBlock(instrument3, voice2);
melodyBlock3.setMutable(false);
melodyBlocks.add(melodyBlock3);
operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice0);
operatorRelation.setTarget(voice2);
operatorRelation.setSteps(2);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.HALF + DurationConstants.QUARTER);
operatorConfig.addOperatorRelations(operatorRelation::execute);
MelodyBlock melodyBlock4 = melodyGenerator.generateEmptyBlock(instrument4, voice3);
melodyBlock4.setMutable(false);
melodyBlocks.add(melodyBlock4);
operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice0);
operatorRelation.setTarget(voice3);
operatorRelation.setSteps(3);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.WHOLE);
operatorConfig.addOperatorRelations(operatorRelation::execute);
return melodyBlocks;
}
public List<MelodyBlock> doubleCanon(){
List<MelodyBlock> melodyBlocks = new ArrayList<>();
MelodyBlock melodyBlock = melodyGenerator.generateMelodyBlockConfig(voice0, instrument1.pickRandomOctaveFromRange());
melodyBlocks.add(melodyBlock);
MelodyBlock melodyBlock2 = melodyGenerator.generateMelodyBlockConfig(voice1, instrument2.pickRandomOctaveFromRange());
melodyBlocks.add(melodyBlock2);
MelodyBlock melodyBlock3 = melodyGenerator.generateEmptyBlock(instrument3, voice2);
melodyBlock3.setMutable(false);
melodyBlocks.add(melodyBlock3);
OperatorRelation operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice0);
operatorRelation.setTarget(voice2);
operatorRelation.setSteps(4);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.HALF);
operatorConfig.addOperatorRelations(operatorRelation::execute);
MelodyBlock melodyBlock4 = melodyGenerator.generateEmptyBlock(instrument4, voice3);
melodyBlock4.setMutable(false);
melodyBlocks.add(melodyBlock4);
operatorRelation = new OperatorRelation(Operator.T_RELATIVE);
operatorRelation.setSource(voice1);
operatorRelation.setTarget(voice3);
operatorRelation.setSteps(4);
operatorRelation.setTimeLine(timeLine);
operatorRelation.setOffset(DurationConstants.HALF);
operatorConfig.addOperatorRelations(operatorRelation::execute);
return melodyBlocks;
}
/**
* Voice 0: homophonicVoice
* Voice 1: homophonicVoice
* Voice 2: homophonicVoice
* Voice 3: melody
* @return melodies
*/
public List<MelodyBlock> allRandom(){
List<MelodyBlock> melodyBlocks = new ArrayList<>();
MelodyBlock melodyBlock = melodyGenerator.generateMelodyBlockConfig(voice0);
melodyBlocks.add(melodyBlock);
MelodyBlock melodyBlock2 = melodyGenerator.generateMelodyBlockConfig(voice1);
melodyBlocks.add(melodyBlock2);
MelodyBlock melodyBlock3 = melodyGenerator.generateMelodyBlockConfig(voice2);
melodyBlocks.add(melodyBlock3);
MelodyBlock melodyBlock4 = melodyGenerator.generateMelodyBlockConfig(voice3);
melodyBlocks.add(melodyBlock4);
return melodyBlocks;
}
public List<MelodyBlock> compositionMap(){
List<MelodyBlock> melodyBlocks = new ArrayList<>();
MelodyBlock melodyBlock = melodyGenerator.pickMelodies(voice0);
melodyBlocks.add(melodyBlock);
MelodyBlock melodyBlock2 = melodyGenerator.pickMelodies(voice1);
melodyBlocks.add(melodyBlock2);
MelodyBlock melodyBlock3 = melodyGenerator.pickMelodies(voice2);
melodyBlocks.add(melodyBlock3);
MelodyBlock melodyBlock4 = melodyGenerator.pickMelodies(voice3);
melodyBlocks.add(melodyBlock4);
return melodyBlocks;
}
public List<MelodyBlock> harmonize(){
return super.harmonize();
}
}
| [
"patrik.rombouts@telenet.be"
] | patrik.rombouts@telenet.be |
2b69cac1707f00ea83bd203296693d1c6c843569 | 0d6ec0475c506622495f5064ac74d6ae1f113d0f | /src/main/java/org/example/java/functionalinterface/SupplierExample.java | 4ce95b1a62509b9c1b0ba3dcc1543593e37ef6bb | [] | no_license | devarabad/java-8-features | 236fae5093c5b20e90da20ca37f2c9462e880aff | 1f58b4a34f001d97f9d6cf81602b669fec0a6357 | refs/heads/master | 2023-03-27T01:49:21.234968 | 2021-03-30T06:49:05 | 2021-03-30T06:49:05 | 346,178,538 | 0 | 0 | null | 2021-03-30T06:49:06 | 2021-03-10T00:00:53 | Java | UTF-8 | Java | false | false | 414 | java | package org.example.java.functionalinterface;
import java.util.function.Supplier;
/**
* @see java.util.function.Supplier
*/
public class SupplierExample
{
public static void main(String[] args)
{
/**
* Basic Usage
*/
Supplier<String> supplier = () ->
{
return "Hello World! This is java8";
};
String result = supplier.get();
System.out.println(result);
}
}
| [
"dev.arabad@gmail.com"
] | dev.arabad@gmail.com |
e893d59a2347700792177bfd386b4fabbf9e19ad | a38729e361d77bf3c4888904974bae7125910567 | /src/main/java/hello/core/discount/RateDiscountPolicy.java | 59823d5d92d052504badc2fb51dacd573cb4ad39 | [] | no_license | asdzxc9395/spring-core | c9b15287748585da4ee50f15c6d9ac2f3791acc0 | 97b2a83010ecee4eb3d9f4d2f515983c910f23a0 | refs/heads/main | 2023-06-28T02:43:42.460131 | 2021-07-23T07:47:03 | 2021-07-23T07:47:03 | 382,983,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package hello.core.discount;
import hello.core.member.Grade;
import hello.core.member.Member;
public class RateDiscountPolicy implements DiscountPolicy{
private int discountPercent = 10;
@Override
public int discount(Member member, int price) {
if(member.getGrade() == Grade.VIP) {
return price * discountPercent / 100;
} else {
return 0;
}
}
}
| [
"asdzxc9395@naver.com"
] | asdzxc9395@naver.com |
45ad13d2660520ba214ddca87cbddf7b3aed3a08 | 9245582ebf4a03285996b6dd6fb1aa17d5bec1a1 | /EasyFactory/src/operation/DivOperation.java | a11dff99613973090844c4874fecc685b5cbfe22 | [] | no_license | hzm121/TalkDesignPattern | 79181911df59b264b30cd335f1792586fbcfe6fe | 22d81821802aa8fbbbf5d93e48119180d4bb7565 | refs/heads/master | 2020-08-12T21:39:11.835452 | 2019-10-13T16:26:53 | 2019-10-13T16:26:53 | 214,847,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | package operation;
public class DivOperation extends Operation {
@Override
public double getResult() {
if (getNumberB() == 0)
throw new ArithmeticException("除数不能为0");
return getNumberA()/getNumberB();
}
}
| [
"2696333036@qq.com"
] | 2696333036@qq.com |
0c5b266b4dd0527b809d2c4483df6dac2f1cd22c | 007d752575644dd0bd74ed46b57187fd6b53ad66 | /app/src/main/java/com/metis/meishuquan/model/provider/ApiCallbackRunner.java | 98c59dbd9c65047df751134c0c04d332039627ac | [] | no_license | metisfe/MeiShuQuanAndroid | 037c1cf08fda1038711b6ec31265545793dd12e9 | 1e85d94cb22f4c412833bbeb752430cc3aff6e70 | refs/heads/master | 2020-05-29T16:50:38.368646 | 2015-07-22T10:48:26 | 2015-07-22T10:48:26 | 32,312,823 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,552 | java | package com.metis.meishuquan.model.provider;
/**
* Created by wudi on 3/15/2015.
*/
public final class ApiCallbackRunner implements Runnable
{
private ApiAsyncHandler<?> apiAsyncHandler;
private ProviderRequestHandler<?> requestHandler;
public ApiCallbackRunner(ProviderRequestHandler<?> requestHandler)
{
this.requestHandler = requestHandler;
}
public ApiCallbackRunner(ApiAsyncHandler<?> apiAsyncHandler)
{
this.apiAsyncHandler = apiAsyncHandler;
}
@Override
public void run()
{
if ((this.apiAsyncHandler == null || this.apiAsyncHandler.ProviderRequestHandler == null) && this.requestHandler == null)
{
//"AsyncCallbackRunner can't execute in UI Thread due to either AsyncHandler or AsyncHandler.ProviderReqeustHandler or RequestHandler is null");
return;
}
if (this.requestHandler != null)
{
//"Invoke this.requestHandler.loadComplete() for postProcess in UIThread");
this.requestHandler.loadComplete();
}
else
{
if (this.apiAsyncHandler.customizedUIRunner != null)
{
//"Invoke this.apiAsyncHandler.customizedUIRunner.run() for postProcess in UIThread");
this.apiAsyncHandler.customizedUIRunner.run();
}
//"Invoke this.apiAsyncHandler.customizedUIRunner.loadComplete() for postProcess in UIThread");
this.apiAsyncHandler.ProviderRequestHandler.loadComplete();
}
}
} | [
"wudi@microsoft.com"
] | wudi@microsoft.com |
ea1a98a392d986b7aa95cdd595c6eb6f2a935eed | e2b85c9455a01a4adf6fad008f90763ce71625ea | /domain/src/main/java/com/valtech/digitalFoosball/domain/common/exceptions/ErrorMessage.java | 32372946be93ab221dbba230c0a0481c34b94581 | [] | no_license | IljaWeber/digitalFoosballPresentation | b9fcd744e86a15b4f25f2b2bc624beca81ad7299 | 17c9e280ccf070566371a5c3ef67bc926b9a282e | refs/heads/main | 2023-01-22T14:56:49.792116 | 2020-12-08T12:41:26 | 2020-12-08T12:41:26 | 319,350,219 | 0 | 0 | null | 2020-12-08T12:41:27 | 2020-12-07T14:45:55 | Java | UTF-8 | Java | false | false | 660 | java | package com.valtech.digitalFoosball.domain.common.exceptions;
import java.util.Date;
public class ErrorMessage {
private Date timestamp;
private String errorMessage;
public ErrorMessage(Date timestamp, String errorMessage) {
this.timestamp = timestamp;
this.errorMessage = errorMessage;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}
| [
"maximilian.huber@valtech.com"
] | maximilian.huber@valtech.com |
cd6755385765c4c5018a7b74a54b0fb7ac940990 | 799a6d3c21608548cd83b24b2d361201be51ea8e | /src/main/java/com/qfedu/SpringbootUploadFastdfsApplication.java | e275ca25dcff0d6441b20d8007c9aec8246d8548 | [] | no_license | longhuiming1999/springboot_upload_fastdfs | fec9801fd812b8a7eb64699edc4af827ea9be6ae | 9857fe5072702e42c66ba306a6a32b837637b7cc | refs/heads/master | 2022-10-01T09:26:40.529970 | 2020-06-08T11:19:03 | 2020-06-08T11:19:03 | 270,639,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package com.qfedu;
import com.github.tobato.fastdfs.FdfsClientConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
@SpringBootApplication(scanBasePackages = "com.qfedu")
@Import(FdfsClientConfig.class)
public class SpringbootUploadFastdfsApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootUploadFastdfsApplication.class, args);
}
}
| [
"longhuiming0122@aliyun.com"
] | longhuiming0122@aliyun.com |
f2f9498083fad8216554d407a9fac1015301fed9 | ba494f88f56cb320b22a25a626184eb4f30b950e | /src/main/java/backtest/struct/ArrayMap.java | 461cb87ce1a6c1de35b634e05f3e5be3d5cb7e98 | [] | no_license | zhuomingli000/autots | 5a31e87115dac1f736ded982c92a02eb05728a5e | e1f3a28b3edd346e4ecd77237a2da3e0d9674922 | refs/heads/master | 2022-09-06T13:07:02.414785 | 2020-02-24T07:26:27 | 2020-02-24T07:26:27 | 242,465,452 | 0 | 0 | null | 2022-09-01T23:20:29 | 2020-02-23T06:00:49 | Java | UTF-8 | Java | false | false | 4,138 | java | package backtest.struct;
import backtest.utils.Util;
import java.util.*;
public class ArrayMap<K extends Comparable<? super K>, V> {
class Entry<EntryKey, EntryValue> implements Map.Entry<EntryKey, EntryValue> {
private EntryKey k;
private EntryValue v;
public Entry(EntryKey k, EntryValue v) {
this.k = k;
this.v = v;
}
public Entry(Map.Entry<EntryKey, EntryValue> entry) {
this.k = entry.getKey();
this.v = entry.getValue();
}
@Override
public EntryKey getKey() {
return k;
}
@Override
public EntryValue getValue() {
return v;
}
@Override
public EntryValue setValue(EntryValue newValue) {
EntryValue oldValue = v;
v = newValue;
return oldValue;
}
@Override
public boolean equals(Object o) {
if (o == null) return false;
if (!(o instanceof Map.Entry))
return false;
Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
return (k == null ? e.getKey() == null : k.equals(e.getKey())) &&
(v == null ? e.getValue() == null : v.equals(e.getValue()));
}
public String toString() {
return k + ": " + v;
}
}
private class EntrySet extends AbstractSet<Map.Entry<K, V>> {
@Override
public Iterator<Map.Entry<K, V>> iterator() {
return list.iterator();
}
@Override
public int size() {
return ArrayMap.this.size();
}
}
private class EntryComparator implements Comparator<Map.Entry<K, V>> {
@Override
public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2) {
return o1.getKey().compareTo(o2.getKey());
}
}
protected List<Map.Entry<K, V>> list;
private EntrySet entrySet;
protected EntryComparator entryComparator;
public ArrayMap() {
list = new ArrayList<>();
entrySet = new EntrySet();
entryComparator = new EntryComparator();
}
public ArrayMap(ArrayMap<K, V> arrayMap) {
entrySet = new EntrySet();
entryComparator = new EntryComparator();
for (Map.Entry<K, V> entry : arrayMap.entrySet()) {
list.add(new Entry<>(entry));
}
}
public ArrayMap<K, V> put(K key, V val) {
if (val != null && key != null)
list.add(new Entry<>(key, val));
return this;
}
public Map.Entry<K, V> getEntry(int i) {
return list.get(i);
}
public int size() {
return list.size();
}
public Set<Map.Entry<K, V>> entrySet() {
return entrySet;
}
public void sortByKey() {
Collections.sort(list, entryComparator);
}
public V lastValue() {
if (size() == 0) throw new NoSuchElementException();
return list.get(list.size() - 1).getValue();
}
public K lastKey() {
if (size() == 0) throw new NoSuchElementException();
return list.get(list.size() - 1).getKey();
}
public V firstValue() {
if (size() == 0) throw new NoSuchElementException();
return list.get(0).getValue();
}
public K firstKey() {
if (size() == 0) throw new NoSuchElementException();
return list.get(0).getKey();
}
/**
* Simply check equality of elements one by one. Therefore need to sort beforehand explicitly.
*/
public boolean equals(ArrayMap<K, V> map) {
if (this.size() != map.size()) return false;
Set<Map.Entry<K, V>> thisSet = this.entrySet();
Set<Map.Entry<K, V>> otherSet = map.entrySet();
Iterator<Map.Entry<K, V>> thisIt = thisSet.iterator();
Iterator<Map.Entry<K, V>> otherIt = otherSet.iterator();
while (thisIt.hasNext() && otherIt.hasNext()) {
if (!thisIt.next().equals(otherIt.next())) return false;
}
return true;
}
public void print() {
Util.printColl(list);
}
public Iterator<Map.Entry<K, V>> iterator() {
return list.iterator();
}
public V getValue(int i) {
if (i >= 0 && i < size()) return list.get(i).getValue();
return null;
}
public void setValue(int i, V v) {
if (i >= 0 && i < size()) list.get(i).setValue(v);
}
public K getKey(int i) {
if (i>=0 && i < size()) return list.get(i).getKey();
return null;
}
public void removeFirst() {
if (!list.isEmpty()) list.remove(0);
}
} | [
"zhuomingli@Zhuomings-MacBook-Pro.local"
] | zhuomingli@Zhuomings-MacBook-Pro.local |
8eca3ead85fc7fee0d8d842322b35305dd8d11bf | 576e7c4f4a06e67a5dfa5a9f51113801478529e0 | /src/test/java/by/epam/springbootmvc/SpringbootmvcApplicationTests.java | ed1dc1618d99de0c038e62d2d8ccefb067ef73b0 | [] | no_license | tarigor/spring-mvc-elearning | 82a918281a41b8b5aadf4e841ec4d228ed796ec6 | 4997c8a02f9d80e3847e77917344a24ba2aa61a9 | refs/heads/master | 2023-05-09T00:11:30.485924 | 2021-05-27T11:37:39 | 2021-05-27T11:37:39 | 371,235,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package by.epam.springbootmvc;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringbootmvcApplicationTests {
@Test
void contextLoads() {
}
}
| [
"tarigor80@gmail.com"
] | tarigor80@gmail.com |
1aa8606c4451ff23a5bfb342c8baa5d0f827c829 | c447dccc476cde0235ff1ba4f214e82d93101ea7 | /JYSystem_back/src/com/jy/service/dsix/imessage/ImessageService.java | 0614328f40595ae87f3cd562221c75916a52d8aa | [] | no_license | fensedaima/d6manager | 4a7edb71def0e7a0983c4573e71c1e2d3fc9dce7 | 2cc14481546d01e5e7430da0a0d1e9e48dfc262b | refs/heads/master | 2021-04-18T22:47:44.605102 | 2018-03-24T06:51:37 | 2018-03-24T06:51:37 | 126,571,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | package com.jy.service.dsix.imessage;
import com.jy.entity.dsix.imessage.Imessage;
import com.jy.service.base.BaseService;
public interface ImessageService extends BaseService<Imessage> {
}
| [
"435100493@qq.com"
] | 435100493@qq.com |
2b3d916e3b70051757a133bb9a67c092f0864372 | 7970947265730da937805629e66cf60d4b553e9c | /Simpyo/app/src/main/java/simpyo/simpyo/Activity/ReportMyListActivity.java | bdcdde777f4a6dfdb18ac0c85cae5ddd8ae9b7d6 | [] | no_license | MobileSeoul/2018seoul-70 | f64869c9e834c1bc337a9a613f3533ebdca57331 | 8513cb299218139e378844e05006a3a0a0f73d46 | refs/heads/master | 2020-04-11T22:04:54.812044 | 2018-12-17T14:31:08 | 2018-12-17T14:31:08 | 162,124,726 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,134 | java | package simpyo.simpyo.Activity;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import simpyo.simpyo.Fragment.MyTabPagerAdapter;
import simpyo.simpyo.R;
import simpyo.simpyo.Setting.FontChange;
import simpyo.simpyo.Setting.Setting;
public class ReportMyListActivity extends AppCompatActivity {
private TabLayout tabLayout;
private ViewPager viewPager;
private ImageView backBtn;
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_report_my_list);
setView();
setFont();
}
private void setView(){
//Initializing the TabLayout;
tabLayout = (TabLayout)findViewById(R.id.tabLayout);
tabLayout.addTab(tabLayout.newTab().setText("흡연신고"));
tabLayout.addTab(tabLayout.newTab().setText("사설신고"));
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
//Initializing ViewPager
viewPager = (ViewPager)findViewById(R.id.viewPager);
backBtn = (ImageView)findViewById(R.id.backBtn);
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
//Creating adapter
MyTabPagerAdapter pagerAdapter = new MyTabPagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
viewPager.setAdapter(pagerAdapter);
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
//Set TabSelectedListener
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
Setting.SMOKE_SWITCH = position;
Log.d(Setting.Tag,"SMOKE_SWITCH : "+position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@RequiresApi(api = Build.VERSION_CODES.O)
private void setFont() {
// 글로벌 폰트 변경
FontChange fontChange = new FontChange(getApplicationContext(), getWindow().getDecorView());
}
}
| [
"ianyrchoi@gmail.com"
] | ianyrchoi@gmail.com |
f2d8a337a8113d483ffcef4a9cbe2018f6be0c6d | 944cbdbe6a800ecf4b0b0bf0e38ce766c9c860fd | /Shape/Square.java | 32ed62be047eb36e0a01e76af7e6581be8f1ec9c | [] | no_license | mcihak/grk-java | 1a5793caf5bc528763d8f9e7c7b382536386582f | 74baa42c2edee87922e83299e178aa5b26e1ce44 | refs/heads/master | 2021-01-15T11:18:50.282833 | 2017-06-16T14:03:36 | 2017-06-16T14:03:36 | 6,827,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 813 | java | public class Square extends Rectangle {
public Square() {
super();
}
public Square(double _side) {
super(_side, _side);
}
public Square(double _side, String _color, boolean _filled) {
super(_side, _side, _color, _filled);
}
public double getSide() {
return width;
}
public void setSide(double _side) {
width = _side;
length = _side;
}
public void setWidth(double _side) {
width = _side;
length = _side;
}
public void setLength(double _side) {
width = _side;
length = _side;
}
public String toString() {
String filledString = null;
if (filled)
filledString = "Filled";
else
filledString = "Non-filled";
return filledString + " square colored " + color + " of side " + String.valueOf(width);
}
} | [
"mcihak@post.cz"
] | mcihak@post.cz |
2d42a76982dfbc2d085e59bbfc224bcb2cf12b7a | 1b70b57b794182eaba3ea2ec1d704c927d210db7 | /lab1/HelloWorld.java | d51b33173275895d1cdb2531d758d2656402218c | [] | no_license | magickey111/CS61B-SP18 | 79eb000df66372f3897aa674f6048b4bfe7c1a9e | f6900650be342218535d2d1cb899b8b86ec247a1 | refs/heads/master | 2021-03-07T23:28:59.034704 | 2020-03-21T13:52:53 | 2020-03-21T13:52:53 | 246,303,429 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | public class HelloWorld{
public static void main(String[] args) {
System.out.println(5 + 10);
}
} | [
"cxs_forever1@sina.com"
] | cxs_forever1@sina.com |
832831c498f70e356e639fa809c1ad77b60ef050 | 3798881ea72aad667e279e8bb779a6d775aec378 | /seata-account-service2003/src/main/java/com/achang/springcloud/SeataAccountMainApp2003.java | 97ead72b50eb73c79b71e15bac38454f537a7cc7 | [] | no_license | qq995931576/SpringCloudStudy | d7758f58a128c039af231beeb1de514c3800f76c | 19da0b1882d9c868628faf7c17563075d1321dfe | refs/heads/master | 2023-03-06T13:16:25.360767 | 2021-02-22T16:18:37 | 2021-02-22T16:18:37 | 341,251,868 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package com.achang.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/******
@author 阿昌
@create 2021-02-14 21:01
*******
*/
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableDiscoveryClient
@EnableFeignClients
public class SeataAccountMainApp2003 {
public static void main(String[] args) {
SpringApplication.run(SeataAccountMainApp2003.class, args);
}
}
| [
"69711899+qq995931576@users.noreply.github.com"
] | 69711899+qq995931576@users.noreply.github.com |
77e14ca56002e665d9a221354200806de95ba08b | 853071caecf75d460fa38247fe7acc7c285716c0 | /_site/plugins/com.abstratt.mdd.frontend.core/src/com/abstratt/mdd/frontend/core/builder/PackageBuilder.java | 63affa0a93e3539a29fc0767df9cf124070d4f48 | [] | no_license | clawplach/textuml | 76693fc6e7b29adc07a8f456923b833988dd04d6 | eb8904d758d99090761a971f2f9efec58e8911cf | refs/heads/master | 2021-01-18T06:06:28.852020 | 2014-07-18T00:53:34 | 2014-07-18T00:53:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,064 | java | package com.abstratt.mdd.frontend.core.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.URI;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.VisibilityKind;
import com.abstratt.mdd.core.IBasicRepository;
import com.abstratt.mdd.core.IRepository;
import com.abstratt.mdd.frontend.core.InternalProblem;
import com.abstratt.mdd.frontend.core.UnclassifiedProblem;
import com.abstratt.mdd.frontend.core.spi.IDeferredReference;
import com.abstratt.mdd.frontend.core.spi.IReferenceTracker;
public class PackageBuilder extends DefaultParentBuilder<Package> {
private List<NameReference> packagesImported = new ArrayList<NameReference>();
private List<NameReference> profilesApplied = new ArrayList<NameReference>();
private List<String> packagesLoaded = new ArrayList<String>();
public PackageBuilder(UML2ProductKind kind) {
super(kind);
}
public PackageBuilder applyProfile(String profileName) {
this.profilesApplied
.add(reference(profileName, UML2ProductKind.PROFILE));
return this;
}
public PackageBuilder importPackage(String packageName) {
this.packagesImported.add(reference(packageName,
UML2ProductKind.PACKAGE));
return this;
}
public ClassifierBuilder newClassifier(UML2ProductKind kind) {
return (ClassifierBuilder) newChildBuilder(kind);
}
@Override
protected Package createProduct() {
return getContext().getRepository().createTopLevelPackage(getName(),
getEClass());
}
@Override
protected void enhance() {
super.enhance();
loadPackages();
applyProfiles();
importPackages();
defineProfile();
}
private void loadPackages() {
for (final String packageURI : this.packagesLoaded) {
getContext().getReferenceTracker().add(new IDeferredReference() {
public void resolve(IBasicRepository repository) {
// TODO maybe allow package loading IBasicRepository to avoid casting
Package loaded = ((IRepository) repository).loadPackage(URI.createURI(packageURI));
if (loaded == null)
getContext().getProblemTracker().add(new UnclassifiedProblem("Could not load URI: '" + packageURI + "')"));
}
}, IReferenceTracker.Step.PACKAGE_IMPORTS);
}
}
private void importPackages() {
for (NameReference packageName : this.packagesImported)
new ReferenceSetter<Package>(packageName, getParentProduct(),
getContext(), IReferenceTracker.Step.PACKAGE_IMPORTS) {
@Override
protected void link(Package package_) {
if (!getProduct().getImportedPackages().contains(package_))
getProduct().createPackageImport(package_,
VisibilityKind.PRIVATE_LITERAL);
}
};
}
private void defineProfile() {
if (getProduct() instanceof Profile)
getContext().getReferenceTracker().add(new IDeferredReference() {
@Override
public void resolve(IBasicRepository repository) {
((Profile) getProduct()).define();
}
}, IReferenceTracker.Step.DEFINE_PROFILES);
}
private void applyProfiles() {
for (NameReference profileName : this.profilesApplied)
new ReferenceSetter<Profile>(profileName, getParentProduct(),
getContext(), IReferenceTracker.Step.PROFILE_APPLICATIONS) {
@Override
protected void link(Profile profile) {
if (!profile.isDefined())
getContext().getProblemTracker().add(
new InternalProblem("Profile '"
+ profile.getName() + "' not defined"));
else {
if (!getProduct().getAppliedProfiles().contains(profile))
getProduct().applyProfile(profile);
if (!getProduct().getImportedPackages().contains(profile))
getProduct().createPackageImport(profile,
VisibilityKind.PRIVATE_LITERAL);
}
}
};
}
public PackageBuilder load(String packageURI) {
this.packagesLoaded.add(packageURI);
return this;
}
public AssociationBuilder newAssociation() {
return newChildBuilder(UML2ProductKind.ASSOCIATION);
}
}
| [
"rafael@abstratt.com"
] | rafael@abstratt.com |
0492b87e0f348dfb013ae396b01998bda206ecc6 | 53293c89842dadcd437fbb8e9d3c066d6db25344 | /CloudStenography/pig-0.3.0/src/org/apache/pig/builtin/TextLoader.java | fff3a7dff08d9eae93879cc77ab7614a9cbce46b | [
"Apache-2.0"
] | permissive | rjurney/Cloud-Stenography | bc5d4a7169e86937b65c2096fc57dee0e9b78302 | d15e78c3763f04efd30b8bd21f3194d8a5b0d58c | refs/heads/master | 2016-09-11T03:21:56.855372 | 2010-06-24T02:57:46 | 2010-06-24T02:57:46 | 242,948 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,031 | 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.pig.builtin;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Map;
import org.apache.pig.ExecType;
import org.apache.pig.LoadFunc;
import org.apache.pig.PigException;
import org.apache.pig.backend.datastorage.DataStorage;
import org.apache.pig.backend.executionengine.ExecException;
import org.apache.pig.data.DataBag;
import org.apache.pig.data.DataByteArray;
import org.apache.pig.data.Tuple;
import org.apache.pig.data.TupleFactory;
import org.apache.pig.impl.io.BufferedPositionedInputStream;
import org.apache.pig.impl.logicalLayer.schema.Schema;
/**
* This load function simply creates a tuple for each line of text that has a single field that
* contains the line of text.
*/
public class TextLoader implements LoadFunc{
BufferedPositionedInputStream in;
final private static Charset utf8 = Charset.forName("UTF8");
long end;
private TupleFactory mTupleFactory = TupleFactory.getInstance();
public void bindTo(String fileName, BufferedPositionedInputStream in, long offset, long end) throws IOException {
this.in = in;
this.end = end;
// Since we are not block aligned we throw away the first
// record and count on a different instance to read it
if (offset != 0)
getNext();
}
public Tuple getNext() throws IOException {
if (in == null || in.getPosition() > end)
return null;
String line;
if ((line = in.readLine(utf8, (byte)'\n')) != null) {
if (line.length()>0 && line.charAt(line.length()-1)=='\r' && System.getProperty("os.name").toUpperCase().startsWith("WINDOWS"))
line = line.substring(0, line.length()-1);
return mTupleFactory.newTuple(new DataByteArray(line.getBytes()));
}
return null;
}
/**
* TextLoader does not support conversion to Boolean.
* @throws IOException if the value cannot be cast.
*/
public Boolean bytesToBoolean(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Boolean.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Integer
* @throws IOException if the value cannot be cast.
*/
public Integer bytesToInteger(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Integer.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Long
* @throws IOException if the value cannot be cast.
*/
public Long bytesToLong(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Long.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Float
* @throws IOException if the value cannot be cast.
*/
public Float bytesToFloat(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Float.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Double
* @throws IOException if the value cannot be cast.
*/
public Double bytesToDouble(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Double.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* Cast data from bytes to chararray value.
* @param b byte array to be cast.
* @return String value.
* @throws IOException if the value cannot be cast.
*/
public String bytesToCharArray(byte[] b) throws IOException {
return new String(b);
}
/**
* TextLoader does not support conversion to Map
* @throws IOException if the value cannot be cast.
*/
public Map<Object, Object> bytesToMap(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Map.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Tuple
* @throws IOException if the value cannot be cast.
*/
public Tuple bytesToTuple(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Tuple.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader does not support conversion to Bag
* @throws IOException if the value cannot be cast.
*/
public DataBag bytesToBag(byte[] b) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion to Bag.";
throw new ExecException(msg, errCode, PigException.BUG);
}
/**
* TextLoader doesn't make use of this.
*/
public void fieldsToRead(Schema schema) {}
/**
* TextLoader does not provide a schema.
*/
public Schema determineSchema(String fileName, ExecType execType,
DataStorage storage) throws IOException {
// TODO Auto-generated method stub
return null;
}
public byte[] toBytes(DataBag bag) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Bag.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(String s) throws IOException {
return s.getBytes();
}
public byte[] toBytes(Double d) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Double.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(Float f) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Float.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(Integer i) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Integer.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(Long l) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Long.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(Map<Object, Object> m) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Map.";
throw new ExecException(msg, errCode, PigException.BUG);
}
public byte[] toBytes(Tuple t) throws IOException {
int errCode = 2109;
String msg = "TextLoader does not support conversion from Tuple.";
throw new ExecException(msg, errCode, PigException.BUG);
}
}
| [
"peyomp@russell-jurneys-macbook-pro.local"
] | peyomp@russell-jurneys-macbook-pro.local |
548a55618a65945f9df3027c8a03ba6d7426ab6d | 21dc7a1f9aa4da0746edf830cd7a4b9cbb5d1a85 | /src/application/Main.java | a91fe63e8e186231d56f67ae40fb1d3ae28973ff | [] | no_license | swim1927/FamilyScheduler | 0862ce7bcfea16906ff8dc245c33410cea66fd19 | 35e885404d623514fd092f11c57249d1488eda46 | refs/heads/master | 2022-10-14T15:50:16.263410 | 2020-06-09T08:39:34 | 2020-06-09T08:39:34 | 270,941,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package application;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
AnchorPane root = new AnchorPane();
Scene scene = new Scene(root,1280,720);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
| [
"swim1927@snu.ac.kr"
] | swim1927@snu.ac.kr |
d514dddadc6205d9cdc8b8114dcac10f2b007ef6 | c5ccf3640e62fbde225040228fe5c5f8e4292108 | /src/main/java/demo/framework/common/PutRequestWithoutBody.java | 6ce9561dac4f24600e9e621c7dc5ccb19d402ca8 | [] | no_license | vikas089/TestAutomation | b9536dc40a5af6e98a56a4ecd76203e5c97f67b0 | ad8206659054512c75e66109b39aa229763eb091 | refs/heads/main | 2023-08-27T13:19:06.367631 | 2021-11-08T05:34:48 | 2021-11-08T05:34:48 | 425,711,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package demo.framework.common;
import com.aventstack.extentreports.Status;
import demo.utils.reports.ExtentTestManager;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import io.restassured.http.Headers;
import io.restassured.response.Response;
import org.apache.commons.io.output.WriterOutputStream;
import java.io.PrintStream;
import java.io.StringWriter;
import static io.restassured.filter.log.RequestLoggingFilter.logRequestTo;
public class PutRequestWithoutBody {
public static Response sendPutRequestWithoutBody(Headers headers, String url, ContentType contentType, String accept){
StringWriter writer = new StringWriter();
PrintStream captor = new PrintStream(new WriterOutputStream(writer), true);
Response response = RestAssured.given()
.contentType(contentType)
.headers(headers)
.accept(accept)
.filter(logRequestTo(captor))
.put(url);
ExtentTestManager.getTest().log(Status.INFO, writer.toString());
ExtentTestManager.getTest().log(Status.INFO, "Response status : " + response.statusCode());
return response;
}
}
| [
"93899642+vikas089@users.noreply.github.com"
] | 93899642+vikas089@users.noreply.github.com |
07e134d3866c4bf938715bf7a4293a73d0bd8c2f | 3f26aea515ee815b86cdd8c71f5764a695a5ceea | /cityLife/src/com/era/orm/NewsDetails.java | 21ac6743aa4574d98c6357eeee0da6e0acb556ed | [] | no_license | liveqmock/company | cd9373f980e3fc8fe379b4e206e2a708f3a07bdd | 0283ee8995115ac4f4b4579781ab7b424c6adb76 | refs/heads/master | 2021-01-14T09:29:03.830977 | 2014-08-30T19:12:01 | 2014-08-30T19:12:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,264 | java | package com.era.orm;
import java.util.List;
/**
* NewsDetails entity. @author MyEclipse Persistence Tools
*/
public class NewsDetails implements java.io.Serializable {
// Fields
private Integer id;
private Integer cityId;
private String title;
private String addtime;
private String author;
private Integer imagesId;
private String conent;
private String imgsList;
private Integer isHead;
// Constructors
/** default constructor */
public NewsDetails() {
}
/** full constructor */
public NewsDetails(Integer cityId, String title, String addtime, String author, Integer imagesId, String conent,Integer isHead) {
this.cityId = cityId;
this.title = title;
this.addtime = addtime;
this.author = author;
this.imagesId = imagesId;
this.conent = conent;
this.isHead = isHead;
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCityId() {
return this.cityId;
}
public void setCityId(Integer cityId) {
this.cityId = cityId;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAddtime() {
return this.addtime;
}
public void setAddtime(String addtime) {
this.addtime = addtime;
}
public String getAuthor() {
return this.author;
}
public void setAuthor(String author) {
this.author = author;
}
public Integer getImagesId() {
return this.imagesId;
}
public void setImagesId(Integer imagesId) {
this.imagesId = imagesId;
}
public String getConent() {
return this.conent;
}
public void setConent(String conent) {
this.conent = conent;
}
public String getImgsList() {
return imgsList;
}
public void setImgsList(String imgsList) {
this.imgsList = imgsList;
}
public Integer getIsHead() {
return isHead;
}
public void setIsHead(Integer isHead) {
this.isHead = isHead;
}
} | [
"215757815@qq.com"
] | 215757815@qq.com |
ff22c272f13811425519a2a5224cb0700f8b9e1f | 770ba756a8fb04f09df7e7981d50437c1755b4e1 | /app/src/main/java/scottie/cs301/EpicActuals/Resources/Cards/CardActuals/ConeOfAcid.java | 9f69d2d925e084f6d457503390b125afc2179aba | [] | no_license | elizmukai/EpicSpellWarsofBattleWizards | d1a36f8724b9a7f2d2b60b2db6df889ff25eee5e | c6504d11f07bd1e04ef728c52c821d805dc9cd99 | refs/heads/master | 2021-01-01T05:43:07.148418 | 2016-04-24T02:32:59 | 2016-04-24T02:32:59 | 56,882,704 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,375 | java | package scottie.cs301.EpicActuals.Resources.Cards.CardActuals;
import java.io.Serializable;
import scottie.cs301.EpicActuals.Resources.Cards.Card;
import scottie.cs301.EpicActuals.Resources.Info.GameStateActual;
import scottie.cs301.Imports.GameFramework.R;
/**
* Created by mukai18 on 4/12/2016.
*
* deals out damage based on die roll to player to the left and his left
*/
public class ConeOfAcid extends CardNode implements Serializable{
//to satisfy the Serializable interface
private static final long serialVersionUID = 3339755561382710158L;
protected ConeOfAcid() {
super(7, 4, 3, R.drawable.coneofacid, SCHOOL.ARCANE);
}
@Override
public void resolve(GameStateActual currentState, int[] spell, int myCasterNum) {
// finds the two foes to the left
int foeL = returnLeft(myCasterNum, currentState);
int foeR = returnRight(myCasterNum, currentState);
// rolls die and deals damage based on die roll
int roll = rollDie() * 2;
if(roll <= 4) {
damage(foeL, 1, currentState);
damage(foeR, 1, currentState);
}
else if(roll <= 9) {
damage(foeL, 2, currentState);
damage(foeR, 2, currentState);
}
else {
damage(foeL, 4, currentState);
damage(foeR, 4, currentState);
}
}
}
| [
"mukai18@up.edu"
] | mukai18@up.edu |
eb639c903d131256fa2bd2c67b50d92484da3dfb | 392e1747a54d1edcfc934dab031c7a14a1822944 | /iflow/workflow/src/main/java/com/pth/iflow/workflow/config/WorkflowWebMvcConfig.java | 5053992c18e9745098d97a97a12b587f7de3e660 | [] | no_license | hamidrezaseifi/iflow-java | dcd745251502d42890d95c55a4af1d86f0019d19 | 2bfb61f0b22f9768769b320a85c79d661c02a3d6 | refs/heads/develop | 2023-01-10T10:42:57.228952 | 2020-03-04T13:44:42 | 2020-03-04T13:44:42 | 190,767,957 | 0 | 0 | null | 2023-01-07T13:09:42 | 2019-06-07T15:33:59 | JavaScript | UTF-8 | Java | false | false | 817 | java | package com.pth.iflow.workflow.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.pth.iflow.common.rest.TokenVerficationHandlerInterceptor;
@Configuration
public class WorkflowWebMvcConfig implements WebMvcConfigurer {
TokenVerficationHandlerInterceptor authenticationVerficationHandler;
@Override
public void addInterceptors(final InterceptorRegistry registry) {
authenticationVerficationHandler = new TokenVerficationHandlerInterceptor(WorkflowConfiguration.INVALID_TOKEN_URL);
registry.addInterceptor(authenticationVerficationHandler).excludePathPatterns(WorkflowConfiguration.NOAUTHENTICATED_URL_LIST);
}
}
| [
"hamidrezaseifi@gmail.com"
] | hamidrezaseifi@gmail.com |
1785d3388c1b64ed3d83b116e55d45c529588ae4 | 9c2f4f6a701cc21addbf455f40198458a6aba0bf | /app/src/main/java/com/example/frank/busmap/Pojo/Rest/ServiceGenerator.java | cca7bf184880e31de8687b7affb30bbaf3ababaa | [] | no_license | FrankieKhor/BusMap | cf55ca209eb5e6a6223f4859c112c5058160aaff | b9e333bd123181411c085d39eeebd090cb07d706 | refs/heads/master | 2021-04-29T19:47:05.321119 | 2018-04-05T20:19:26 | 2018-04-05T20:19:26 | 121,583,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package com.example.frank.busmap.Pojo.Rest;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by frank on 21/03/2018.
*/
public class ServiceGenerator {
private static final String BASE_URL = "https://api.tfl.gov.uk/";
private final OkHttpClient okHttpClient= new OkHttpClient.Builder()
.readTimeout(5, TimeUnit.SECONDS)
.connectTimeout(5, TimeUnit.SECONDS)
.build();
private static Gson gson = new GsonBuilder()
.setLenient()
.create();
private static Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson));
private static Retrofit retrofit = builder.build();
private static HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
private static OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
public static <S> S createTflClient(Class<S> serviceClass){
// if(!httpClientBuilder.interceptors().contains(loggingInterceptor)){
// httpClientBuilder.addInterceptor(loggingInterceptor);
// builder = builder.client(httpClientBuilder.build());
// retrofit = builder.build();
// }
return retrofit.create(serviceClass);
}
}
| [
"frankiekhor12344321@gmail.com"
] | frankiekhor12344321@gmail.com |
b7d3308a9edc96a2178a7147c25f174281ff4501 | 8fa22f5aaf9f3bb83879267b586f3b7e3ac9e219 | /src/edu/cmu/tetrad/algcomparison/simulation/LoadContinuousDataAndGraphs.java | 96e7652208265727fbe40bc16c51c4419c934260 | [] | no_license | tyler-lovelace1/tetrad-censored | 795e3970fbd562f07bd083ff3fa99d2eaf9f8162 | 94983ee578ddacec924048ba55b06844f26457f5 | refs/heads/master | 2023-01-16T08:23:41.174868 | 2020-11-13T22:29:01 | 2020-11-13T22:29:01 | 259,706,930 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,297 | java | package edu.cmu.tetrad.algcomparison.simulation;
import edu.cmu.tetrad.data.DataModel;
import edu.cmu.tetrad.data.DataReader;
import edu.cmu.tetrad.data.DataSet;
import edu.cmu.tetrad.data.DataType;
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.graph.GraphUtils;
import edu.cmu.tetrad.util.IM;
import edu.cmu.tetrad.util.Parameters;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author jdramsey
*/
public class LoadContinuousDataAndGraphs implements Simulation {
static final long serialVersionUID = 23L;
private String path;
private List<Graph> graphs = new ArrayList<>();
private List<DataSet> dataSets = new ArrayList<>();
private List<String> usedParameters = new ArrayList<>();
public LoadContinuousDataAndGraphs(String path) {
this.path = path;
}
@Override
public void createData(Parameters parameters) {
this.dataSets = new ArrayList<>();
if (new File(path + "/data").exists()) {
int numDataSets = new File(path + "/data").listFiles().length;
try {
for (int i = 0; i < numDataSets; i++) {
File file2 = new File(path + "/graph/graph." + (i + 1) + ".txt");
System.out.println("Loading graph from " + file2.getAbsolutePath());
this.graphs.add(GraphUtils.loadGraphTxt(file2));
edu.cmu.tetrad.graph.GraphUtils.circleLayout(this.graphs.get(i), 225, 200, 150);
File file1 = new File(path + "/data/data." + (i + 1) + ".txt");
System.out.println("Loading data from " + file1.getAbsolutePath());
DataReader reader = new DataReader();
reader.setVariablesSupplied(true);
dataSets.add(reader.parseTabular(file1));
}
File file = new File(path, "parameters.txt");
BufferedReader r = new BufferedReader(new FileReader(file));
String line;
while ((line = r.readLine()) != null) {
if (line.contains(" = ")) {
String[] tokens = line.split(" = ");
String key = tokens[0];
String value = tokens[1];
try {
double _value = Double.parseDouble(value);
usedParameters.add(key);
parameters.set(key, _value);
} catch (NumberFormatException e) {
usedParameters.add(key);
parameters.set(key, value);
}
}
}
parameters.set("numRuns", numDataSets);
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public Graph getTrueGraph(int index) {
return graphs.get(index);
}
@Override
public DataModel getDataModel(int index) {
return dataSets.get(index);
}
@Override
public String getDescription() {
try {
File file = new File(path, "parameters.txt");
BufferedReader r = new BufferedReader(new FileReader(file));
StringBuilder b = new StringBuilder();
b.append("Load data sets and graphs from a directory.").append("\n\n");
String line;
while ((line = r.readLine()) != null) {
if (line.trim().isEmpty()) continue;
b.append(line).append("\n");
}
return b.toString();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public List<String> getParameters() {
return usedParameters;
}
@Override
public int getNumDataModels() {
return dataSets.size();
}
@Override
public DataType getDataType() {
return DataType.Continuous;
}
public void setInitialGraph(Graph g){throw new UnsupportedOperationException();}
public IM getInstantiatedModel(int index){throw new UnsupportedOperationException();}
}
| [
"t-love01@tamu.edu"
] | t-love01@tamu.edu |
99d3200621b0023327030f215246ffd9a0a0a4ea | c13cb85b0c361eb578f517ba912e9ba5a83f4283 | /src/com/company/jsl_07/ShopProject/view/Test.java | 5e1050b30bfbaf14fb574e08716b83e937f685ac | [] | no_license | joyoungwook-korean/JSLcodings | 71bdd3c02347b674fe52327e701a2af62163e225 | 0fb84b0fba4aac4d239e8995dc70b74d7aa4a010 | refs/heads/master | 2023-07-15T09:16:57.128772 | 2021-09-04T00:20:36 | 2021-09-04T00:20:36 | 367,224,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.company.jsl_07.ShopProject.view;
import com.company.jsl_07.ShopProject.model.dao.ShopDAO;
public class Test {
public static void main(String[] args) {
ShopDAO dao = ShopDAO.getInstance();
}
}
| [
"siosio24@naver.com"
] | siosio24@naver.com |
03bf89ee2d838fe0ecbb8f0e31a9cc6939dcaee3 | 37f52c89aefe4457fc29dee8f7f9d690271c2d3a | /Grupo-19-OO2-2021/src/main/java/com/Grupo19OO22021/entities/Auditor.java | b2b65e6ce9c2c782d49341794a483c1443b98895 | [] | no_license | IgnacioIA/Grupo-19-OO2-2021 | 3681f2fe4b5251b08469cf7b699d7b95d798fd00 | b2b6496b517a6e09a6865ff88e35b04bd0281fe3 | refs/heads/master | 2023-05-23T17:22:33.825094 | 2021-06-13T17:09:12 | 2021-06-13T17:09:12 | 371,112,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 156 | java | package com.Grupo19OO22021.entities;
import javax.persistence.Entity;
@Entity
public class Auditor extends Perfil{
public Auditor() {
super();
}
}
| [
"hbanfi@hotmail.com"
] | hbanfi@hotmail.com |
cf17220550a44b0fdad547e257d76851e45f59e9 | b5855ff5dd38217bd89e2b2350e9a340ec683746 | /src/main/MyClass.java | 10195d2364597c85e3ad53435225f1d6f66d18b3 | [] | no_license | moqeuin/Observer | fea562e6b66df99477156a4d501c7dbb4631dfbc | 4c8481617577c7dfc4a9244c152e05b85faab919 | refs/heads/master | 2022-11-09T16:31:38.726200 | 2020-06-28T09:47:24 | 2020-06-28T09:47:24 | 275,553,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | package main;
import java.util.Observable;
public class MyClass extends Observable{ // Human
private String preArg = null;
private String id;
private String password;
// 일반 메소드
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void notifyObservers(Object arg) {
String str = (String)arg;
// 변화가 없다 -> 통지 안함.
if(str.equals(preArg)) return;
// 변화가 있음
preArg = str;
setChanged(); // reset
super.notifyObservers(arg);
clearChanged();
}
}
| [
"qudrb414@naver.com"
] | qudrb414@naver.com |
519b7696eab95b2e8d4c7942fe4d14089eafaed0 | eb9827a2f28615c257d6fc0d11700861317ce7aa | /src/main/java/base/IdWorker.java | da04235ffe923fb6b94e5ca7620198ddca887311 | [
"MIT"
] | permissive | youngcao2015/yunhe | bdf08f9b1e104d4e9421e09da78c0fc0b3f6a40e | 229eaac11729ab07e030cafdc6c3178027c4b37c | refs/heads/master | 2020-03-22T03:41:49.511527 | 2018-07-22T08:41:41 | 2018-07-22T08:41:41 | 139,446,926 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,674 | java | package base;
import org.apache.commons.lang3.StringUtils;
/**
* 使用 Snowflake 算法生成的 64 位 long 类型的 ID,结构如下:<br>
* 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 <br>
* 1) 01 位标识,由于 long 在 Java 中是有符号的,最高位是符号位,正数是 0,负数是 1,ID 一般使用正数,所以最高位是 0<br>
* 2) 41 位时间截(毫秒级),注意,41 位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间 - 开始时间)得到的值,
* 开始时间截,一般是业务开始的时间,由我们程序来指定,如 IdWorker 中的 START_TIMESTAMP 属性。
* 41 位的时间截,可以使用 70 年: (2^41)/(1000*60*60*24*365) = 69.7 年<br>
* 3) 10 位的数据机器位,可以部署在 1024 个节点,包括 5 位 dataCenterId 和 5 位 workerId<br>
* 4) 12 位序列,毫秒内的计数,12 位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生 4096 个 ID 序号<br>
*
* SnowFlake 的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生 ID 碰撞(由数据中心 ID 和机器 ID 作区分),并且效率较高。
* 最多支持 1024 台机器,每台机器每毫秒能够生成最多 4096 个 ID,整个集群理论上每秒可以生成 1024 * 1000 * 4096 = 42 亿个 ID。
*/
public class IdWorker {
/** 开始时间截(2017-01-01),单位毫秒 */
private static final long START_TIMESTAMP = 1483228800000L;
/** 机器 ID 所占的位数 */
private static final long WORKER_ID_BITS = 5L;
/** 数据标识 ID 所占的位数 */
private static final long DATACENTER_ID_BITS = 5L;
/** 支持的最大机器 ID,结果是 31: 0B11111 */
private static final long MAX_WORKER_ID = ~(-1L << WORKER_ID_BITS);
/** 支持的最大数据中心 ID,结果是 31: 0B11111 */
private static final long MAX_DATACENTER_ID = ~(-1L << DATACENTER_ID_BITS);
/** 序列在 ID 中占的位数 */
private static final long SEQUENCE_BITS = 12L;
/** 机器 ID 向左移 12 位 */
private static final long WORKER_ID_SHIFT = SEQUENCE_BITS;
/** 数据中心 ID 向左移 17 位(12+5) */
private static final long DATACENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
/** 时间截向左移 22 位(5+5+12) */
private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATACENTER_ID_BITS;
/** 生成序列的掩码,这里为 4095(0B111111111111=0xFFF=4095) */
private static final long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
/** 工作机器 ID(0~31) */
private long workerId;
/** 数据中心 ID(0~31) */
private long dataCenterId;
/** 毫秒内序列(0~4095) */
private long sequence = 0L;
/** 上次生成 ID 的时间截 */
private long lastTimestamp = -1L;
/**
* 创建 ID 生成器的方式一: 使用工作机器的序号,范围是 [0, 1023],优点是方便给机器编号
*
* @param workerId 工作机器 ID
*/
public IdWorker(long workerId) {
long maxMachineId = (MAX_DATACENTER_ID +1) * (MAX_WORKER_ID +1) - 1; // 1023
if (workerId < 0 || workerId > maxMachineId) {
throw new IllegalArgumentException(String.format("Worker ID can't be greater than %d or less than 0", maxMachineId));
}
this.dataCenterId = (workerId >> WORKER_ID_BITS) & MAX_DATACENTER_ID;
this.workerId = workerId & MAX_WORKER_ID;
}
/**
* 创建 ID 生成器的方式二: 使用工作机器 ID 和数据中心 ID,优点是方便分数据中心管理
*
* @param dataCenterId 数据中心 ID (0~31)
* @param workerId 工作机器 ID (0~31)
*/
public IdWorker(long dataCenterId, long workerId) {
if (workerId > MAX_WORKER_ID || workerId < 0) {
throw new IllegalArgumentException(String.format("Worker ID can't be greater than %d or less than 0", MAX_WORKER_ID));
}
if (dataCenterId > MAX_DATACENTER_ID || dataCenterId < 0) {
throw new IllegalArgumentException(String.format("Datacenter ID can't be greater than %d or less than 0", MAX_DATACENTER_ID));
}
this.workerId = workerId;
this.dataCenterId = dataCenterId;
}
/**
* 获得下一个 ID(该方法是线程安全的),同一机器同一时间可产生 4096 个 ID,70 年内不生成重复的 ID
*
* @return long 类型的 ID
*/
public synchronized long nextId() {
long timestamp = timeGen();
// 如果当前时间小于上一次 ID 生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
if (timestamp < lastTimestamp) {
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
}
// 如果是同一时间生成的,则进行毫秒内序列
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & SEQUENCE_MASK;
// 毫秒内序列溢出
if (sequence == 0) {
// 阻塞到下一个毫秒,获得新的时间戳
timestamp = tilNextMillis(lastTimestamp);
}
} else {
sequence = 0L; // 时间戳改变,毫秒内序列重置
}
// 上次生成 ID 的时间截
lastTimestamp = timestamp;
// 移位并通过或运算拼到一起组成 64 位的 ID
return ((timestamp - START_TIMESTAMP) << TIMESTAMP_LEFT_SHIFT)
| (dataCenterId << DATACENTER_ID_SHIFT)
| (workerId << WORKER_ID_SHIFT)
| sequence;
}
/**
* 阻塞到下一个毫秒,直到获得新的时间戳
*
* @param lastTimestamp 上次生成 ID 的时间截
* @return 当前时间戳(毫秒)
*/
private long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
timestamp = timeGen();
}
return timestamp;
}
/**
* 返回当前时间,以毫秒为单位
*
* @return 当前时间(毫秒)
*/
private long timeGen() {
return System.currentTimeMillis();
}
public static void main(String[] args) {
IdWorker idWorker = new IdWorker(0, 0);
for (int i = 0; i < 1000; i++) {
long id = idWorker.nextId();
System.out.println(id);
System.out.println(StringUtils.leftPad(Long.toBinaryString(id), 64, "0"));
}
}
}
| [
"858222866@qq.com"
] | 858222866@qq.com |
97167bbd79ac3870c9173a6a3cd6351710394231 | e423f88f9476bca82892e4438235ec53324ab7a0 | /src/java/com/d2g/mead/conditions/AstronomyFeed.java | dd81b11ddf939e9fd128be5ef378052d286488b4 | [] | no_license | photoTed/PiWeatherStation | a077ef9beed20d3aa2c7f5db3799ee0d5d1d0de8 | 514d6c9e216a9e1ed71ba1434dd7960a63cdfe49 | refs/heads/master | 2016-09-05T16:42:07.811787 | 2014-06-16T19:42:15 | 2014-06-16T19:42:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | package com.d2g.mead.conditions;
import java.io.File;
import java.net.URL;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.io.FileUtils;
import com.d2g.mead.weather.DataFeed;
import com.d2g.mead.weather.DataManager;
import com.d2g.mead.weather.ScheduleManager;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class AstronomyFeed extends DataFeed {
public AstronomyFeed(DataManager dataManager) {
super(dataManager);
this.name = "astronomy";
setProperties();
gsonType = new TypeToken<Astronomy>() {}.getType();
}
@Override
public void update(boolean scheduleNext) throws Exception {
try {
Gson gson = new Gson();
FileUtils.copyURLToFile(new URL(url), new File(filename));
Astronomy astronomy = gson.fromJson(dataManager.readUrl("file:" + filename), gsonType);
dataManager.getFrameManager().getConditionsFrame().updateAstronomy(astronomy);
lastRefreshed = new Date();
dataManager.notifyListeners(name);
} finally {
if ( scheduleNext ) {
scheduleNextUpdate();
}
}
}
public Date getNextScheduleDate() {
Calendar now = Calendar.getInstance();
now.setTime(new Date());
now.add(Calendar.HOUR, 24);
now.set(Calendar.MINUTE, 0);
now.set(Calendar.SECOND, 0);
now.set(Calendar.MILLISECOND, ScheduleManager.RANDOMIZER);
now.set(Calendar.HOUR_OF_DAY, 4);
//now.add(Calendar.MILLISECOND, ScheduleManager.RANDOMIZER);
return now.getTime();
}
}
| [
"ted.mead@gmail.com"
] | ted.mead@gmail.com |
72ac1b9cec9280f6057be2a90141e56e933af123 | f664ac6b46bd9f37518fa25188281784f233b61d | /Server/src/main/java/biz/kakee/utils/Crypto.java | 3e2bce085a7ecbc6ea962528449a3057d6675dd6 | [] | no_license | rleiwang/kakee | 22751d728342b3944f94747bd7792fa20f342eb9 | f48d44c5b7678a16ee2caadf7ffc301404cc2a80 | refs/heads/master | 2020-05-31T19:40:25.254672 | 2019-06-05T19:56:50 | 2019-06-05T19:56:50 | 190,459,462 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,411 | java | package biz.kakee.utils;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.activity.InvalidActivityException;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.AlgorithmParameters;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.util.Base64;
@Slf4j
public class Crypto {
@Data
public static class Message {
private String iv;
private String msg;
private String digest;
}
private static final String CIPHER = "AES/CBC/PKCS5Padding";
private static final String DIGEST_ALGO = "SHA-256";
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
// based 64
public static String encryptWithPasswd(char[] password, String plainText) {
return encryptWithPasswd(password, plainText.getBytes(StandardCharsets.UTF_8));
}
public static String encryptWithPasswd(char[] password, byte[] plainText) {
try {
Crypto.Message msg = Crypto.encrypt(password, plainText);
return Base64.getEncoder().encodeToString(OBJECT_MAPPER.writeValueAsBytes(msg));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
// based 64
public static String decryptWithPasswd(char[] password, String encoded) {
return new String(decryptBytesWithPasswd(password, encoded), StandardCharsets.UTF_8);
}
public static byte[] decryptBytesWithPasswd(char[] password, String encoded) {
try {
Crypto.Message msg = OBJECT_MAPPER.readValue(Base64.getDecoder().decode(encoded), Crypto.Message.class);
return Crypto.decrypt(password, msg);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static Message encrypt(char[] password, byte[] msg) {
try {
Cipher cipher = Cipher.getInstance(CIPHER);
cipher.init(Cipher.ENCRYPT_MODE, getKey(password));
AlgorithmParameters params = cipher.getParameters();
Message et = new Message();
et.setIv(new BASE64Encoder().encode(params.getParameterSpec(IvParameterSpec.class).getIV()));
System.out.println(et.getIv());
et.setMsg(new BASE64Encoder().encode(cipher.doFinal(msg)));
System.out.println(et.getMsg());
et.setDigest(new BASE64Encoder().encode(MessageDigest.getInstance(DIGEST_ALGO).digest(msg)));
System.out.println(et.getDigest());
return et;
} catch (Exception e) {
log.error("unable to encrypt", e);
throw new RuntimeException(e);
}
}
public static byte[] decrypt(char[] password, Message cryptMsg) {
try {
Cipher cipher = Cipher.getInstance(CIPHER);
cipher.init(Cipher.DECRYPT_MODE, getKey(password),
new IvParameterSpec(new BASE64Decoder().decodeBuffer(cryptMsg.getIv())));
byte[] msg = cipher.doFinal(new BASE64Decoder().decodeBuffer(cryptMsg.getMsg()));
byte[] digest = MessageDigest.getInstance(DIGEST_ALGO).digest(msg);
if (!cryptMsg.getDigest().equals(new BASE64Encoder().encode(digest))) {
throw new InvalidActivityException("The digest of message doesn't match");
}
return msg;
} catch (Exception e) {
log.error("unable to decrypt", e);
throw new RuntimeException(e);
}
}
private static SecretKey getKey(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {
// "PBKDF2WithHmacSHA256" Java 8
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
KeySpec spec = new PBEKeySpec(password, new String(password).getBytes(StandardCharsets.UTF_8), 65536, 256);
SecretKey tmp = factory.generateSecret(spec);
return new SecretKeySpec(tmp.getEncoded(), "AES");
}
}
| [
"rleiwang@gmail.com"
] | rleiwang@gmail.com |
5b58fed3f8d9a2d8707ee2a0ec1ca420fb643b2c | 5aa586fb3c6d1c5350af10e857f31a3daed9b970 | /AC-Game/data/scripts/system/handlers/ai/siege/ShieldNpcAI2.java | 1624eabdbc50e6dffc6a8d12e1ac5be4d6a555f6 | [] | no_license | JohannesPfau/aion48 | c1b77a46b6f98759e3704507fd48a47c5da48021 | ebed1fc243fa85ee56a2af49d84a6d6dcca6c027 | refs/heads/master | 2020-03-18T01:15:05.566820 | 2018-05-16T20:40:16 | 2018-05-16T20:40:16 | 134,134,369 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,423 | java | /**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning 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 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning 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 Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*
*
* Credits goes to all Open Source Core Developer Groups listed below
* Please do not change here something, ragarding the developer credits, except the "developed by XXXX".
* Even if you edit a lot of files in this source, you still have no rights to call it as "your Core".
* Everybody knows that this Emulator Core was developed by Aion Lightning
* @-Aion-Unique-
* @-Aion-Lightning
* @Aion-Engine
* @Aion-Extreme
* @Aion-NextGen
* @Aion-Core Dev.
*/
package ai.siege;
import com.aionemu.gameserver.ai2.AIName;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.network.aion.serverpackets.SM_SHIELD_EFFECT;
import com.aionemu.gameserver.services.SiegeService;
import com.aionemu.gameserver.utils.PacketSendUtility;
import com.aionemu.gameserver.world.knownlist.Visitor;
/**
* @author Source
*/
@AIName("siege_shieldnpc")
public class ShieldNpcAI2 extends SiegeNpcAI2 {
@Override
protected void handleDespawned() {
sendShieldPacket(false);
super.handleDespawned();
}
@Override
protected void handleSpawned() {
sendShieldPacket(true);
super.handleSpawned();
}
private void sendShieldPacket(boolean shieldStatus) {
int id = getSpawnTemplate().getSiegeId();
SiegeService.getInstance().getFortress(id).setUnderShield(shieldStatus);
final SM_SHIELD_EFFECT packet = new SM_SHIELD_EFFECT(id);
getPosition().getWorldMapInstance().doOnAllPlayers(new Visitor<Player>() {
@Override
public void visit(Player player) {
PacketSendUtility.sendPacket(player, packet);
}
});
}
}
| [
"aion@gmx-topmail.de"
] | aion@gmx-topmail.de |
154a2a81d7f2bfb966b72ad4f9b315a4e20233eb | 52cfdd56ff563e2f31b63e5ddd5368504b35ecca | /dasi-executor/src/main/java/com/techstar/om/dasi/handler/ssh/DiskFreeHandler.java | ef76e4a74d454d4c994d46a4f790b7ea2e2f3914 | [] | no_license | kuaiqing/dsi-object | b9ab124d5f38f28d96df34f2521e828e8c5a0386 | 67b742940891fbe0ffc26088491a7305f48dce98 | refs/heads/master | 2023-01-23T08:30:42.237586 | 2020-11-30T10:13:44 | 2020-11-30T10:13:44 | 317,176,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,227 | java | package com.techstar.om.dasi.handler.ssh;
import com.techstar.om.dasi.domain.ECheckTargetType;
import com.techstar.om.dasi.domain.EPriority;
import com.techstar.om.dasi.handler.SshHandler;
import com.techstar.om.dasi.handler.annotation.DsiHandler;
import com.techstar.om.dasi.jpa.result.CheckResult;
import com.techstar.om.dasi.jpa.result.CheckResultDiskFree;
import com.techstar.om.dasi.jpa.result.CheckResultDiskFreeId;
import com.techstar.om.dasi.param.SshParam;
import com.techstar.om.dasi.repos.result.CheckResultDiskFreeRepos;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@DsiHandler(id = "server_disk_free", name = "磁盘使用检查", type = ECheckTargetType.Server)
public class DiskFreeHandler extends SshHandler<CheckResultDiskFree, SshParam> {
@Autowired
private CheckResultDiskFreeRepos diskFreeRepos;
@Override
protected List<CheckResultDiskFree> processData(String data, SshParam param, CheckResult result) {
List<CheckResultDiskFree> diskFrees = new ArrayList<>();
if (result.getReturnStatus() == 0) { // 成功执行
DateTime appliedTime = appliedTimeOf(result.getCheckTime(), param);
String[] rows = data.split("\n");
for (int i = 1; i < rows.length; i++) {
String[] cols = rows[i].split("\\s+");
if (cols.length >= 6) {
String mount = cols[5];
if (matched(mount, param.getMatches())) {
CheckResultDiskFreeId id = new CheckResultDiskFreeId(appliedTime, result.getId(), mount);
CheckResultDiskFree diskFree = new CheckResultDiskFree(id, result);
diskFree.setFilesystem(cols[0]);
diskFree.setSize(Integer.valueOf(cols[1]));
diskFree.setUsed(Integer.valueOf(cols[2]));
diskFrees.add(diskFree);
}
}
}
}
return diskFrees;
}
@Override
public String commandOf(SshParam param) {
return "df";
}
@Override
protected void saveCheckResultData(List<CheckResultDiskFree> data) {
diskFreeRepos.saveAll(data);
}
@Override
protected void processResultData(List<CheckResultDiskFree> values, SshParam param, CheckResult result) {
Map<String, List<CheckResultDiskFree>> mountDiskFrees = param.getMatches().stream().collect(Collectors.toMap(
k -> k,
v -> values.stream().filter(df -> matched(df.getId().getMount(), v)).collect(Collectors.toList())
));
mountDiskFrees.forEach((k, v) -> {
if (v.isEmpty()) { // 没有匹配到数据
result.setPriority(EPriority.Error);
result.setHint(String.format("%s,目录不存在", k));
} else {
v.forEach(value -> {
param.get("use").check(k, value.getUse(), result);
});
}
});
}
}
| [
"326339456@qq.com"
] | 326339456@qq.com |
56bd660b36b8cd80e540ea8ff965a3dd343991bd | d2798388180b926e131b9b5e5c542de5b5dbd607 | /src/by/it/drachyova/jd01_08/Theatre.java | 020f902ecac1411eeac8719e678e0d5663e77d85 | [] | no_license | VasilevichSergey/JD2016 | 14a22a5c31ded3783014b9d89cdddf0eb6ad4398 | dfb8e38a6c4022677708dc03d0047d76bc801bfd | refs/heads/master | 2020-12-24T20:25:06.458871 | 2016-10-04T10:35:49 | 2016-10-04T10:35:49 | 58,029,314 | 0 | 0 | null | 2016-05-04T06:46:27 | 2016-05-04T06:46:27 | null | UTF-8 | Java | false | false | 1,088 | java | package by.it.drachyova.jd01_08;
public class Theatre extends PublicBuilding implements IBuilding{
public Theatre(){
super();
setName("Театр");
}
@Override
public void destroy(){
System.out.println("Театр разрушен");
}
@Override
public void showState(){//метод показывает текушее состояние театра
if(this.repair()){
System.out.println("Театр отремонтирован");
}
if(this.clean()){
System.out.println("Театр убран");
}
if(this.openDoors()){
System.out.println("Двери театра открыты");
}
if(!this.closeDoors()){
System.out.println("Двери театра закрыты");
}
if(this.turnOnLight()){
System.out.println("Свет в театре включен");
}
if(!this.turnOffLight()){
System.out.println("Свет в театре выключен");
}
}
}
| [
"miss-elena86@mail.ru"
] | miss-elena86@mail.ru |
64baa2ca7a7f82ef9f3555f55a93ff73fa78e903 | 8edee90cb9610c51539e0e6b126de7c9145c57bc | /datastructures-json-iterator/src/main/java/org/xbib/datastructures/json/iterator/fuzzy/StringLongDecoder.java | cb144b9bebd60c67d3d69ffca06a78ebe74c3bd8 | [
"Apache-2.0"
] | permissive | jprante/datastructures | 05f3907c2acba8f743639bd8b64bde1e771bb074 | efbce5bd1c67a09b9e07d2f0d4e795531cdc583b | refs/heads/main | 2023-08-14T18:44:35.734136 | 2023-04-25T15:47:23 | 2023-04-25T15:47:23 | 295,021,623 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 815 | java | package org.xbib.datastructures.json.iterator.fuzzy;
import org.xbib.datastructures.json.iterator.CodegenAccess;
import org.xbib.datastructures.json.iterator.JsonIterator;
import org.xbib.datastructures.json.iterator.spi.Decoder;
import java.io.IOException;
public class StringLongDecoder extends Decoder.LongDecoder {
@Override
public long decodeLong(JsonIterator iter) throws IOException {
byte c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringLongDecoder", "expect \", but found: " + (char) c);
}
long val = iter.readLong();
c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringLongDecoder", "expect \", but found: " + (char) c);
}
return val;
}
}
| [
"joergprante@gmail.com"
] | joergprante@gmail.com |
c9f89cafc9262c3c687b4abe70eef458a9f0a02b | 33ef450131b2e646ca8500e58ded810b839a556a | /bagpackageElev/BagITest.java | a5e35d6b33fc95bea725ce4030adb0194d73f76a | [] | no_license | joandrsn/12s | b78ab61ea0ecbc301704d0fddb0bb06c4b1c44b0 | c7a48b55ef3ff9f05b19a3ffe143eef0e8e78b7b | refs/heads/master | 2021-05-27T15:42:37.994593 | 2013-10-25T07:46:16 | 2013-10-25T07:46:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,664 | java | package bagpackageElev;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class BagITest {
private BagI<String> bag;
@Before
public void setUp() throws Exception {
bag = new LinkedBag<String>();
bag.add("Jan");
bag.add("Per");
bag.add("Hans");
}
@Test
public void testGetCurrentSize() {
assertEquals(3, bag.getCurrentSize());
bag.add("Lis");
assertEquals(4, bag.getCurrentSize());
}
@Test
public void testIsFull() {
assertFalse(bag.isFull());
for (int i = 1; i<=22;i++){
bag.add("ny "+ 1);
}
assertFalse(bag.isFull());
}
@Test
public void testIsEmpty() {
assertFalse(bag.isEmpty());
bag.clear();
assertTrue(bag.isEmpty());
}
@Test
public void testAdd() {
assertFalse(bag.contains("Lis"));
bag.add("Lis");
assertTrue(bag.contains("Lis"));
}
@Test
public void testRemove() {
String s = bag.remove();
assertFalse(bag.contains(s));
assertEquals(2, bag.getCurrentSize());
}
@Test
public void testRemoveT() {
assertTrue(bag.contains("Per"));
assertTrue(bag.remove("Per"));
assertFalse(bag.contains("Per"));
assertEquals(2, bag.getCurrentSize());
}
@Test
public void testClear() {
bag.clear();
assertEquals(0, bag.getCurrentSize());
assertTrue(bag.isEmpty());
}
@Test
public void testGetFrequencyOf() {
assertEquals(1, bag.getFrequencyOf("Per"));
bag.add("Per");
assertEquals(2, bag.getFrequencyOf("Per"));
}
@Test
public void testContains() {
assertTrue(bag.contains("Per"));
assertFalse(bag.contains("Pia"));
}
@Test
public void testToArray() {
Object[] arr = bag.toArray();
assertEquals(3,arr.length);
}
}
| [
"jonasbylling@gmail.com"
] | jonasbylling@gmail.com |
ce22244f7ec5a0cb5f7624085a3302706352de59 | 7b3295de4e2300aa30aef26f3191f8f1d8bfac7e | /app/src/main/java/com/coahr/fanoftruck/mvp/constract/Fragment_userInfo_C.java | 5adf2cdf24c3dfd2c7771534613735a32469a25a | [] | no_license | LEEHOR/fanoftruck | dc1d1f4fe03f8ac64e840ed3d77261d87278d4b1 | 5b2bc5735b6cf87b6352c483fd65ff1de84a96fb | refs/heads/master | 2020-04-07T07:29:05.390297 | 2019-04-16T09:24:02 | 2019-04-16T09:24:02 | 158,178,152 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,748 | java | package com.coahr.fanoftruck.mvp.constract;
import com.coahr.fanoftruck.mvp.Base.BaseContract;
import com.coahr.fanoftruck.mvp.model.Bean.Center_Initial_Data;
import com.coahr.fanoftruck.mvp.model.Bean.LoginBean;
import com.coahr.fanoftruck.mvp.model.Bean.LoginOutBean;
import com.coahr.fanoftruck.mvp.model.Bean.Save_Identity_Info;
import java.util.Map;
/**
* Created by Leehor
* on 2018/11/6
* on 17:49
*/
public interface Fragment_userInfo_C {
interface View extends BaseContract.View {
void getCenter_Initial_DataSuccess(Center_Initial_Data center_initial_data);
void getCenter_Initial_DataFailure(String failure);
void Save_Identity_InfoSuccess(Save_Identity_Info save_identity_info);
void Save_Identity_InfoFailure(String failure);
void LoginOutSuccess(LoginOutBean loginOutBean);
void LoginOutFailure(String failure);
}
interface Presenter extends BaseContract.Presenter {
void getCenter_Initial_Data(Map<String,String> map);
void getCenter_Initial_DataSuccess(Center_Initial_Data center_initial_data);
void getCenter_Initial_DataFailure(String failure);
void Save_Identity_Info(Map<String,String> map);
void Save_Identity_InfoSuccess(Save_Identity_Info save_identity_info);
void Save_Identity_InfoFailure(String failure);
void LoginOut(Map<String,String> map);
void LoginOutSuccess(LoginOutBean loginOutBean);
void LoginOutFailure(String failure);
}
interface Model extends BaseContract.Model {
void getCenter_Initial_Data(Map<String,String> map);
void Save_Identity_Info(Map<String,String> map);
void LoginOut(Map<String,String> map);
}
}
| [
"1622293788@qq.com"
] | 1622293788@qq.com |
257b8d9d7d9ec2ed4301fd4f06254721135dc377 | 947aa11b559e656d70cb12f034b4a7725251935b | /src/Constants.java | c6b3c278e908c70f168afc0141926cb70b76e154 | [] | no_license | JJMUSA/Space-Invaders | 2b4af039b64df4760445bde066ec52455e9cfb11 | 0da1898d48331788d8800a94214777b8d539414e | refs/heads/master | 2021-09-03T08:12:20.123380 | 2018-01-07T11:02:14 | 2018-01-07T11:02:14 | 105,454,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.Buffer;
public class Constants {
public static final double CEILING=80;
public static final double RIGHT_BORDER=30;
public static final double LEFT_BORDER=5;
public static final int FRAME_HEIGHT=450;
public static final int FRAME_WIDTH=500;
public static final int GROUND=390;
public static final Dimension FRAME_SIZE=new Dimension(Constants.FRAME_WIDTH,Constants.FRAME_HEIGHT);
public static BufferedImage[][] AlienSprites={{getSprites(22,0,16,16),getSprites(22,16,16,16)},
{getSprites(38,0,24,16),getSprites(38,16,24,16)},
{getSprites(0,0,22,16),getSprites(0,16,22,16)}
};
public static BufferedImage PlayerSprite=getSprites(62,0,22,16);
public static BufferedImage BlockerSprite=getSprites(84,8,36,24);
public static BufferedImage getSprites(int x, int y, int width, int height){
BufferedImage spriteSheet=null;
BufferedImage sprite;
try{
spriteSheet= ImageIO.read(new File("invaders.png"));
}
catch (IOException e){
e.printStackTrace();
}
sprite=spriteSheet.getSubimage(x,y,width,height) ;
return sprite;
}
}
| [
"thejabirmusa@gmail.com"
] | thejabirmusa@gmail.com |
4a231506f9c3bcadcdb0439cbc1835c89e2a9bc5 | 139960e2d7d55e71c15e6a63acb6609e142a2ace | /mobile_app1/module2/src/main/java/module2packageJava0/Foo91.java | 70e91052c755cc1e0f1cc9195c02afa70851ea3c | [
"Apache-2.0"
] | permissive | uber-common/android-build-eval | 448bfe141b6911ad8a99268378c75217d431766f | 7723bfd0b9b1056892cef1fef02314b435b086f2 | refs/heads/master | 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 | Apache-2.0 | 2021-09-24T08:55:30 | 2020-09-11T23:27:37 | Java | UTF-8 | Java | false | false | 385 | java | package module2packageJava0;
import java.lang.Integer;
public class Foo91 {
Integer int0;
Integer int1;
public void foo0() {
new module2packageJava0.Foo90().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"oliviern@uber.com"
] | oliviern@uber.com |
c6ed603a504a28375480bbdd40c5caacec5bba3f | e71b683fb04cf1907eda3df6f60b6b3865fccb04 | /src/main/java/com/api/api/controller/UserController.java | ca98813f18e0943c10849b0bc6f3414154319fcb | [] | no_license | Chelyos/spring-boot-api | 308761ce68a9e0394977adebed7282bd81bfccef | a54ee22cd3dd0e2d7a637af303656b2489b4826e | refs/heads/master | 2023-01-24T16:47:15.118933 | 2020-12-04T23:33:46 | 2020-12-04T23:33:46 | 318,658,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.api.api.controller;
import com.api.api.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.api.api.service.UserService;
import java.util.Optional;
@RestController
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/user")
public Optional<User> index(@RequestParam("email") final String email) {
return userService.getUsers(email);
}
@PostMapping("/user/sign-up")
public User signUp(@RequestBody User user) {
return userService.createUser(user);
}
@PostMapping("/user/sign-in")
public User signIn(@RequestBody User user){
return userService.registerUser(user);
}
}
| [
"cheyrendt@outlook.com"
] | cheyrendt@outlook.com |
4b445809ba2a922cc80c84b52f7caa64dda6f894 | bccef3f8bbc31556c8f0ad21a6044af6ed65a3a0 | /en/architecture/SpringBootSecurity/src/main/java/de/oio/spring/config/ApplicationInitializer.java | e340fc5d5370e9fbec1ff8574afa5430062fad1c | [
"Unlicense",
"MIT"
] | permissive | Peter-Nikodem/vaadin-by-example | b627755735e12ce688cf84637ac9e66574dd08af | b39c162bb3c632d8f6b9318038531f52ec0cc511 | refs/heads/master | 2021-01-17T10:49:49.246708 | 2015-10-18T17:23:09 | 2015-10-18T17:23:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,771 | java | package de.oio.spring.config;
import de.oio.model.Role;
import de.oio.model.User;
import de.oio.service.RoleRepository;
import de.oio.service.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.ServletContextInitializer;
import org.springframework.context.annotation.Configuration;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@Configuration
public class ApplicationInitializer implements ServletContextInitializer {
@Autowired
private UserRepository userRepository;
@Autowired
private RoleRepository roleRepository;
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
Role adminRole;
Role userRole;
if (roleRepository.count() == 0) {
adminRole = new Role("ROLE_ADMIN");
roleRepository.save(adminRole);
userRole = new Role("ROLE_USER");
roleRepository.save(userRole);
} else {
adminRole = roleRepository.findByAuthority("ADMIN");
userRole = roleRepository.findByAuthority("USER");
}
if (userRepository.count() == 0) {
userRepository.save(createUser("admin", "admin", "Administrator", adminRole, userRole));
userRepository.save(createUser("user", "user", "John Doe", userRole));
}
}
private User createUser(String username, String password, String fullname, Role ... roles) {
User user = new User();
user.setUsername(username);
user.setUnencryptedPassword(password);
user.setFullName(fullname);
for (Role role : roles) {
user.addAuthority(role);
}
return user;
}
}
| [
"info@rolandkrueger.info"
] | info@rolandkrueger.info |
8c2deffe9e0095479500ec160459553a79fb740b | 25cf0f9d173f38be4d0221eddfc473c1ea2754bc | /B621032recy/app/src/main/java/com/example/b621032recy/LittleAdapter.java | efcddc4ed3ed17ab31a11979e1d90c974ca91356 | [] | no_license | mlapinm/b06andr | 3e4d9b6786151a9748f29f3a836b89f95a1fb3e2 | 39f2633e0dec9307fe1974678335979156c396d7 | refs/heads/main | 2023-03-01T12:20:27.536179 | 2021-02-10T17:39:40 | 2021-02-10T17:39:40 | 327,809,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,090 | java | package com.example.b621032recy;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
public class LittleAdapter extends RecyclerView.Adapter<LittleAdapter.LittleViewHolder> {
private Context context;
private ArrayList<LittleItem> items;
public LittleAdapter(Context context, ArrayList<LittleItem> items) {
this.context = context;
this.items = items;
}
public class LittleViewHolder extends RecyclerView.ViewHolder{
public ImageView imageView;
public TextView textViewCreator;
public TextView textViewLikes;
public LittleViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.image_view);
textViewCreator = itemView.findViewById(R.id.text_view_creator);
textViewLikes = itemView.findViewById(R.id.text_view_download);
}
}
@NonNull
@Override
public LittleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context)
.inflate(R.layout.little_item, parent, false);
return new LittleViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull LittleViewHolder holder, int position) {
LittleItem littleItem = items.get(position);
String imageUrl = littleItem.getImageUrl();
String creator = littleItem.getCreator();
int likes = littleItem.getLikes();
holder.textViewCreator.setText(creator);
holder.textViewLikes.setText("Likes: " + likes);
Picasso.get().load(imageUrl)
.fit()
.centerInside()
.into(holder.imageView);
}
@Override
public int getItemCount() {
return items.size();
}
}
| [
"mlapin@rambler.ru"
] | mlapin@rambler.ru |
2ee1d7f4f487c7d69897cd24349fe1be025daad1 | 2a293ac24659653121030776dd174ed7a99d8bad | /app/src/main/java/com/example/enzo/databindingdemo/UnidirectionBinding/User.java | 24f9b67913410d8e50d5e48d0ba8eb555bef94e4 | [] | no_license | zeng-yh/DataBindingDemo | ae19f4fc3d2d9f8680a8f070917b5e2f57b847c3 | 2ea35d21e7e082cdfb99817bad61518889786c45 | refs/heads/master | 2021-06-27T04:32:58.503228 | 2017-09-19T22:14:08 | 2017-09-19T22:14:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.example.enzo.databindingdemo.UnidirectionBinding;
/**
* <p>
* Created by ZENG Yuhao(Enzo)<br>
* Contact: enzo.zyh@gmail.com
* </p>
*/
public class User {
private String name;
private String email;
public User(String name, String email) {
this.name = name;
this.email = email;
}
public String getEmail() {
return email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"enzo.zyh@gmail.com"
] | enzo.zyh@gmail.com |
7cf05dd8360e11641592365e24ed20a1157c7148 | b008855f3f16f7c634b87adbb605131f7343af82 | /e3-manager/e3-manager-service/src/main/java/cn/e3mall/service/impl/ItemServiceImpl.java | dc3ea64d69e16154014ecd99effa2557248f121e | [] | no_license | jiahuaile/codeMachine | 7d0d92eb6d6fe3ab5596234dda4b046fc3c13f64 | 1e7dae25f3b551ca85b5226f1a1e1bcd62bc5cb3 | refs/heads/master | 2021-05-09T02:46:29.765909 | 2018-01-28T02:52:04 | 2018-01-28T02:52:04 | 119,221,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package cn.e3mall.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.e3mall.common.pojo.EasyUIDataGridResult;
import cn.e3mall.mapper.TbItemMapper;
import cn.e3mall.pojo.TbItem;
import cn.e3mall.pojo.TbItemExample;
import cn.e3mall.service.ItemService;
/**
* 商品管理Service
* <p>
* Title: ItemServiceImpl
* </p>
* <p>
* Description:
* </p>
* <p>
* Company: www.itcast.cn
* </p>
*
* @version 1.0
*/
@Service
public class ItemServiceImpl implements ItemService {
@Autowired
private TbItemMapper itemMapper;
@Override
public TbItem getItemById(long itemId) {
TbItem tbItem = itemMapper.selectByPrimaryKey(itemId);
return tbItem;
}
@Override
public EasyUIDataGridResult getItemList(int page, int rows) {
//封装分页参数
PageHelper.startPage(page, rows);
//查询结果
TbItemExample example = new TbItemExample();
List<TbItem> list = itemMapper.selectByExample(example);
//从结果中获取所要的数据
PageInfo<TbItem> pageInfo = new PageInfo<>(list);
//分页总数
long total = pageInfo.getTotal();
//创建一个视图结果对象
EasyUIDataGridResult result = new EasyUIDataGridResult();
//封装参数并返回结果
result.setTotal(total);
result.setRows(list);
return result;
}
}
| [
"jhl163.com"
] | jhl163.com |
90a3dd3d0266fc1760c678ba0905f816966f50cd | d613e5fc028b92e728df6011ad313bfd44c80d3c | /src/main/java/com/is/swgflooring/dao/ProductDAOFileImpl.java | c83a7aaa6c0ea938dceb5069869b60b3a15396db | [] | no_license | IblasioS418/FlooringSystem | 458d4c06259a2aceec6fb2d72d182c07d687c67e | 3ec09105d975cfd9865df444a0bdb7645d393581 | refs/heads/master | 2023-02-21T15:24:34.499851 | 2021-01-23T18:05:30 | 2021-01-23T18:05:30 | 332,275,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,791 | 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.is.swgflooring.dao;
import com.is.swgflooring.dto.Order;
import com.is.swgflooring.dto.Product;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author ibby4
*/
public class ProductDAOFileImpl implements ProductDAO {
private String FILENAME;
private String DELIMITER;
private Map<String, Product> productList = new HashMap<>();
public ProductDAOFileImpl(String filename) {
this.FILENAME = filename;
this.load();
}
@Override
public List<Product> ReadAll() {
return new ArrayList<>(productList.values());
}
@Override
public Product ReadByName(String productType) {
return productList.get(productType);
}
private void load() {
try {
Scanner sc = new Scanner(
new BufferedReader(new FileReader(this.FILENAME)));
while (sc.hasNextLine()) {
String currentLine = sc.nextLine();
Product selectedProduct = Mapper.MapToProduct(currentLine);
productList.put(selectedProduct.getProductType(), selectedProduct);
}
sc.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(TaxDAOFileImpl.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"Iblasio.sanchez@gmail.com"
] | Iblasio.sanchez@gmail.com |
64477f8fa8d00def7774471ebad739178ae3a70d | 778bc5b0ca6c6f94a685559574294a88396434dc | /Canopus dev/org.unipampa.lesse.canopus.edit/src/canopus/canopusPerformanceMonitoring/canopusPerformanceMetric/provider/AssociationCounterCriteriaThresholdItemProvider.java | b055de3b87a92d8a319c6fe2a109be45727c855c | [] | no_license | OpenMLPerfProject/OpenMLPerf | d7b4a636868241e99ba111973c2611babbb17e04 | fe87d909603140271f9e1c40751ed411505d6094 | refs/heads/master | 2022-11-22T12:00:21.985559 | 2020-07-27T00:42:18 | 2020-07-27T00:42:18 | 272,554,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,129 | java | /**
*/
package canopus.canopusPerformanceMonitoring.canopusPerformanceMetric.provider;
import canopus.canopusPerformanceMonitoring.canopusPerformanceMetric.ASSOCIATION_CRITERIA;
import canopus.canopusPerformanceMonitoring.canopusPerformanceMetric.AssociationCounterCriteriaThreshold;
import canopus.canopusPerformanceMonitoring.canopusPerformanceMetric.CanopusPerformanceMetricPackage;
import canopus.provider.CanopusEditPlugin;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link canopus.canopusPerformanceMonitoring.canopusPerformanceMetric.AssociationCounterCriteriaThreshold} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class AssociationCounterCriteriaThresholdItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AssociationCounterCriteriaThresholdItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addAssociationCriteriaPropertyDescriptor(object);
addThresholdPropertyDescriptor(object);
addCriteriaPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Association Criteria feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAssociationCriteriaPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AssociationCounterCriteriaThreshold_associationCriteria_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AssociationCounterCriteriaThreshold_associationCriteria_feature", "_UI_AssociationCounterCriteriaThreshold_type"),
CanopusPerformanceMetricPackage.Literals.ASSOCIATION_COUNTER_CRITERIA_THRESHOLD__ASSOCIATION_CRITERIA,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Threshold feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addThresholdPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AssociationCounterCriteriaThreshold_threshold_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AssociationCounterCriteriaThreshold_threshold_feature", "_UI_AssociationCounterCriteriaThreshold_type"),
CanopusPerformanceMetricPackage.Literals.ASSOCIATION_COUNTER_CRITERIA_THRESHOLD__THRESHOLD,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Criteria feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCriteriaPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AssociationCounterCriteriaThreshold_criteria_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AssociationCounterCriteriaThreshold_criteria_feature", "_UI_AssociationCounterCriteriaThreshold_type"),
CanopusPerformanceMetricPackage.Literals.ASSOCIATION_COUNTER_CRITERIA_THRESHOLD__CRITERIA,
true,
false,
true,
null,
null,
null));
}
/**
* This returns AssociationCounterCriteriaThreshold.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/AssociationCounterCriteriaThreshold"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
ASSOCIATION_CRITERIA labelValue = ((AssociationCounterCriteriaThreshold)object).getAssociationCriteria();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_AssociationCounterCriteriaThreshold_type") :
getString("_UI_AssociationCounterCriteriaThreshold_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(AssociationCounterCriteriaThreshold.class)) {
case CanopusPerformanceMetricPackage.ASSOCIATION_COUNTER_CRITERIA_THRESHOLD__ASSOCIATION_CRITERIA:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return CanopusEditPlugin.INSTANCE;
}
}
| [
"joaocarbonellpc@gmail.com"
] | joaocarbonellpc@gmail.com |
5e61483f46bd55cf3b0c863649bf6356f047d832 | b9a3b34d840f3165a4daf27407f5e0234b0d872c | /src/main/java/org/mybatis/dynamic/sql/select/CountDSLCompleter.java | 63dc135ccb81959b63e3e9b7cff641db8b558dad | [
"Apache-2.0"
] | permissive | topsoft-support/mybatis-dynamic-sql | e74df8854e1871518ed65ee5fdd2007a3cebde95 | 060b27f975207e894a21e9277d0bb21c94273380 | refs/heads/master | 2020-06-25T11:57:01.397443 | 2019-09-07T02:33:28 | 2019-09-07T02:33:28 | 199,301,980 | 0 | 0 | NOASSERTION | 2019-09-07T02:33:29 | 2019-07-28T15:06:34 | Java | UTF-8 | Java | false | false | 2,427 | java | /**
* Copyright 2016-2019 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.mybatis.dynamic.sql.select;
import java.util.function.Function;
import java.util.function.ToLongFunction;
import org.mybatis.dynamic.sql.util.Buildable;
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
/**
* Represents a function that can be used to create a general count method. When using this function,
* you can create a method that does not require a user to call the build() and render() methods - making
* client code look a bit cleaner.
*
* <p>This function is intended to by used in conjunction with a utility method like
* {@link MyBatis3Utils#count(ToLongFunction, CountDSL, CountDSLCompleter)}
*
* <p>For example, you can create mapper interface methods like this:
*
* <pre>
* @SelectProvider(type=SqlProviderAdapter.class, method="select")
* long count(SelectStatementProvider selectStatement);
*
* default long count(CountDSLCompleter completer) {
* return MyBatis3Utils.count(this::count, person, completer);
* }
* </pre>
*
* <p>And then call the simplified default method like this:
*
* <pre>
* long rows = mapper.count(c ->
* c.where(occupation, isNull()));
* </pre>
*
* <p>You can implement a "count all" with the following code:
*
* <pre>
* long rows = mapper.count(c -> c);
* </pre>
*
* <p>Or
*
* <pre>
* long rows = mapper.count(CountDSLCompleter.allRows());
* </pre>
*
* @author Jeff Butler
*/
@FunctionalInterface
public interface CountDSLCompleter extends
Function<CountDSL<SelectModel>, Buildable<SelectModel>> {
/**
* Returns a completer that can be used to count every row in a table.
*
* @return the completer that will count every row in a table
*/
static CountDSLCompleter allRows() {
return c -> c;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
74dc0e3956e6c6667a2f54a85139195e8bd9e813 | dc7fed8c6746bf9fbaaf3e5cbcf66ff6cb1cfe30 | /src/com/yijun/androidsafeguard/AntiTheftSetup1Activity.java | b7dc35f827a3a213427989ddd6b6119816df926b | [] | no_license | siren0413/AndroidSafeGuard | f77da343e1952ac2623f815ffce439ccdac6588f | b7c9c0fcc34db8301b04488b532d595705e1507f | refs/heads/master | 2021-01-10T20:05:22.549644 | 2014-09-11T07:18:54 | 2014-09-11T07:18:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 967 | java | package com.yijun.androidsafeguard;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class AntiTheftSetup1Activity extends AntiTheftBaseSetupActivity {
private static final String TAG = "AntiTheftSetup1Activity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_anti_theft_setup1);
}
public void next(View view){
Intent intent = new Intent(this, AntiTheftSetup2Activity.class);
startActivity(intent);
Log.i(TAG, "Enter Anti-theft setup 2 activity");
finish();
overridePendingTransition(R.anim.trans_in, R.anim.trans_out);
}
public void previous(View view){
Log.i(TAG, "Roll back to Anti-theft setup 1 activity");
finish();
overridePendingTransition(R.anim.rev_trans_in, R.anim.rev_trans_out);
}
}
| [
"siren0413@gmail.com"
] | siren0413@gmail.com |
a9c36b54a6bbb5380c60c4d6b26ddef33146f451 | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_3/src/g/c/b/Calc_1_3_6218.java | 6265d80b1976894c19b59e4f746c152432b3fb56 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package g.c.b;
public class Calc_1_3_6218 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
a61ab2bec8622cb7f02a245df67ab77d840ec91c | dd8ab753ee6fd873d3957799667cfa905b25a853 | /PerformanceOptimizationTopic/jvmdemo/src/main/java/com/gupao/edu/vip/course/chaper2/BigObjectIntoOldGen.java | 66d04c25eda4c1d68d1aad7d2258590ea003122e | [] | no_license | Vadin/gupaoedu | 78a5d44a1b4cde76fd5513fcad3cb1802eb2fdb2 | 33d24ed733b492c2b2979d5802f2d1d90c2accc2 | refs/heads/master | 2021-10-21T08:47:17.310778 | 2019-03-03T23:08:25 | 2019-03-03T23:08:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package com.gupao.edu.vip.course.chaper2;
public class BigObjectIntoOldGen {
public static void main(String[] args) {
byte[] d1 = new byte[6 * 1024 * 1024];
}
}
| [
"denny9527@qq.com"
] | denny9527@qq.com |
8e98d6ddc7bf5564637c59fe3bd07b78a5bec220 | befd1c8c70d0779d2c3c2ea26c17a7addeca42e8 | /org/stonybrookschool/merits/objects/User.java | 5bc4ebb385a6af1d4b0183d4461943a10d838bd6 | [] | no_license | anders94/sbs | 33e2d480e6de79d7b8174ca46ff8469f2ff45a04 | 754b2fd11319871e0b32f68373ffd4f0daa1447c | refs/heads/master | 2020-06-05T18:55:42.572429 | 2013-08-31T13:09:17 | 2013-08-31T13:09:17 | 12,505,391 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,178 | java | package org.stonybrookschool.merits.objects;
public class User
{
private int id, yearId;
private String first, last, title, date, username, password;
private String email, faculty, superuser, year;
private String studentCarPermission, adultCarPermission;
private float merits, demerits;
public User ( )
{
}
public User ( int id, String first, String last, String title,
String date, String username,
String email, String faculty, String superuser,
float merits, float demerits, String year,
String studentCarPermission, String adultCarPermission )
{
this.id = id;
this.first = first;
this.last = last;
this.title = title;
this.date = date;
this.username = username;
this.email = email;
this.faculty = faculty;
this.superuser = superuser;
this.merits = merits;
this.demerits = demerits;
this.year = year;
this.studentCarPermission = studentCarPermission;
this.adultCarPermission = adultCarPermission;
}
public int getId( ) { return( id ); }
public String getFirst( ) { return( first ); }
public String getLast( ) { return( last ); }
public String getTitle( ) { return( title ); }
public String getDate( ) { return( date ); }
public String getUsername( ) { return( username ); }
public String getPassword( ) { return( password ); }
public String getEmail( ) { return( email ); }
public String getFaculty( ) { return( faculty ); }
public String getSuperuser( ) { return( superuser ); }
public float getMerits( ) { return( merits ); }
public float getDemerits( ) { return( demerits ); }
public String getYear( ) { return( year ); }
public int getYearId( ) { return( yearId ); }
public String getStudentCarPermission( ) { return( studentCarPermission ); }
public String getAdultCarPermission( ) { return( adultCarPermission ); }
public void setId( int id ) { this.id = id; }
public void setFirst( String first ) { this.first = first; }
public void setLast( String last ) { this.last = last; }
public void setTitle( String title ) { this.title = title; }
public void setDate( String date ) { this.date = date; }
public void setUsername( String username ) { this.username = username; }
public void setPassword( String password ) { this.password = password; }
public void setEmail( String email ) { this.email = email; }
public void setFaculty( String faculty ) { this.faculty = faculty; }
public void setSuperuser( String superuser ) { this.superuser = superuser; }
public void setMerits( float merits ) { this.merits = merits; }
public void setDemerits( float demerits ) { this.demerits = demerits; }
public void setYear( String year ) { this.year = year; }
public void setYearId( int yearId ) { this.yearId = yearId; }
public void setStudentCarPermission( String studentCarPermission ) { this.studentCarPermission = studentCarPermission; }
public void setAdultCarPermission( String adultCarPermission ) { this.adultCarPermission = adultCarPermission; }
}
| [
"anders-git@evantide.com"
] | anders-git@evantide.com |
26368facc7621c58c57221506f8f27e900c21b25 | 662f1eba7874c788e7b86e8f9964c4c6d79d6f11 | /onlide/web/src/main/java/es/upm/muss/agile/webapp/filter/LocaleFilter.java | 204d31b3465a0260c9e353a89f6b181fd933301b | [] | no_license | nanobeto/onlide | 3e096eacefb492d9c0c2b804b1f782628f7f50fd | 81f012ebb45c5e834aa52ab803677b47bfd8ec04 | refs/heads/master | 2021-01-01T16:04:53.956537 | 2013-11-21T14:22:52 | 2013-11-21T14:22:52 | 14,552,673 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,685 | java | package es.upm.muss.agile.webapp.filter;
import es.upm.muss.agile.Constants;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.jstl.core.Config;
import java.io.IOException;
import java.util.Locale;
import java.util.Map;
/**
* Filter to wrap request with a request including user preferred locale.
*/
public class LocaleFilter extends OncePerRequestFilter {
/**
* This method looks for a "locale" request parameter. If it finds one, it sets it as the preferred locale
* and also configures it to work with JSTL.
*
* @param request the current request
* @param response the current response
* @param chain the chain
* @throws IOException when something goes wrong
* @throws ServletException when a communication failure happens
*/
@SuppressWarnings("unchecked")
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
FilterChain chain)
throws IOException, ServletException {
String locale = request.getParameter("locale");
Locale preferredLocale = null;
if (locale != null) {
int indexOfUnderscore = locale.indexOf('_');
if (indexOfUnderscore != -1) {
String language = locale.substring(0, indexOfUnderscore);
String country = locale.substring(indexOfUnderscore + 1);
preferredLocale = new Locale(language, country);
} else {
preferredLocale = new Locale(locale);
}
}
HttpSession session = request.getSession(false);
if (session != null) {
if (preferredLocale == null) {
preferredLocale = (Locale) session.getAttribute(Constants.PREFERRED_LOCALE_KEY);
} else {
session.setAttribute(Constants.PREFERRED_LOCALE_KEY, preferredLocale);
Config.set(session, Config.FMT_LOCALE, preferredLocale);
}
if (preferredLocale != null && !(request instanceof LocaleRequestWrapper)) {
request = new LocaleRequestWrapper(request, preferredLocale);
LocaleContextHolder.setLocale(preferredLocale);
}
}
chain.doFilter(request, response);
// Reset thread-bound LocaleContext.
LocaleContextHolder.setLocaleContext(null);
}
}
| [
"nanobeto@gmail.com"
] | nanobeto@gmail.com |
814469179478b81a63a186ae5b0f57ca9ea5e9b6 | 3f10af579d2100ad9a519b162d65bd6f0b429129 | /RecyclerViewDemo/app/src/main/java/com/example/lenovo/recyclerviewdemo/Holder/TwoViewHolder.java | 414c8c17f3c45052c22705548ebe9a84f63f1c8b | [] | no_license | wangaiji/Android | 97f5ad89286e5977f21ca50a75c4b2a6ec0d6cfd | 5d062ed1faac6022acfd20a704ba1bc76bcc3a9f | refs/heads/master | 2020-03-25T06:17:56.110494 | 2019-10-14T02:21:30 | 2019-10-14T02:21:30 | 143,493,843 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package com.example.lenovo.recyclerviewdemo.Holder;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.lenovo.recyclerviewdemo.R;
public class TwoViewHolder extends RecyclerView.ViewHolder{
public View twoView;
public TextView title2;
public ImageView image;
public TextView source2;
public TwoViewHolder(View view) {
super(view);
this.twoView = view;
this.title2 = view.findViewById(R.id.title2);
this.image = view.findViewById(R.id.image);
this.source2 = view.findViewById(R.id.source2);
}
}
| [
"1670142221@qq.com"
] | 1670142221@qq.com |
5fdaa833ac5f68ddfb5dc83c70756899aa057007 | 59e4596f07b00a69feabb1fb119619aa58964dd4 | /StsTool.v.1.3.3/eu.aniketos.wp1.ststool.commitments/src/eu/aniketos/wp1/ststool/commitments/actions/CommitmentsResponsibleFilterAction.java | 40d09999831829c8bdd737e3d607f0c24e8a71c0 | [] | no_license | AniketosEU/Socio-technical-Security-Requirements | 895bac6785af1a40cb55afa9cb3dd73f83f8011f | 7ce04c023af6c3e77fa4741734da7edac103c875 | refs/heads/master | 2018-12-31T17:08:39.594985 | 2014-02-21T14:36:14 | 2014-02-21T14:36:14 | 15,801,803 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,344 | java | /*
* CommitmentsResponsibleFilterAction.java
*
* This file is part of the STS-Tool project.
* Copyright (c) 2011-2012 "University of Trento - DISI" All rights reserved.
*
* Is strictly forbidden to remove this copyright notice from this source code.
*
* Disclaimer of Warranty:
* STS-Tool (this software) is provided "as-is" and without warranty of any kind,
* express, implied or otherwise, including without limitation, any warranty of
* merchantability or fitness for a particular purpose.
* In no event shall the copyright holder or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused and on
* any theory of liability, whether in contract, strict liability, or tort (including
* negligence or otherwise) arising in any way out of the use of this software, even
* if advised of the possibility of such damage.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License version 3
* as published by the Free Software Foundation with the addition of the
* following permission added to Section 15 as permitted in Section 7(a):
* FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
* "University of Trento - DISI","University of Trento - DISI" DISCLAIMS THE
* WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program; if not, see http://www.gnu.org/licenses or write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA, 02110-1301 USA, or download the license from the following URL:
* http://www.sts-tool.eu/License.php
*
* For more information, please contact STS-Tool group at this
* address: ststool@disi.unitn.it
*
*/
package eu.aniketos.wp1.ststool.commitments.actions;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import eu.aniketos.wp1.ststool.commitments.interfaces.ICommitment;
import eu.aniketos.wp1.ststool.commitments.manager.CommitmentManager;
import eu.aniketos.wp1.ststool.commitments.view.part.CommitmentsView;
public class CommitmentsResponsibleFilterAction extends Action {
private final Shell shell;
private final CommitmentsView view;
public CommitmentsResponsibleFilterAction(CommitmentsView view, String text) {
super(text);
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
this.view = view;
}
@Override
public void run(){
Set<String> names = new HashSet<String>();
for (ICommitment c : CommitmentManager.getManager().getAllCommitments()) {
names.add(c.getResponsible());
}
FilterDialog dialog = new FilterDialog(shell, "Select 'Responsible' to Filter", view.getDebtorFilterPattern(), new ArrayList<String>(names));
if (dialog.open() == InputDialog.OK) view.setDebtorFilter(dialog.getText());
}
}
| [
"mattia@MacBookPro.local"
] | mattia@MacBookPro.local |
7c70b2cd2b09de0224eac80263c7c042bf807733 | 665a8fb0d39f18f9c41425fe0a1fe6774edbb8de | /JAVA OOPs/src/ExpressionsAndCalculationsWithUserInput/Advanced/UserInputandConcatenation.java | 5f910d5cee3cced756dcdcf9bbb75710e5769062 | [] | no_license | vinzlercodes/Java-OOPs--Algorithms | 73d2cdcdb55bd7a542fb7d7cd12c9a8637d8ee88 | 4379aa1e78dc79ede1891896b756907bcdfa0c14 | refs/heads/main | 2023-02-10T05:31:55.533874 | 2021-01-09T08:44:03 | 2021-01-09T08:44:03 | 326,488,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package ExpressionsAndCalculationsWithUserInput.Advanced;
import java.util.Scanner;
public class UserInputandConcatenation {
public static String concatenation(String a, float b, char c){
/*
this method defines a concatenation function that
that joins the string, number (float or int) and a unique character
*/
String x = a + b + c;
return x;
}// end of method
public static void main(String[]args){
/*
The main method generates a unique username for the user
the method takes in any string, any number and a unique character from the user
and concatenates them together to form a unique username string
*/
Scanner sc = new Scanner(System.in);
System.out.println("Enter a string: ");
String z = sc.nextLine();
System.out.println("Enter a number: ");
float f = sc.nextFloat();
System.out.println("Enter a unique character: ");
char h = sc.next().charAt(0);
String concatenated = concatenation(z, f, h);
System.out.println("Your new username is: " + concatenated);
}// end of main method
}// end of class
| [
"vinayak.sengupta@gmail.com"
] | vinayak.sengupta@gmail.com |
3d606464a491c2a23350b4ee3bb4e2511dae553c | 594aa88a3159e58d2ba7df9a567f16df2a04bccf | /src/main/java/com/cg/goa/model/AddressModel.java | 4b7b0eaf06a8f088f9a510607fc54a45f0814654 | [] | no_license | ShubhashishVarshney/Great-Outdoor-Application-middleware | 00d2752286aa9fd8dd449c2002f54ee04d588976 | 4c9ae8dbda28d1d6ac45ef3326d2d08bc8cc1b03 | refs/heads/master | 2023-04-24T11:15:08.233367 | 2021-05-04T14:34:40 | 2021-05-04T14:34:40 | 364,171,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,770 | java | package com.cg.goa.model;
import javax.persistence.Embeddable;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
@Embeddable
public class AddressModel {
/*
* Private Members Validation
*/
@NotNull(message = "address Id cannot be null")
@NotBlank(message = "address Id cannot be blank")
private String addressId;
@NotNull(message = "buildingNo cannot be null")
@NotBlank(message = "buildingNo cannot be blank")
private String buildingName;
@NotNull(message = "streetName cannot be null")
@NotBlank(message = "streetName cannot be blank")
private String streetNo;
@NotNull(message = "area cannot be null")
@NotBlank(message = "area cannot be blank")
private String area;
@NotBlank(message = "city cannot be blank")
private String city;
@NotNull(message = "state cannot be null")
@NotBlank(message = "state cannot be blank")
private String state;
@Min(value = 6, message = "pincode should be of 6 digits")
@Max(value = 6, message = "pincode should be of 6 digits")
private int zip;
/*
* A default Constructor with no implementation
*/
public AddressModel() {
// no implementation
}
/*
* A Parameterized Constructor for assigning the values to private members
*/
public AddressModel(String addressId, String buildingName, String streetNo, String area, String city, String state,
int zip) {
super();
this.addressId = addressId;
this.buildingName = buildingName;
this.streetNo = streetNo;
this.area = area;
this.city = city;
this.state = state;
this.zip = zip;
}
public String getAddressId() {
return addressId;
}
public void setAddressId(String addressId) {
this.addressId = addressId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
public String getStreetNo() {
return streetNo;
}
public void setStreetNo(String streetNo) {
this.streetNo = streetNo;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public int getZip() {
return zip;
}
public void setZip(int zip) {
this.zip = zip;
}
@Override
public String toString() {
return String.format(
"AddressModel [addressId=%s, buildingName=%s, streetNo=%s, area=%s, city=%s, state=%s, zip=%s]",
addressId, buildingName, streetNo, area, city, state, zip);
}
}
| [
"65329259shubh01"
] | 65329259shubh01 |
216f179368e23a3c202332fc87b2a138b82a5ff1 | 9a163eba3ae364e4c8604592a62699fda99e9018 | /src/main/java/Latihan6.java | e36e4dd04334fb86a72f94338ccebbf89eb12e1a | [] | no_license | Ayajatra/JavaJSONUtilities | 4cea73a7b06784f47619de9013f676bec496f704 | ea06df073684739f402b0b762a1eb604bb1f83bc | refs/heads/master | 2023-04-30T11:01:45.223214 | 2019-11-29T08:45:12 | 2019-11-29T08:45:12 | 224,813,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | import org.json.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Latihan6 {
public static void main(String[] args) {
List<User> users = IntStream
.range(0, 5)
.mapToObj(x -> new User(x, "Name" + String.valueOf(x)))
.collect(Collectors.toList());
List<Post> posts = IntStream
.range(0, 5)
.mapToObj(x -> new Post(x, "Title" + String.valueOf(x), "Body" + String.valueOf(x), x, users))
.collect(Collectors.toList());
JSONArray jsonArray = JSONUtils.toJSONArray(posts);
List<Post> _posts = JSONUtils.fromJSONArray(jsonArray, Post.class);
int test = 1;
}
}
| [
"artajayahansen12@gmail.com"
] | artajayahansen12@gmail.com |
e1518e381b836c7ef18469e0911a75a71d6704f4 | 7dc5976a590a6836d4ff5c089fa4f3372a14a05c | /app/src/main/java/com/open/openglstudy/util/LogUtil.java | 5503db0417a462ee87f0ed57d4b8633617b8fb3a | [] | no_license | liudao01/openGLStudy | b41f91c859aa5b72664240f1f7127a190308f704 | c6d3294c7d39d9e69c270db943925f8d5df84bee | refs/heads/main | 2023-01-04T15:03:47.684481 | 2020-10-28T03:18:51 | 2020-10-28T03:18:51 | 306,270,137 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,877 | java | package com.open.openglstudy.util;
import android.util.Log;
import com.open.openglstudy.BuildConfig;
/**
* @explain log工具类 tag值可以直接过滤为当前类
* @author liuml.
* @time 2017/12/5 10:01
*/
public class LogUtil {
public static boolean DEBUG = BuildConfig.DEBUG;
/**
* Don't let anyone instantiate this class.
*/
private LogUtil() {
throw new Error("Do not need instantiate!");
}
public static void d(String TAG, String msg) {
if (DEBUG) {
Log.d(TAG, msg);
}
}
public static void e(String tag, String msg) {
if (DEBUG) {
Log.e(tag, msg);
}
}
public static void i(String tag, String msg) {
if (DEBUG) {
Log.i(tag, msg);
}
}
public static void v(String tag, String msg) {
if (DEBUG) {
Log.v(tag, msg);
}
}
public static void v(String tag, String msg, Throwable tr) {
if (DEBUG) {
Log.v(tag, msg, tr);
}
}
public static void w(String tag, String msg) {
if (DEBUG) {
Log.w(tag, msg);
}
}
/**
* Send a {@link Log#VERBOSE} log message.
*
* @param obj
*/
public static void v(Object obj) {
if (DEBUG) {
String tag = getClassName();
String msg = obj != null ? obj.toString() : "obj == null";
Log.v(tag, msg);
}
}
/**
* @param obj
*/
public static void d(Object obj) {
if (DEBUG) {
String tag = getClassName();
String msg = obj != null ? obj.toString() : "obj == null";
Log.d(tag, msg);
}
}
/**
* Send an {@link Log#INFO} log message.
*
* @param obj
*/
public static void i(Object obj) {
if (DEBUG) {
String tag = getClassName();
String msg = obj != null ? obj.toString() : "obj == null";
Log.i(tag, msg);
}
}
/**
* Send a {@link Log#WARN} log message.
*
* @param obj
*/
public static void w(Object obj) {
if (DEBUG) {
String tag = getClassName();
String msg = obj != null ? obj.toString() : "obj == null";
Log.w(tag, msg);
}
}
/**
* Send an {@link Log#ERROR} log message.
*
* @param obj
*/
public static void e(Object obj) {
if (DEBUG) {
String tag = getClassName();
String msg = obj != null ? obj.toString() : "obj == null";
Log.e(tag, msg);
}
}
private static String getClassName() {
String result = "";
StackTraceElement thisMethodStack = (new Exception()).getStackTrace()[2];
result = thisMethodStack.getClassName();
return result;
}
}
| [
"liudao1@qq.com"
] | liudao1@qq.com |
e2ba4bbb69743810fb024daf09069beceb120150 | 20472047ed78aa49509f81c2f48d4d3e59954520 | /src/main/java/org/websync/supportedframeworks/jdi/AttributesInitialization.java | dcc8aa3be039d5ad98227ecc3b59c2a5bcc7219d | [
"Apache-2.0"
] | permissive | codacy-badger/websync-idea | e6c38885c6830dae318f0121215378c35046165b | 973fcb840458a413f0c76e9b6cae1989bf960a0e | refs/heads/master | 2021-01-16T01:10:00.438974 | 2020-02-20T12:57:39 | 2020-02-20T12:57:39 | 241,811,840 | 0 | 0 | Apache-2.0 | 2020-02-20T06:36:49 | 2020-02-20T06:36:48 | null | UTF-8 | Java | false | false | 2,486 | java | package org.websync.supportedframeworks.jdi;
import com.epam.jdi.light.elements.common.Label;
import com.epam.jdi.light.elements.composite.WebPage;
import com.epam.jdi.light.elements.pageobjects.annotations.*;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.*;
public class AttributesInitialization extends WebPage {
@Css(".testCss")
public Label initializedWithCss;
@XPath("//testXpath")
public Label initializedWithXpath;
@ByText("test")
public Label initializedWithByText;
@UI("test")
public Label initializedWithUi;
@WithText("test")
public Label initializedWithWithText;
@FindBy(id = "test")
public Label initializedWithFindBy;
@FindBys({@FindBy(id = "test"), @FindBy(id = "test1")})
public Label initializedWithFindBys;
@Frame("test")
public Label initializedWithFrame;
@Name("test")
public Label initializedWithName;
@Title("test")
public Label initializedWithTitle;
@XPath("//testXpath")
@Css(".testCss")
public Label overlappedCssAndXpath;
@Css("//testCss")
public Label wrongCssFormat;
@XPath(".testXpath")
public Label wrongXpathFormat;
public String getLabelValueByCss() {
return initializedWithCss.getValue();
}
public String getLabelValueByXpath() {
return initializedWithXpath.getValue();
}
public String getLabelValueByText() {
return initializedWithByText.getValue();
}
public String getLabelValueByUi() {
return initializedWithUi.getValue();
}
public String getLabelValueByWithText() {
return initializedWithWithText.getValue();
}
public String getLabelValueByFindBy() {
return initializedWithFindBy.getValue();
}
public String getLabelValueByFindBys() {
return initializedWithFindBys.getValue();
}
public String getLabelValueByFrame() {
return initializedWithFrame.getValue();
}
public String getLabelValueByName() {
return initializedWithName.getValue();
}
public String getLabelValueByTitle() {
return initializedWithTitle.getValue();
}
public String getLabelValueByOverlappedCssAndXpath() {
return overlappedCssAndXpath.getValue();
}
public String getLabelValueByWrongCssFormat() {
return wrongCssFormat.getValue();
}
public String getLabelValueByWrongXpathFormat() {
return wrongXpathFormat.getValue();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
826fa4c13601b067eba7cfabee5c9c4bf34d2c84 | 0aa9993aad7dbf3d32210600f34b345958bcf03e | /app/src/androidTest/java/mm/spp/ExampleInstrumentedTest.java | fd383836ca667106d88a204b66730160f79379b3 | [] | no_license | mariusolariu/Spp | 30d5ccee6d5bbf6aad204af87fdcd2c5dfaaf54b | 54717f334f2684132c8da261043adb9a59e46c87 | refs/heads/master | 2021-09-03T21:27:05.313132 | 2018-01-12T04:46:55 | 2018-01-12T04:46:55 | 115,653,817 | 0 | 0 | null | 2018-01-07T18:49:24 | 2017-12-28T19:34:53 | Java | UTF-8 | Java | false | false | 696 | java | package mm.spp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("mm.spp", appContext.getPackageName());
}
}
| [
"marius.olariu@ssi-schaefer.com"
] | marius.olariu@ssi-schaefer.com |
e490543df9b7c30ca82b1b45ec495b7c8b301403 | ac60d08fae7a6beba5a01ee9c1bccf70cf1e401f | /impl/src/main/java/uk/ac/ox/oucs/vle/xcri/daisy/CourseSubUnit.java | 7ae55d329c2024bc26bb0f5ab346f4a83b0524d8 | [] | no_license | buckett/wl-course-signup | f1bc604bc31cd0f4492b77a58af45e9967e075e6 | 63b818965a83045fb84d5b85f3e6be3dd96decae | refs/heads/master | 2021-01-15T20:33:39.831058 | 2013-01-22T16:53:25 | 2013-01-22T16:53:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java | package uk.ac.ox.oucs.vle.xcri.daisy;
import org.jdom.Element;
import org.xcri.Extension;
import org.xcri.exceptions.InvalidElementException;
public class CourseSubUnit extends DaisyElement implements Extension {
private String code;
/**
* @return the element name
*/
@Override
public String getName() {
return "courseSubUnit";
}
/**
* @return the identifier
*/
public String getCode() {
return this.code;
}
/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}
/*
*
*/
@Override
public void fromXml(Element element) throws InvalidElementException {
super.fromXml(element);
if (null != element.getAttribute("code")) {
this.setCode(element.getAttributeValue("code"));
}
}
/* (non-Javadoc)
* @see org.xcri.types.XcriElement#toXml()
*/
@Override
public Element toXml() {
Element element = super.toXml();
if (this.getCode() != null) {
element.setAttribute("code", this.getCode(), getNamespace());
}
return element;
}
}
| [
"marc.savitsky@it.ox.ac.uk"
] | marc.savitsky@it.ox.ac.uk |
1cbbf27c5d7c8d8d627e60e7da16b7b97b61e515 | 9f98af39ad5d04c43ae9d8fac1f6ea0bbd3f417c | /src/main/java/com/moses/leet/n0900/FairCandySwap.java | b10a2a24e6209cdea0f60e97222c5b0df51b74da | [] | no_license | mosesgi/leet | 818fee0e2f894144295b9b30a22142c01bd75b6b | 94159c78cf7ba3eed1f703095234bd9ed5f665fb | refs/heads/master | 2021-07-10T07:34:30.763807 | 2021-03-30T14:55:19 | 2021-03-30T14:55:19 | 231,286,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,833 | java | package com.moses.leet.n0900;
import java.util.HashSet;
import java.util.Set;
/**
* Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar of candy that Bob has.
*
* Since they are friends, they would like to exchange one candy bar each so that after the exchange, they both have the same total amount of candy. (The total amount of candy a person has is the sum of the sizes of candy bars they have.)
*
* Return an integer array ans where ans[0] is the size of the candy bar that Alice must exchange, and ans[1] is the size of the candy bar that Bob must exchange.
*
* If there are multiple answers, you may return any one of them. It is guaranteed an answer exists.
*
*
*
* Example 1:
*
* Input: A = [1,1], B = [2,2]
* Output: [1,2]
*
* Example 2:
*
* Input: A = [1,2], B = [2,3]
* Output: [1,2]
*
* Example 3:
*
* Input: A = [2], B = [1,3]
* Output: [2,3]
*
* Example 4:
*
* Input: A = [1,2,5], B = [2,4]
* Output: [5,4]
*
*
*
* Note:
*
* 1 <= A.length <= 10000
* 1 <= B.length <= 10000
* 1 <= A[i] <= 100000
* 1 <= B[i] <= 100000
* It is guaranteed that Alice and Bob have different total amounts of candy.
* It is guaranteed there exists an answer.
*
*/
public class FairCandySwap {
public int[] fairCandySwap(int[] A, int[] B) {
int sumA=0, sumB = 0;
Set<Integer> bSet= new HashSet<>();
for(int i : A){
sumA+=i;
}
for(int i : B){
sumB +=i;
bSet.add(i);
}
int diff = sumA-sumB;
diff /=2;
for(int i : A){
if(bSet.contains(i-diff)){
return new int[]{i, i-diff};
}
}
return new int[]{-1, -1};
}
}
| [
"jimuchen@163.com"
] | jimuchen@163.com |
d2d8c76da64c0f326db8967cac99d752fa6e0b7f | 0156bf8e02471127bcec7b98e216d143b9144849 | /codigoFuente/agregacion/point.java | ada0e4e7b722ef6f8d6193348cd17d2ec8204309 | [] | no_license | erickcontreras12/lab2 | cd26ef2eee3e8b9b5420070ef751477d56dd011f | dc8f762b65651cb20b9a4895845727e850f7064a | refs/heads/master | 2021-01-20T08:34:14.226474 | 2017-08-29T04:46:32 | 2017-08-29T04:46:32 | 101,564,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,028 | java | package agregacion;
public class Point {
private int x;
private int y;
public Point(int x, int y) {
super();
this.x = x;
this.y = y;
}
public Point() {
super();
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public String toString() {
return "Point [x=" + x + ", y=" + y + "]";
}
public int[] getXY() {
int[] cord = new int[2];
cord[0] = this.x;
cord[1] = this.y;
return cord;
}
public void setXY(int x, int y){
this.x = x;
this.y = y;
}
public double distance(int x, int y) {
double d = Math.sqrt(Math.pow(this.x-x,2)+Math.pow(this.y-y,2));
return d;
}
public double distance() {
double d = Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));
return d;
}
public double distance(Point otro) {
double d = Math.sqrt(Math.pow(this.x-otro.x,2)+Math.pow(this.y-otro.y,2));
return d;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
79fcfd7d209bc759e5d392689f2a7b5b2a52333b | 446a15f82901027b199d6d6ef21e4f5ff41fffc0 | /src/Admin Panel/adminPanel.java | 5e3a98cc1435d20043c9401fd562e753c40ea1ee | [] | no_license | muhsinalkilinc/stoktakip | 96c10f6acbf40c1d58ae224e64becfb802ff8d0b | 7c2bf6dfe25a66abeed76b8134dfd171af10903e | refs/heads/main | 2023-06-10T09:21:31.675110 | 2021-06-24T14:01:51 | 2021-06-24T14:01:51 | 376,863,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,297 | java | package AdminPanel;
import main.UserConnection;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class adminPanel extends javax.swing.JFrame implements ActionListener {
public adminPanel() {
initComponents();
setLocationRelativeTo(null);
}
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
bCikis = new javax.swing.JButton();
bKullanicilar = new javax.swing.JButton();
bKullaniciEkle = new javax.swing.JButton();
bKullaniciSil = new javax.swing.JButton();
bKullaniciGuncelle = new javax.swing.JButton();
bProgramGit = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Admin Panel");
setPreferredSize(new java.awt.Dimension(1000, 600));
jPanel2.setBackground(new java.awt.Color(45, 76, 184));
jPanel2.setMaximumSize(new java.awt.Dimension(500, 32767));
jPanel2.setPreferredSize(new java.awt.Dimension(300, 600));
bCikis.setBackground(java.awt.Color.darkGray);
bCikis.setForeground(Color.WHITE);
bCikis.setText("Çıkış");
bCikis.addActionListener(this);
bCikis.addActionListener(this);
bKullanicilar.setBackground(java.awt.Color.darkGray);
bKullanicilar.setForeground(Color.WHITE);
bKullanicilar.setText("Kullanıcılar");
bKullanicilar.addActionListener(this);
bKullaniciEkle.setBackground(java.awt.Color.darkGray);
bKullaniciEkle.setForeground(Color.WHITE);
bKullaniciEkle.addActionListener(this);
bKullaniciEkle.setText("Yeni Kullanıcı Ekle");
bKullaniciSil.setBackground(java.awt.Color.darkGray);
bKullaniciSil.setForeground(Color.WHITE);
bKullaniciSil.setText("Kullanıcı Sil");
bKullaniciSil.addActionListener(this);
bKullaniciGuncelle.setBackground(java.awt.Color.darkGray);
bKullaniciGuncelle.setForeground(Color.WHITE);
bKullaniciGuncelle.setText("Kullanıcı Güncelle");
bKullaniciGuncelle.addActionListener(this);
bProgramGit.setBackground(java.awt.Color.darkGray);
bProgramGit.setForeground(Color.WHITE);
bProgramGit.setText("Kullanıcı Değiştir");
bProgramGit.addActionListener(this);
jLabel2.setIcon(new javax.swing.ImageIcon("/home/takoz/Pictures/administrative-tools.png"));
jLabel1.setFont(new java.awt.Font("Arial", 1, 18));
jLabel1.setForeground(new java.awt.Color(254, 254, 254));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("MENÜ");
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bProgramGit, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bKullaniciGuncelle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bCikis, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bKullanicilar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bKullaniciEkle, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bKullaniciSil, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 204, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bKullanicilar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bKullaniciEkle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bKullaniciSil, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bKullaniciGuncelle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bProgramGit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(bCikis, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(34, 34, 34))
);
jLabel1.getAccessibleContext().setAccessibleName("MENU");
jPanel3.setBackground(new java.awt.Color(254, 254, 254));
jPanel3.setPreferredSize(new java.awt.Dimension(700, 600));
jLabel3.setIcon(new javax.swing.ImageIcon(""));
jLabel3.setAlignmentX(0.5F);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(131, 131, 131)
.addComponent(jLabel3)
.addContainerGap(163, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(160, 160, 160)
.addComponent(jLabel3)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 694, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
private javax.swing.JButton bCikis;
private javax.swing.JButton bKullaniciEkle;
private javax.swing.JButton bKullaniciGuncelle;
private javax.swing.JButton bKullaniciSil;
private javax.swing.JButton bKullanicilar;
private javax.swing.JButton bProgramGit;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == bKullanicilar){
jPanel3.removeAll();
javax.swing.JPanel kullanicilar=new kullaniciListe();
kullanicilar.setSize(680,570);
jPanel3.add(kullanicilar);
jPanel3.revalidate();
jPanel3.repaint();
}
else if(e.getSource() == bKullaniciEkle){
jPanel3.removeAll();
javax.swing.JPanel kullanicilar=new KullaniciEkle();
kullanicilar.setSize(680,570);
jPanel3.add(kullanicilar);
jPanel3.revalidate();
jPanel3.repaint();
}
else if(e.getSource() == bKullaniciSil){
jPanel3.removeAll();
javax.swing.JPanel kullanicilar=new KullaniciSil();
kullanicilar.setSize(680,570);
jPanel3.add(kullanicilar);
jPanel3.revalidate();
jPanel3.repaint();
}
else if(e.getSource() == bKullaniciGuncelle){
jPanel3.removeAll();
javax.swing.JPanel kullanicilar=new KullaniciGuncelle();
kullanicilar.setSize(680,570);
jPanel3.add(kullanicilar);
jPanel3.revalidate();
jPanel3.repaint();
}
else if(e.getSource() == bProgramGit){
this.dispose();
new UserConnection().setVisible(true);
}
else if(e.getSource() == bCikis){
this.dispose();
}
}
}
| [
"85889748+muhsinalkilinc@users.noreply.github.com"
] | 85889748+muhsinalkilinc@users.noreply.github.com |
7c48a8c50e9c279c8e014f571945a5116a5b8839 | 980f1b94d70d11fca3a50e159aa1ba8d92e52d73 | /src/org/adligo/fabricate/routines/I_TaskBuilder.java | 7c9a4a2d4628084eb4a134f4c9b0ef1aa08bf687 | [
"Apache-2.0"
] | permissive | adligo/fabricate.adligo.org | 7b9ca3a374ec552687c077bc7444e814329c0a3e | 9e1f20751573461db8e17555993c3b4d51570359 | refs/heads/master | 2020-05-28T05:26:09.346201 | 2020-03-28T16:55:28 | 2020-03-28T16:55:28 | 33,228,680 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 976 | java | package org.adligo.fabricate.routines;
import org.adligo.fabricate.models.common.FabricationRoutineCreationException;
import org.adligo.fabricate.models.common.I_ExpectedRoutineInterface;
import org.adligo.fabricate.models.common.I_FabricationRoutine;
import java.util.Set;
/**
* This interface helps build most routines
* by creating them with the task factory
* @author scott
*
*/
public interface I_TaskBuilder {
/**
*
* @param name
* @param implementedInterfaces the interfaces that
* the client code to this method expects the return
* value to implement.
* @return a fabrication routine
*/
public I_FabricationRoutine buildTask(String name,
Set<I_ExpectedRoutineInterface> implementedInterfaces)
throws FabricationRoutineCreationException;
public I_FabricationRoutine buildInitialTask(String name,
Set<I_ExpectedRoutineInterface> implementedInterfaces)
throws FabricationRoutineCreationException;
}
| [
"scott@adligo.com"
] | scott@adligo.com |
050fa7d3d3d5283a8be91c63ecaebbeaf042ed76 | 7e2fd6292be3763f03318a55740bc11246fa7191 | /util-elasticsearch/src/main/java/com/tyaer/elasticsearch/app/AMSSubQuery.java | 9820145f5fc3542aa2b80c65defd5ab8c34da124 | [] | no_license | chuqiang3344/Twin-Utils | 09f5a4324ce1787cdc8dd7de10eef43087f50a5e | fcbb700f8c9a26f4889bbebe23c18dd1ece87af5 | refs/heads/master | 2021-08-31T21:24:59.760478 | 2017-12-23T00:45:22 | 2017-12-23T00:45:22 | 100,248,673 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 6,672 | java | package com.tyaer.elasticsearch.app;
import com.tyaer.elasticsearch.conf.DTO;
import com.tyaer.elasticsearch.manage.EsClientMananger;
import org.apache.log4j.Logger;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.RangeQueryBuilder;
import org.elasticsearch.search.Scroll;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.sort.SortOrder;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Map;
import java.util.concurrent.ExecutionException;
/**
* Created by Twin on 2017/11/20.
*/
public class AMSSubQuery {
private static final Logger logger = Logger.getLogger(AMSSubQuery.class);
public static void main(String[] args) {
String es_hosts = DTO.configFileReader.getConfigValue("es.hosts");
String esClusterName = DTO.configFileReader.getConfigValue("es.cluster.name");
EsClientMananger esClientMananger = new EsClientMananger(es_hosts, esClusterName);
TransportClient transportClient = esClientMananger.getEsClient();
String index = DTO.configFileReader.getConfigValue("es.index");
SearchRequestBuilder searchRequest = transportClient.prepareSearch(index);
/**
* DSL查询语句组装
*/
BoolQueryBuilder queryBuilder0 = getQueryBuilder0();//todo
//
/***/
/**
* 查询设置
*/
String[] types = new String[]{};
// types = new String[]{"t_article"};
if (types != null && types.length > 0) {
searchRequest.setTypes(types);
}
int pageSize = 10;
Scroll scoll = new Scroll(new TimeValue(600000));//翻页器,保持游标查询窗口一分钟。
searchRequest.addSort("created_at", SortOrder.DESC);//排序规则
searchRequest.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
// .setFetchSource(new String[]{"mid","emotion","zan_count","comments_count","reposts_count","created_at"}, null)//指定返回字段.
// .setFetchSource(new String[]{"subjects_tag", "orgs_tag"}, null)//指定返回字段.
.setQuery(queryBuilder0)
.setSize(pageSize)
.setScroll(scoll);
//打印DSL语句到控制台
if (types != null && types.length > 0) {
StringBuilder types_str = new StringBuilder();
for (String type : types) {
if (types_str.length() > 0) {
types_str.append(",");
}
types_str.append(type);
}
logger.info("\nGET /" + index + "/" + types_str + "/_search" + "\n" + searchRequest.toString());// 打印DSL语句.
} else {
logger.info("\nGET /" + index + "/_search" + "\n" + searchRequest.toString());// 打印DSL语句.
}
/**
* 是否需要翻页
*/
boolean isPaging = true;
/**
* 翻页页数,等于0则无限制
*/
int pageMax = 0;
try {
SearchResponse searchResponse = searchRequest.execute().get();
int sum = 0;
int pageNum = 1;
while (pageNum == 1 || (isPaging && (pageMax == 0 || pageNum < pageMax))) {
String scrollId = searchResponse.getScrollId();
logger.info("###翻页查询,页数:" + pageNum + ",开始ID:" + scrollId);
pageNum++;
SearchHits hits = searchResponse.getHits();
long totalHits = hits.getTotalHits();
SearchHit[] searchHits = hits.getHits();
logger.info("当前查询条件下的记录数:" + totalHits + ",单次返回条数:" + searchHits.length);
sum += searchHits.length;
for (SearchHit searchHit : searchHits) {
// System.out.println(searchHit.getSourceAsString());
Map<String, Object> source = searchHit.getSource();
String id = searchHit.getId();
source.put("_id", id);
System.out.println(source);
/**
* 数据操作
*/
dataHandle(source);//todo
}
/**
* scroll翻页操作
*/
searchResponse = transportClient.prepareSearchScroll(scrollId).setScrollId(scrollId).setScroll(scoll).get();
// String scrollId2 = searchResponse.getScrollId();//全部是一样的值
// logger.info(scrollId.equals(scrollId2));
//Break condition: No hits are returned
if (searchResponse.getHits().getHits().length == 0) {
logger.info("全部查询结果已返回,总计:" + sum + "|结果验证:" + (sum == totalHits));
break;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
private static void dataHandle(Map<String, Object> source) {
}
private static BoolQueryBuilder getQueryBuilder0() {
BoolQueryBuilder queryBuilder0 = QueryBuilders.boolQuery();
//属性
queryBuilder0.must(QueryBuilders.existsQuery("events_tag"));
queryBuilder0.must(QueryBuilders.matchQuery("events_tag", "100683"));
//时间
RangeQueryBuilder queryBuilder_created_at = QueryBuilders.rangeQuery("created_at");
String format = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
queryBuilder_created_at.format(format);
Calendar instance = Calendar.getInstance();
instance.add(Calendar.DAY_OF_MONTH, -150);
queryBuilder_created_at.from(simpleDateFormat.format(instance.getTime()));
queryBuilder_created_at.to("2100-08-12 15:43:45");
queryBuilder0.must(queryBuilder_created_at);
//文章类型
// queryBuilder0.must(QueryBuilders.termQuery("article_type", "1"));
queryBuilder0.mustNot(QueryBuilders.existsQuery("article_type"));//筛选出微博
return queryBuilder0;
}
}
| [
"490350431@qq.com"
] | 490350431@qq.com |
8c6ba6103c594d496e77b5e5d5510755163573e2 | aeebbce4730c95cae394ad25d1daea2527aa1611 | /app/src/main/java/rice/p2p/util/XMLWriter.java | 78a83b381a4bbb40e2c200569d4ff6b278e76c53 | [] | no_license | lordcanete/tfmteleco | 504cb73275c69455f2febb67bc6072cf83c32b0b | 34fbc8f78248b88521d5ee672aea51ed04f8b58b | refs/heads/master | 2020-12-19T06:42:55.781474 | 2020-11-25T19:02:11 | 2020-11-25T19:02:11 | 235,651,842 | 1 | 0 | null | 2020-11-25T19:02:12 | 2020-01-22T19:40:48 | Java | UTF-8 | Java | false | false | 8,073 | java | /*******************************************************************************
"FreePastry" Peer-to-Peer Application Development Substrate
Copyright 2002-2007, Rice University. Copyright 2006-2007, Max Planck Institute
for Software Systems. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Rice University (RICE), Max Planck Institute for Software
Systems (MPI-SWS) nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
permission.
This software is provided by RICE, MPI-SWS and the contributors on an "as is"
basis, without any representations or warranties of any kind, express or implied
including, but not limited to, representations or warranties of
non-infringement, merchantability or fitness for a particular purpose. In no
event shall RICE, MPI-SWS or contributors be liable for any direct, indirect,
incidental, special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including negligence
or otherwise) arising in any way out of the use of this software, even if
advised of the possibility of such damage.
*******************************************************************************/
package rice.p2p.util;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
/**
* XMLWriter is a utility class used by XMLObjectOutputStream to perform the actual
* XML writing. This writing is based on the XML Pull-Parsing API, available online
* at http://www.xmlpull.org. Any of the provided serializer implementations will work
* with this reader.
*
* @version $Id: XMLWriter.java 3613 2007-02-15 14:45:14Z jstewart $
*
* @author Alan Mislove
*/
public class XMLWriter {
/**
* The actual XML serializer, which does the writing
*/
protected XmlSerializer serializer;
/**
* The underlying writer which the serializer uses
*/
protected Writer writer;
/**
* Constructor which takes the provided writer and
* builds a new XML writier to read XML from the writier.
*
* @param out The writer to base this XML writer off of
* @throws IOException If an error occurs
*/
public XMLWriter(OutputStream out) throws IOException {
try {
this.writer = new BufferedWriter(new OutputStreamWriter(out));
XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
serializer = factory.newSerializer();
serializer.setOutput(this.writer);
//serializer.setProperty("http://xmlpull.org/v1/doc/properties.html#serializer-indentation", " ");
//serializer.setProperty("http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", "\n");
//serializer.setFeature("http://xmlpull.org/v1/doc/features.html#serializer-attvalue-use-apostrophe", true);
} catch (XmlPullParserException e) {
throw new IOException("XML Exception thrown: " + e);
}
}
/**
* Method which flushes all buffered data to the underlying writer
*
* @throws IOException If an error occurs
*/
public void flush() throws IOException {
serializer.flush();
}
/**
* Method which flushes and closes the underlying writer, which will
* cause future writer attempts to throw an IOException.
*
* @throws IOException If an error occurs
*/
public void close() throws IOException {
serializer.text("\n");
serializer.flush();
writer.close();
}
/**
* Method which writes a sequence of base64 encoded bytes to the output stream
*
* @param bytes The bytes to write
*/
public void writeBase64(byte[] bytes, int off, int len) throws IOException {
flush();
writer.write(Base64.encodeBytes(bytes, off, len));
}
/**
* Method which writes the XML header to the writer.
*
* @throws IOException If an error occurs
*/
public void writeHeader() throws IOException {
serializer.startDocument(null, null);
serializer.text("\n\n");
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, int value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, double value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, float value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, long value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, char value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, boolean value) throws IOException {
attribute(name, String.valueOf(value));
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
public void attribute(String name, Object value) throws IOException {
if (value == null)
return;
attribute(name, value.toString());
}
/**
* Method which writes an attribute to the XML document.
*
* @param name The name of the attribute to write
* @param value The value to write
* @throws IOException If an error occurs
*/
protected void attribute(String name, String value) throws IOException {
serializer.attribute(null, name, value);
}
/**
* Method which starts the given tag name
*
* @param name The name of the tag to start
* @throws IOException If an error occurs
*/
public void start(String name) throws IOException {
serializer.startTag(null, name);
}
/**
* Method which ends the given tag name
*
* @param name The name of the tag to end
* @throws IOException If an error occurs
*/
public void end(String name) throws IOException {
serializer.endTag(null, name);
}
}
| [
"pedcanvaz@gmail.com"
] | pedcanvaz@gmail.com |
c61759084df682fa3091fd2bcb8bce473dd666b3 | ff1b7804d803f0dab3318894aaa53eee10398b7e | /platformserv-admin-web/src/main/java/cn/wjh/platformserv/admin/web/security/model/AuthUser.java | 0732a344ceed5b33978d3b9560de99420c8a7e78 | [] | no_license | Deament/PlatFormService | 0f3eb87234e14d34e38af62bfbbfdcc330aecb1e | 3cc81322c9eef7aa2d9c7e218048c36849abe344 | refs/heads/master | 2021-01-22T21:41:21.643839 | 2017-03-09T01:18:33 | 2017-03-09T01:18:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,556 | java | package cn.wjh.platformserv.admin.web.security.model;
import cn.wjh.platformserv.common.web.security.model.AbstractAuthUser;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import java.util.Collection;
/**
* Security User
*
* @author michaelfreeman
*/
public class AuthUser extends AbstractAuthUser {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 登录名
*/
private String loginName;
/**
* 姓名
*/
private String name;
/**
* 密码
*/
private String password;
/**
* 邮箱
*/
private String email;
/**
* 电话
*/
private String phone;
/**
* 手机
*/
private String mobile;
/**
* 权限
*/
private Collection<SimpleGrantedAuthority> authorities;
/**
* 锁定
*/
private boolean enabled;
public AuthUser(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String getUsername() {
return loginName;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public void setName(String name) {
this.name = name;
}
@JsonIgnore
@Override
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public void setEmail(String email) {
this.email = email;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public void setAuthorities(Collection<SimpleGrantedAuthority> authorities) {
this.authorities = authorities;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public String getPhone() {
return phone;
}
public String getMobile() {
return mobile;
}
@Override
public Collection<SimpleGrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public boolean isEnabled() {
return enabled;
}
}
| [
"mike.1234@qq.com"
] | mike.1234@qq.com |
b3a301170d38f09dbb93f1e6e988d70eb197a0d1 | 57e834fed01894836e514dd060a982f004c3a40d | /src/main/java/com/harystolho/services/ServiceError.java | 98e0e2d53edb84f6241cd3ce96520f7c5e2a8912 | [
"MIT"
] | permissive | victorbrndls/WebsiteJson | 6aa0d8462f163e9c53f5c3387c8cf598d79cd2f9 | 52b28fd70f58c26f09f51674c374a0db7be41830 | refs/heads/master | 2021-10-20T21:13:26.481614 | 2019-03-01T18:44:53 | 2019-03-01T18:58:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package com.harystolho.services;
public enum ServiceError {
INVALID_CATEGORY_ID, INVALID_MODULE_ID, SUCESS
}
| [
"haristolhogamer@gmail.com"
] | haristolhogamer@gmail.com |
a9e7daecc9770467fd0acc61a47358df6fb6cf4b | 7018ac360e2f83e6b3118a6edc24ca5e5211a344 | /Zuul-Api-Proxy/src/main/java/com/learn/ZuulApiProxy/ZuulApiProxyApplication.java | c12f0df64aff9ee723a1bd660f57911cfd5281b6 | [] | no_license | amitagrahari2512/MicroservicesCoordinating | 784052c2c592e42a7ee47aeadc8c2b828a8a25ff | 6f8cfb5ff7c43c9eab2b3e8c37aa0a0d094b3d78 | refs/heads/master | 2020-07-09T18:51:33.325070 | 2019-08-29T16:11:21 | 2019-08-29T16:11:21 | 204,053,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 865 | java | package com.learn.ZuulApiProxy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import com.learn.ZuulApiProxy.filters.ProxyFilter;
import com.learn.ZuulApiProxy.filters.StartPreFilter;
import com.learn.ZuulApiProxy.filters.StopPostFilter;
@EnableZuulProxy
@SpringBootApplication
public class ZuulApiProxyApplication {
public static void main(String[] args) {
SpringApplication.run(ZuulApiProxyApplication.class, args);
}
@Bean
public ProxyFilter proxyFilter() {
return new ProxyFilter();
}
@Bean
public StartPreFilter startPreFilter() {
return new StartPreFilter();
}
@Bean
public StopPostFilter stopPostFilter() {
return new StopPostFilter();
}
}
| [
"amit.agrahari@nagarro.com"
] | amit.agrahari@nagarro.com |
f765daa5d7cb14bc7635de9be29f6efcaab6d81b | 2564cb0a992644d8deb61aa74d6ff08287938e8d | /OOAD/solid-app/src/dip/violation/XmlLogger.java | a9c3a28f110ef2c631e714c45e170ec9785ea4cc | [] | no_license | stdheeraj/dheeraj_swabhav | b87d7769326cab4b58f58525d5d5fa0a76c155eb | 3a337141a690b6400565384c6afee7dfc008dbbd | refs/heads/master | 2018-10-13T05:57:37.579794 | 2018-08-24T13:24:54 | 2018-08-24T13:24:54 | 117,322,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package dip.violation;
public class XmlLogger {
public void log(Exception e){
System.out.println("Error message logging to XML file.");
System.out.println("Error logged as "+e.getMessage());
}
}
| [
"cdheeraj76@gmail.com"
] | cdheeraj76@gmail.com |
e353bbba4dc0c70957ff68d00048d80d8e008dc1 | 8c8d2ac89a4d933d3988e2fa334d096fd0841ff2 | /src/main/java/guru/springfamework/api/v1/mapper/CustomerMapper.java | 634008eeff3c80733f6dec69c70d3ea714446821 | [] | no_license | shingeru/spring5-mvc-rest | 1d3caf211280ef9ec21130a9810a12f2c6794432 | 6e94971dc0b505517c8808bb8da52af8926adc78 | refs/heads/master | 2020-04-15T18:04:43.756693 | 2019-01-13T20:10:37 | 2019-01-13T20:10:37 | 164,899,877 | 0 | 0 | null | 2019-01-09T16:37:40 | 2019-01-09T16:37:38 | null | UTF-8 | Java | false | false | 447 | java | package guru.springfamework.api.v1.mapper;
import guru.springfamework.api.v1.model.CustomerDTO;
import guru.springfamework.domain.Customer;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface CustomerMapper {
CustomerMapper INSTANCE = Mappers.getMapper(CustomerMapper.class);
CustomerDTO customerToCustomerDTO(Customer customer);
Customer customerDTOToCustomer(CustomerDTO customerDTO);
}
| [
"shingeru@gmail.com"
] | shingeru@gmail.com |
0af19f100d868faa6d7fe200ec726055d25f6ac9 | b3000eb87059226318c971911f77a8b59dbeaa04 | /programlama_mantıgı3.java | 66eff43c802096e7b15759992342fcc200e7fae0 | [] | no_license | hostperson/java | 947c750c1bc0d438041b5232fc7474c0dea5362e | 53f4462fcc09c939421d102451a48eb5603612c1 | refs/heads/master | 2020-12-02T06:42:33.828958 | 2017-07-11T11:49:19 | 2017-07-11T11:49:19 | 96,884,694 | 1 | 0 | null | null | null | null | ISO-8859-9 | Java | false | false | 1,272 | java | package ilkdeneme1;
import java.util.Scanner;
public class programlama_mantıgı3 {
public static void main (String[] args )
{
Scanner input = new Scanner(System.in);
String marka,model,kontrol;
int yıl,yas;
System.out.println("arabanızın markasını giriniz");
marka = input.nextLine();
System.out.println("arabanızın modelini giriniz");
model = input.nextLine();
System.out.println("arabanızın model yılınız giriniz: ");
yıl = input.nextInt();
yas = 2017-yıl;
if(yas>=1 && yas<5)
{
System.out.println("arabanız " +marka.substring(0,1) +model.substring(0,1)+ " yeni sayılır");
}
else if(yas>=5 && yas<20)
{
System.out.println("arabanız " +marka.substring(0,1) +model.substring(0,1)+ " motoru açılmıştır");
}
else if(yas>=20 && yas<35)
{
System.out.println("arabanız " +marka.substring(0,1) +model.substring(0,1)+ " bakıma ihtiyacı var");
}
else if(yas>=35 && yas<50)
{
System.out.println("arabanız " +marka.substring(0,1) +model.substring(0,1)+ " değiştirme vakti geldi");
}
else if(yas>=50)
{
System.out.println("arabanız " +marka.substring(0,1) +model.substring(0,1)+ " bir hurdadır");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
6641bd71ffaaf58363e96211867529928661f84c | 4fa27dd1589650926f2a22d9a53eca2112a5fce7 | /Clase2/app/src/main/java/com/maugzuni/clase2/MainActivity.java | 4bd514b7c0f6fb87f16627ed36c28d6c22b52516 | [] | no_license | maugzuni/infortic2015 | d79983f5f8bc8826bd813d9bfc76b6e2d271cc92 | 2c7f415d477a8306d6138f3605413a54fb1ce26a | refs/heads/master | 2021-01-10T07:25:49.930250 | 2015-10-30T01:52:51 | 2015-10-30T01:52:51 | 45,070,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,669 | java | package com.maugzuni.clase2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
public class MainActivity extends AppCompatActivity {
private TextView info;
//Estos dos elementos,vienen de facebook(Agregado en el archivo buil.gradle)
private LoginButton loginButton;
private CallbackManager callbackManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//--------------------------------------------//
FacebookSdk.sdkInitialize(this);//El SDK necesita ser inicializado antes de usar cualquiera de sus métodos,pasando el contexto de la actividad(Activity)
callbackManager = CallbackManager.Factory.create();//inizializamos el CallbackManager
//---------------------------------------------//
setContentView(R.layout.activity_main);
info = (TextView) findViewById(R.id.info);
loginButton = (LoginButton) findViewById(R.id.login_button);
//--------------------------------------------------//
loginButton.setReadPermissions(Arrays.asList("public_profile, email"));//Asignamos permisos
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
//Creamos el GraphRequest
GraphRequest request = GraphRequest.newMeRequest(
loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override //Si se completa el login
public void onCompleted(
JSONObject object,
GraphResponse response) {
// Application code
try {// facebook nos respondera con un JsonObject(object)
String id = object.getString("id");//Obtenemos el id
URL imgUrl = new URL("https://graph.facebook.com/" + id + "/picture?type=large");//Obtener imagen de perfil
String name = object.getString("name");//Obtenemos en nombre
String email = object.getString("email");//Obtenemos el mail
Intent i = new Intent(getApplicationContext(), Main2Activity.class);//Enviamos al usuario a otro activity
startActivity(i);
} catch (JSONException e) {
Toast.makeText(MainActivity.this, "Error", Toast.LENGTH_SHORT).show();
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email");
request.setParameters(parameters);
request.executeAsync();
}
@Override
public void onCancel() {//Si se cancela la solicitus de login
info.setText("Login attempt canceled.");
}
@Override
public void onError(FacebookException e) {//Si ocurre un error
info.setText("Login attempt failed.");
}
});
}
//---------------------------------------------------------------------------//
//---------------------------------------------------------------------------//
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
callbackManager.onActivityResult(requestCode, resultCode, data);
}
} | [
"mauigzuni@gmail.com"
] | mauigzuni@gmail.com |
169c32d572cc8a19eb04fbd3f7eb25db76c4fcfe | 937a86ec827224a625d94db1ff0ede8268e1af7c | /src/java/paqueteaemet/ServletAEMET.java | b18e41620b833d23a9156e9db0c723be63d6771f | [] | no_license | webfuhrer/AEMET_ParseoXML | 457c2cc3c78dbd7b8fb76a1ea97ca54862988954 | 17f92ed0efcad9ee0d49ecc532ea7f6bcfadd46f | refs/heads/master | 2021-08-31T04:12:45.603360 | 2017-12-20T09:54:19 | 2017-12-20T09:54:19 | 114,871,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,212 | 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 paqueteaemet;
import conexion.ConexionURL;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.xml.sax.InputSource;
/**
*
* @author luis
*/
@WebServlet(name = "ServletAEMET", urlPatterns = {"/ServletAEMET"})
public class ServletAEMET extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String url="http://www.aemet.es/xml/municipios/localidad_28079.xml";
String xml_respuesta=ConexionURL.peticionWeb(url);
List<ObjetoClima> lista_objetos_clima=tratarXML(xml_respuesta);
request.setAttribute("lista_objetos_clima", lista_objetos_clima);
request.getRequestDispatcher("verclima.jsp").forward(request, response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
private List<ObjetoClima> tratarXML(String xml_respuesta) {
List<ObjetoClima> lista_climas=new ArrayList<>();
try {
SAXBuilder builder = new SAXBuilder();
//Se crea el documento a traves del archivo
Document document = (Document) builder.build(new InputSource(new ByteArrayInputStream(xml_respuesta.getBytes("utf-8"))));
Element raiz=document.getRootElement();
List lista_hijos=raiz.getChildren();
Element elemento_prediccion=(Element)lista_hijos.get(4);//
Element elemento_prediccion_otra_forma=raiz.getChild("prediccion");
List lista_elementos_dia=elemento_prediccion.getChildren();
for (int i=0; i<lista_elementos_dia.size(); i++)
{
Element elemento_dia=(Element)lista_elementos_dia.get(i);
String fecha=elemento_dia.getAttributeValue("fecha");
Element elemento_temperatura=elemento_dia.getChild("temperatura");
Element elemento_t_min=elemento_temperatura.getChild("minima");
Element elemento_t_max=elemento_temperatura.getChild("maxima");
String t_min=elemento_t_min.getText();
String t_max=elemento_t_max.getText();
ObjetoClima oc=new ObjetoClima(fecha, Integer.parseInt(t_min), Integer.parseInt(t_max));
lista_climas.add(oc);
}
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(ServletAEMET.class.getName()).log(Level.SEVERE, null, ex);
} catch (JDOMException ex) {
Logger.getLogger(ServletAEMET.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ServletAEMET.class.getName()).log(Level.SEVERE, null, ex);
}
return lista_climas;
}
}
| [
"ataraxa@hotmail.com"
] | ataraxa@hotmail.com |
b2fb108530a5b7bc071d0fca4150a2cb73bdd794 | da8808ab16fdf64849869ee282b98dd995695943 | /online-shoppingmall-order/src/main/java/com/whalesj/order/component/Impl/JedisClientSingle.java | c44b0364d97e72e6e268fc7768ac5eb954cbb36f | [] | no_license | GaoJiHu/OnlineShoppingMall | 6ed1ecac2832232c9254564fbb75c917caa60c62 | 8383bc0eaf12a806a2a46335d0c786b1fa717efc | refs/heads/master | 2021-01-24T03:38:15.941387 | 2018-02-04T12:05:33 | 2018-02-04T12:05:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,880 | java | package com.whalesj.order.component.Impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.whalesj.order.component.JedisClient;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
/**
* redis客户端单机版实现
* @author wushijia
*
*/
public class JedisClientSingle implements JedisClient {
@Autowired
private JedisPool jedisPool;//由Spring注入
@Override
public String set(String key, String value) {
Jedis jedis = jedisPool.getResource();
String res = jedis.set(key, value);
jedis.close();
return res;
}
@Override
public String get(String key) {
Jedis jedis = jedisPool.getResource();
String res = jedis.get(key);
jedis.close();
return res;
}
@Override
public Long hset(String key, String item, String value) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.hset(key, item, value);
jedis.close();
return res;
}
@Override
public String hget(String key, String item) {
Jedis jedis = jedisPool.getResource();
String res = jedis.hget(key, item);
jedis.close();
return res;
}
@Override
public Long incr(String key) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.incr(key);
jedis.close();
return res;
}
@Override
public Long decr(String key) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.decr(key);
jedis.close();
return res;
}
@Override
public Long expire(String key, int second) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.expire(key, second);
jedis.close();
return res;
}
@Override
public Long ttl(String key) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.ttl(key);
jedis.close();
return res;
}
@Override
public Long hdel(String key, String item) {
Jedis jedis = jedisPool.getResource();
Long res = jedis.hdel(key, item);
jedis.close();
return res;
}
}
| [
"whalewsj@gmail.com"
] | whalewsj@gmail.com |
8052f560d9050bcb6f0b042a2b3ec6ee43f7aa5e | b6e9d5d0930cdc0b192d39e4e844aba43bb5ac7a | /src/java/parent/poi/event/Excel2007Reader.java | f5930711d7b234a500fb7d83a1c3a7d94e3f055c | [] | no_license | amull6/vehcert_12_26 | 2c2c2fa94d4825462915cd8eced49de02e2028f3 | df3ce288f20dcdf1f6c0dd5e98972e44bce6a2f4 | refs/heads/master | 2020-04-13T21:40:44.688364 | 2019-05-15T02:35:09 | 2019-05-15T02:35:09 | 163,461,482 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,820 | java | package parent.poi.event;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xssf.eventusermodel.XSSFReader;
import org.apache.poi.xssf.model.SharedStringsTable;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 抽象Excel2007读取器,excel2007的底层数据结构是xml文件,采用SAX的事件驱动的方法解析
* xml,需要继承DefaultHandler,在遇到文件内容时,事件会触发,这种做法可以大大降低
* 内存的耗费,特别使用于大数据量的文件。
*
*/
public class Excel2007Reader extends DefaultHandler {
//共享字符串表
private SharedStringsTable sst;
//上一次的内容
private String lastContents;
private boolean nextIsString;
private List<String> rowlist = new ArrayList<String>();
private List<Map<String,String>> resultList = new ArrayList<Map<String, String>>();
//当前行
private int curRow = 0;
//当前列
private int curCol = 0;
//日期标志
// private boolean dateFlag;
//数字标志
// private boolean numberFlag;
private boolean isTElement;
private IRowReader rowReader;
public void setRowReader(IRowReader rowReader){
this.rowReader = rowReader;
}
public List<Map<String, String>> getResultList() {
return resultList;
}
/**只遍历一个电子表格,其中sheetId为要遍历的sheet索引,从1开始,1-3
* @param filename
* @param sheetId
* @throws Exception
*/
public void processOneSheet(String filename,int sheetId) throws Exception {
OPCPackage pkg = OPCPackage.open(filename);
XSSFReader r = new XSSFReader(pkg);
SharedStringsTable sst = r.getSharedStringsTable();
XMLReader parser = fetchSheetParser(sst);
// 根据 rId# 或 rSheet# 查找sheet
InputStream sheet2 = r.getSheet("rId"+sheetId);
InputSource sheetSource = new InputSource(sheet2);
parser.parse(sheetSource);
sheet2.close();
}
/**
* 遍历工作簿中所有的电子表格
* @param filename
* @throws Exception
*/
public void process(String filename) throws Exception {
OPCPackage pkg = OPCPackage.open(filename);
XSSFReader r = new XSSFReader(pkg);
SharedStringsTable sst = r.getSharedStringsTable();
XMLReader parser = fetchSheetParser(sst);
Iterator<InputStream> sheets = r.getSheetsData();
if (sheets.hasNext()) {
curRow = 0;
InputStream sheet = sheets.next();
InputSource sheetSource = new InputSource(sheet);
parser.parse(sheetSource);
sheet.close();
}
}
public XMLReader fetchSheetParser(SharedStringsTable sst)
throws SAXException {
XMLReader parser = XMLReaderFactory
.createXMLReader("org.apache.xerces.parsers.SAXParser");
this.sst = sst;
parser.setContentHandler(this);
return parser;
}
public void startElement(String uri, String localName, String name,
Attributes attributes) throws SAXException {
// c => 单元格
if ("c".equals(name)) {
// 如果下一个元素是 SST 的索引,则将nextIsString标记为true
String cellType = attributes.getValue("t");
if ("s".equals(cellType)) {
nextIsString = true;
} else {
nextIsString = false;
}
//日期格式
// String cellDateType = attributes.getValue("s");
// if ("1".equals(cellDateType)){
// dateFlag = false;
// } else {
// dateFlag = false;
// }
// String cellNumberType = attributes.getValue("s");
// if("2".equals(cellNumberType)){
// numberFlag = false;
// } else {
// numberFlag = false;
// }
}
//当元素为t时
if("t".equals(name)){
isTElement = true;
} else {
isTElement = false;
}
// 置空
lastContents = "";
}
public void endElement(String uri, String localName, String name)
throws SAXException {
// 根据SST的索引值的到单元格的真正要存储的字符串
// 这时characters()方法可能会被调用多次
if (nextIsString) {
try {
int idx = Integer.parseInt(lastContents);
lastContents = new XSSFRichTextString(sst.getEntryAt(idx))
.toString();
} catch (Exception e) {
}
}
//t元素也包含字符串
if(isTElement){
String value = lastContents.trim();
rowlist.add(curCol, value);
curCol++;
isTElement = false;
// v => 单元格的值,如果单元格是字符串则v标签的值为该字符串在SST中的索引
// 将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符
} else if ("v".equals(name)) {
String value = lastContents.trim();
value = value.equals("")?" ":value;
//日期格式处理
// if(dateFlag){
// Date date = HSSFDateUtil.getJavaDate(Double.valueOf(value));
// SimpleDateFormat dateFormat = new SimpleDateFormat(
// "dd/MM/yyyy");
// value = dateFormat.format(date);
// }
//数字类型处理
// if(numberFlag){
// BigDecimal bd = new BigDecimal(value);
// value = bd.setScale(3,BigDecimal.ROUND_UP).toString();
// }
rowlist.add(curCol, value);
curCol++;
}else {
//如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法
if (name.equals("row")) {
Map<String, String> data=rowReader.getRows(curRow,rowlist);
if(data!=null){
resultList.add(data);
}
rowlist.clear();
curRow++;
curCol = 0;
}
}
}
public void characters(char[] ch, int start, int length)
throws SAXException {
//得到单元格内容的值
lastContents += new String(ch, start, length);
}
} | [
"250676978@qq.com"
] | 250676978@qq.com |
da1150805ce11ba3e177b563d6ae155a6211df5b | 9773e1bb1c1a217393f39d365e2bf074949a27d7 | /day_20/src/day20_test/Test_02.java | f2935260a5e094cbceb248b024b2ab420028f94f | [] | no_license | wangchencom/bashDemo | e0cebf05b39ec8fae296e05d772ae888a51dca87 | d99d458c76312741f4293c375e1cd4036e1c44d7 | refs/heads/master | 2021-09-08T11:08:02.294092 | 2021-09-07T12:25:47 | 2021-09-07T12:25:47 | 188,663,536 | 2 | 0 | null | null | null | null | GB18030 | Java | false | false | 460 | java | package day20_test;
//有一对兔子,从出生后第3个月起每个月都生一对兔子,
//小兔子长到第三个月后每个月又生一对兔子,假如兔子
//都不死,问:第二十个月的兔子对数为多少?
public class Test_02 {
public static void main(String[] args) {
System.out.println(fun(20));
}
public static int fun(int n){
if (n == 1) {
return 1 ;
}else if(n == 2){
return 1;
}else {
return (n-1)+(n-2);
}
}
}
| [
"2947872572@qq.com"
] | 2947872572@qq.com |
d6b5e1ec7f580227c2369e17e1f345678ae1a654 | 601582228575ca0d5f61b4c211fd37f9e4e2564c | /logisoft_revision1/src/com/gp/cong/logisoft/struts/form/MasterCustomForm.java | 914d2cc72d58ee531dc1f926244d9478612a61a3 | [] | no_license | omkarziletech/StrutsCode | 3ce7c36877f5934168b0b4830cf0bb25aac6bb3d | c9745c81f4ec0169bf7ca455b8854b162d6eea5b | refs/heads/master | 2021-01-11T08:48:58.174554 | 2016-12-17T10:45:19 | 2016-12-17T10:45:19 | 76,713,903 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,723 | java | /*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.gp.cong.logisoft.struts.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
/**
* MyEclipse Struts
* Creation date: 03-11-2008
*
* XDoclet definition:
* @struts.form name="masterCustomForm"
*/
public class MasterCustomForm extends ActionForm {
/*
* Generated Methods
*/
private String buttonValue;
private String accountType;
private String name;
private String acctNo;
private String master;
public String getMaster() {
return master;
}
public void setMaster(String master) {
this.master = master;
}
public String getAcctNo() {
return acctNo;
}
public void setAcctNo(String acctNo) {
this.acctNo = acctNo;
}
public String getAccountType() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public String getButtonValue() {
return buttonValue;
}
public void setButtonValue(String buttonValue) {
this.buttonValue = buttonValue;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
} | [
"omkar@ziletech.com"
] | omkar@ziletech.com |
2db95eeb5c35d7b4d6a52a81caa7642a48d3c1f4 | 72cbd420d57f970a6bfbf9cf4dc62f662e6a0ebb | /plugin/core/src/com/perl5/lang/perl/fileTypes/PerlPluginBaseFileType.java | 233cdb95ee9c30d408660d4235f2b3df9d811d96 | [
"Apache-2.0"
] | permissive | xcodejoy/Perl5-IDEA | e36061de84cc1780ed76711190bb5ce4b05fa3f0 | 2179a9ab2e9006d4c5501a878f484293220046ac | refs/heads/master | 2020-09-19T09:15:35.960543 | 2019-11-23T08:46:28 | 2019-11-23T08:46:28 | 224,215,081 | 1 | 0 | NOASSERTION | 2019-11-26T14:44:56 | 2019-11-26T14:44:55 | null | UTF-8 | Java | false | false | 1,300 | java | /*
* Copyright 2015-2019 Alexandr Evstigneev
*
* 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.perl5.lang.perl.fileTypes;
import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public abstract class PerlPluginBaseFileType extends LanguageFileType {
public PerlPluginBaseFileType(@NotNull Language language) {
super(language);
}
protected static boolean isMyFile(@Nullable PsiElement element, @NotNull FileType fileType) {
return element != null &&
element.getContainingFile().getViewProvider().getVirtualFile().getFileType() == fileType;
}
}
| [
"hurricup@gmail.com"
] | hurricup@gmail.com |
44a9028a7e6fa1ec4279ce0b2293dd5fb5624089 | e820097c99fb212c1c819945e82bd0370b4f1cf7 | /gwt-sh/src/main/java/com/skynet/spms/manager/stockServiceBusiness/warehouseManageBusiness/CargoSpaceManager.java | 932469705ef7c26362fcc73c08c3ea91ae7465f3 | [] | no_license | jayanttupe/springas-train-example | 7b173ca4298ceef543dc9cf8ae5f5ea365431453 | adc2e0f60ddd85d287995f606b372c3d686c3be7 | refs/heads/master | 2021-01-10T10:37:28.615899 | 2011-12-20T07:47:31 | 2011-12-20T07:47:31 | 36,887,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,653 | java | package com.skynet.spms.manager.stockServiceBusiness.warehouseManageBusiness;
import java.util.List;
import java.util.Map;
import com.skynet.spms.manager.CommonManager;
import com.skynet.spms.persistence.entity.stockServiceBusiness.warehouseManageBusiness.cargoSpaceManage.CargoSpace;
/**
* 货位信息Manager实现类
* @author HDJ
* @version 1.0
* @date 2011-07-12
*/
public interface CargoSpaceManager extends CommonManager<CargoSpace>{
/**
* 生成货位
* @param cargoSpace
*/
void createCargoSpace(CargoSpace cargoSpace);
/**
* 设置货位
* @param cargoSpace
*/
void setCargoSpace(CargoSpace cargoSpace);
/**
* 获取货位相关信息
* @param values
* @param startRow
* @param endRow
* @return
*/
List<CargoSpace> getAllCargoSpace(Map values, int startRow, int endRow);
/**
* 根据货位ID删除该货位信息
* @param cargoSpaceID
*/
public void deleteCargoSpace(String[] cargoSpaceID);
/**
* 获取货位信息
* @param values
* @return 货位信息
*/
List<CargoSpace> getCargoSpaceFieldData(Map values);
/**
* 拆分货位
* @param cargoSpaceNumber
* @param storageRacksCaseNumber
* @param newCargoSpaceCount
*/
void splitCargoSpace(String cargoSpaceNumber, String storageRacksCaseNumber, Integer newCargoSpaceCount);
/**
* 合并货位
* @param cargoSpaceNumbers
*/
void mergeCargoSpace(String[] cargoSpaceNumbers);
/**
* 根据补码ID获取货位信息
* @param repairCodeId
* @return 货位信息
*/
List<CargoSpace> findByRepairCodeId(String repairCodeId);
}
| [
"usedtolove@3b6edebd-8678-f8c2-051a-d8e859c3524d"
] | usedtolove@3b6edebd-8678-f8c2-051a-d8e859c3524d |
8a01a4eb8709dc08dece5e402c88a9886d8428a1 | 4b5cca7c10e86bdac03505657c66acdb601016b6 | /app/src/main/java/net/toughcoder/opengl/opengl2s/OpenGLES2SurfaceView.java | 03056e405d3ced49d52b75494886855f2aa8462d | [] | no_license | alexhilton/MoreEffectiveAndroid | 92a4a8a3a79406651a8a68253a41bf34932dd1d3 | 25aad6f697fabd218ca2f3cb0ff959ce911ebab5 | refs/heads/master | 2020-04-05T14:04:23.487158 | 2017-11-09T10:23:35 | 2017-11-09T10:23:35 | 44,109,420 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,550 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.toughcoder.opengl.opengl2s;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;
import net.toughcoder.opengl.oaqs.AirHockeyRenderer;
/**
* A view container where OpenGL ES graphics can be drawn on screen.
* This view can also be used to capture touch events, such as a user
* interacting with drawn objects.
*/
public class OpenGLES2SurfaceView extends GLSurfaceView {
// private final OpenGLES2Render mRenderer;
private final AirHockeyRenderer mRenderer;
public OpenGLES2SurfaceView(Context context) {
super(context);
// Create an OpenGL ES 2.0 context.
setEGLContextClientVersion(2);
// Set the Renderer for drawing on the GLSurfaceView
// mRenderer = new JayWayRenderer();
// mRenderer = new OpenGLES2Render();
// setRenderer(new JayWayRenderer());
mRenderer = new AirHockeyRenderer(context);
setRenderer(mRenderer);
// Render the view only when there is a change in the drawing data
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
final float normalizedX = (event.getX() / (float) getWidth()) * 2 - 1;
final float normalizedY = -((event.getY() / (float) getHeight()) * 2 -1);
if (event.getAction() == MotionEvent.ACTION_DOWN) {
queueEvent(new Runnable() {
@Override
public void run() {
mRenderer.handleTouchPress(normalizedX, normalizedY);
}
});
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
queueEvent(new Runnable() {
@Override
public void run() {
mRenderer.handleTouchDrag(normalizedX, normalizedY);
}
});
}
return true;
}
}
| [
"dragonhilton@gmail.com"
] | dragonhilton@gmail.com |
1195a1562b59b4ec68e422e4f93aeefc173ea8b1 | d9012d38b0d3d3112ad0e86bb73f45bc62487e6b | /src/src/Database.java | 3c22c0cfd4668c1c1e2248b599abd919f191a169 | [] | no_license | erxygnd/StokOtomasyon | 256a833cefd3ee0cb5e91a1a8ff92d13c4e0dc22 | 8506e9090e96c0d54a91c0d50fc243c31bb09e3c | refs/heads/main | 2023-02-22T15:55:15.547884 | 2021-01-22T19:49:31 | 2021-01-22T19:49:31 | 332,029,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 93 | java | package src;
public interface Database {
User getUser();
void setUser(User user);
}
| [
"77805925+erxygnd@users.noreply.github.com"
] | 77805925+erxygnd@users.noreply.github.com |
2fc40ae18637ccfc988e609eaf0634f68e450a03 | 1d2fda2245888413e3eef8798a61236822f022db | /com/wurmonline/server/questions/CreatureChangeAgeQuestion.java | f966b0b44164915be30fec818614a0277e8f855d | [
"IJG"
] | permissive | SynieztroLedPar/Wu | 3b4391e916f6a5605d60663f800702f3e45d5dfc | 5f7daebc2fb430411ddb76a179005eeecde9802b | refs/heads/master | 2023-04-29T17:27:08.301723 | 2020-10-10T22:28:40 | 2020-10-10T22:28:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,349 | java | package com.wurmonline.server.questions;
import com.wurmonline.server.creatures.Communicator;
import com.wurmonline.server.creatures.Creature;
import com.wurmonline.server.creatures.CreatureStatus;
import com.wurmonline.server.creatures.Creatures;
import com.wurmonline.server.creatures.DbCreatureStatus;
import com.wurmonline.server.creatures.NoSuchCreatureException;
import java.io.IOException;
import java.util.Properties;
public final class CreatureChangeAgeQuestion
extends Question
{
public CreatureChangeAgeQuestion(Creature aResponder, String aTitle, String aQuestion, long aTarget)
{
super(aResponder, aTitle, aQuestion, 153, aTarget);
}
public void sendQuestion()
{
StringBuilder buf = new StringBuilder(getBmlHeader());
int width = 150;
int height = 150;
try
{
Creature target = Creatures.getInstance().getCreature(this.target);
int age = target.getStatus().age;
buf.append("harray{input{id='newAge'; maxchars='3'; text='").append(age).append("'}label{text='Age'}}");
}
catch (NoSuchCreatureException ex)
{
ex.printStackTrace();
}
buf.append(createAnswerButton2());
getResponder().getCommunicator().sendBml(width, height, true, true, buf.toString(), 200, 200, 200, this.title);
}
public void answer(Properties answers)
{
setAnswer(answers);
init(this);
}
private void init(CreatureChangeAgeQuestion question)
{
Creature responder = question.getResponder();
int newAge = 0;
long target = question.getTarget();
try
{
Creature creature = Creatures.getInstance().getCreature(target);
String age = question.getAnswer().getProperty("newAge");
newAge = Integer.parseInt(age);
((DbCreatureStatus)creature.getStatus()).updateAge(newAge);
creature.getStatus().lastPolledAge = 0L;
creature.pollAge();
creature.refreshVisible();
}
catch (NoSuchCreatureException|IOException ex)
{
ex.printStackTrace();
}
responder.getCommunicator().sendNormalServerMessage("Age = " + newAge + ".");
}
}
/* Location: C:\Games\SteamLibrary\steamapps\common\Wurm Unlimited Dedicated Server\server.jar!\com\wurmonline\server\questions\CreatureChangeAgeQuestion.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/ | [
"dwayne.griffiths@outlook.com"
] | dwayne.griffiths@outlook.com |
f670dae830df4028ff47f56b2e6737006870ccf5 | 03b4746198ddaee63ec0ae9fb56b4092c003efe1 | /factory/src/main/java/com/tufer/factory/presenter/BaseSourcePresenter.java | 849cce408a201a59a8fbbf43ecf7b90170af557b | [] | no_license | Tuferzzz/MyTuferIMClient | 74483236f2d7bec5c69a148690530f760fc6be2b | 40e8e979b755a466a8d6b84e969683be3af6fba9 | refs/heads/master | 2020-05-05T14:03:45.420303 | 2019-05-07T05:40:12 | 2019-05-07T05:40:12 | 180,105,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 907 | java | package com.tufer.factory.presenter;
import com.tufer.factory.data.DataSource;
import com.tufer.factory.data.DbDataSource;
import java.util.List;
/**
* 基础的仓库源的Presenter定义
*
* @author Tufer
* @version 1.0.0
*/
public abstract class BaseSourcePresenter<Data, ViewModel,
Source extends DbDataSource<Data>,
View extends BaseContract.RecyclerView>
extends BaseRecyclerPresenter<ViewModel, View>
implements DataSource.SucceedCallback<List<Data>> {
protected Source mSource;
public BaseSourcePresenter(Source source, View view) {
super(view);
this.mSource = source;
}
@Override
public void start() {
super.start();
if (mSource != null)
mSource.load(this);
}
@Override
public void destroy() {
super.destroy();
mSource.dispose();
mSource = null;
}
}
| [
"1126179195@qq.com"
] | 1126179195@qq.com |
02905a013d11e0bbccdb8967f2586676720f4108 | 7a8617f40640ff29e15f339b3b8fe4c406b25222 | /LetOJ/Chi中文Let/1437. 是否所有 1 都至少相隔 k 个元素.java | 27d2b06087ae69876d12c646b2cf23f85a38a1d8 | [] | no_license | 63a16d97ea4816a7f854483da5031469/Data-Structure | 3178d712dc9138c5f14749b0320ef2a81035c5e7 | 2d564a708ecd98d9aad0314c7bf7887d154dc13b | refs/heads/master | 2022-11-13T16:51:00.884489 | 2022-11-07T13:47:58 | 2022-11-07T13:47:58 | 44,916,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,199 | java |
/*
*
link:
https://leetcode-cn.com/problems/check-if-all-1s-are-at-least-length-k-places-away/
2020-8-18 at 8:57 am
1437. 是否所有 1 都至少相隔 k 个元素
难度
中等
5
收藏
分享
切换为英文
关注
反馈
给你一个由若干 0 和 1 组成的数组 nums 以及整数 k。如果所有 1 都至少相隔 k 个元素,则返回 True ;否则,返回 False 。
示例 1:
输入:nums = [1,0,0,0,1,0,0,1], k = 2
输出:true
解释:每个 1 都至少相隔 2 个元素。
示例 2:
输入:nums = [1,0,0,1,0,1], k = 2
输出:false
解释:第二个 1 和第三个 1 之间只隔了 1 个元素。
示例 3:
输入:nums = [1,1,1,1,1], k = 0
输出:true
示例 4:
输入:nums = [0,1,0,1], k = 1
输出:true
提示:
1 <= nums.length <= 10^5
0 <= k <= nums.length
nums[i] 的值为 0 或 1
对题目易错地方进行总结:
对题目的实现思路进行几句话总结:
从这道题目学到了什么,哪些地方需要提升? :
*
*/
class Solution {
//8.48am-8.56am
public boolean kLengthApart(int[] nums, int k) {
int lastOne=-1;
for(int i=0;i<nums.length;i++){
if(nums[i]==1){
if(lastOne==-1){
lastOne=i;
}else{
int dist=i-lastOne-1;
if(dist<k){
return false;
}
lastOne=i;
}
}
}
return true;
}
}
public class kLengthApart {
public boolean kLengthApart(int[] nums, int k) {
for (int pre = -100000, next = 0; next < nums.length; next++) {
if (nums[next] == 1) {
if (next - pre <= k)
return false;
pre = next;
}
}
return true;
}
}
// 作者:ustcyyw
// 链接:https://leetcode-cn.com/problems/check-if-all-1s-are-at-least-length-k-places-away/solution/5401java-zhi-jie-shuang-zhi-zhen-1ms-hen-jian-dan-/
// 来源:力扣(LeetCode)
// 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
| [
"ntutonycao@gmail.com"
] | ntutonycao@gmail.com |
0dca719e263b3e1c2013319a6e241ca7996667d9 | 72bc9a35d5cf5f557ee87905f515f8157b415dac | /GladiatorGame/src/main/mainMain.java | 1069a6aef32cf54fd75ff232a012d22b12bd3778 | [] | no_license | Rallexu/Projects | de72ed146aa7dd31d2aec9996bc289f04dfbc0ac | 0c8098453a893e690289b22610af8c94242674e1 | refs/heads/master | 2021-04-15T15:05:00.525609 | 2018-10-16T13:38:33 | 2018-10-16T13:38:33 | 126,898,142 | 0 | 0 | null | 2018-10-16T13:38:34 | 2018-03-26T22:38:45 | Java | UTF-8 | Java | false | false | 21,140 | 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 main;
import Stats.Skills;
import attack_system.monsters;
import static creatingChar.creatingCharacter.object_character;
import dealers.dealersMainMain;
/**
*
* @author allan
*/
public class mainMain extends javax.swing.JFrame {
public mainMain() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
Exit = new javax.swing.JButton();
handlarz = new javax.swing.JTabbedPane();
journey = new javax.swing.JPanel();
Katakumby = new javax.swing.JButton();
Poczta = new javax.swing.JPanel();
post = new javax.swing.JButton();
Miasto = new javax.swing.JPanel();
sellerArmor = new javax.swing.JButton();
Arena = new javax.swing.JButton();
heller = new javax.swing.JButton();
Kowal = new javax.swing.JButton();
tawern = new javax.swing.JButton();
work = new javax.swing.JButton();
Postać = new javax.swing.JPanel();
Stats = new javax.swing.JButton();
champ = new javax.swing.JButton();
skills = new javax.swing.JButton();
quests = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(860, 484));
setPreferredSize(new java.awt.Dimension(860, 484));
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
Exit.setText("Exit");
Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ExitActionPerformed(evt);
}
});
getContentPane().add(Exit, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 420, 181, -1));
handlarz.setBackground(new java.awt.Color(0, 0, 0));
handlarz.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
handlarz.setFocusable(false);
handlarz.setFont(new java.awt.Font("Papyrus", 1, 13)); // NOI18N
journey.setBackground(new java.awt.Color(0, 0, 0));
Katakumby.setBackground(new java.awt.Color(255, 255, 255));
Katakumby.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
Katakumby.setText("Katakumby");
Katakumby.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
KatakumbyMouseClicked(evt);
}
});
Katakumby.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
KatakumbyActionPerformed(evt);
}
});
javax.swing.GroupLayout journeyLayout = new javax.swing.GroupLayout(journey);
journey.setLayout(journeyLayout);
journeyLayout.setHorizontalGroup(
journeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(journeyLayout.createSequentialGroup()
.addContainerGap()
.addComponent(Katakumby, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(18, Short.MAX_VALUE))
);
journeyLayout.setVerticalGroup(
journeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(journeyLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(Katakumby, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(306, Short.MAX_VALUE))
);
handlarz.addTab("Podróż", journey);
Poczta.setBackground(new java.awt.Color(0, 0, 0));
post.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
post.setText("Skrzynka pocztowa");
javax.swing.GroupLayout PocztaLayout = new javax.swing.GroupLayout(Poczta);
Poczta.setLayout(PocztaLayout);
PocztaLayout.setHorizontalGroup(
PocztaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PocztaLayout.createSequentialGroup()
.addContainerGap()
.addComponent(post, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(18, Short.MAX_VALUE))
);
PocztaLayout.setVerticalGroup(
PocztaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PocztaLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(post, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(306, Short.MAX_VALUE))
);
handlarz.addTab("Poczta", Poczta);
Miasto.setBackground(new java.awt.Color(0, 0, 0));
sellerArmor.setBackground(new java.awt.Color(255, 255, 255));
sellerArmor.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
sellerArmor.setText("Handlarze");
sellerArmor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
sellerArmorMouseClicked(evt);
}
});
sellerArmor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sellerArmorActionPerformed(evt);
}
});
Arena.setBackground(new java.awt.Color(255, 255, 255));
Arena.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
Arena.setText("Arena");
Arena.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
ArenaMouseClicked(evt);
}
});
Arena.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ArenaActionPerformed(evt);
}
});
heller.setBackground(new java.awt.Color(255, 255, 255));
heller.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
heller.setText("Uzdrowiciel");
heller.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
hellerMouseClicked(evt);
}
});
heller.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
hellerActionPerformed(evt);
}
});
Kowal.setBackground(new java.awt.Color(255, 255, 255));
Kowal.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
Kowal.setText("Kowal");
Kowal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
KowalActionPerformed(evt);
}
});
tawern.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
tawern.setText("Tawerna");
tawern.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tawernActionPerformed(evt);
}
});
work.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
work.setText("Praca");
javax.swing.GroupLayout MiastoLayout = new javax.swing.GroupLayout(Miasto);
Miasto.setLayout(MiastoLayout);
MiastoLayout.setHorizontalGroup(
MiastoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(MiastoLayout.createSequentialGroup()
.addContainerGap()
.addGroup(MiastoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Arena, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(heller, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Kowal, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tawern, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(work, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sellerArmor, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(18, Short.MAX_VALUE))
);
MiastoLayout.setVerticalGroup(
MiastoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(MiastoLayout.createSequentialGroup()
.addComponent(sellerArmor, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Arena, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(heller, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Kowal, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tawern, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(work, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(27, Short.MAX_VALUE))
);
handlarz.addTab("Miasto", Miasto);
Postać.setBackground(new java.awt.Color(0, 0, 0));
Stats.setBackground(new java.awt.Color(255, 255, 255));
Stats.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
Stats.setText("Statystyki");
Stats.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
StatsMouseClicked(evt);
}
});
Stats.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
StatsActionPerformed(evt);
}
});
champ.setBackground(new java.awt.Color(255, 255, 255));
champ.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
champ.setText("Gladiator");
champ.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
champActionPerformed(evt);
}
});
skills.setBackground(new java.awt.Color(255, 255, 255));
skills.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
skills.setText("Umiejętności");
skills.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
skillsActionPerformed(evt);
}
});
quests.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
quests.setText("Zadania");
quests.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
questsActionPerformed(evt);
}
});
javax.swing.GroupLayout PostaćLayout = new javax.swing.GroupLayout(Postać);
Postać.setLayout(PostaćLayout);
PostaćLayout.setHorizontalGroup(
PostaćLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PostaćLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PostaćLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quests, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Stats, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(champ, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(skills, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
PostaćLayout.setVerticalGroup(
PostaćLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PostaćLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(champ, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Stats, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(skills, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quests, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0))
);
handlarz.addTab("Postać", Postać);
getContentPane().add(handlarz, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 280, 395));
jLabel1.setBackground(new java.awt.Color(213, 238, 238));
jLabel1.setIcon(new javax.swing.ImageIcon("/Users/allan/Desktop/gallery_photos_game/tlo2.jpg")); // NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(-5, -4, 870, 490));
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void KatakumbyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_KatakumbyMouseClicked
}//GEN-LAST:event_KatakumbyMouseClicked
private void KatakumbyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_KatakumbyActionPerformed
this.setVisible(false);
new monsters().setVisible(true);
}//GEN-LAST:event_KatakumbyActionPerformed
private void StatsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_StatsMouseClicked
object_character.addStats();
}//GEN-LAST:event_StatsMouseClicked
private void champActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_champActionPerformed
new Heal().setVisible(true);
}//GEN-LAST:event_champActionPerformed
private void ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitActionPerformed
this.dispose();
}//GEN-LAST:event_ExitActionPerformed
private void StatsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StatsActionPerformed
object_character.pobierzOpis();
}//GEN-LAST:event_StatsActionPerformed
private void sellerArmorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sellerArmorMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_sellerArmorMouseClicked
private void sellerArmorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sellerArmorActionPerformed
this.setVisible(false);
new dealersMainMain().setVisible(true);
}//GEN-LAST:event_sellerArmorActionPerformed
private void hellerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_hellerMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_hellerMouseClicked
private void hellerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hellerActionPerformed
this.setVisible(false);
new Heal().setVisible(true);
}//GEN-LAST:event_hellerActionPerformed
private void ArenaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ArenaMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_ArenaMouseClicked
private void ArenaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ArenaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_ArenaActionPerformed
private void KowalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_KowalActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_KowalActionPerformed
private void skillsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skillsActionPerformed
this.setVisible(false);
new Skills().setVisible(true);
}//GEN-LAST:event_skillsActionPerformed
private void tawernActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tawernActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tawernActionPerformed
private void questsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_questsActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_questsActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(mainMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(mainMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(mainMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(mainMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new mainMain().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Arena;
private javax.swing.JButton Exit;
private javax.swing.JButton Katakumby;
private javax.swing.JButton Kowal;
private javax.swing.JPanel Miasto;
private javax.swing.JPanel Poczta;
private javax.swing.JPanel Postać;
private javax.swing.JButton Stats;
private javax.swing.JButton champ;
private javax.swing.JTabbedPane handlarz;
private javax.swing.JButton heller;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel journey;
private javax.swing.JButton post;
private javax.swing.JButton quests;
private javax.swing.JButton sellerArmor;
private javax.swing.JButton skills;
private javax.swing.JButton tawern;
private javax.swing.JButton work;
// End of variables declaration//GEN-END:variables
}
| [
"noreply@github.com"
] | noreply@github.com |
81f15987e9410f1b53cd92ecd0d90a9a7fe4667a | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-resourceexplorer2/src/main/java/com/amazonaws/services/resourceexplorer2/model/IndexType.java | b18cc216d65fecab3c782a89e878fcd7cdb4651b | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 1,759 | java | /*
* Copyright 2018-2023 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.resourceexplorer2.model;
import javax.annotation.Generated;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum IndexType {
LOCAL("LOCAL"),
AGGREGATOR("AGGREGATOR");
private String value;
private IndexType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
/**
* Use this in place of valueOf.
*
* @param value
* real value
* @return IndexType corresponding to the value
*
* @throws IllegalArgumentException
* If the specified value does not map to one of the known values in this enum.
*/
public static IndexType fromValue(String value) {
if (value == null || "".equals(value)) {
throw new IllegalArgumentException("Value cannot be null or empty!");
}
for (IndexType enumEntry : IndexType.values()) {
if (enumEntry.toString().equals(value)) {
return enumEntry;
}
}
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
}
}
| [
""
] | |
19eec08083e9a227db5ac608b0f1165a7ed51226 | 7ca2f1fb334e9e939fdc16f65aca55c93435d7fd | /spring-REST/src/main/java/com/demo/spring/AppConfig.java | 627fea747596e1ab2370003925f4972aa082251d | [] | no_license | tarique00/TechnoGhost | aba81922a6adfe6cb6997410627bbc0d2f1d6173 | a034c74afec12f091a6f9ad81290587bd9fbf7bd | refs/heads/master | 2021-01-10T02:47:49.726011 | 2017-09-08T11:18:28 | 2017-09-08T11:18:28 | 45,168,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,058 | java | package com.demo.spring;
import javax.persistence.EntityManagerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.Database;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@ComponentScan(basePackages={"com.demo.spring"})
@EnableTransactionManagement
@EnableJpaRepositories(basePackages="com.demo.spring")
public class AppConfig {
@Bean
public DriverManagerDataSource dataSource(){
DriverManagerDataSource ds= new DriverManagerDataSource();
ds.setDriverClassName("com.mysql.jdbc.Driver");
ds.setUrl("jdbc:mysql://localhost:3306/springdb");
ds.setUsername("root");
ds.setPassword("root");
return ds;
}
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(){
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(dataSource());
emf.setPackagesToScan("com.demo.spring");
HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter();
va.setDatabase(Database.MYSQL);
va.setShowSql(true);
emf.setJpaVendorAdapter(va);
return emf;
}
@Bean
public JpaTransactionManager transactionManager(){
JpaTransactionManager txm = new JpaTransactionManager();
txm.setEntityManagerFactory(entityManagerFactory().getObject());
return txm;
}
} | [
"noreply@github.com"
] | noreply@github.com |
d3cee5ef37a605c27984ccf6694e8a460d908ccd | 73631c5f1e0f89fa97744680785a2e5ec29b28ec | /src/main/java/au/com/iglooit/silverwater/security/GoogleAccountsAuthenticationProvider.java | 6a68bf2f420d5eec7cb2557d0b8742d4e903dca4 | [] | no_license | igloooooo/silverwater | fe5d6f3eadb7fef660b5ae97355786a5ba240b66 | 82892671617d91b5f577a067e320eb683e243f2c | refs/heads/master | 2021-01-02T22:51:12.647844 | 2015-01-07T13:00:29 | 2015-01-07T13:00:29 | 27,011,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,315 | java | package au.com.iglooit.silverwater.security;
import au.com.iglooit.silverwater.model.entity.IGUser;
import au.com.iglooit.silverwater.model.entity.UserOriginalSystem;
import au.com.iglooit.silverwater.service.dao.UserDAO;
import com.google.appengine.api.users.User;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.SpringSecurityMessageSource;
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
import javax.annotation.Resource;
/**
* A simple authentication provider which interacts with {@code IGUser} returned by the GAE {@code UserService},
* and also the local persistent {@code UserRegistry} to build an application user principal.
* <p>
* If the user has been authenticated through google accounts, it will check if they are already registered
* and either load the existing user information or assign them a temporary identity with limited access until they
* have registered.
* <p>
* If the account has been disabled, a {@code DisabledException} will be raised.
*
* @author Luke Taylor
*/
public class GoogleAccountsAuthenticationProvider implements AuthenticationProvider, MessageSourceAware {
protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
@Resource
private UserDAO userDAO;
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
IGUser user = null;
if(authentication.getPrincipal() instanceof User) {
User googleUser = (User) authentication.getPrincipal();
user = userDAO.findByEmail(googleUser.getEmail());
if (user == null) {
// IGUser not in registry. Needs to register
IGUser rawUser = new IGUser(googleUser.getUserId(), googleUser.getNickname(), googleUser.getEmail());
rawUser.setUserOriginalSystem(UserOriginalSystem.GOOGLE);
user = userDAO.signUpAsNewDefaultUser(rawUser);
}
} else if (authentication.getPrincipal() instanceof com.face4j.facebook.entity.User) {
com.face4j.facebook.entity.User facebookUser = (com.face4j.facebook.entity.User) authentication.getPrincipal();
user = userDAO.findByEmail(facebookUser.getEmail());
if (user == null) {
// IGUser not in registry. Needs to register
IGUser rawUser = new IGUser("", facebookUser.getName(), facebookUser.getEmail());
rawUser.setUserOriginalSystem(UserOriginalSystem.FACEBOOK);
user = userDAO.signUpAsNewDefaultUser(rawUser);
}
} else if (authentication.getPrincipal() instanceof IGUser) {
user = userDAO.findByEmail(((IGUser)authentication.getPrincipal()).getEmail());
if (user == null) {
// IGUser not in registry. Needs to register
IGUser rawUser = new IGUser("", "", user.getEmail());
rawUser.setUserOriginalSystem(UserOriginalSystem.DB);
user = userDAO.signUpAsNewDefaultUser(rawUser);
}
} else {
throw new InvalidAuthenticationException("user is invalid");
}
if (!user.isEnabled()) {
throw new DisabledException("Account is disabled");
}
return new GaeUserAuthentication(user, authentication.getDetails());
}
/**
* Indicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.
*/
public final boolean supports(Class<?> authentication) {
return PreAuthenticatedAuthenticationToken.class.isAssignableFrom(authentication);
}
public void setUserDAO(UserDAO userDAO) {
this.userDAO = userDAO;
}
public void setMessageSource(MessageSource messageSource) {
this.messages = new MessageSourceAccessor(messageSource);
}
}
| [
"nichols.zu@gmail.com"
] | nichols.zu@gmail.com |
4b9eb8782ab7a6f88d87f4b600c2403408943418 | 272507ca6f193bfd86dbc75ac9a69b4f0977dca1 | /Topic 3/Chapter6_Question12.java | b78deabe8180bc30f2d085b6f17f539a971e3fbc | [] | no_license | whit0851/CST-105 | 7e505ad3dca2c12a5cecc17980844fdce90364a7 | fdf85e7ad63810d7f8804f7885ad61ad244a16ea | refs/heads/master | 2020-05-20T18:00:12.106846 | 2017-04-06T20:11:13 | 2017-04-06T20:11:13 | 84,498,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | import java.util.*;
public class Chapter6_Question12 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Please enter two Characters and the number of Characters per Line: ");
char ch1 = input.next().charAt(0);
char ch2 = input.next().charAt(0);
int perline = input.nextInt();
input.nextLine();
input.close();
printChars(ch1, ch2, perline);
}
public static void printChars(char ch1, char ch2, int numberPerLine){
for(int i = 1; ch1 < ch2 + 1; i++){
if(i%numberPerLine==0)
System.out.printf("%-2s\n", ch1);
else
System.out.printf("%-2s", ch1);
ch1++;
}
}
}
| [
"whit0851@gmail.com"
] | whit0851@gmail.com |
50a585b129e4046d76166dc97f50533b871dc0ee | 2034a5924be653dda6ffbead4ff4cb8996f43a1d | /app/src/main/java/com/jsd/jsdweinxin/app/util/PinyinUtils.java | e06c40f2d474a6bd4423358c67689a1216958025 | [] | no_license | jsd01/JSDweixin | fb109d689a5fd8c17714602025e5537d8651c426 | e19d3afc24606871f0d7f91a890882a51bc30481 | refs/heads/master | 2020-03-23T09:15:06.172719 | 2018-07-19T10:42:37 | 2018-07-19T10:42:37 | 141,376,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,853 | java | package com.jsd.jsdweinxin.app.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
/**
* @创建者 CSDN_LQR
* @描述 拼音工具(需要pinyin4j-2.5.0.jar)
*/
public class PinyinUtils {
/**
* 根据传入的字符串(包含汉字),得到拼音
* 沧晓 -> CANGXIAO
* 沧 晓*& -> CANGXIAO
* 沧晓f5 -> CANGXIAO
*
* @param str 字符串
* @return
*/
public static String getPinyin(String str) {
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
format.setCaseType(HanyuPinyinCaseType.UPPERCASE);
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
StringBuilder sb = new StringBuilder();
char[] charArray = str.toCharArray();
for (int i = 0; i < charArray.length; i++) {
char c = charArray[i];
// 如果是空格, 跳过
if (Character.isWhitespace(c)) {
continue;
}
if (c >= -127 && c < 128 || !(c >= 0x4E00 && c <= 0x9FA5)) {
// 肯定不是汉字
sb.append(c);
} else {
String s = "";
try {
// 通过char得到拼音集合. 单 -> dan, shan
s = PinyinHelper.toHanyuPinyinStringArray(c, format)[0];
sb.append(s);
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
sb.append(s);
}
}
}
return sb.toString();
}
}
| [
"jacyffamily@163.com"
] | jacyffamily@163.com |
0a12f571c053f92e6d2b111b8c5a444a4c2c834e | 86a620704217f87028dd504c66c1bf9b165127b0 | /design-pattern-practice/src/com/ihhira/dptest/observer_pattern_test/test/Main.java | 39a847bf7ef6a88886d125b6deb73841c45f13f4 | [] | no_license | imranhasanhira/design-pattern-test | c96a1022bd05582b189eba1c2bdede964346415f | 10a837014682553ae1d028fdf079a925d5b490ad | refs/heads/master | 2021-01-25T10:05:42.247188 | 2014-10-22T10:32:44 | 2014-10-22T10:32:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package com.ihhira.dptest.observer_pattern_test.test;
import com.ihhira.dptest.observer_pattern_test.core.LargeOperation;
/**
* created on 8/25/14.
*
* @author Md Imran Hasan Hira (imranhasanhira@gmail.com)
*/
public class Main {
public static void main(String[] args) {
LargeOperation operation = new LargeOperation();
LargeOperationEventHandler handler = new LargeOperationEventHandler();
operation.addListener(handler);
operation.perform();
}
}
| [
"imranhasanhira@gmail.com"
] | imranhasanhira@gmail.com |
1980de058592530980a446caa62594c22427a1bf | 803aaa7937a003ac3d3aed4c03153f232caf8390 | /part3/filter/src/main/java/com/manbalboy/filter/filter/GlobalFilter.java | e73c29609c8f59fb99d4a27450e750192bbd984a | [] | no_license | manbalboy/java-another-level | 88fe5079b1b3654d4f36b7c4decfe09305c77831 | 79d8f6a2b061240be50eb5fc162d8c1363cf34f0 | refs/heads/main | 2023-09-01T05:16:10.873937 | 2021-10-13T13:40:25 | 2021-10-13T13:40:25 | 406,363,450 | 0 | 0 | null | 2021-10-11T11:01:20 | 2021-09-14T12:45:36 | Java | UTF-8 | Java | false | false | 1,852 | java | package com.manbalboy.filter.filter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Slf4j
@WebFilter(urlPatterns = "/api/user/*")
public class GlobalFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
// 전처리
// HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
// HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
ContentCachingRequestWrapper httpServletRequest = new ContentCachingRequestWrapper(
(HttpServletRequest) servletRequest);
ContentCachingResponseWrapper httpServletResponse = new ContentCachingResponseWrapper(
(HttpServletResponse) servletResponse);
String url = httpServletRequest.getRequestURI();
filterChain.doFilter(httpServletRequest, httpServletResponse);
// 후처리
// ContentCachingRequestWrapper tofilter 후에 찍어야한다. getContentAsByteArray
String reqContent = new String(httpServletRequest.getContentAsByteArray());
log.info("request url : {}, request body : {}", url, reqContent);
String resContent = new String(httpServletResponse.getContentAsByteArray());
int httpStatus = httpServletResponse.getStatus();
httpServletResponse.copyBodyToResponse();
log.info("response status : {}, responseBody : {}", httpStatus, resContent);
}
}
| [
"manbalboy@hanmail.net"
] | manbalboy@hanmail.net |
c7c46fc1f4e206a39daf94a64914f0786f7d572a | e720f6dfb65edaf788c13fa4e08954950c797622 | /all/org.liveSense.scripting.jsp.taglib.json/src/main/java/atg/taglib/json/util/HTTP.java | 9f898b77994cf34c671bde18d7997879e710ae8a | [
"Apache-2.0"
] | permissive | manjunathkg/liveserver | ddca6c890f3b934a4f7e66e0c267dc12306eb12b | 1be13f898a2d254587f6b271a0b37156f767f9b5 | refs/heads/master | 2020-05-18T06:10:20.745943 | 2013-07-11T07:01:25 | 2013-07-11T07:01:25 | 11,333,416 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,665 | java | package atg.taglib.json.util;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import java.util.Iterator;
/**
* Convert an HTTP header to a JSONObject and back.
* @author JSON.org
* @version 2
*/
public class HTTP {
/** Carriage return/line feed. */
public static final String CRLF = "\r\n";
/**
* Convert an HTTP header string into a JSONObject. It can be a request
* header or a response header. A request header will contain
* <pre>{
* Method: "POST" (for example),
* "Request-URI": "/" (for example),
* "HTTP-Version": "HTTP/1.1" (for example)
* }</pre>
* A response header will contain
* <pre>{
* "HTTP-Version": "HTTP/1.1" (for example),
* "Status-Code": "200" (for example),
* "Reason-Phrase": "OK" (for example)
* }</pre>
* In addition, the other parameters in the header will be captured, using
* the HTTP field names as JSON names, so that <pre>
* Date: Sun, 26 May 2002 18:06:04 GMT
* Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
* Cache-Control: no-cache</pre>
* become
* <pre>{...
* Date: "Sun, 26 May 2002 18:06:04 GMT",
* Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
* "Cache-Control": "no-cache",
* ...}</pre>
* It does no further checking or conversion. It does not parse dates.
* It does not do '%' transforms on URLs.
* @param string An HTTP header string.
* @return A JSONObject containing the elements and attributes
* of the XML string.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException {
JSONObject o = new JSONObject();
HTTPTokener x = new HTTPTokener(string);
String t;
t = x.nextToken();
if (t.toUpperCase().startsWith("HTTP")) {
// Response
o.put("HTTP-Version", t);
o.put("Status-Code", x.nextToken());
o.put("Reason-Phrase", x.nextTo('\0'));
x.next();
} else {
// Request
o.put("Method", t);
o.put("Request-URI", x.nextToken());
o.put("HTTP-Version", x.nextToken());
}
// Fields
while (x.more()) {
String name = x.nextTo(':');
x.next(':');
o.put(name, x.nextTo('\0'));
x.next();
}
return o;
}
/**
* Convert a JSONObject into an HTTP header. A request header must contain
* <pre>{
* Method: "POST" (for example),
* "Request-URI": "/" (for example),
* "HTTP-Version": "HTTP/1.1" (for example)
* }</pre>
* A response header must contain
* <pre>{
* "HTTP-Version": "HTTP/1.1" (for example),
* "Status-Code": "200" (for example),
* "Reason-Phrase": "OK" (for example)
* }</pre>
* Any other members of the JSONObject will be output as HTTP fields.
* The result will end with two CRLF pairs.
* @param o A JSONObject
* @return An HTTP header string.
* @throws JSONException if the object does not contain enough
* information.
*/
public static String toString(JSONObject o) throws JSONException {
Iterator keys = o.keys();
String s;
StringBuffer sb = new StringBuffer();
if (o.has("Status-Code") && o.has("Reason-Phrase")) {
sb.append(o.getString("HTTP-Version"));
sb.append(' ');
sb.append(o.getString("Status-Code"));
sb.append(' ');
sb.append(o.getString("Reason-Phrase"));
} else if (o.has("Method") && o.has("Request-URI")) {
sb.append(o.getString("Method"));
sb.append(' ');
sb.append('"');
sb.append(o.getString("Request-URI"));
sb.append('"');
sb.append(' ');
sb.append(o.getString("HTTP-Version"));
} else {
throw new JSONException("Not enough material for an HTTP header.");
}
sb.append(CRLF);
while (keys.hasNext()) {
s = keys.next().toString();
if (!s.equals("HTTP-Version") && !s.equals("Status-Code") &&
!s.equals("Reason-Phrase") && !s.equals("Method") &&
!s.equals("Request-URI") && !o.isNull(s)) {
sb.append(s);
sb.append(": ");
sb.append(o.getString(s));
sb.append(CRLF);
}
}
sb.append(CRLF);
return sb.toString();
}
}
| [
"mkaliyur@gmail.com"
] | mkaliyur@gmail.com |
e87a5ce571deb83650e4950ce2a874b7c1b1dfb6 | d9a09ee75b91216b9085742f7bbe424ee374c9c0 | /src/main/java/forbeatdev/userrestapi/ServletInitializer.java | 271e2cd617189c27742f6a6f16a0fcd3ce2a6321 | [] | no_license | xolyspirit/userrestapi | 7597fbed92550e3e0b44bfb5aca458a11c07541d | dfbc1da5db1d207e3f80c759d6a17263a0677baa | refs/heads/master | 2020-03-16T15:38:24.593558 | 2018-05-09T13:21:33 | 2018-05-09T13:21:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package forbeatdev.userrestapi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(UserrestapiApplication.class);
}
}
| [
"odibar@yandex.ru"
] | odibar@yandex.ru |
1288d5ba4ecb4f31074b9ea8370509ccddd03465 | 632b4fd540544102f37a7139b06ecf95ae700d87 | /src/test/java/com/github/michaelwittmann/conditionalstateful/StateMachineTest.java | 9eb37af9680cfc8bb752d9f4bc14271aed6f27e2 | [
"Apache-2.0"
] | permissive | michaelwittmann/conditionalstateful | 6a4a347c19b24fbd96c1d5fb7a4ff59f71ac4ff2 | 2e63e2148dd34fb3d3627c76f6e8eb4b9b72c553 | refs/heads/master | 2021-06-13T11:02:44.784340 | 2021-04-27T12:36:20 | 2021-04-27T12:36:20 | 186,764,587 | 0 | 0 | Apache-2.0 | 2021-04-27T12:35:57 | 2019-05-15T06:39:03 | Java | UTF-8 | Java | false | false | 5,422 | java | package com.github.michaelwittmann.conditionalstateful;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class StateMachineTest {
enum State {
IDLE, DRIVING, CHARGING
}
@Test
public void testStateMachineTransitions() throws InconsistentTranstitionException, UnevaluatedTransitionException {
StateVariable<Integer> position = new StateVariable(1);
StateVariable<Integer> targetPosition = new StateVariable(2);
StateVariable<Double> charge = new StateVariable<>(85.5);
StateMachine<State> stateMachine =
new StateMachineBuilder<State>(State.IDLE)
.onEnter(State.IDLE, () -> System.out.println("Entering IDLE"))
.onExit(State.IDLE, () -> System.out.println("Exit IDLE"))
.onEnter(State.DRIVING, () -> System.out.println("Entering DRIVING"))
.onExit(State.DRIVING, () -> System.out.println("Exit DRIVING"))
.onEnter(State.CHARGING, () -> System.out.println("Entering CHARGING"))
.onExit(State.CHARGING, () -> System.out.println("Exit CHARGING"))
.addTransition(State.IDLE, () -> position.getValue()!=targetPosition.getValue(), State.DRIVING)
.addTransition(State.IDLE, () -> shouldRecharge(charge.getValue()), State.CHARGING)
.addTransition(State.DRIVING, () -> position.getValue()==targetPosition.getValue(), State.IDLE)
.addTransition(State.CHARGING, () -> charge.getValue() >=80, State.IDLE)
.build();
stateMachine.evaluate();
targetPosition.setValue(1);
stateMachine.evaluate();
position.setValue(1);
stateMachine.evaluate();
charge.setValue(10.0);
stateMachine.evaluate();
charge.setValue(90.0);
stateMachine.evaluate();
}
public boolean shouldRecharge(double currrentCharge){
return currrentCharge<=25?true:false;
}
@Test(expected = InconsistentTranstitionException.class)
public void forceTransitionsIntoError() throws UnevaluatedTransitionException {
MyDataContainer position = new MyDataContainer(1, 0);
MyDataContainer targetPosition = new MyDataContainer(1, 0);
MyDataContainer charge = new MyDataContainer(1, 85);
StateMachine<State> stateMachine =
new StateMachineBuilder<State>(State.IDLE)
.onEnter(State.IDLE, () -> System.out.println("Entering IDLE"))
.onExit(State.IDLE, () -> System.out.println("Exit IDLE"))
.onEnter(State.DRIVING, () -> System.out.println("Entering DRIVING"))
.onExit(State.DRIVING, () -> System.out.println("Exit DRIVING"))
.onEnter(State.CHARGING, () -> System.out.println("Entering CHARGING"))
.onExit(State.CHARGING, () -> System.out.println("Exit CHARGING"))
.addTransition(State.IDLE, () -> position.getValue()!=targetPosition.getValue(), State.DRIVING)
.addTransition(State.IDLE, () -> shouldRecharge(charge.getValue()), State.CHARGING)
.addTransition(State.DRIVING, () -> position.getValue()==targetPosition.getValue(), State.IDLE)
.addTransition(State.CHARGING, () -> charge.getValue() >=80, State.IDLE)
.build();
stateMachine.evaluate();
targetPosition.setValue(1);
charge.setValue(10);
stateMachine.evaluate();
}
@Test(expected = InconsistentTranstitionException.class)
public void checkRedundantTransitions() throws UnevaluatedTransitionException {
MyDataContainer position = new MyDataContainer(1, 0);
MyDataContainer targetPosition = new MyDataContainer(1, 0);
MyDataContainer charge = new MyDataContainer(1, 85);
StateMachine<State> stateMachine =
new StateMachineBuilder<State>(State.IDLE)
.onEnter(State.IDLE, () -> System.out.println("Entering IDLE"))
.onExit(State.IDLE, () -> System.out.println("Exit IDLE"))
.onEnter(State.DRIVING, () -> System.out.println("Entering DRIVING"))
.onExit(State.DRIVING, () -> System.out.println("Exit DRIVING"))
.onEnter(State.CHARGING, () -> System.out.println("Entering CHARGING"))
.onExit(State.CHARGING, () -> System.out.println("Exit CHARGING"))
.addTransition(State.IDLE, () -> true, State.DRIVING)
.addTransition(State.IDLE, () -> false, State.DRIVING)
.build();
}
static class MyDataContainer{
private int id;
private double value;
public MyDataContainer(int id, double value) {
this.id = id;
this.value = value;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
}
}
| [
"michael.wittmann@tum.de"
] | michael.wittmann@tum.de |
e529e303f969c275871e4879fd69f4335437a59a | d25b0440201501f6e5353cfa0c9939755c92e4ca | /src/test/java/com/hmi/kiddos/util/DocumentGenerationTest.java | b6947c958f7c63d168ba7c59c85e754755a14cdb | [] | no_license | amit-agrawal/kiddos | c78f7d6a9eb262890f11aa848916f64bfc4a9eef | 5e02ba540f46682bcdbb910d4d6369e69065d73a | refs/heads/master | 2023-01-11T22:33:58.619117 | 2019-08-09T09:44:35 | 2019-08-09T09:44:35 | 58,826,753 | 0 | 1 | null | 2023-01-04T11:27:16 | 2016-05-14T19:42:05 | Java | UTF-8 | Java | false | false | 1,144 | java | package com.hmi.kiddos.util;
import java.util.Calendar;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.hmi.kiddos.model.Payment;
import com.hmi.kiddos.model.PaymentDataOnDemand;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath*:/META-INF/spring/applicationContext*.xml")
@Configurable
public class DocumentGenerationTest {
@Autowired
private InvoiceDocumentGenerator docGenerator;
@Autowired
PaymentDataOnDemand dod;
@Test
public void createInvoiceTest() {
Payment obj = dod.getRandomPayment();
obj.setNextFeeDueAmount(19903);
obj.setNextFeeDueDate(Calendar.getInstance());
obj.setPayer("Ajay");
Assert.assertNotNull("Data on demand for 'Payment' failed to initialize correctly", obj);
String docPath = docGenerator.generateInvoice(obj);
Assert.assertNotNull(docPath);
}
} | [
"Amit"
] | Amit |
cc1e9e5082776e7d78d3347ec73c8bd2281364cb | 33c3473630719a68f5728671e61ad39446574841 | /src/main/java/ru/alfasobes/alfasobes/model/Candidate.java | 634d2179fdd846aaf597dcea3fbc050e97862215 | [] | no_license | AlyssaSK/alfasobes | b30e51f7ab51810fa79b20f9992ec2367771bf49 | 5fa6389d2efce287a3d4380135482b12ac3867d8 | refs/heads/master | 2020-04-18T20:39:47.532713 | 2019-01-26T22:03:28 | 2019-01-26T22:03:28 | 167,743,494 | 0 | 0 | null | 2019-01-26T21:57:51 | 2019-01-26T21:57:50 | null | UTF-8 | Java | false | false | 534 | java | package ru.alfasobes.alfasobes.model;
import lombok.Data;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Data
@Entity
public class Candidate {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
private Long id;
private String name;
@OneToMany(mappedBy = "candidate", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private List<Interview> interviews = new ArrayList<>();
public void addInterview(Interview interview) {
interviews.add(interview);
}
}
| [
"hentai.exe@gmail.com"
] | hentai.exe@gmail.com |
4571c0fe4cbbd2919a636bd20d40d14cae58648c | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/ipcall/a/d/l.java | cdba0abaddc0a10f9bd9674c3763ac523cc2474c | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 5,481 | java | package com.tencent.mm.plugin.ipcall.a.d;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.b.a;
import com.tencent.mm.ai.b.b;
import com.tencent.mm.ai.b.c;
import com.tencent.mm.ai.f;
import com.tencent.mm.ai.m;
import com.tencent.mm.network.e;
import com.tencent.mm.network.k;
import com.tencent.mm.network.q;
import com.tencent.mm.platformtools.aa;
import com.tencent.mm.plugin.ipcall.a.i;
import com.tencent.mm.plugin.ipcall.b.c;
import com.tencent.mm.protocal.protobuf.bmf;
import com.tencent.mm.protocal.protobuf.bmg;
import com.tencent.mm.sdk.platformtools.ab;
public final class l extends m
implements k
{
private com.tencent.mm.ai.b ehh;
private f ehi;
private bmf nyC;
private bmg nyD;
public l(int paramInt, long paramLong, boolean paramBoolean)
{
AppMethodBeat.i(21869);
this.ehh = null;
this.nyC = null;
this.nyD = null;
Object localObject1 = new b.a();
((b.a)localObject1).fsJ = new bmf();
((b.a)localObject1).fsK = new bmg();
((b.a)localObject1).fsI = 227;
((b.a)localObject1).uri = "/cgi-bin/micromsg-bin/pstnreport";
((b.a)localObject1).fsL = 0;
((b.a)localObject1).fsM = 0;
this.ehh = ((b.a)localObject1).acD();
this.nyC = ((bmf)this.ehh.fsG.fsP);
this.nyC.wem = paramInt;
this.nyC.wOS = paramLong;
localObject1 = this.nyC;
if (paramBoolean);
for (paramInt = 1; ; paramInt = 0)
{
((bmf)localObject1).wPl = paramInt;
ab.d("MicroMsg.NetSceneIPCallReport", "NetSceneIPCallReport, roomId: %d, callseq: %d, gotAnswer: %d", new Object[] { Integer.valueOf(this.nyC.wem), Long.valueOf(this.nyC.wOS), Integer.valueOf(this.nyC.wPl) });
localObject1 = this.nyC;
Object localObject2 = i.bHs();
localObject2 = ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwu + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwv + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxO + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).gyD + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxP + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxE + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxF + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxG + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxH + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxI + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxJ + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxK + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxL + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxM + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxN + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxQ + "," + c.bIP() + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxZ + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).countryCode + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nya + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nyb + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nyc + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxX + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nye;
ab.i("MicroMsg.IPCallReportHelper", "getPstnClientReportString, result: %s", new Object[] { localObject2 });
((bmf)localObject1).wPi = aa.vy((String)localObject2);
localObject1 = this.nyC;
localObject2 = i.bHs();
localObject2 = ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwu + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwv + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxO + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxW;
ab.i("MicroMsg.IPCallReportHelper", "getPstnChannelReportString, result: %s", new Object[] { localObject2 });
((bmf)localObject1).wPj = aa.vy((String)localObject2);
localObject1 = this.nyC;
localObject2 = i.bHs();
localObject2 = ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwu + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nwv + "," + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxO + ((com.tencent.mm.plugin.ipcall.a.c.b)localObject2).nxV;
ab.i("MicroMsg.IPCallReportHelper", "getPstnEngineReport, result: %s", new Object[] { localObject2 });
((bmf)localObject1).wPk = aa.vy((String)localObject2);
AppMethodBeat.o(21869);
return;
}
}
public final int a(e parame, f paramf)
{
AppMethodBeat.i(21870);
this.ehi = paramf;
int i = a(parame, this.ehh, this);
AppMethodBeat.o(21870);
return i;
}
public final void a(int paramInt1, int paramInt2, int paramInt3, String paramString, q paramq, byte[] paramArrayOfByte)
{
AppMethodBeat.i(21871);
ab.i("MicroMsg.NetSceneIPCallReport", "onGYNetEnd, errType: %d, errCode: %d", new Object[] { Integer.valueOf(paramInt2), Integer.valueOf(paramInt3) });
this.nyD = ((bmg)((com.tencent.mm.ai.b)paramq).fsH.fsP);
if (this.ehi != null)
this.ehi.onSceneEnd(paramInt2, paramInt3, paramString, this);
AppMethodBeat.o(21871);
}
public final int getType()
{
return 227;
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes5-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.ipcall.a.d.l
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
bd5d54fc6252ba5974ead94b3844c7df873d6a5d | 2303dabcca346e60ba76f8ed38fcdb0823d6a7e3 | /Java/Hello User/src/HelloUser.java | 765637917184589635b179683c1a7a6a69fde718 | [] | no_license | j0shyua/iDTech_Programming_Labs_101 | 8828576291ba70408ed71f912cf4909138366703 | b2e488b4fc1a87cc5013b0c616efc0567a47e609 | refs/heads/master | 2021-01-11T16:56:44.983194 | 2017-02-19T22:56:37 | 2017-02-19T22:56:37 | 79,700,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | import java.util.Scanner;
public class HelloUser {
public static void main(String[] args)
{
Scanner input = new Scanner (System.in);
String userInput;
System.out.println ("What's your name?");
userInput = input.nextLine();
System.out.println ("Hello, " + userInput + ", have a good day!");
}
}
| [
"noreply@github.com"
] | noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.