blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01c812e90edf0dac22313b6e4922cc450430d9fc
|
21d7436b01e03a6f9c4c878e604cb4d2adebffa0
|
/src/test/java/ch/lihsmi/effectivejava/chapter2/item8/OverrideEqualsTest.java
|
446c371730ab1365e2dd996b56834cb1e62ad73a
|
[] |
no_license
|
michaellihs/effective-java
|
72027674552a70ebeb40b401b22af429ebe84b7f
|
d6790743fddbcd066393d6e3e4c870a7fdb7c7ed
|
refs/heads/master
| 2021-01-19T10:43:07.751207 | 2019-03-19T22:13:20 | 2019-03-19T22:13:20 | 63,182,686 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,984 |
java
|
package ch.lihsmi.effectivejava.chapter2.item8;
import org.junit.Test;
import static org.junit.Assert.*;
public class OverrideEqualsTest {
@Test
public void overridenEqualsIsReflexive() {
OverrideEquals.ValueClass x = OverrideEquals.getValueClassFor(10);
assertTrue(x.equals(x));
}
@Test
public void overridenEqualsIsSymmetric() {
int value = 100;
OverrideEquals.ValueClass x = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass y = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass z = OverrideEquals.getValueClassFor(value + 1);
assertTrue(x.equals(y) && y.equals(x));
assertFalse(x.equals(z) || z.equals(x));
}
@Test
public void overrideEqualsIsTransitive() {
int value = 101;
OverrideEquals.ValueClass x = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass y = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass z = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass w = OverrideEquals.getValueClassFor(value + 1);
assertTrue(!(x.equals(y) && y.equals(z)) || x.equals(z));
assertTrue(!(x.equals(y) && y.equals(w)) || x.equals(w));
}
@Test
public void overriddenEqualsIsConsistent() {
int value = 100;
OverrideEquals.ValueClass x = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass y = OverrideEquals.getValueClassFor(value);
OverrideEquals.ValueClass z = OverrideEquals.getValueClassFor(value + 1);
assertTrue(x.equals(y));
assertTrue(x.equals(y));
assertTrue(x.equals(y));
assertFalse(x.equals(z));
assertFalse(x.equals(z));
assertFalse(x.equals(z));
}
@Test
public void notNullNeverEqualsNull() {
OverrideEquals.ValueClass x = OverrideEquals.getValueClassFor(10);
assertFalse(x.equals(null));
}
}
|
[
"[email protected]"
] | |
b647c32616ac128642183d0a23db4b0512ba90ef
|
5c3c0fdfb18b893b75d824dd75cc7e18d26684c2
|
/src/main/java/ESWCrefactoring/ConvertDatasetToFeatureSetForCRFSuite.java
|
329b9a9691c9534bd75009090a2439d175d98c0a
|
[] |
no_license
|
fmoghaddam/RoleTaggerWorkFlow
|
c1b5bbe3cfe21418fa6f1d5a323ebf0b1a812c63
|
fb2c63180d2ba1ddf5bbc48960b3d56b136448a0
|
refs/heads/master
| 2021-05-11T18:30:38.112197 | 2018-02-05T11:15:02 | 2018-02-05T11:15:02 | 110,526,492 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,272 |
java
|
package ESWCrefactoring;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ise.roletagger.model.Global;
import ise.roletagger.model.TrainTestData;
import ise.roletagger.util.CharactersUtils;
import ise.roletagger.util.Config;
import ise.roletagger.util.FileUtil;
/**
* This class convert dataset files to a structure which CRFSuite CRF can read
* for training
*
* This version works with output of
* {@link DatasetGeneratorWithCategoryTrees4thVersion}}
*
* @author fbm
*
*/
public class ConvertDatasetToFeatureSetForCRFSuite {
/**
* Name of test/train data file which will be produced
*/
//private final String TEST_TXT;
//private final String TRAIN_TXT;
private final String WHERE_TO_WRITE_CRF_DATASET = Config.getString("WHERE_TO_WRITE_CRF_DATASET", "");
private final int CHUNKING_SIZE = 1000;
private final int NUMBER_OF_THREADS = Config.getInt("NUMBER_OF_THREADS", 0);
private final String POSITIVE_DATA_ADDRESS = Config.getString("WHERE_TO_WRITE_DATASET", "")
+ Config.getString("POSITIVE_UNIQUE_DATASET_NAME", "");
private final String NEGATIVE_DATA_ADDRESS = Config.getString("WHERE_TO_WRITE_DATASET", "")
+ Config.getString("DIFFICULT_UNIQUE_NEGATIVE_DATASET_NAME", "");
private final String EASY_NEGATIVE_DATA_ADDRESS = Config.getString("WHERE_TO_WRITE_DATASET", "")
+ Config.getString("EASY_UNIQUE_NEGATIVE_DATASET_NAME", "");
/**
* How much data should be considered as test data?
*/
private double TEST_PERCENTAGE = 0.2f;
//private final List<String> finalResult = Collections.synchronizedList(new ArrayList<>());
/**
* With seed
*/
private final Random RAND = new Random(1);
public ConvertDatasetToFeatureSetForCRFSuite(double d) {
TEST_PERCENTAGE = d;
//TEST_TXT = "test"+String.valueOf(d);
//TRAIN_TXT = "train"+String.valueOf(d);
}
public static void main(String[] args) throws IOException {
final Thread t = new Thread(new ConvertDatasetToFeatureSetForCRFSuite(0.).run());
t.setDaemon(false);
t.start();
}
public Runnable run() {
return () -> {
try {
final List<String> positiveLines = Files.readAllLines(Paths.get(POSITIVE_DATA_ADDRESS),
StandardCharsets.UTF_8);
final List<String> negativeLines = Files.readAllLines(Paths.get(NEGATIVE_DATA_ADDRESS),
StandardCharsets.UTF_8);
final List<String> easyNegativeLines = Files.readAllLines(Paths.get(EASY_NEGATIVE_DATA_ADDRESS),
StandardCharsets.UTF_8);
final TrainTestData positiveTTD = sampleData(positiveLines, TEST_PERCENTAGE);
final TrainTestData difficultNegativeTTD = sampleData(negativeLines, TEST_PERCENTAGE);
final TrainTestData easyNegativeTTD = sampleData(easyNegativeLines, TEST_PERCENTAGE);
System.err.println(positiveTTD.getTrainSet().size());
System.err.println(positiveTTD.getTestSet().size());
System.err.println(difficultNegativeTTD.getTrainSet().size());
System.err.println(difficultNegativeTTD.getTestSet().size());
System.err.println(easyNegativeTTD.getTrainSet().size());
System.err.println(easyNegativeTTD.getTestSet().size());
// generateFullDataset(positiveTTD.getTrainSet(), difficultNegativeTTD.getTrainSet(), true);
// generateFullDataset(positiveTTD.getTestSet(), difficultNegativeTTD.getTestSet(), false);
generateFullDatasetOnlyForPositive(positiveTTD.getTrainSet(),true);
generateFullDatasetOnlyForDifficultNegative(difficultNegativeTTD.getTrainSet(),false);
generateFullDatasetOnlyForEasyNegative(easyNegativeTTD.getTrainSet(),false);
} catch (Exception e) {
e.printStackTrace();
}
};
}
private void generateFullDatasetOnlyForDifficultNegative(List<String> difficultNegative,boolean isPositive) {
try {
final List<String> finalResult = Collections.synchronizedList(new ArrayList<>());
final ExecutorService executor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
for (int i = 0; i < difficultNegative.size(); i = Math.min(i + CHUNKING_SIZE, difficultNegative.size())) {
executor.execute(handle(difficultNegative, i, Math.min(i + CHUNKING_SIZE, difficultNegative.size()), isPositive,finalResult));
}
executor.shutdown();
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
FileUtil.createFolder(WHERE_TO_WRITE_CRF_DATASET);
FileUtil.writeDataToFile(finalResult, WHERE_TO_WRITE_CRF_DATASET + "difficultNegativeSeparated", false);
finalResult.clear();
} catch (final Exception e) {
e.printStackTrace();
}
}
private void generateFullDatasetOnlyForPositive(List<String> positive,boolean isPositive) {
try {
final List<String> finalResult = Collections.synchronizedList(new ArrayList<>());
final ExecutorService executor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
for (int i = 0; i < positive.size(); i = Math.min(i + CHUNKING_SIZE, positive.size())) {
executor.execute(handle(positive, i, Math.min(i + CHUNKING_SIZE, positive.size()),isPositive,finalResult));
}
executor.shutdown();
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
FileUtil.createFolder(WHERE_TO_WRITE_CRF_DATASET);
FileUtil.writeDataToFile(finalResult, WHERE_TO_WRITE_CRF_DATASET + "positiveSeparated", false);
finalResult.clear();
} catch (final Exception e) {
e.printStackTrace();
}
}
// /**
// * Run in parallel Convert data to the features set which can be used by
// * CRFSuite First chunk data and pass each chunk to each thread Can be used for
// * converting train or test data by {@code isTrain}
// *
// * @param postiveData
// * @param negativeData
// * @param isTrain
// */
// private void generateFullDataset(List<String> postiveData, List<String> negativeData, boolean isTrain) {
// try {
// final List<String> finalResult = Collections.synchronizedList(new ArrayList<>());
// final ExecutorService executor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
// for (int i = 0; i < postiveData.size(); i = Math.min(i + CHUNKING_SIZE, postiveData.size())) {
// executor.execute(handle(postiveData, i, Math.min(i + CHUNKING_SIZE, postiveData.size()), true));
// }
// for (int i = 0; i < negativeData.size(); i = Math.min(i + CHUNKING_SIZE, negativeData.size())) {
// executor.execute(handle(negativeData, i, Math.min(i + CHUNKING_SIZE, negativeData.size()), false));
// }
// executor.shutdown();
// executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
// FileUtil.createFolder(WHERE_TO_WRITE_CRF_DATASET);
// FileUtil.writeDataToFile(finalResult, WHERE_TO_WRITE_CRF_DATASET + (isTrain ? TRAIN_TXT : TEST_TXT), false);
// finalResult.clear();
// } catch (final Exception e) {
// e.printStackTrace();
// }
// }
private void generateFullDatasetOnlyForEasyNegative(List<String> easyNegativeData,boolean isPositive) {
try {
final List<String> finalResult = Collections.synchronizedList(new ArrayList<>());
final ExecutorService executor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
for (int i = 0; i < easyNegativeData.size(); i = Math.min(i + CHUNKING_SIZE, easyNegativeData.size())) {
executor.execute(handle(easyNegativeData, i, Math.min(i + CHUNKING_SIZE, easyNegativeData.size()), isPositive,finalResult));
}
executor.shutdown();
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
FileUtil.createFolder(WHERE_TO_WRITE_CRF_DATASET);
FileUtil.writeDataToFile(finalResult, WHERE_TO_WRITE_CRF_DATASET + "easyNegativeSeparated", false);
finalResult.clear();
} catch (final Exception e) {
e.printStackTrace();
}
}
/**
* Returns a runnable for processing chunk of data. What this function does is
* converting data to features set to be used in CRFSuite
*
* @param data
* @param start
* @param end
* @param isPositive
* @param finalResult
* @return
*/
private Runnable handle(List<String> data, int start, int end, boolean isPositive, List<String> finalResult) {
final Runnable r = () -> {
for (int i = start; i < end; i++) {
String line = data.get(i);
String taggedLine = line;
taggedLine = normalizeTaggedSentence(taggedLine);
final Map<Integer, Map<String, String>> result = SentenceToFeature.convertTaggedSentenceToFeatures(taggedLine,isPositive);
finalResult.addAll(SentenceToFeature.featureMapToStringList(result));
}
System.err.println(
"Thread " + (isPositive ? "positive " : "negative ") + ((start / CHUNKING_SIZE) + 1) + " is done");
};
return r;
}
public static String normalizeTaggedSentence(String line) {
final Map<String,String> result = new HashMap<>();
line = Global.removeRolePhraseTag(line);
Pattern p = Pattern.compile("</?HR>");
Matcher matcher = p.matcher(line);
while(matcher.find()) {
final String saltString = " "+CharactersUtils.getSaltString()+" ";
line = line.replace(matcher.group(0),saltString);
result.put(saltString, matcher.group(0));
}
line = CharactersUtils.normalizeTrainSentence(line);
for(Entry<String, String> e:result.entrySet()) {
line = line.replace(e.getKey(), e.getValue());
}
line = line.replaceAll("\\s+"," ");
return line;
}
private TrainTestData sampleData(List<String> lines, double testPer) {
if(testPer==0.) {
return new TrainTestData(lines, new ArrayList<>());
}
int total = lines.size();
int trainSize = (int) (total * (1 - testPer));
final Set<Integer> indexes = new HashSet<>();
while (indexes.size() < trainSize) {
indexes.add((int) (RAND.nextFloat() * total));
}
final List<String> train = new ArrayList<>();
final List<String> test = new ArrayList<>();
for (int i : indexes) {
train.add(lines.get(i));
}
for (int i = 0; i < total; i++) {
if (!indexes.contains(i)) {
test.add(lines.get(i));
}
}
return new TrainTestData(train, test);
}
}
|
[
"[email protected]"
] | |
25845ff3f775bfc6db51db9d69c4032488449c48
|
4d0907cd5b7b397b14eccc0a08a9c02a28503ef1
|
/Model/src/main/java/org/gusdb/wdk/model/user/dataset/irods/icat/query/SelectAllMetadata.java
|
45119d7e76dec0f13fbea3a23c7d9f55312f9bc3
|
[
"Apache-2.0"
] |
permissive
|
VEuPathDB/WDK
|
2fedfad74cd3e60be1d6efcdaaf1f206d0d21608
|
bfd661cae73ddf2ad5b15731fdf1ccd23b5b6387
|
refs/heads/master
| 2023-08-17T17:48:54.868518 | 2023-08-03T00:29:46 | 2023-08-03T00:29:46 | 190,667,058 | 0 | 6 |
Apache-2.0
| 2023-09-07T17:20:04 | 2019-06-07T00:21:00 |
Java
|
UTF-8
|
Java
| false | false | 985 |
java
|
package org.gusdb.wdk.model.user.dataset.irods.icat.query;
import org.gusdb.fgputil.TraceLog;
import org.gusdb.wdk.model.WdkModelException;
import org.gusdb.wdk.model.user.dataset.irods.icat.ICatCollection;
import org.irods.jargon.core.pub.IRODSGenQueryExecutor;
import java.nio.file.Path;
public class SelectAllMetadata implements ICatQueryRunner {
private static final TraceLog TRACE = new TraceLog(SelectAllMetadata.class);
private final ICatCollection root;
private final Path path;
private final IRODSGenQueryExecutor db;
public SelectAllMetadata(
final ICatCollection root,
final Path path,
final IRODSGenQueryExecutor db
) {
this.root = root;
this.path = path;
this.db = db;
}
@Override
public ICatQueryRunner run() throws WdkModelException {
TRACE.start();
AppendCollectionMetaRecursive.run(root, path, db);
AppendObjectMetaRecursive.run(root, path, db);
return TRACE.end(this);
}
}
|
[
"[email protected]"
] | |
cc399b90e4a048352d3a64bf97a0b7dbdb45cdfb
|
4e1d72eae7d74c80f52790cbe40de3327d23cbba
|
/src/com/mycompany/javaCollections/TestCollections/Test.java
|
acf3b8ac53ae25f73af0797372d84f11896767ac
|
[] |
no_license
|
alexusievich/NC_homeworks
|
0683ccdeb9c892b76e5535305e86f6f6c559e474
|
8885e2577708cb45e0d8633f682f6224767243f8
|
refs/heads/master
| 2023-02-22T22:49:35.872775 | 2021-01-31T19:48:16 | 2021-01-31T19:48:16 | 321,334,439 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,766 |
java
|
package com.mycompany.javaCollections.TestCollections;
import java.util.*;
public class Test {
int size;
ArrayList<String> arrayList = new ArrayList<>();
LinkedList<String> linkedList = new LinkedList<>();
HashSet<String> hashSet = new HashSet<>();
LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>();
TreeSet<String> treeSet = new TreeSet<>();
HashMap<Integer, String> hashMap = new HashMap<>();
LinkedHashMap<Integer, String> linkedHashMap = new LinkedHashMap<>();
TreeMap<Integer, String> treeMap = new TreeMap<>();
//Добавление, вставка, удаление элементов - сравнить
public Test(int size) {
this.size = size;
for (int i = 0; i < size; i++) {
arrayList.add("aa" + i);
linkedList.add("aa" + i);
hashSet.add("aa" + i);
linkedHashSet.add("aa" + i);
treeSet.add("aa" + i);
hashMap.put(i, "aa" + i);
linkedHashMap.put(i, "aa" + i);
treeMap.put(i, "aa" + i);
}
}
public void compareAddList(String element, int place) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
arrayList.add(place + i, element);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedList.add(place + i, element);
}
printResults("LinkedList", startTime);
}
public void compareAddListBeginning(String element) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
arrayList.add(0, element);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedList.add(0, element);
}
printResults("LinkedList", startTime);
}
public void compareAddListEnd(String element) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
arrayList.add(size - 1, element);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedList.add(size - 1, element);
}
printResults("LinkedList", startTime);
}
public void compareRemoveList(int place) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < 10000; i++) {
arrayList.remove(place - i);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < 10000; i++) {
linkedList.remove(place - i);
}
printResults("LinkedList", startTime);
}
public void compareRemoveListBeginning() {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
arrayList.remove(0);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedList.remove(0);
}
printResults("LinkedList", startTime);
}
public void compareRemoveListEnd() {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
arrayList.remove(size - 1);
}
printResults("ArrayList", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedList.remove(size - 1);
}
printResults("LinkedList", startTime);
}
public void compareAddSet(String element) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashSet.add(element + i);
}
printResults("HashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashSet.add(element + i);
}
printResults("LinkedHashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeSet.add(element + i);
}
printResults("TreeSet", startTime);
}
public void compareContainsSet(String element) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashSet.contains(element + (size / 1000));
}
printResults("HashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashSet.contains(element + (size / 1000));
}
printResults("LinkedHashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeSet.contains(element + (size / 1000));
}
printResults("TreeSet", startTime);
}
public void compareRemoveSet(String element) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashSet.remove(element + (size / 1000));
}
printResults("HashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashSet.remove(element + (size / 1000));
}
printResults("LinkedHashSet", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeSet.remove(element + (size / 1000));
}
printResults("TreeSet", startTime);
}
public void comparePutMap(Integer key, String value) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashMap.put(key + i, value + i);
}
printResults("HashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashMap.put(key + i, value + i);
}
printResults("LinkedHashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeMap.put(key + i, value + i);
}
printResults("TreeMap", startTime);
}
public void compareGetMap(Integer key) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashMap.get(key + (100 * i));
}
printResults("HashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashMap.get(key + (100 * i));
}
printResults("LinkedHashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeMap.get(key + (100 * i));
}
printResults("TreeMap", startTime);
}
public void compareRemoveMap(Integer key) {
long startTime;
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
hashMap.remove(key + (100 * i));
}
printResults("HashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
linkedHashMap.remove(key + (100 * i));
}
printResults("LinkedHashMap", startTime);
startTime = System.nanoTime();
for (int i = 0; i < size; i++) {
treeMap.remove(key + (100 * i));
}
printResults("TreeMap", startTime);
}
public void printResults(String name, long startTime) {
long estimatedTime;
estimatedTime = System.nanoTime() - startTime;
System.out.println(name + ": " + estimatedTime);
}
}
|
[
"[email protected]"
] | |
24771d7d1da5bdaacb7682ff263c8335148ec9d1
|
60df3026bbddffb080f2d99ddd8d1870b8350326
|
/FinalProject/app/src/main/java/com/udacity/gradle/builditbigger/MainActivity.java
|
43ba4b86961af19ac3ef466e693fa56cddf2e9c4
|
[] |
no_license
|
neev/BuildItBigger
|
d3e7645efae83464bf0a4cbe9d31eab7dc646a73
|
77d4f6b6eea0796d9711994e3ee1f9364e93cccf
|
refs/heads/master
| 2021-01-10T07:05:50.872875 | 2015-12-09T06:58:06 | 2015-12-09T06:58:06 | 47,609,645 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 801 |
java
|
package com.udacity.gradle.builditbigger;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
/* public void tellJoke(View view){
Toast.makeText(this,"clicked",Toast.LENGTH_SHORT);
new JokeAsyncTask(new OnJokeListener() {
@Override
public void onGetJoke(String joke) {
Intent intent = new Intent(MainActivity.this, JokeActivity.class);
intent.putExtra(JokeActivity.EXTRA_JOKE, joke);
startActivity(intent);
}
}).execute();
}*/
}
|
[
"[email protected]"
] | |
8103d1dd71e82fb8d036b971f355d38f5e0b8019
|
6541b4ea4a094799fa5bcdd973e9b8c990695733
|
/SlidingMenuwithABSFragments/src/com/example/slidingmenuwithabsfragments/fragments/BBranchFragment.java
|
41467a96a4f3b26bb48aaecdbafaa4d07c18cb00
|
[] |
no_license
|
Mohammed-khurram-Ahmed/slidingMenuWithABSfragments
|
466a8967a95038c6d6bbd4ca1e42772e50056d03
|
e760cc7f456a1ca1481802b4d51f7b0c16c29278
|
refs/heads/master
| 2021-01-10T20:44:53.654973 | 2014-01-28T13:43:57 | 2014-01-28T13:46:46 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,062 |
java
|
package com.example.slidingmenuwithabsfragments.fragments;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.Tab;
import com.actionbarsherlock.app.SherlockFragment;
import com.example.slidingmenuwithabsfragments.R;
public class BBranchFragment extends SherlockFragment implements
ActionBar.TabListener {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_branch_b, container,
false);
return rootView;
}
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
ft.add(android.R.id.content, this, "apple");
ft.attach(this);
}
@Override
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
ft.detach(this);
}
@Override
public void onTabReselected(Tab tab, FragmentTransaction ft) {
}
}
|
[
"khurram@khurram-developer"
] |
khurram@khurram-developer
|
2ab4177a19737e15f6a66a3099f75d4bc9498fee
|
9b86d6353504bfc5f446fe36a8abe698c44d3ca7
|
/AU22/src/au22/ClockModel.java
|
ff1a590006a32a8f97fa5af6ba7c72f0adac2830
|
[] |
no_license
|
Minecraftschurli/SEW
|
d3ec0531f00846d5af1e0ed886f373854aa6cea0
|
1b7bd3d64621dfd6099002de6d9e5ad7b0b93f9e
|
refs/heads/master
| 2020-03-18T06:53:01.628044 | 2018-11-16T11:14:09 | 2018-11-16T11:14:09 | 134,419,457 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,704 |
java
|
package au22;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.Random;
import static api.gui.GUIHelper.*;
@SuppressWarnings({"WeakerAccess", "SameParameterValue", "unused"})
public class ClockModel extends JPanel {
private int radius;
private int time;
private int alarmTime;
private Point center;
private boolean initialized;
private Color paintColor;
private boolean isSetAlert;
public ClockModel(){
super();
calculateRandomTime();
initialized = false;
}
@Override
protected void paintComponent(Graphics g) {
checkAlarm();
super.paintComponent(g);
g.setColor(this.paintColor/*getInverseColor(this.getBackground())*/);
drawClock(g,10,10);
String seconds = (this.time%60)+"";
String minutes = ((this.time/60)%60)+"";
String hours = (this.time/60/60)+"";
Point tmp = new Point(this.center);
tmp.translate(-25,40);
drawRectWithString(g,tmp,hours+":"+(minutes.length()==1?"0"+minutes:minutes)+":"+(seconds.length()==1?"0"+seconds:seconds));
}
private void checkAlarm() {
if (this.time == this.alarmTime){
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("./au22/resources/Das Sägewerk Bad Segeberg.wav").getAbsoluteFile());
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
} catch(Exception e) {
System.out.println("Error with playing sound.");
e.printStackTrace();
}
}
}
private void drawClock(Graphics g, int xOffset, int yOffset) {
this.radius = (getWidth()-(xOffset*2) > getHeight()-(yOffset*2) ? getHeight()-(yOffset*2) : getWidth()-(xOffset*2))/2;
this.center = new Point(getWidth()/2,yOffset+radius);
fillCircle(g,this.center,this.radius+1,this.paintColor);
fillCircle(g,this.center,this.radius-1,this.getBackground());
for (int i = 0; i < 12 * 5; i++) {
if (i%5!=0)drawLine(g,angularMovedPoint(this.center,this.radius/16*15,i*6),angularMovedPoint(this.center,this.radius,i*6));
else drawLine(g,angularMovedPoint(this.center,this.radius/6*5,i*30),angularMovedPoint(this.center,this.radius,i*30));
}
drawVector(g,this.center,getHourDegrees(),this.radius/20*13);
drawVector(g,this.center,getMinuteDegrees(),this.radius/10*9);
drawVector(g,this.center,getSecondDegrees(),this.radius/20*18,new Color(0xC90A0A));
}
private double getSecondDegrees(){
return (((isSetAlert?0:time)%60.0)*6.0);
}
private double getMinuteDegrees(){
return ((((isSetAlert?alarmTime:time)/60.0)%60.0)*6.0);
}
private double getHourDegrees(){
return ((((isSetAlert?alarmTime:time)/60.0)/60.0)*30.0);
}
public void calculateRandomTime() {
if (!this.initialized) {
Random rand = new Random();
this.time = rand.nextInt(24*60*60);
}
}
public void addHour(int hour) {
addMinute(hour*60);
}
public void addMinute(int minute) {
addSecond(minute*60);
}
public void addSecond(int seconds) {
if (!isSetAlert) {
this.time += seconds;
if (this.time >= 24*60*60){
this.time -= 24*60*60;
}
if (this.time < 0){
this.time += 24*60*60;
}
} else {
this.alarmTime += seconds;
if (this.alarmTime >= 24*60*60){
this.alarmTime -= 24*60*60;
}
if (this.alarmTime < 0){
this.alarmTime += 24*60*60;
}
}
}
public void addSeconds(int seconds) {
this.time += seconds;
if (this.time >= 24*60*60){
this.time -= 24*60*60;
}
if (this.time < 0){
this.time += 24*60*60;
}
}
public void setInitialTime(long time,int timezone) {
if (!this.initialized) {
int days = 0;
while (time > 24*60*60){
time -= 24*60*60;
days ++;
}
time += timezone*60*60;
this.time = (int)time;
this.initialized = true;
}
}
public void setPaintColor(Color c){
this.paintColor = c;
}
public void setIsAlert(boolean b){
this.isSetAlert = b;
}
}
|
[
"[email protected]"
] | |
259111c9912bf5f03bdd651fd703a27d65069c15
|
7cab6fe085f321c794ac7bb35a55a94cd0b7bb82
|
/mybaselibrary/src/main/java/com/fivefivelike/mybaselibrary/utils/DialogDeclare.java
|
8ebf1346c61c807913cefbcbeb1b8727e8e4d53f
|
[] |
no_license
|
beyondzzz/erp_android
|
ef3fa2a3e1f3ad55e5e27fcbd471cf7d4bf90eb0
|
df77ceb4f39d868252560ecc6e5c6c48a378b071
|
refs/heads/master
| 2020-04-26T23:01:35.572421 | 2019-03-06T07:23:36 | 2019-03-06T07:23:36 | 173,890,126 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,138 |
java
|
package com.fivefivelike.mybaselibrary.utils;
import android.graphics.Color;
import android.os.Handler;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import com.circledialog.CircleDialog;
import com.circledialog.callback.ConfigButton;
import com.circledialog.callback.ConfigDialog;
import com.circledialog.callback.ConfigInput;
import com.circledialog.callback.ConfigText;
import com.circledialog.params.ButtonParams;
import com.circledialog.params.DialogParams;
import com.circledialog.params.InputParams;
import com.circledialog.params.ProgressParams;
import com.circledialog.params.TextParams;
import com.circledialog.view.listener.OnInputClickListener;
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by liugongce on 2017/9/15.
*/
public class DialogDeclare {
public void show(final AppCompatActivity context) {
// 单个按钮
new CircleDialog.Builder(context)
.setTitle("标题")
.setText("提示框")
.configText(new ConfigText() {
@Override
public void onConfig(TextParams params) {
params.gravity = Gravity.LEFT;
params.padding = new int[]{50, 50, 50, 50};
}
})
.setPositive("确定", null)
.show();
// 两个按钮
new CircleDialog.Builder(context)
.setCanceledOnTouchOutside(false)
.setCancelable(false)
.setTitle("标题")
.setText("确定框")
.setNegative("取消", null)
.setPositive("确定", new View.OnClickListener() {
@Override
public void onClick(View v) {
}
})
.show();
// 底部多选
final String[] items = {"拍照", "从相册选择", "小视频"};
new CircleDialog.Builder(context)
.configDialog(new ConfigDialog() {
@Override
public void onConfig(DialogParams params) {
//增加弹出动画
// params.animStyle = R.style.dialogWindowAnim;
}
})
.setTitle("标题")
.setTitleColor(Color.BLUE)
.setItems(items, new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position, long id) {
}
})
.setNegative("取消", null)
.configNegative(new ConfigButton() {
@Override
public void onConfig(ButtonParams params) {
//取消按钮字体颜色
params.textColor = Color.RED;
}
})
.show();
// 输入弹出框
new CircleDialog.Builder(context)
.setCanceledOnTouchOutside(false)
.setCancelable(true)
.setTitle("输入框")
.setInputHint("请输入条件")
.configInput(new ConfigInput() {
@Override
public void onConfig(InputParams params) {
// params.inputBackgroundResourceId = R.drawable.bg_input;
}
})
.setNegative("取消", null)
.setPositiveInput("确定", new OnInputClickListener() {
@Override
public void onClick(String text, View v) {
}
})
.show();
// 进度弹出框
final Timer timer = new Timer();
final CircleDialog.Builder builder = new CircleDialog.Builder(context);
builder.setCancelable(false).setCanceledOnTouchOutside(false)
.setTitle("下载")
.setProgressText("已经下载")
// .setProgressText("已经下载%s了")
// .setProgressDrawable(R.drawable.bg_progress_h)
.setNegative("取消", new View.OnClickListener() {
@Override
public void onClick(View v) {
timer.cancel();
}
})
.show();
TimerTask timerTask = new TimerTask() {
final int max = 222;
int progress = 0;
@Override
public void run() {
progress++;
if (progress >= max) {
context.runOnUiThread(new Runnable() {
@Override
public void run() {
builder.setProgressText("下载完成").create();
timer.cancel();
}
});
} else {
builder.setProgress(max, progress).create();
}
}
};
timer.schedule(timerTask, 0, 50);
// 等待弹出框
final DialogFragment dialogFragment = new CircleDialog.Builder(context)
.setProgressText("登录中...")
.setProgressStyle(ProgressParams.STYLE_SPINNER)
// .setProgressDrawable(R.drawable.bg_progress_s)
.show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
dialogFragment.dismiss();
}
}, 3000);
// 动态改变内容弹出框
builder.configDialog(new ConfigDialog() {
@Override
public void onConfig(DialogParams params) {
params.gravity = Gravity.TOP;
// TranslateAnimation refreshAnimation = new TranslateAnimation(15, -15,
// 0, 0);
// refreshAnimation.setInterpolator(new OvershootInterpolator());
// refreshAnimation.setDuration(100);
// refreshAnimation.setRepeatCount(3);
// refreshAnimation.setRepeatMode(Animation.RESTART);
// params.refreshAnimation = R.anim.refresh_animation;
}
})
.setTitle("动态改变内容")
.setText("3秒后更新其它内容")
.show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
builder.setText("已经更新内容").create();
}
}, 3000);
}
}
|
[
"[email protected]"
] | |
941bd58d73a357026138245d50920d64ab393728
|
5b6fbcbda29b386034891823bb1d7553e816ec23
|
/NetBeansProjects/PBOD/src/pertemuan5/TestIter3.java
|
044fa60c2fd5c5bd405b6476de36d98ff3be1ba4
|
[] |
no_license
|
rizqaalfi/Java
|
b0b9a55dc5b7d5a7df9dfd95a8e52b79c721c279
|
6f6b9d434930f9495497c6347822411464faff5e
|
refs/heads/master
| 2023-05-04T23:33:04.950175 | 2021-05-28T12:03:24 | 2021-05-28T12:03:24 | 371,676,972 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 504 |
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 pertemuan5;
/**
*Rizqa Alfiani
* E31191919
*/
public class TestIter3 {
public static void main(String[] args) {
int c;
System.out.println("Sebelum for");
for(c=0;c<5;c++)
System.out.println("Nilai c: " + c);
System.out.println("Setelah for");
}
}
|
[
"[email protected]"
] | |
93f3cb97e6a6cc9f15b3faebc947e866f63098d6
|
7a06a0a175a32587fd4b68a2b6f6b5d781bdcbc1
|
/backend/src/main/java/com/example/bookstore/controller/ProductController.java
|
01765285537b2a48af26433e41347c8ddb071f3b
|
[] |
no_license
|
hechengu/bookstore
|
f66c04c988e215401cc0151115fa8ac31a1691d6
|
e02f5dcd67c75a743b654fb1f25e0e9c931776d4
|
refs/heads/master
| 2023-02-15T13:07:03.230947 | 2020-04-21T03:20:40 | 2020-04-21T03:20:40 | 255,544,752 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 979 |
java
|
package com.example.bookstore.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.example.bookstore.domain.ProductModel;
import com.example.bookstore.service.ProductService;
@CrossOrigin(origins = { "http://localhost:3000", "http://localhost:4200" })
@RestController
public class ProductController {
@Autowired
private ProductService productService;
@RequestMapping("/Product")
public List<ProductModel> ALL() {
return productService.findAll();
}
@RequestMapping("/Details")
public ProductModel Find(@RequestParam(value="id", defaultValue="0") int id) {
return productService.findById(id);
}
}
|
[
"[email protected]"
] | |
9f83ef17fb1505e040c1436e776e5a7a46230318
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/15/15_388df0071fdad56d70b906017e904d452ea84f21/RecordStoreImpl/15_388df0071fdad56d70b906017e904d452ea84f21_RecordStoreImpl_t.java
|
13b8b5731b6c8d3c94f7a17657ac725381dad2db
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null |
UTF-8
|
Java
| false | false | 11,959 |
java
|
/*
* MicroEmulator
* Copyright (C) 2001-2005 Bartek Teodorczyk <[email protected]>
*
* It is licensed under the following two licenses as alternatives:
* 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
* 2. Apache License (the "AL") Version 2.0
*
* You may not use this file except in compliance with at least one of
* the above two licenses.
*
* You may obtain a copy of the LGPL at
* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*
* You may obtain a copy of the AL 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 LGPL or the AL for the specific language governing permissions and
* limitations.
*/
package org.microemu.util;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import javax.microedition.rms.InvalidRecordIDException;
import javax.microedition.rms.RecordComparator;
import javax.microedition.rms.RecordEnumeration;
import javax.microedition.rms.RecordFilter;
import javax.microedition.rms.RecordListener;
import javax.microedition.rms.RecordStore;
import javax.microedition.rms.RecordStoreException;
import javax.microedition.rms.RecordStoreFullException;
import javax.microedition.rms.RecordStoreNotOpenException;
import org.microemu.RecordStoreManager;
public class RecordStoreImpl extends RecordStore
{
private static final byte[] fileIdentifier = { 0x4d, 0x49, 0x44, 0x52, 0x4d, 0x53 };
private static final byte versionMajor = 0x03;
private static final byte versionMinor = 0x00;
private Hashtable records = new Hashtable();
private String recordStoreName;
private int version = 0;
private long lastModified = 0;
public int size = 0;
private transient boolean open;
private transient RecordStoreManager recordStoreManager;
private transient Vector recordListeners = new Vector();
public RecordStoreImpl(RecordStoreManager recordStoreManager, String recordStoreName)
{
this.recordStoreManager = recordStoreManager;
if (recordStoreName.length() <= 32) {
this.recordStoreName = recordStoreName;
} else {
this.recordStoreName = recordStoreName.substring(0, 32);
}
this.open = false;
}
public RecordStoreImpl(RecordStoreManager recordStoreManager)
throws IOException
{
this.recordStoreManager = recordStoreManager;
}
public int readHeader(DataInputStream dis)
throws IOException
{
for (int i = 0; i < fileIdentifier.length; i++) {
if (dis.read() != fileIdentifier[i]) {
throw new IOException();
}
}
dis.read(); // Major version number
dis.read(); // Minor version number
dis.read(); // Encrypted flag
recordStoreName = dis.readUTF();
lastModified = dis.readLong();
version = dis.readInt();
dis.readInt(); // TODO AuthMode
dis.readByte(); // TODO Writable
size = dis.readInt();
return size;
}
public void readRecord(DataInputStream dis)
throws IOException
{
int recordId = dis.readInt();
dis.readInt(); // TODO Tag
byte[] data = new byte[dis.readInt()];
dis.read(data, 0, data.length);
this.records.put(new Integer(recordId), data);
}
public void writeHeader(DataOutputStream dos)
throws IOException
{
dos.write(fileIdentifier);
dos.write(versionMajor);
dos.write(versionMinor);
dos.write(0); // Encrypted flag
dos.writeUTF(recordStoreName);
dos.writeLong(lastModified);
dos.writeInt(version);
dos.writeInt(0); // TODO AuthMode
dos.writeByte(0); // TODO Writable
dos.writeInt(size);
}
public void writeRecord(DataOutputStream dos, int recordId)
throws IOException
{
dos.writeInt(recordId);
dos.writeInt(0); // TODO Tag
try {
byte[] data = getRecord(recordId);
dos.writeInt(data.length);
dos.write(data);
} catch (RecordStoreException e) {
throw new IOException();
}
}
public boolean isOpen()
{
return open;
}
public void setOpen(boolean open)
{
this.open = open;
}
public void closeRecordStore()
throws RecordStoreNotOpenException, RecordStoreException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
if (recordListeners != null) {
recordListeners.removeAllElements();
}
recordStoreManager.fireRecordStoreListener(ExtendedRecordListener.RECORDSTORE_CLOSE, this.getName());
open = false;
}
public String getName()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
return recordStoreName;
}
public int getVersion()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
return version;
}
}
public int getNumRecords()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
return size;
}
}
public int getSize()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
int result = 0;
for (int i = 1; i <= size; i++) {
try {
result += getRecord(i).length;
} catch (RecordStoreException e) {
e.printStackTrace();
}
}
return result;
}
public int getSizeAvailable()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
return recordStoreManager.getSizeAvailable(this);
}
public long getLastModified()
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
return lastModified;
}
}
public void addRecordListener(RecordListener listener)
{
if (!recordListeners.contains(listener)) {
recordListeners.addElement(listener);
}
}
public void removeRecordListener(RecordListener listener)
{
recordListeners.removeElement(listener);
}
public int getNextRecordID()
throws RecordStoreNotOpenException, RecordStoreException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
return size + 1;
}
}
public int addRecord(byte[] data, int offset, int numBytes)
throws RecordStoreNotOpenException, RecordStoreException, RecordStoreFullException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
if (data == null && numBytes > 0) {
throw new NullPointerException();
}
if (numBytes > recordStoreManager.getSizeAvailable(this)) {
throw new RecordStoreFullException();
}
byte[] recordData = new byte[numBytes];
if (data != null) {
System.arraycopy(data, offset, recordData, 0, numBytes);
}
int nextRecordID = getNextRecordID();
synchronized (this) {
records.put(new Integer(nextRecordID), recordData);
version++;
lastModified = System.currentTimeMillis();
size++;
}
recordStoreManager.saveRecord(this, nextRecordID);
fireRecordListener(ExtendedRecordListener.RECORD_ADD, nextRecordID);
return nextRecordID;
}
public void deleteRecord(int recordId)
throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
if (recordId < 1 || recordId > size) {
throw new InvalidRecordIDException();
}
records.remove(new Integer(recordId));
version++;
lastModified = System.currentTimeMillis();
size--;
}
recordStoreManager.deleteRecord(this, recordId);
fireRecordListener(ExtendedRecordListener.RECORD_DELETE, recordId);
}
public int getRecordSize(int recordId)
throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
synchronized (this) {
byte[] data = (byte[]) records.get(new Integer(recordId));
if (data == null) {
recordStoreManager.loadRecord(this, recordId);
data = (byte[]) records.get(new Integer(recordId));
}
return data.length;
}
}
public int getRecord(int recordId, byte[] buffer, int offset)
throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException
{
int recordSize;
synchronized (this) {
recordSize = getRecordSize(recordId);
System.arraycopy(records.get(new Integer(recordId)), 0, buffer, offset, recordSize);
}
fireRecordListener(ExtendedRecordListener.RECORD_READ, recordId);
return recordSize;
}
public byte[] getRecord(int recordId)
throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException
{
byte[] data;
synchronized (this) {
data = new byte[getRecordSize(recordId)];
getRecord(recordId, data, 0);
}
return data.length < 1 ? null : data;
}
public void setRecord(int recordId, byte[] newData, int offset, int numBytes)
throws RecordStoreNotOpenException, InvalidRecordIDException, RecordStoreException, RecordStoreFullException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
// FIXME fixit
if (numBytes > recordStoreManager.getSizeAvailable(this)) {
throw new RecordStoreFullException();
}
byte[] recordData = new byte[numBytes];
System.arraycopy(newData, offset, recordData, 0, numBytes);
synchronized (this) {
if (recordId < 1 || recordId > size) {
throw new InvalidRecordIDException();
}
records.put(new Integer(recordId), recordData);
version++;
lastModified = System.currentTimeMillis();
}
recordStoreManager.saveRecord(this, recordId);
fireRecordListener(ExtendedRecordListener.RECORD_CHANGE, recordId);
}
public RecordEnumeration enumerateRecords(RecordFilter filter, RecordComparator comparator, boolean keepUpdated)
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
return new RecordEnumerationImpl(this, filter, comparator, keepUpdated);
}
public int getHeaderSize()
{
// TODO fixit
return recordStoreName.length() + 4 + 8 + 4;
}
public int getRecordHeaderSize()
{
return 4 + 4;
}
private void fireRecordListener(int type, int recordId)
{
long timestamp = System.currentTimeMillis();
if (recordListeners != null) {
for (Enumeration e = recordListeners.elements(); e.hasMoreElements();) {
RecordListener l = (RecordListener) e.nextElement();
if (l instanceof ExtendedRecordListener) {
((ExtendedRecordListener) l).recordEvent(type, timestamp, this, recordId);
} else {
switch (type) {
case ExtendedRecordListener.RECORD_ADD:
l.recordAdded(this, recordId);
break;
case ExtendedRecordListener.RECORD_CHANGE:
l.recordChanged(this, recordId);
break;
case ExtendedRecordListener.RECORD_DELETE:
l.recordDeleted(this, recordId);
}
}
}
}
}
}
|
[
"[email protected]"
] | |
537330321c0b6591a1f9a73b82aee1d87f24dd39
|
926a683ca1d935f959e59dd058b2a80a236d671a
|
/models/src/main/java/repository/AccounRepository.java
|
be52552751d64d14d3b049f417c313f95c0e7fee
|
[] |
no_license
|
wdalmeida/pds_eight_app
|
fa139356a7cca35445518a3f0e6fa11e26f2943f
|
487b09aaf96972c27735851337d5aea4555f20e5
|
refs/heads/master
| 2023-03-06T00:58:52.962644 | 2023-03-01T08:28:11 | 2023-03-01T08:28:11 | 134,713,315 | 0 | 0 | null | 2023-03-01T08:29:43 | 2018-05-24T12:38:02 |
Java
|
UTF-8
|
Java
| false | false | 193 |
java
|
package repository;
import entity.AccounEntity;
import org.springframework.data.repository.CrudRepository;
public interface AccounRepository extends CrudRepository<AccounEntity,String> {
}
|
[
"[email protected]"
] | |
2438533b184036610b7e9289296cac67b8120cd0
|
ed2f41c3e04d825457e6b3a406fa3abe29ea41de
|
/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LongValueIterator.java
|
4df1fc24909d50b8ec9b91af118e3c4259604ae6
|
[
"ECL-2.0"
] |
permissive
|
lancespeelmon/sakai-travis-test
|
38d5d4fe978392dc241d60fd8cf4cbe47d24cff4
|
c3eca9d97f959e73fd3f227ccd29b274969c95c3
|
refs/heads/master
| 2021-01-10T08:06:43.259585 | 2013-02-27T04:56:14 | 2013-02-27T16:55:35 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,064 |
java
|
/**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/citations/tags/sakai-2.9.1/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LongValueIterator.java $
* $Id: LongValueIterator.java 59673 2009-04-03 23:02:03Z [email protected] $
***********************************************************************************
*
* Copyright (c) 2006, 2007, 2008 The Sakai Foundation
*
* Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.sakaibrary.osid.repository.xserver;
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
public class LongValueIterator
implements org.osid.shared.LongValueIterator
{
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
public LongValueIterator(java.util.Vector vector)
throws org.osid.shared.SharedException
{
this.vector = vector;
}
public boolean hasNextLongValue()
throws org.osid.shared.SharedException
{
return i < vector.size();
}
public long nextLongValue()
throws org.osid.shared.SharedException
{
if (i < vector.size())
{
return ((Long)vector.elementAt(i++)).longValue();
}
else
{
throw new org.osid.shared.SharedException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
}
}
}
|
[
"[email protected]"
] | |
e869ddea45616b7b28352d2ba08ab4824ff27c40
|
a6e06bf3f455d69c97fadf89232a44d7a1e5a872
|
/src/java/signupservlet/SignIn.java
|
d35c8cbc3b984422e6687980603cab4e05767bf6
|
[] |
no_license
|
akshita046/practicing
|
687063843b2b1eef9de9e63473e587c48342fd72
|
0ea25012d02d49acc4ee066cb96fd893a6671f31
|
refs/heads/master
| 2020-04-09T05:41:32.922210 | 2018-12-02T18:10:51 | 2018-12-02T18:10:51 | 160,075,152 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,520 |
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 signupservlet;
import java.io.*;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author hi
*/
public class SignIn 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 {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/mydb?useSSL=false","root","akshita");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT* FROM project");
String s1 = request.getParameter("name");
String s2 = request.getParameter("pwd");
int flag=0;
while(rs.next())
{
if(s1.equals(rs.getString("fname")))
{
if(s2.equals(rs.getString("pass")))
{
flag=1;
}
}
}
if(flag==1)
{
response.sendRedirect("index.html");
}
else
{
out.println("Login unsuccessful");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
// <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>
}
|
[
"[email protected]"
] | |
2f67fed03dc34285ededb1e666fe50112fc3f147
|
9a260b59248acfe10aa4311f61151ab92cc41eb2
|
/app/src/androidTest/java/cf/victorlopez/frasesretrofit/ExampleInstrumentedTest.java
|
dbd3087ac35c7d38611d41eae511250206c0cc92
|
[] |
no_license
|
victorjp1/FrasesRetrofit
|
979d11ee8ca4a5644aead1def1587f8f806673a7
|
8177a2d89907546330c057f1f32bc2a44b791dc6
|
refs/heads/master
| 2023-03-12T17:16:19.688217 | 2021-03-04T14:33:13 | 2021-03-04T14:33:13 | 344,502,517 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 772 |
java
|
package cf.victorlopez.frasesretrofit;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("cf.victorlopez.frasesretrofit", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
ae119dd757056bb9d5a9b8eeb603e45905d677fc
|
60dd03a27d9004d096a3d34ae7a148648b853650
|
/src/main/java/brotherhui/demo/account/domain/event/SourceBankAccountDebitedEvent.java
|
23185f0bb71e876cd34c9798119dce1af66d8f4f
|
[] |
no_license
|
brotherhui/15-practice-axon-saga-simple
|
1ca0f69ea66b1a15d8c2a6cc0a09c535a3eaa11a
|
3c21859a67d0228c64747bf2b249ce7b8e07b2c9
|
refs/heads/master
| 2021-05-08T19:05:26.359170 | 2018-01-30T14:57:36 | 2018-01-30T14:57:36 | 119,548,842 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,122 |
java
|
/*
* Copyright (c) 2016. Axon Framework
*
* 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 brotherhui.demo.account.domain.event;
public class SourceBankAccountDebitedEvent extends MoneySubtractedEvent {
private String bankTransferId;
public SourceBankAccountDebitedEvent(String id, long amountOfMoney, String bankTransferId) {
super(id, amountOfMoney);
this.bankTransferId = bankTransferId;
}
public String getBankTransferId() {
return bankTransferId;
}
public void setBankTransferId(String bankTransferId) {
this.bankTransferId = bankTransferId;
}
}
|
[
"[email protected]"
] | |
301172bcea3f19b8370c3c7546b9cb74e3e81761
|
35f4bdc87bf8dd0a6d62c68582032304d6745c13
|
/demo/src/main/java/com/qianfeng/demo/interceptor/AuthInterceptor.java
|
a4ae1aab8a183cf37f4074c88282d6d58da4c842
|
[] |
no_license
|
ZengJiFa/spring-hello
|
8a1b20a60d67b599ecc720ff5f462354ae0a1783
|
cf45dfed14c778db513f2a31441e3beec0dcf3a6
|
refs/heads/master
| 2020-06-27T03:14:21.305707 | 2019-07-31T09:54:56 | 2019-07-31T09:54:56 | 199,800,706 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 949 |
java
|
package com.qianfeng.demo.interceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author ZengJiFA
* @Date 2019/7/29
*/
//注解:将类交给spring管理
@Component
public class AuthInterceptor implements HandlerInterceptor {
//jdk1.8之前 接口不能有实现
//实现类实现接口 需要实现接口的所有方法 除非自己也是抽象的
//但是通常这个实现类 我们希望不是一个抽象类 ,又不想所有的方法都实现(使用适配器的方式)
//jdk1.8之后 直接实现即可 (接口可以有默认的实现)
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.err.println("拦截器前置拦截");
return true;
}
}
|
[
"[email protected]"
] | |
7205945e026a6ef95ae8c677bcb15fffe87b3066
|
d6c041879c662f4882892648fd02e0673a57261c
|
/com/planet_ink/coffee_mud/Items/Basic/GenResource.java
|
b9103c6e912c11ea8af8f173d7342471c047a084
|
[
"Apache-2.0"
] |
permissive
|
linuxshout/CoffeeMud
|
15a2c09c1635f8b19b0d4e82c9ef8cd59e1233f6
|
a418aa8685046b08c6d970083e778efb76fd3716
|
refs/heads/master
| 2020-04-14T04:17:39.858690 | 2018-12-29T20:50:15 | 2018-12-29T20:50:15 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,349 |
java
|
package com.planet_ink.coffee_mud.Items.Basic;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.GenCow;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2002-2018 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class GenResource extends GenItem implements RawMaterial
{
@Override
public String ID()
{
return "GenResource";
}
public GenResource()
{
super();
setName("a pile of resources");
setDisplayText("a pile of resources sits here.");
setDescription("");
setMaterial(RawMaterial.RESOURCE_IRON);
basePhyStats().setWeight(0);
recoverPhyStats();
}
protected String domainSource = null;
protected String resourceSubType = "";
@Override
public String domainSource()
{
return domainSource;
}
@Override
public void setDomainSource(final String src)
{
domainSource = src;
}
@Override
public void setSubType(final String subType)
{
resourceSubType = (subType == null)?"":subType;
}
@Override
public String getSubType()
{
return resourceSubType;
}
@Override
public boolean rebundle()
{
return CMLib.materials().rebundle(this);
}
@Override
public void quickDestroy()
{
CMLib.materials().quickDestroy(this);
}
private final static String[] MYCODES={"DOMAINSRC","RSUBTYPE"};
@Override
public String getStat(final String code)
{
if(super.isStat(code))
return super.getStat(code);
else
switch(getCodeNum(code))
{
case 0:
return this.domainSource();
case 1:
return this.getSubType();
default:
return CMProps.getStatCodeExtensionValue(getStatCodes(), xtraValues, code);
}
}
@Override
public void setStat(final String code, final String val)
{
if(super.isStat(code))
super.setStat(code, val);
else
switch(getCodeNum(code))
{
case 0:
setDomainSource(val);
break;
case 1:
this.setSubType(val);
break;
default:
CMProps.setStatCodeExtensionValue(getStatCodes(), xtraValues, code, val);
break;
}
}
@Override
protected int getCodeNum(final String code)
{
for(int i=0;i<MYCODES.length;i++)
{
if(code.equalsIgnoreCase(MYCODES[i]))
return i;
}
return -1;
}
private static String[] codes = null;
@Override
public String[] getStatCodes()
{
if(codes!=null)
return codes;
final String[] MYCODES=CMProps.getStatCodesList(GenResource.MYCODES,this);
final String[] superCodes=CMParms.toStringArray(super.getStatCodes());
codes=new String[superCodes.length+MYCODES.length];
int i=0;
for(;i<superCodes.length;i++)
codes[i]=superCodes[i];
for(int x=0;x<MYCODES.length;i++,x++)
codes[i]=MYCODES[x];
return codes;
}
@Override
public boolean sameAs(final Environmental E)
{
if(!(E instanceof GenResource))
return false;
final String[] codes=getStatCodes();
for(int i=0;i<codes.length;i++)
{
if(!E.getStat(codes[i]).equals(getStat(codes[i])))
return false;
}
return true;
}
}
|
[
"[email protected]"
] | |
a470ea4b88d3de48c56cf5b9a07aa79cb59df9fa
|
7041e1c76d2e6226e6ee984252c2f5d77f4525fa
|
/app/src/test/java/muchbeer/raum/jetpacknavdrawer/ExampleUnitTest.java
|
f372c30c3689cdb7f4da7b6484e3bfa067cdccdc
|
[] |
no_license
|
muchbeer/JetPackNavDrawer
|
75a9559789d8c4d91f489196668f3e7ae0a0b7b8
|
9ad8c5949864a3fadfd4d8dde5e35a705d95aa09
|
refs/heads/master
| 2020-09-26T21:41:12.934815 | 2019-12-06T14:51:45 | 2019-12-06T14:51:45 | 226,348,271 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 391 |
java
|
package muchbeer.raum.jetpacknavdrawer;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
8e17a82996f5b38cd4bc91738ec8a60d0a6ab973
|
bf2966abae57885c29e70852243a22abc8ba8eb0
|
/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/OpsItemAlreadyExistsExceptionUnmarshaller.java
|
db6cc241570ad8d6caeccb2681dc5b1dc4e3321a
|
[
"Apache-2.0"
] |
permissive
|
kmbotts/aws-sdk-java
|
ae20b3244131d52b9687eb026b9c620da8b49935
|
388f6427e00fb1c2f211abda5bad3a75d29eef62
|
refs/heads/master
| 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 |
Apache-2.0
| 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null |
UTF-8
|
Java
| false | false | 3,298 |
java
|
/*
* Copyright 2016-2021 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.simplesystemsmanagement.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.simplesystemsmanagement.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* OpsItemAlreadyExistsException JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OpsItemAlreadyExistsExceptionUnmarshaller extends EnhancedJsonErrorUnmarshaller {
private OpsItemAlreadyExistsExceptionUnmarshaller() {
super(com.amazonaws.services.simplesystemsmanagement.model.OpsItemAlreadyExistsException.class, "OpsItemAlreadyExistsException");
}
@Override
public com.amazonaws.services.simplesystemsmanagement.model.OpsItemAlreadyExistsException unmarshallFromContext(JsonUnmarshallerContext context)
throws Exception {
com.amazonaws.services.simplesystemsmanagement.model.OpsItemAlreadyExistsException opsItemAlreadyExistsException = new com.amazonaws.services.simplesystemsmanagement.model.OpsItemAlreadyExistsException(
null);
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("OpsItemId", targetDepth)) {
context.nextToken();
opsItemAlreadyExistsException.setOpsItemId(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return opsItemAlreadyExistsException;
}
private static OpsItemAlreadyExistsExceptionUnmarshaller instance;
public static OpsItemAlreadyExistsExceptionUnmarshaller getInstance() {
if (instance == null)
instance = new OpsItemAlreadyExistsExceptionUnmarshaller();
return instance;
}
}
|
[
""
] | |
3c8af5479b9141288fa765c9c325290fab9f85ca
|
f36c29c44e93b4c86741a7de4ab9dd85b7cd1b43
|
/core-customize/hybris/bin/custom/theBodyShopfulfilmentprocess/src/uk/co/thebodyshop/fulfilmentprocess/actions/consignment/CheckConsignmentStatusAction.java
|
7982d6bb1e1d785f4d4d7c18b85868aa89deb92a
|
[] |
no_license
|
genabush/en-shop
|
22f2a3aed5867825b53409fb0bbcd9fefa9a81e7
|
3d5a4741e7af071c77374769410ec8a46d62a027
|
refs/heads/master
| 2023-01-28T23:23:26.086256 | 2020-01-25T16:02:22 | 2020-01-25T16:02:22 | 235,858,083 | 0 | 0 | null | 2023-01-05T05:42:42 | 2020-01-23T18:23:23 |
Java
|
UTF-8
|
Java
| false | false | 1,970 |
java
|
/*
* Copyright (c)
* 2019 THE BODY SHOP INTERNATIONAL LIMITED.
* All rights reserved.
*/
package uk.co.thebodyshop.fulfilmentprocess.actions.consignment;
import java.util.HashSet;
import java.util.Set;
import org.springframework.util.Assert;
import de.hybris.platform.basecommerce.enums.ConsignmentStatus;
import de.hybris.platform.ordersplitting.model.ConsignmentModel;
import de.hybris.platform.ordersplitting.model.ConsignmentProcessModel;
import de.hybris.platform.processengine.action.AbstractAction;
import de.hybris.platform.task.RetryLaterException;
/**
* @author vasanthramprakasam
*/
public class CheckConsignmentStatusAction extends AbstractAction<ConsignmentProcessModel>
{
public enum Transition
{
SHIPPED, CANCELLED, WAIT;
public static Set<String> getStringValues()
{
final Set<String> res = new HashSet<>();
for (final Transition transition : Transition.values())
{
res.add(transition.toString());
}
return res;
}
}
@Override
public String execute(final ConsignmentProcessModel consignmentProcess) throws RetryLaterException, Exception
{
// Check Order status and payment status and return NOK
final ConsignmentModel consignment = consignmentProcess.getConsignment();
Assert.notNull(consignment, "consignment can't be null");
final ConsignmentStatus consignmentStatus = consignment.getStatus();
if (consignmentStatus != null && (consignmentStatus.equals(ConsignmentStatus.SHIPPED) || consignmentStatus.equals(ConsignmentStatus.PART_SHIPPED) || consignmentStatus.equals(ConsignmentStatus.PICKUP_COMPLETE)))
{
return Transition.SHIPPED.toString();
}
if (consignmentStatus != null && (consignmentStatus.equals(ConsignmentStatus.CANCELLED) || consignmentStatus.equals(ConsignmentStatus.NOT_SHIPPED)))
{
return Transition.CANCELLED.toString();
}
return Transition.WAIT.toString();
}
@Override
public Set<String> getTransitions()
{
return Transition.getStringValues();
}
}
|
[
"[email protected]"
] | |
a7a98be8a6ee4eeecff0461d93822866d70f47ab
|
642e9fe4368989572a7baa0f61eae4174ce78041
|
/FlightsClient/build/generated/jax-wsCache/FlightWSService/ru/javabegin/training/flight/ws/BuyTicketResponse.java
|
a9f644b73cebd325cdd776e51da7755fc2897d8c
|
[] |
no_license
|
ansurakin/FlightsWS
|
5f09e47819b53b1d0236940b7ffe16d59bb99780
|
d2ce5c8ab251ccc288ca27e7ac14f441cfebc6c5
|
refs/heads/master
| 2021-04-30T11:08:45.547572 | 2018-02-19T08:07:36 | 2018-02-19T08:07:36 | 121,347,989 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,262 |
java
|
package ru.javabegin.training.flight.ws;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for buyTicketResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="buyTicketResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "buyTicketResponse", propOrder = {
"_return"
})
public class BuyTicketResponse {
@XmlElement(name = "return")
protected boolean _return;
/**
* Gets the value of the return property.
*
*/
public boolean isReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
*/
public void setReturn(boolean value) {
this._return = value;
}
}
|
[
"Alex@Alex-PC"
] |
Alex@Alex-PC
|
a3cce4c5d14cbe8ea950d6f3ada4eaa0288bd01e
|
7f6514ae54d7ccad82c096e8a5f5057e9678863d
|
/src/main/java/com/tssb/dao/AuditInfoDao.java
|
6a2fc927816a577b535fd533b736a492a9c6c2d9
|
[] |
no_license
|
17701320887/tssb-admin
|
c09fe71833885605beb974c25c5610f6c4483fe4
|
e7f87447022faac024111a6727c049d57d8f4358
|
refs/heads/master
| 2021-09-09T02:56:07.781167 | 2018-03-13T12:19:35 | 2018-03-13T12:19:38 | 104,698,370 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 336 |
java
|
package com.tssb.dao;
import com.tssb.model.system.AuditInfo;
import org.springframework.stereotype.Repository;
import com.tssb.dao.api.IAuditInfoDao;
/**
* Dao Implementation:AuditInfo
* @author duia_builder
* @date 2017-9-25
*/
@Repository
public class AuditInfoDao extends BaseDao<AuditInfo,Long> implements IAuditInfoDao {
}
|
[
"[email protected]"
] | |
0a5c2048e245a15cf29a1cf745a3a24deac147f6
|
c3d62c540bcdd63dc79e37dca6ed50eba7ed2957
|
/SinalgoWsn/src/projects/wsn1/nodes/timers/MapTimer.java
|
73850f703f80ed9d8dddd25482c061e207272fb2
|
[
"BSD-3-Clause"
] |
permissive
|
ricardoalvim-edu/monitoramentobovino
|
9722cb87b7de18ec96256d6b1be30daa1f4d3c9f
|
124d808ce8db08b62dfce188852ac9cb2dd9b16a
|
refs/heads/master
| 2021-03-16T06:54:43.601024 | 2016-11-25T21:41:30 | 2016-11-25T21:41:30 | 72,479,173 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 402 |
java
|
package projects.wsn1.nodes.timers;
import sinalgo.nodes.timers.Timer;
import projects.wsn1.nodes.nodeImplementations.Sink;
import projects.wsn1.nodes.messages.Map;
public class MapTimer extends Timer {
private Map message;
public MapTimer(Map message) {
this.message = message;
}
@Override
public void fire() {
((Sink)node).broadcast(message);
}
}
|
[
"[email protected]"
] | |
e0b8ee7ee29e26146a21a19ec4719ed4332ada79
|
e2456cc7b0dba87f6366db0384ebfc690817cbb0
|
/circleimageview/src/main/java/de/hdodenhof/circleimageview/CircleImageView.java
|
e13bbd41e645e5d7089971cb98675f282618393f
|
[
"Apache-2.0"
] |
permissive
|
noumannaseer/CircleImageView
|
ff2dfdec45d1afb8ab29404008b09fa9cb4f51d3
|
0aac8e7a8a09e495f29ca92fb759bc57613c8d4a
|
refs/heads/master
| 2021-01-16T22:01:25.112863 | 2014-01-20T20:56:35 | 2014-01-20T21:42:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,842 |
java
|
package de.hdodenhof.circleimageview;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final int DEFAULT_BORDER_WIDTH = 0;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private ColorStateList mBorderColor = ColorStateList.valueOf(DEFAULT_BORDER_COLOR);
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private int mBitmapHeight;
private float mDrawableRadius;
private float mBorderRadius;
private boolean mReady;
private boolean mSetupPending;
public CircleImageView(Context context) {
super(context);
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
super.setScaleType(SCALE_TYPE);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, 0);
mBorderColor = a.getColorStateList(R.styleable.CircleImageView_border_color);
a.recycle();
if (mBorderColor == null){
mBorderColor = ColorStateList.valueOf(DEFAULT_BORDER_COLOR);
}
mReady = true;
if (mSetupPending){
setup();
mSetupPending = false;
}
}
@Override
public ScaleType getScaleType() {
return SCALE_TYPE;
}
@Override
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE){
throw new RuntimeException(); // TODO
}
}
@Override
protected void onDraw(Canvas canvas) {
if (getDrawable() == null){
return;
}
canvas.drawCircle(getWidth()/2, getHeight()/2, mDrawableRadius, mBitmapPaint);
canvas.drawCircle(getWidth()/2, getHeight()/2, mBorderRadius, mBorderPaint);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setup();
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
setup();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
setup();
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
}
private Bitmap getBitmapFromDrawable(Drawable drawable){
if (drawable == null){
return null;
}
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
}
private void setup(){
if (!mReady){
mSetupPending = true;
return;
}
if (mBitmap == null){
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor.getDefaultColor());
mBorderPaint.setStrokeWidth(mBorderWidth);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(0, 0, getWidth(), getHeight());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth)/2, (mBorderRect.width() - mBorderWidth)/2);
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
mDrawableRadius = Math.min(mDrawableRect.height()/2, mDrawableRect.width()/2);
updateShaderMatrix();
invalidate();
}
private void updateShaderMatrix() {
float scale;
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapHeight;
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
} else {
scale = mDrawableRect.width() / (float) mBitmapWidth;
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
}
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth, (int) (dy + 0.5f) + mBorderWidth);
mBitmapShader.setLocalMatrix(mShaderMatrix);
}
}
|
[
"[email protected]"
] | |
eb104811f03ba99d550dfd60580aced1427f52e3
|
e75be673baeeddee986ece49ef6e1c718a8e7a5d
|
/submissions/blizzard/Corpus/eclipse.jdt.debug/11.java
|
a718bfd991447a73f7f62d68d47b0e424f6679c0
|
[
"MIT"
] |
permissive
|
zhendong2050/fse18
|
edbea132be9122b57e272a20c20fae2bb949e63e
|
f0f016140489961c9e3c2e837577f698c2d4cf44
|
refs/heads/master
| 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,809 |
java
|
/*******************************************************************************
* Copyright (c) 2002, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.debug.tests.eval;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
public class TestsOperators1 extends Tests {
/**
* Constructor for TypeHierarchy.
* @param name
*/
public TestsOperators1(String name) {
super(name);
}
public void init() throws Exception {
initializeFrame("EvalSimpleTests", 37, 1, 1);
}
protected void end() throws Exception {
destroyFrame();
}
public void testIntPlusInt() throws Throwable {
try {
init();
IValue value = eval(xInt + plusOp + yInt);
String typeName = value.getReferenceTypeName();
assertEquals("int plus int : wrong type : ", "int", typeName);
int intValue = ((IJavaPrimitiveValue) value).getIntValue();
assertEquals("int plus int : wrong result : ", xIntValue + yIntValue, intValue);
value = eval(yInt + plusOp + xInt);
typeName = value.getReferenceTypeName();
assertEquals("int plus int : wrong type : ", "int", typeName);
intValue = ((IJavaPrimitiveValue) value).getIntValue();
assertEquals("int plus int : wrong result : ", yIntValue + xIntValue, intValue);
} finally {
end();
}
}
public void testStringPlusString() throws Throwable {
try {
init();
IValue value = eval(xString + plusOp + yString);
String typeName = value.getReferenceTypeName();
assertEquals("java.lang.String plus java.lang.String : wrong type : ", "java.lang.String", typeName);
String stringValue = ((JDIObjectValue) value).getValueString();
assertEquals("java.lang.String plus java.lang.String : wrong result : ", xStringValue + yStringValue, stringValue);
value = eval(yString + plusOp + xString);
typeName = value.getReferenceTypeName();
assertEquals("java.lang.String plus java.lang.String : wrong type : ", "java.lang.String", typeName);
stringValue = ((JDIObjectValue) value).getValueString();
assertEquals("java.lang.String plus java.lang.String : wrong result : ", yStringValue + xStringValue, stringValue);
} finally {
end();
}
}
public void testInt() throws Throwable {
try {
init();
IValue value = eval(xVarInt);
String typeName = value.getReferenceTypeName();
assertEquals("int local variable value : wrong type : ", "int", typeName);
int intValue = ((IJavaPrimitiveValue) value).getIntValue();
assertEquals("int local variable value : wrong result : ", xVarIntValue, intValue);
value = eval(yVarInt);
typeName = value.getReferenceTypeName();
assertEquals("int local variable value : wrong type : ", "int", typeName);
intValue = ((IJavaPrimitiveValue) value).getIntValue();
assertEquals("int local variable value : wrong result : ", yVarIntValue, intValue);
} finally {
end();
}
}
public void testString() throws Throwable {
try {
init();
IValue value = eval(xVarString);
String typeName = value.getReferenceTypeName();
assertEquals("java.lang.String local variable value : wrong type : ", "java.lang.String", typeName);
String stringValue = ((JDIObjectValue) value).getValueString();
assertEquals("java.lang.String local variable value : wrong result : ", xVarStringValue, stringValue);
value = eval(yVarString);
typeName = value.getReferenceTypeName();
assertEquals("java.lang.String local variable value : wrong type : ", "java.lang.String", typeName);
stringValue = ((JDIObjectValue) value).getValueString();
assertEquals("java.lang.String local variable value : wrong result : ", yVarStringValue, stringValue);
} finally {
end();
}
}
}
|
[
"[email protected]"
] | |
7f9cf2819833c71fd74852d075e4e22885d0f54f
|
25e5f3eed2ecf04c1c8aa4d06065f561b75f1a6b
|
/AED_Final_Project_Package_Fall2016/AED_FINAL_PROJECT/src/UserInterface/ResearchRole/ConductResearchJPanel.java
|
3aec74e056f7451fdd576acdd02db5639758e92b
|
[] |
no_license
|
vipul-krishna/projects-and-assignments
|
af56ce2c83b1058002a2850a0945717605f9a65b
|
e4f73cc0210eae4eaadfc41224a82ddecafa6fd4
|
refs/heads/master
| 2021-01-23T01:01:23.032039 | 2018-04-19T04:28:02 | 2018-04-19T04:28:02 | 85,860,994 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 20,413 |
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 UserInterface.ResearchRole;
import Business.Enterprise.Enterprise;
import Business.Organization.Organization;
import Business.Organization.ResearchOrganization;
import Business.ResearchParameters.Crop;
import Business.UserAccount.UserAccount;
import Business.WorkQueue.CropTestResultQueue;
import UserInterface.SignUpJPanel;
import UserInterface.SystemAdminRole.ManageNetworkJPanel;
import java.awt.CardLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author kkgarg
*/
public class ConductResearchJPanel extends javax.swing.JPanel {
/**
* Creates new form ConductResearchJPanel
*/
private JPanel userProcessContainer;
//private CropTestResultQueue request;
private UserAccount userAccount;
private Enterprise enterprise;
private Image image2;
public ConductResearchJPanel(JPanel userProcessContainer, UserAccount userAccount, Enterprise enterprise) {
initComponents();
this.userProcessContainer = userProcessContainer;
//this.request = request;
this.userAccount = userAccount;
this.enterprise = enterprise;
//cropTextField.setText(request.getPlannedCropType());
backgroundImage("/resources/imgs/HP2.jpg");
}
private void backgroundImage(String str){
try {
BufferedImage image1 = ImageIO.read(ManageNetworkJPanel.class.getResource(str));
image2 = image1.getScaledInstance(1200,800,Image.SCALE_SMOOTH);
} catch (IOException ex) {
Logger.getLogger(SignUpJPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Draw the background image.
g.drawImage(image2, 0, 0, this);
}
/**
* 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() {
expectedBlkTxtFld = new javax.swing.JTextField();
expectedPhTxtFld = new javax.swing.JTextField();
expectedNitrateTxtFld = new javax.swing.JTextField();
expectedWaterTxtFld = new javax.swing.JTextField();
expectedElectricalTxtFld = new javax.swing.JTextField();
cropTypeLabel = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
cropTextField = new javax.swing.JTextField();
saveBtn = new javax.swing.JButton();
backBtn = new javax.swing.JButton();
expectedOrganicCarbonTextField = new javax.swing.JTextField();
expectedAluminiumSaturationTextField = new javax.swing.JTextField();
expectedCalciumCarbonateContentTextField = new javax.swing.JTextField();
expectedCNRatioTextField = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
cropTypeLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
cropTypeLabel.setText("Crop Type:");
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel2.setText("Bulk Density(g/cc):");
jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel4.setText("Nitrate Level(ppm):");
jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel5.setText("Water Content:");
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel6.setText("Electrical Conductivity:");
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel3.setText("pH:");
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel1.setText("Fill In The Expected Values Of The Soil Parameters For The Mentioned Crop");
saveBtn.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
saveBtn.setText("Save Research Results");
saveBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveBtnActionPerformed(evt);
}
});
backBtn.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
backBtn.setText("<<Back");
backBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
backBtnActionPerformed(evt);
}
});
jLabel9.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel9.setText("Organic Carbon(%):");
jLabel10.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel10.setText("C/N Ratio:");
jLabel11.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel11.setText("Aluminium Saturation(ppm):");
jLabel12.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel12.setText("CalciumCarbonate Content:");
jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imgs/agronomyAdvancement.JPG"))); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 1327, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(129, 129, 129)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(backBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(3, 3, 3)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(cropTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel4))
.addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(expectedWaterTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(expectedPhTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(expectedNitrateTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(expectedBlkTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cropTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(expectedAluminiumSaturationTextField, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(expectedCNRatioTextField, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(expectedOrganicCarbonTextField, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(expectedCalciumCarbonateContentTextField)
.addComponent(expectedElectricalTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(169, 169, 169)
.addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(jLabel1))))
.addContainerGap(175, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(33, 33, 33)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cropTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cropTypeLabel))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(expectedBlkTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(expectedPhTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(expectedNitrateTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel9)
.addGroup(layout.createSequentialGroup()
.addComponent(expectedOrganicCarbonTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(expectedCNRatioTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10))
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(expectedAluminiumSaturationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(expectedCalciumCarbonateContentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(expectedElectricalTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(expectedWaterTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(saveBtn)
.addComponent(backBtn))
.addContainerGap(44, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
// TODO add your handling code here:
try
{
for(Organization organization : enterprise.getOrganizationDirectory().getOrganizationList())
{
if(organization instanceof ResearchOrganization)
{
Crop crop = ((ResearchOrganization) organization).getCropDirectory().addCrop();
crop.setCropName(cropTextField.getText());
crop.getSoilParameter().setExpectedNitrateLevel(Float.parseFloat(expectedNitrateTxtFld.getText()));
crop.getSoilParameter().setExpectedElectricalConductivity(Float.parseFloat(expectedElectricalTxtFld.getText()));
crop.getSoilParameter().setExpectedBulkDensity(Float.parseFloat(expectedBlkTxtFld.getText()));
crop.getSoilParameter().setExpectedWaterContent(Float.parseFloat(expectedWaterTxtFld.getText()));
crop.getSoilParameter().setExpectedSoilPH(Float.parseFloat(expectedPhTxtFld.getText()));
crop.getSoilParameter().setExpectedOrganicCarbon(Float.parseFloat(expectedOrganicCarbonTextField.getText()));
crop.getSoilParameter().setExpectedCarbonNitrogenRatio(Float.parseFloat(expectedCNRatioTextField.getText()));
crop.getSoilParameter().setExpectedAluminiumSaturation(Float.parseFloat(expectedAluminiumSaturationTextField.getText()));
crop.getSoilParameter().setExpectedCalciumCarbonateContent(Float.parseFloat(expectedCalciumCarbonateContentTextField.getText()));
}
}
JOptionPane.showMessageDialog(null, "Crop added successfully");
cropTextField.setText("");
expectedAluminiumSaturationTextField.setText("");
expectedBlkTxtFld.setText("");
expectedCNRatioTextField.setText("");
expectedCalciumCarbonateContentTextField.setText("");
expectedElectricalTxtFld.setText("");
expectedNitrateTxtFld.setText("");
expectedOrganicCarbonTextField.setText("");
expectedPhTxtFld.setText("");
expectedWaterTxtFld.setText("");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, "Please Enter all the values");
}
}//GEN-LAST:event_saveBtnActionPerformed
private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBtnActionPerformed
// TODO add your handling code here:
userProcessContainer.remove(this);
CardLayout layout = (CardLayout) userProcessContainer.getLayout();
layout.previous(userProcessContainer);
}//GEN-LAST:event_backBtnActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton backBtn;
private javax.swing.JTextField cropTextField;
private javax.swing.JLabel cropTypeLabel;
private javax.swing.JTextField expectedAluminiumSaturationTextField;
private javax.swing.JTextField expectedBlkTxtFld;
private javax.swing.JTextField expectedCNRatioTextField;
private javax.swing.JTextField expectedCalciumCarbonateContentTextField;
private javax.swing.JTextField expectedElectricalTxtFld;
private javax.swing.JTextField expectedNitrateTxtFld;
private javax.swing.JTextField expectedOrganicCarbonTextField;
private javax.swing.JTextField expectedPhTxtFld;
private javax.swing.JTextField expectedWaterTxtFld;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel9;
private javax.swing.JButton saveBtn;
// End of variables declaration//GEN-END:variables
}
|
[
"[email protected]"
] | |
0c665d70482a357e7f00a658e879544dafa937af
|
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
|
/Corpus/eclipse.jdt.core/870.java
|
b1edf6c55bb7efd9e617cc13f21996fb9c1c6452
|
[
"MIT"
] |
permissive
|
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
|
d3fd21745dfddb2979e8ac262588cfdfe471899f
|
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
|
refs/heads/master
| 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 |
MIT
| 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null |
UTF-8
|
Java
| false | false | 421 |
java
|
package test.copyright;
/**
* Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: IBM Corporation - initial API and implementation
*/
public class X1 {
}
|
[
"[email protected]"
] | |
6807dfb80d846a91c0692b55f70e3562c14550d9
|
75a1bb7d5079fc8e833b56f7fd6f83d9eccc9b31
|
/src/java/Maestros/Cliente.java
|
f0a786888dc3045e2523b35251bf8814deecbb59
|
[] |
no_license
|
Humberto-manjarres/Control
|
554ce30a1cf6daed7394d2e5a9f05690341dd268
|
303c8401744d48d2df0e02ee5e2fbd912785333e
|
refs/heads/master
| 2023-01-24T04:42:52.700815 | 2020-11-23T20:50:18 | 2020-11-23T20:50:18 | 274,275,685 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,030 |
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 Maestros;
/**
*
* @author Humberto Manjarres
*/
public class Cliente {
private String identificacion;
private String nombre;
private String apellidos;
private String telefono;
private String direccion;
private String empresa;
private String numeroTarjeta;
private String error;
private String clienteDgl;
public Cliente() {
}
public String getClienteDgl() {
return clienteDgl;
}
public void setClienteDgl(String clienteDgl) {
this.clienteDgl = clienteDgl;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getIdentificacion() {
return identificacion;
}
public void setIdentificacion(String identificacion) {
this.identificacion = identificacion;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellidos() {
return apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public String getDireccion() {
return direccion;
}
public void setDireccion(String direccion) {
this.direccion = direccion;
}
public String getEmpresa() {
return empresa;
}
public void setEmpresa(String empresa) {
this.empresa = empresa;
}
public String getNumeroTarjeta() {
return numeroTarjeta;
}
public void setNumeroTarjeta(String numeroTarjeta) {
this.numeroTarjeta = numeroTarjeta;
}
}
|
[
"[email protected]"
] | |
60ae2dee17fe77f5ad5b78c9361e09381de253ec
|
57672b57b256b90b789a196c94b27918a530cef6
|
/src/main/java/curso_intermedio/activitys/tema4inActivity.java
|
116a9ba077a2b1347c8a9d55615e3c8ad641dc6f
|
[] |
no_license
|
SaulGrez/curso_php
|
3e6553fee772adc6afea4ff5e4d14e15103d49b9
|
f017017aae1a39d95c87bb26d9551c783c593e12
|
refs/heads/master
| 2022-12-27T04:37:51.944965 | 2020-10-13T01:54:19 | 2020-10-13T01:54:19 | 303,559,802 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,956 |
java
|
package curso_intermedio.activitys;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.example.curso_php.R;
import com.example.curso_php.contenido_intermedio;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import curso_intermedio.adapters.AdapIT4;
import curso_intermedio.temas.Temain_4;
public class tema4inActivity extends AppCompatActivity {
DatabaseReference t4ireference;
RecyclerView t4irecyclerView;
ArrayList<Temain_4> t4ilist;
AdapIT4 t4iadapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inter4);
t4irecyclerView = (RecyclerView) findViewById(R.id.rvtema4);
t4irecyclerView.setLayoutManager(new LinearLayoutManager(this));
t4ilist = new ArrayList<Temain_4>();
t4ireference = FirebaseDatabase.getInstance().getReference().child("intermedio").child("tema4");
t4ireference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
t4ilist.clear();
for (DataSnapshot dataSnapshot1: dataSnapshot.getChildren())
{
Temain_4 t4 = dataSnapshot1.getValue(Temain_4.class);
t4ilist.add(t4);
}
t4iadapter = new AdapIT4(tema4inActivity.this,t4ilist);
t4irecyclerView.setAdapter(t4iadapter);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Toast.makeText(tema4inActivity.this,"Opssss.... Algo va mal",Toast.LENGTH_SHORT).show();
}
});
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public void Anterior(View view) {
Intent anterior = new Intent(this, contenido_intermedio.class);
startActivity(anterior);
finish();
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public void ant_tema(View view) {
Intent anterior = new Intent(this, tema3inActivity.class);
startActivity(anterior);
finish();
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public void sig_tema(View view) {
Intent siguiente = new Intent(this, tema5inActivity.class);
startActivity(siguiente);
finish();
}
}
|
[
"[email protected]"
] | |
28de49e74bb0cd0fcdf7d85cd0a2002d55b543ff
|
8d9a66f98c42f7b6ab09734e4acaf9ab76214a18
|
/app/src/main/java/com/tagliaro/monclin/urca/ui/ClassesListAdapter.java
|
97025a2c0db373d5c0e26a6770c1d64958f1a7d9
|
[] |
no_license
|
btglr/agenda
|
1663d6863eecf3d9a519a5f89447007664c0f9c7
|
3fc5991736151ced5a7b381bb0279fb91de22810
|
refs/heads/master
| 2021-09-11T21:00:37.203974 | 2018-04-12T10:23:15 | 2018-04-12T10:23:15 | 126,180,190 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,307 |
java
|
package com.tagliaro.monclin.urca.ui;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.tagliaro.monclin.urca.R;
import com.tagliaro.monclin.urca.utils.Classes;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ClassesListAdapter extends ArrayAdapter<Classes> {
private int resource;
public ClassesListAdapter(@NonNull Context context, int resource) {
super(context, resource);
}
public ClassesListAdapter(@NonNull Context context, int resource, @NonNull List<Classes> classes) {
super(context, resource, classes);
this.resource = resource;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View v = convertView;
if(v == null) {
LayoutInflater vi = LayoutInflater.from(getContext());
v = vi.inflate(resource, null);
}
Classes c = getItem(position);
if(c != null) {
TextView className = v.findViewById(R.id.className);
TextView time = v.findViewById(R.id.time);
TextView location = v.findViewById(R.id.location);
if(className != null) {
className.setText(c.getClassname());
}
if(time != null) {
time.setText(String.format(getContext().getString(R.string.class_time), c.getStartTime(), c.getEndTime()));
}
if(location != null) {
Pattern classroomPattern = Pattern.compile("\\[(.*?)\\] (.*?)");
Matcher m = classroomPattern.matcher(c.getClassroom());
if(m.matches()) {
String classroom = m.group(2);
classroom = classroom.substring(0,1).toUpperCase() + classroom.substring(1);
location.setText(classroom);
}
else
location.setText(c.getClassroom());
}
v.setTag(c.getId());
}
return v;
}
}
|
[
"[email protected]"
] | |
b1fca5a8854ad75bb74934628905ca0fa06726cf
|
2600e669f4ef570949bf1322606ae7be41d6584d
|
/src/test/java/br/com/awServices/AppTest.java
|
4b9fed516eb9a3452d78afe4bd226428ffb06f29
|
[] |
no_license
|
rcicero/awService
|
74dc3718a8133c3d1e62b1ddb1e58ce3d5cf978a
|
dba86507d71e9ef4bf4b1e7e88842502dd54745b
|
refs/heads/develop
| 2021-01-21T13:26:52.746217 | 2016-04-25T19:40:04 | 2016-04-25T19:40:04 | 53,681,825 | 0 | 0 | null | 2016-04-25T19:40:06 | 2016-03-11T16:45:46 |
Java
|
UTF-8
|
Java
| false | false | 645 |
java
|
package br.com.awServices;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
|
[
"[email protected]"
] | |
7ab230a4380ff1d9f85f8d6fd15c1fc4aa079c10
|
862558193045a621e8aff6a0324a27a09904b51c
|
/edgar/src/main/java/br/net/mirante/pde/exception/PasswordException.java
|
f8254da9ff9e7323b4ca5c7ad397eff1f0a9a943
|
[] |
no_license
|
EdgarFabiano/modulo-final-pde
|
c31bcdfdabfafcb7b52cbdb608d65ac73d96576f
|
a4c5e8657cfb1b0aaf380c79994db1d40666e826
|
refs/heads/master
| 2023-01-09T04:30:25.954287 | 2019-08-05T19:00:14 | 2019-08-05T19:00:14 | 198,526,306 | 0 | 0 | null | 2022-12-31T02:19:43 | 2019-07-24T00:08:39 |
Java
|
UTF-8
|
Java
| false | false | 564 |
java
|
package br.net.mirante.pde.exception;
/**
* Exception para ser lançada nos casos de senha fora do padrão esperado:
* - No mínimo 6 caracteres;
* - Pelo menos 1 caracter alfabético (minúsculo ou maiúsculo);
* - Pelo menos 1 caracter numérico;
* - Pode ter espaços.
*/
public class PasswordException extends RuntimeException {
public PasswordException() {
super();
}
public PasswordException(String s) {
super(s);
}
public PasswordException(String s, Throwable throwable) {
super(s, throwable);
}
}
|
[
"[email protected]"
] | |
d19ddb444a7e4dceade9ff0c75d1e48c0d883b14
|
c6c58242f2145e1cbbed547eb03e3e28a4538cfb
|
/portal/src/codegen/service/AuthRulePOService.java
|
e44dad6fe15f8509d35cc92c8f67410c08118b1c
|
[] |
no_license
|
jichen/wlan
|
a404f6e255094be1c75a1bd15367b9fb3f97d40c
|
e3805917227a360ad43f7d679fc87d40d93bc600
|
refs/heads/master
| 2020-05-31T11:17:05.310852 | 2014-10-22T07:12:32 | 2014-10-22T07:12:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 280 |
java
|
package com.cmct.portal.service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.cmct.portal.dao.AuthRulePODao;
@Service
public class AuthRulePOService {
@Autowired
private AuthRulePODao authRuleDao;
}
|
[
"[email protected]"
] | |
d592714fee14458da41e6971835b48e123f2ea28
|
380ccfc409e31aa9299d1c4b683f8c1dc1bf69c1
|
/dynamo-frontend-export/src/main/java/com/ocs/dynamo/ui/composite/export/impl/ModelBasedCsvExportTemplate.java
|
9b9a39c58df80c79af45710a10fd1fbb685ff5e2
|
[
"Apache-2.0"
] |
permissive
|
jroovers/dynamo
|
4ed0625d88188d47b70105264141496e39ca4157
|
38876e9021a1a691dc45a15e908378feb5db47b7
|
refs/heads/master
| 2023-01-04T14:51:57.924726 | 2020-11-03T08:26:31 | 2020-11-03T08:26:31 | 258,517,972 | 0 | 0 |
Apache-2.0
| 2020-11-03T08:26:32 | 2020-04-24T13:20:11 | null |
UTF-8
|
Java
| false | false | 4,449 |
java
|
/*
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.ocs.dynamo.ui.composite.export.impl;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import com.ocs.dynamo.dao.FetchJoinInformation;
import com.ocs.dynamo.dao.SortOrder;
import com.ocs.dynamo.domain.AbstractEntity;
import com.ocs.dynamo.domain.model.AttributeModel;
import com.ocs.dynamo.domain.model.EntityModel;
import com.ocs.dynamo.domain.model.EntityModelFactory;
import com.ocs.dynamo.domain.query.DataSetIterator;
import com.ocs.dynamo.filter.Filter;
import com.ocs.dynamo.service.BaseService;
import com.ocs.dynamo.service.ServiceLocatorFactory;
import com.ocs.dynamo.ui.composite.export.CustomXlsStyleGenerator;
import com.ocs.dynamo.ui.composite.type.ExportMode;
import com.ocs.dynamo.ui.utils.FormatUtils;
import com.ocs.dynamo.ui.utils.VaadinUtils;
import com.ocs.dynamo.util.SystemPropertyUtils;
import com.ocs.dynamo.utils.ClassUtils;
import com.opencsv.CSVWriter;
/**
* A template for exporting data to CSV
*
* @author Bas Rutten
*
* @param <ID> the type of the primary key of the entity to export
* @param <T> the type of the entity to export
*/
public class ModelBasedCsvExportTemplate<ID extends Serializable, T extends AbstractEntity<ID>> extends BaseCsvExportTemplate<ID, T> {
/**
* Constructor
*
* @param service service used for retrieving data from the database
* @param entityModel the entity model of the entities to export
* @param exportMode the export mode
* @param sortOrders the sort orders used to order the data
* @param filter filter to apply to limit the results
* @param joins
*/
public ModelBasedCsvExportTemplate(BaseService<ID, T> service, EntityModel<T> entityModel, ExportMode exportMode,
SortOrder[] sortOrders, Filter filter, CustomXlsStyleGenerator<ID, T> customGenerator, FetchJoinInformation... joins) {
super(service, entityModel, exportMode, sortOrders, filter, "", joins);
}
@Override
protected byte[] generate(DataSetIterator<ID, T> iterator) throws IOException {
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
CSVWriter writer = new CSVWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8),
SystemPropertyUtils.getCsvSeparator().charAt(0), SystemPropertyUtils.getCsvQuoteChar().charAt(0),
SystemPropertyUtils.getCsvEscapeChar().charAt(0), String.format("%n"))) {
// add header row
List<String> headers = new ArrayList<>();
for (AttributeModel am : getEntityModel().getAttributeModels()) {
if (show(am)) {
headers.add(am.getDisplayName(VaadinUtils.getLocale()));
}
}
writer.writeNext(headers.toArray(new String[0]));
// iterate over the rows
T entity = iterator.next();
while (entity != null) {
List<String> row = new ArrayList<>();
for (AttributeModel am : getEntityModel().getAttributeModels()) {
if (show(am)) {
Object value = ClassUtils.getFieldValue(entity, am.getPath());
EntityModelFactory emf = ServiceLocatorFactory.getServiceLocator().getEntityModelFactory();
String str = FormatUtils.formatPropertyValue(emf, am, value, ", ");
row.add(str);
}
}
if (!row.isEmpty()) {
writer.writeNext(row.toArray(new String[0]));
}
entity = iterator.next();
}
writer.flush();
return out.toByteArray();
}
}
}
|
[
"[email protected]"
] | |
15dac5cda6c7db50c592fa80dd49eacca4874c70
|
841c037b8afd1d73504a6b90ba15ed9b28f754dd
|
/src/main/java/setup/ReadProperties.java
|
5498e76d369543ada48d8d49a63aaa5f33f9c440
|
[] |
no_license
|
vedanthreddy160/Finding-hospitals
|
485abc8ff56edbd543312a51f0cf3d05db906591
|
cd858799918e0ec51275719f69ea4b6a0e771410
|
refs/heads/master
| 2023-04-29T10:27:47.048708 | 2021-05-21T07:58:19 | 2021-05-21T07:58:19 | 369,456,081 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 590 |
java
|
package setup;
import java.io.FileInputStream;
import java.util.Properties;
public class ReadProperties {
static Properties prop;
public static Properties readFile(String fileName)
{
try{
//To read the property file
FileInputStream file=new FileInputStream(fileName);
prop=new Properties();
prop.load(file);
if(prop!=null)
{
file.close();
}else{
System.out.println("Connection Failed with property file");
}
}catch (Exception e) {
System.out.println("Error in ReadPrperties Class");
}
return prop;
}
}
|
[
"Lenovo@DESKTOP-41ETOLI"
] |
Lenovo@DESKTOP-41ETOLI
|
74c42a7a8d84113e6089699ef2c5a6ca76740785
|
1977757fa8a337e3346795cfb1ceca9ae95b97fb
|
/src/code11/LogicalOperatorSingleAmpersend.java
|
a7803ce057b1d348dfb7e287b6aeabc1d0bf795d
|
[] |
no_license
|
Tarana82/MyFirstProject
|
fcb3e81c3659e9f846a71c7856fcf4ba914e15ad
|
6fe9bb5f1d90812f6c2e5ef68ba275435a7cabce
|
refs/heads/master
| 2021-02-11T16:22:21.801471 | 2020-03-03T03:33:39 | 2020-03-03T03:33:39 | 244,509,280 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,682 |
java
|
package code11;
public class LogicalOperatorSingleAmpersend {
public static void main(String[] args) {
// && 2 ampersand & 1 ampersand -->> Logical AND operator
// This is used to check both conditions are true at the same time
// && is called short circuit AND
// -->> it does not check the next condition as long as the first condition is false
// -->> just like if you have multiple condition for rocket launching
// isEngineRunning , isCommunicationSystemWorking , isAirEnough
// isEngineRunning && isCommunicationSystemWorking && isAirEnough
// if isEngineRunning is false then it does not go and check next conditions
// & -->> CHECK EACH AND every condition no matter what
// isEngineRunning & isCommunicationSystemWorking & isAirEnough
// if isEngineRunning is false
// it still check isCommunicationSystemWorking
// it still check isAirEnough
// and eventually give you the outcome
// System.out.println( 7>5 && 1>7 );
// System.out.println( 5>5 && 1>7 );
// System.out.println( 1>5 && 9>7 );
//
// System.out.println( 7>5 & 1>7 );
// System.out.println( 5>5 & 1>7 );
// System.out.println( 1>5 & 9>7 );
//System.out.println( 9/0 ); // ERROR!! CAN NOT DIVIDE BY 0
// I want to check whether dividing 9 by 0 is 3
// System.out.println( 9/0 ==3 );
// combine the result of
// checking 5 is more than 10
// and 9 divided by 0 is 3
System.out.println(5 > 10 && 9 / 0 == 3);
System.out.println(5 > 10 & 9 / 0 == 3);
}
}
|
[
"[email protected]"
] | |
b6b7f8e9fb9acc8df33bc2b80952c4fc905470c6
|
77288a90c4b6484ba9d34b0b87f117b3962ef102
|
/src/main/java/org/astashonok/onlinestorebackend/dto/OrderItem.java
|
be6e8063c6216416e2526d66e2e54a058de27396
|
[] |
no_license
|
Kkandidov/onlinestore
|
1651545a2498e0f71fc6600ddfe3fcdcf42bbcee
|
552a39829a92cd743dead84adf708ac4339c1712
|
refs/heads/master
| 2022-12-22T05:02:51.462673 | 2020-04-09T12:19:59 | 2020-04-09T12:19:59 | 239,855,201 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,610 |
java
|
package org.astashonok.onlinestorebackend.dto;
import org.astashonok.onlinestorebackend.dto.abstracts.Entity;
import org.astashonok.onlinestorebackend.exceptions.logicalexception.NegativeValueException;
import org.astashonok.onlinestorebackend.exceptions.logicalexception.NullReferenceException;
import java.util.Objects;
public class OrderItem extends Entity {
private Order order;
private double total;
private Product product;
private int productCount;
private double productPrice;
public OrderItem() {
}
public OrderItem(Order order, double total, Product product, int productCount, double productPrice) {
this.order = order;
this.total = total;
this.product = product;
this.productCount = productCount;
this.productPrice = productPrice;
}
public OrderItem(long id, Order order, double total, Product product, int productCount, double productPrice) {
this(order, total, product, productCount, productPrice);
super.id = id;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) throws NullReferenceException {
if (order == null) {
throw new NullReferenceException("The order must be indicated in the orderItem! ");
}
this.order = order;
}
public double getTotal() {
return total;
}
public void setTotal(double total) throws NegativeValueException {
if (total < 0) {
throw new NegativeValueException("The total must be from 0! ");
}
this.total = total;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) throws NullReferenceException {
if (product == null) {
throw new NullReferenceException("If there are orderItem, then the product has to match it! ");
}
this.product = product;
}
public int getProductCount() {
return productCount;
}
public void setProductCount(int productCount) throws NegativeValueException {
if (productCount < 0) {
throw new NegativeValueException("The product count must be from 0! ");
}
this.productCount = productCount;
}
public double getProductPrice() {
return productPrice;
}
public void setProductPrice(double productPrice) throws NegativeValueException {
if (productPrice < 0) {
throw new NegativeValueException("The product price must be from 0! ");
}
this.productPrice = productPrice;
}
@Override
public String toString() {
return "OrderItem{" +
super.toString() +
", order=" + order +
", total=" + total +
", product=" + product +
", productCount=" + productCount +
", productPrice=" + productPrice +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OrderItem orderItem = (OrderItem) o;
return Double.compare(orderItem.total, total) == 0 &&
productCount == orderItem.productCount &&
Double.compare(orderItem.productPrice, productPrice) == 0 &&
Objects.equals(order, orderItem.order) &&
Objects.equals(product, orderItem.product);
}
@Override
public int hashCode() {
return Objects.hash(order, total, product, productCount, productPrice);
}
}
|
[
"[email protected]"
] | |
0a2420fac3cd547b55fe76d1a61486a31e92ba22
|
4c9d35da30abf3ec157e6bad03637ebea626da3f
|
/eclipse/libs_src/org/ripple/bouncycastle/asn1/esf/SPUserNotice.java
|
3d6b0bd30c405ab867b8ae507e7505e71bf54cdf
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0"
] |
permissive
|
youweixue/RipplePower
|
9e6029b94a057e7109db5b0df3b9fd89c302f743
|
61c0422fa50c79533e9d6486386a517565cd46d2
|
refs/heads/master
| 2020-04-06T04:40:53.955070 | 2015-04-02T12:22:30 | 2015-04-02T12:22:30 | 33,860,735 | 0 | 0 | null | 2015-04-13T09:52:14 | 2015-04-13T09:52:11 | null |
UTF-8
|
Java
| false | false | 2,148 |
java
|
package org.ripple.bouncycastle.asn1.esf;
import java.util.Enumeration;
import org.ripple.bouncycastle.asn1.ASN1Encodable;
import org.ripple.bouncycastle.asn1.ASN1EncodableVector;
import org.ripple.bouncycastle.asn1.ASN1Object;
import org.ripple.bouncycastle.asn1.ASN1Primitive;
import org.ripple.bouncycastle.asn1.ASN1Sequence;
import org.ripple.bouncycastle.asn1.ASN1String;
import org.ripple.bouncycastle.asn1.DERSequence;
import org.ripple.bouncycastle.asn1.x509.DisplayText;
import org.ripple.bouncycastle.asn1.x509.NoticeReference;
public class SPUserNotice extends ASN1Object {
private NoticeReference noticeRef;
private DisplayText explicitText;
public static SPUserNotice getInstance(Object obj) {
if (obj instanceof SPUserNotice) {
return (SPUserNotice) obj;
} else if (obj != null) {
return new SPUserNotice(ASN1Sequence.getInstance(obj));
}
return null;
}
private SPUserNotice(ASN1Sequence seq) {
Enumeration e = seq.getObjects();
while (e.hasMoreElements()) {
ASN1Encodable object = (ASN1Encodable) e.nextElement();
if (object instanceof DisplayText || object instanceof ASN1String) {
explicitText = DisplayText.getInstance(object);
} else if (object instanceof NoticeReference
|| object instanceof ASN1Sequence) {
noticeRef = NoticeReference.getInstance(object);
} else {
throw new IllegalArgumentException(
"Invalid element in 'SPUserNotice': "
+ object.getClass().getName());
}
}
}
public SPUserNotice(NoticeReference noticeRef, DisplayText explicitText) {
this.noticeRef = noticeRef;
this.explicitText = explicitText;
}
public NoticeReference getNoticeRef() {
return noticeRef;
}
public DisplayText getExplicitText() {
return explicitText;
}
/**
* <pre>
* SPUserNotice ::= SEQUENCE {
* noticeRef NoticeReference OPTIONAL,
* explicitText DisplayText OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
if (noticeRef != null) {
v.add(noticeRef);
}
if (explicitText != null) {
v.add(explicitText);
}
return new DERSequence(v);
}
}
|
[
"[email protected]"
] | |
f5f6ed3cb41aae00c69d99347bc3103b01c8bbef
|
0e719c6700400b547ca62cfb2d1ab4c74f8218ff
|
/P2Pproj/src/main/java/top/zzh/bean/Bz.java
|
4935061bfe0b2327d402136e4d0a1a4261906a53
|
[] |
no_license
|
ChenZhenCZ/JavaWeb
|
688a6ad92622af24e238c12ce15cdc5c19e75fd9
|
cc308c4decc3ef5d65ccae26453cbcfbbc3871b4
|
refs/heads/master
| 2021-05-16T05:09:47.967350 | 2018-03-22T00:02:24 | 2018-03-22T00:02:24 | 106,273,182 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 762 |
java
|
package top.zzh.bean;
//标种表
public class Bz {
private Long bzid;
private String bzname;//标种名称
private Byte state;
public Bz(Long bzid, String bzname, Byte state) {
this.bzid = bzid;
this.bzname = bzname;
this.state = state;
}
public Bz() {
super();
}
public Long getBzid() {
return bzid;
}
public void setBzid(Long bzid) {
this.bzid = bzid;
}
public String getBzname() {
return bzname;
}
public void setBzname(String bzname) {
this.bzname = bzname == null ? null : bzname.trim();
}
public Byte getState() {
return state;
}
public void setState(Byte state) {
this.state = state;
}
}
|
[
"[email protected]"
] | |
0a9efae350768c27b4a9dca7ba614f86bc1ef157
|
ce9f18574b97dd6fb43f988fd38463fbad364d91
|
/Semester 3/Advanced Programming Methods/Courses/Ex3-TableView-first/src/application/Person.java
|
6633a9b43ca889c3d124c5f80d3dbcceaf49a7e7
|
[] |
no_license
|
anamariadem/University
|
ab43b5671ef13141272d7733e643bf63ad8d8c9f
|
d0366ef07e5bc004c6d2e1f7b0ca76fad0c95886
|
refs/heads/master
| 2023-03-17T08:47:20.452547 | 2021-03-10T11:34:33 | 2021-03-10T11:34:33 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,019 |
java
|
package application;
import javafx.beans.property.SimpleStringProperty;
public class Person {
private final SimpleStringProperty firstName = new SimpleStringProperty("");
private final SimpleStringProperty lastName = new SimpleStringProperty("");
private final SimpleStringProperty email = new SimpleStringProperty("");
public Person() {
this("", "", "");
}
public Person(String firstName, String lastName, String email) {
setFirstName(firstName);
setLastName(lastName);
setEmail(email);
}
public String getFirstName() {
return firstName.get();
}
public void setFirstName(String fName) {
firstName.set(fName);
}
public String getLastName() {
return lastName.get();
}
public void setLastName(String fName) {
lastName.set(fName);
}
public String getEmail() {
return email.get();
}
public void setEmail(String fName) {
email.set(fName);
}
}
|
[
"[email protected]"
] | |
e0cd016157a8e69f7b935b1e09402a9e8c50e7e3
|
6f334ef3a768a4a74a287d068c3489c5832ae3b8
|
/src/main/java/com/project/animals/AnimalsApplication.java
|
4d3d1110f2826cea51993d550c44bf0ec937253c
|
[
"MIT"
] |
permissive
|
AndreaCandia/In120Mins-Tutorial
|
37670afbe6d83d43304e1e622c7c398ce061d09f
|
75a4048b0b70d0f612cd3601706e27e1fb4aed99
|
refs/heads/main
| 2023-06-03T19:32:09.587733 | 2021-06-22T11:06:47 | 2021-06-22T11:06:47 | 379,212,179 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 314 |
java
|
package com.project.animals;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AnimalsApplication {
public static void main(String[] args) {
SpringApplication.run(AnimalsApplication.class, args);
}
}
|
[
"[email protected]"
] | |
0818183719faff8ca409528364c794c51df94a9e
|
b0b1cf3635f9e36516aee7a2ea1f443365b4ac7d
|
/src/VISTA/JPanelRegistrarDevolucion.java
|
506e7862ff2fac8aa02a49b50d5f5ebad259a257
|
[] |
no_license
|
dayamedina95/BibliotecaUDES
|
889cb4376533cd84e4a3affe69fa255822d4f693
|
992a7917f8faa6a2cd0ed170dbffcbd9a299cbcb
|
refs/heads/master
| 2020-06-15T14:48:06.698223 | 2019-07-10T16:08:50 | 2019-07-10T16:08:50 | 195,325,115 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,390 |
java
|
package VISTA;
public class JPanelRegistrarDevolucion extends javax.swing.JPanel {
private IniciarSesion login;
public JPanelRegistrarDevolucion(IniciarSesion login) {
initComponents();
this.login = login;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTablePrestamo = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jScrollPane2 = new javax.swing.JScrollPane();
jTableDevololver = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setText("LIBROS PRESTADOS");
add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 11, 201, 34));
jTablePrestamo.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(jTablePrestamo);
add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 56, 523, 159));
jButton1.setText("DEVOLVER");
add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(551, 107, 201, 44));
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel2.setText("SOLICITUD DE LIBROS A DEVOLVER");
add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 244, 316, 34));
add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 226, 782, 12));
jTableDevololver.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane2.setViewportView(jTableDevololver);
add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 284, 523, 159));
jButton2.setText("CANCELAR");
add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(551, 338, 201, 44));
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTable jTableDevololver;
private javax.swing.JTable jTablePrestamo;
// End of variables declaration//GEN-END:variables
}
|
[
"PC-2@PC-2-PC"
] |
PC-2@PC-2-PC
|
2a816e67527e3701bccc0275dbefef0409114f91
|
95fb3d06bfdc3ccffa8e4a39c284b39b37a8706f
|
/quiet-live-hall/src/main/java/com/quiet/live/hall/mapper/JUserMapper.java
|
7c9414b3101a9f5dcf7d533c28560668e2a65380
|
[] |
no_license
|
zhongrl/wechat-quiet
|
c3ccf16fb07a2a028212edba819b3d3cb991e2ce
|
ab08b03a844ba76a938ad99295d09836662bb04d
|
refs/heads/master
| 2022-12-13T03:02:20.671543 | 2019-11-26T07:33:30 | 2019-11-26T07:33:30 | 213,796,177 | 0 | 0 | null | 2022-12-05T23:49:42 | 2019-10-09T01:53:27 |
TSQL
|
UTF-8
|
Java
| false | false | 283 |
java
|
package com.quiet.live.hall.mapper;
import com.quiet.live.hall.entity.JUser;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author william zhong123
* @since 2019-08-07
*/
public interface JUserMapper extends BaseMapper<JUser> {
}
|
[
"[email protected]"
] | |
874c8bc59bde56ea394a7b8e58100da57aaa0973
|
9623f83defac3911b4780bc408634c078da73387
|
/PC_for_1_3/src/minecraft/net/minecraft/src/EntitySpider.java
|
d73a8acc2396ac2063ace29d1595f7980b972338
|
[] |
no_license
|
BlearStudio/powercraft-legacy
|
42b839393223494748e8b5d05acdaf59f18bd6c6
|
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
|
refs/heads/master
| 2021-01-21T21:18:55.774908 | 2015-04-06T20:45:25 | 2015-04-06T20:45:25 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,589 |
java
|
package net.minecraft.src;
public class EntitySpider extends EntityMob
{
public EntitySpider(World par1World)
{
super(par1World);
this.texture = "/mob/spider.png";
this.setSize(1.4F, 0.9F);
this.moveSpeed = 0.8F;
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(16, new Byte((byte)0));
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
super.onUpdate();
if (!this.worldObj.isRemote)
{
this.setBesideClimbableBlock(this.isCollidedHorizontally);
}
}
public int getMaxHealth()
{
return 16;
}
/**
* Returns the Y offset from the entity's position for any entity riding this one.
*/
public double getMountedYOffset()
{
return (double)this.height * 0.75D - 0.5D;
}
/**
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
protected boolean canTriggerWalking()
{
return false;
}
/**
* Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking
* (Animals, Spiders at day, peaceful PigZombies).
*/
protected Entity findPlayerToAttack()
{
float var1 = this.getBrightness(1.0F);
if (var1 < 0.5F)
{
double var2 = 16.0D;
return this.worldObj.getClosestVulnerablePlayerToEntity(this, var2);
}
else
{
return null;
}
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.spider";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.spider";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.spiderdeath";
}
/**
* Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
*/
protected void attackEntity(Entity par1Entity, float par2)
{
float var3 = this.getBrightness(1.0F);
if (var3 > 0.5F && this.rand.nextInt(100) == 0)
{
this.entityToAttack = null;
}
else
{
if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0)
{
if (this.onGround)
{
double var4 = par1Entity.posX - this.posX;
double var6 = par1Entity.posZ - this.posZ;
float var8 = MathHelper.sqrt_double(var4 * var4 + var6 * var6);
this.motionX = var4 / (double)var8 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D;
this.motionZ = var6 / (double)var8 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D;
this.motionY = 0.4000000059604645D;
}
}
else
{
super.attackEntity(par1Entity, par2);
}
}
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Item.silk.shiftedIndex;
}
/**
* Drop 0-2 items of this living's type
*/
protected void dropFewItems(boolean par1, int par2)
{
super.dropFewItems(par1, par2);
if (par1 && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + par2) > 0))
{
this.dropItem(Item.spiderEye.shiftedIndex, 1);
}
}
/**
* returns true if this entity is by a ladder, false otherwise
*/
public boolean isOnLadder()
{
return this.isBesideClimbableBlock();
}
/**
* Sets the Entity inside a web block.
*/
public void setInWeb() {}
/**
* How large the spider should be scaled.
*/
public float spiderScaleAmount()
{
return 1.0F;
}
/**
* Get this Entity's EnumCreatureAttribute
*/
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.ARTHROPOD;
}
public boolean isPotionApplicable(PotionEffect par1PotionEffect)
{
return par1PotionEffect.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(par1PotionEffect);
}
/**
* Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using
* setBesideClimableBlock.
*/
public boolean isBesideClimbableBlock()
{
return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
/**
* Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is
* false.
*/
public void setBesideClimbableBlock(boolean par1)
{
byte var2 = this.dataWatcher.getWatchableObjectByte(16);
if (par1)
{
var2 = (byte)(var2 | 1);
}
else
{
var2 &= -2;
}
this.dataWatcher.updateObject(16, Byte.valueOf(var2));
}
}
|
[
"[email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c"
] |
[email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
|
299353a0d7998460c75684f3856d9bef61a68906
|
4b7673c5754039c26a3e18c9e99dcdae83dbcc40
|
/shipment/src/main/java/com/legacy/shipment/config/AppConfig.java
|
f19fe9721b2fb09c0d5bdf5961bd5c5a6c66e944
|
[
"Apache-2.0"
] |
permissive
|
ali1dc/legacy-modernization
|
0dbb0786fb4a0d3cff8c5891ee526d4ae0acd269
|
e4c7373fe7efe8a4888fd2f97a66f6603455c599
|
refs/heads/master
| 2022-11-21T07:47:49.863883 | 2020-07-23T01:41:27 | 2020-07-23T01:41:27 | 260,297,982 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 314 |
java
|
package com.legacy.shipment.config;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AppConfig {
@Bean
public ModelMapper mapper() {
return new ModelMapper();
}
}
|
[
"[email protected]"
] | |
b17004cbdd6c9c382d5f7ab32be0db007764af27
|
4c276897dcc64c7ff80911f5e547f9f920c1b841
|
/DiemDanhAndroid/app/src/main/java/com/mta/diemdanhandroid/entity/HocPhanEntity.java
|
57e1d9685d67c7295517c303fd49ddff0a8ed3ca
|
[] |
no_license
|
HuyAK47/diemdanh
|
d2a00a14bce2aad8683270f98209ea1f5a6eed16
|
6d7a52c5e48632c44705b8bc2d2758eb40ac81bd
|
refs/heads/main
| 2023-07-09T18:50:34.509671 | 2021-07-15T12:59:10 | 2021-07-15T12:59:10 | 386,288,795 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 862 |
java
|
package com.mta.diemdanhandroid.entity;
public class HocPhanEntity {
private String maHocPhan;
private String tenHocPhan;
private int soTinChi;
public HocPhanEntity() {
}
public HocPhanEntity(String maHocPhan, String tenHocPhan, int soTinChi) {
this.maHocPhan = maHocPhan;
this.tenHocPhan = tenHocPhan;
this.soTinChi = soTinChi;
}
public String getMaHocPhan() {
return maHocPhan;
}
public void setMaHocPhan(String maHocPhan) {
this.maHocPhan = maHocPhan;
}
public String getTenHocPhan() {
return tenHocPhan;
}
public void setTenHocPhan(String tenHocPhan) {
this.tenHocPhan = tenHocPhan;
}
public int getSoTinChi() {
return soTinChi;
}
public void setSoTinChi(int soTinChi) {
this.soTinChi = soTinChi;
}
}
|
[
"[email protected]"
] | |
5c8b87d26f5bbea403e7ca64df155ab0deaa11a8
|
10de16c79aae5f0ae2ac7f79d850a4b38669725d
|
/src/main/java/com/wzd/web/dto/history/WelfareDto.java
|
5ee1213b03bc0552aa105c365145acad73e7f4fb
|
[] |
no_license
|
weizidong/jersey-demo
|
dcd1cf030d302be3977a1112eac3f78bfe4878cd
|
de770ea256a331196d9e74f9e0d9d7b84be14c26
|
refs/heads/master
| 2021-01-17T23:07:49.668825 | 2017-04-12T01:57:35 | 2017-04-12T01:57:35 | 84,211,000 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,208 |
java
|
package com.wzd.web.dto.history;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import com.alibaba.fastjson.JSON;
/**
* 福利Dto
*
* @author WeiZiDong
*
*/
@SuppressWarnings("serial")
public class WelfareDto implements Serializable {
private String id;
@Column(name = "welfare_id")
private String welfareId;
@Column(name = "pic_url")
private String picUrl; // 配图
private String name; // 名称
@Column(name = "end_time")
private Date endTime;// 结束时间
private String title;// 标题
private String content;// 内容
private Integer score;// 积分
private String ticket;// 票券
private Date recording;// 记录时间
private Date used;// 使用时间
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getWelfareId() {
return welfareId;
}
public void setWelfareId(String welfareId) {
this.welfareId = welfareId;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public Date getRecording() {
return recording;
}
public void setRecording(Date recording) {
this.recording = recording;
}
public Date getUsed() {
return used;
}
public void setUsed(Date used) {
this.used = used;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
|
[
"[email protected]"
] | |
ca673ba7ecb49de0ecfd6e7203b8379f54c5ff68
|
b9022e8b38fa0a1feccde3d36d6b87fb34fdb70f
|
/java_hackerrank/introduction/Loops.java
|
b39c7dcbe185fc1a1e685bf3447d51ac9a3300aa
|
[] |
no_license
|
vishwanathj/java
|
980a2f3ae36e6afecc6b2e79080b00e4f92c810e
|
fcd92ee0768de6ffd9dc8ed6bfb0dba88c16803d
|
refs/heads/master
| 2021-01-16T19:06:38.636659 | 2018-01-07T06:20:54 | 2018-01-07T06:20:54 | 100,137,027 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 882 |
java
|
/* Objective
In this challenge, we're going to use loops to help us do some simple math.
Task
Given an integer, N, print its first 10 multiples. Each multiple N x i (where 1 <= i <= 10) should be printed on a new
line in the form:
N x i = result.
Input Format
A single integer, N.
Constraints
2 <= N <= 20
Output Format
Print 10 lines of output; each line i (where 1 <= i <= 10) contains the result of N x i in the form:
N x i = result.
Sample Input
2
Sample Output
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20*/
import java.util.*;
public class Loops {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
in.close();
for (int i=1; i<=10; i++) {
System.out.printf("%d x %d = %d\n", N, i, N*i);
}
}
}
|
[
"[email protected]"
] | |
dc4cb42d8a1df0b55cc31bcc90d78d80a968815d
|
591b2221b5aa48d310982cfb4207e03e22d6c5c8
|
/src/day11/SortArrayListClass.java
|
e0b8eff24371131fad5f0fed5fc659bf1085b8b3
|
[] |
no_license
|
mnmythri/BasicPrograms
|
3f8ed7d383ff665b055620a26ee0b293acf70cfd
|
43505f574407c240d07df2b2fa6758ab0e78d978
|
refs/heads/master
| 2022-06-08T16:50:07.613445 | 2020-04-29T06:44:24 | 2020-04-29T06:44:24 | 257,574,159 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 472 |
java
|
package day11;
import java.util.ArrayList;
import java.util.Collections;
public class SortArrayListClass {
public static void main(String[] args) {
ArrayList<String> fruits = new ArrayList<String>();
fruits.add("Orange");
fruits.add("Apple");
fruits.add("Banana");
fruits.add("Pineapple");
Collections.sort(fruits);
for (String str : fruits) {
System.out.println(str);
}
}
}
|
[
"user.email"
] |
user.email
|
bfd9ce0b5c67386c7eb7eb63c0288ec80e0fae42
|
b73338d560f59b05ad1af9f85baa9977090ab90f
|
/src/_02_cat/Cat_Runner.java
|
9e83f93faa90de3437b02e9786bce02ea9d5dc87
|
[] |
no_license
|
League-Level1-Student/level1-module1-jeff1234563456789098765432345678
|
0db909513fb1e93a107660e0adf18f627e5aa627
|
76bfdbe71881899f3858f75172153278e3d126fc
|
refs/heads/master
| 2021-05-24T14:55:07.009768 | 2020-04-09T22:08:23 | 2020-04-09T22:08:23 | 253,615,000 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 169 |
java
|
package _02_cat;
public class Cat_Runner {
public static void main(String[] args) {
Cat caty= new Cat("boby");
caty.meow();
caty.printName();
caty.kill();
}
}
|
[
"[email protected]"
] | |
336a781c497c11878a059a4cc88f4b7b608ee1df
|
e12c3275fd5740d173ea29a10798ca3fb185494e
|
/app/src/main/java/marioargandona/com/petagram5/AcercaDe.java
|
9064cfe4ea241cfcadeaa2dbb16eeea74d1a1878
|
[] |
no_license
|
MarioArgandona/Petagram5
|
3e54cf63b4519335091cc37ecfb5f82b65f406db
|
1367f0ed257fa48b63c67a4ba27cd15db1643ded
|
refs/heads/master
| 2020-12-25T15:29:02.928900 | 2016-08-06T21:54:30 | 2016-08-06T21:54:30 | 65,103,618 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 551 |
java
|
package marioargandona.com.petagram5;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
public class AcercaDe extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_acerca_de);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar4);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
|
[
"[email protected]"
] | |
6344048610655f64b9fa4d4b2d4d8887966085b1
|
603e1c71c7b47166622110204d292358a0a025f0
|
/src/main/java/novi/basics/springbootDemo/exception/UserNotFoundAdvice.java
|
faccc0765958872fa97c76b9e03983cb9f22f189
|
[] |
no_license
|
SunshineSummerville/EindopdrachtHM
|
43406c2e19f05a46840b8429010486e2fecba2e1
|
595d72049a0e6d438d79ea9f694dbccd410b89c2
|
refs/heads/master
| 2022-12-30T07:46:36.631035 | 2020-10-05T09:06:35 | 2020-10-05T09:06:35 | 290,865,027 | 0 | 2 | null | 2020-09-16T10:06:51 | 2020-08-27T19:35:28 |
Java
|
UTF-8
|
Java
| false | false | 617 |
java
|
package novi.basics.springbootDemo.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
@ControllerAdvice
public class UserNotFoundAdvice {
@ResponseBody
@ExceptionHandler(UserNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public String userNotFoundHandler(UserNotFoundException ex) {
return ex.getMessage();
}
}
|
[
"[email protected]"
] | |
b0a0d02b67d9d56de204a896fbd505bcd1550f0c
|
50414cf7b7648ed461b5de5c3efd58e0cd2d4b71
|
/spring-hibernate-validation-example/src/main/java/be/g00glen00b/validation/CheckMailValidator.java
|
aaab9e706839c38388aad1f2024f26a0e0b2f145
|
[
"Apache-2.0"
] |
permissive
|
Total-L/spring-examples
|
2dc23876bebffb9023f4574b57b365d69ef57cbc
|
e101af3913836b291ea80defe9c146a78498b63c
|
refs/heads/master
| 2020-04-04T21:45:59.319714 | 2016-09-01T14:23:31 | 2016-09-01T14:23:31 | 66,659,276 | 0 | 0 | null | 2016-08-26T15:37:07 | 2016-08-26T15:37:04 |
Java
|
UTF-8
|
Java
| false | false | 753 |
java
|
package be.g00glen00b.validation;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;
public class CheckMailValidator implements ConstraintValidator<Email, String> {
@Override
public void initialize(Email constraintAnnotation) {
// TODO Auto-generated method stub
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
if (StringUtils.isEmpty(value)) {
return false;
}
try {
new InternetAddress(value, true);
return true;
} catch (AddressException ex) {
return false;
}
}
}
|
[
"[email protected]"
] | |
dae7ddebc1ae9815f20e226aedc05b374dc4d481
|
761a3406a7c4fe7f788cfaf7b35ed64daf01a466
|
/wear/src/main/java/com/rothen/rmetarwear/MyStubBroadcastActivity.java
|
e0acd3abe47fb141bbbe0114b738e6ec5ec9ab74
|
[] |
no_license
|
Rothen68/RMetarWear
|
b92a59c23d797cc2202b2d053578fa47cc0a8058
|
f8921474b39806cb162ff7fa8dcae9e85801e0ab
|
refs/heads/master
| 2021-01-10T18:41:18.483065 | 2015-10-09T13:32:07 | 2015-10-09T13:32:07 | 40,409,644 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 612 |
java
|
package com.rothen.rmetarwear;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
/**
* Example shell activity which simply broadcasts to our receiver and exits.
*/
public class MyStubBroadcastActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent i = new Intent();
i.setAction("com.rothen.rmetarwear.SHOW_NOTIFICATION");
i.putExtra(MyPostNotificationReceiver.CONTENT_KEY, getString(R.string.title));
sendBroadcast(i);
finish();
}
}
|
[
"[email protected]"
] | |
df87e07f69e3ee1014ca00f50da0fdf9de2d1c0c
|
040f1cb6fb373433d3849b189e21b9c244ceea72
|
/Lab_11/LabText/src/CommissionEmployee.java
|
49817df0614658fb74751141e4b4a5bc9bf04078
|
[] |
no_license
|
dreamking60/SUSTech_CS102A
|
148ffd49865e487151333f64fbaeeb2e1573fc7a
|
fb6a274412a5d5b26ff69e0caffb498e9e99eead
|
refs/heads/master
| 2023-05-02T00:04:43.574024 | 2021-05-18T03:24:07 | 2021-05-18T03:24:07 | 368,385,905 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,815 |
java
|
public class CommissionEmployee {
private String firstName;
private String lastName;
private String socialSecurityNumber;
private double grossSales;
private double commissionRate;
public CommissionEmployee(String first, String last, String ssn,
double sales, double rate){
firstName = first;
lastName = last;
socialSecurityNumber = ssn;
setGrossSales(sales);
setCommissionRate(rate);
}
public double earnings(){
return commissionRate*grossSales;
}
public String toString(){
return String.format("%s: %s %s\n%s: %s\n%s: %.2f\n%s: %.2f",
"commission employee", firstName, lastName,
"social security number", socialSecurityNumber,
"gross sales", grossSales,
"commission rate", commissionRate);
}
public void setGrossSales(double sales){
grossSales = (sales < 0.0) ? 0.0 : sales;
}
public void setCommissionRate( double rate ){
commissionRate = (rate > 0.0 && rate < 1.0) ? rate : 0.0;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getSocialSecurityNumber() {
return socialSecurityNumber;
}
public void setSocialSecurityNumber(String socialSecurityNumber) {
this.socialSecurityNumber = socialSecurityNumber;
}
public double getGrossSales() {
return grossSales;
}
public double getCommissionRate() {
return commissionRate;
}
}
|
[
"[email protected]"
] | |
c0130957f8422812a0f589ebd9def770672b94c6
|
3320fb07c7431722cf16caf3c835c61aa75ddc63
|
/SeleniumInterviewQuestions/src/test/java/mypackage/downloadPdfFile30.java
|
8f5d81ee34b04a89765775a6dd108a563a914526
|
[] |
no_license
|
9700222571/FirstRepo
|
c12a91f07d07f232508aaa7642c127e17b13baab
|
a70999b9d77bc083f0bd8ac3b163c0b1d8dae1dc
|
refs/heads/master
| 2023-07-13T15:24:56.620264 | 2021-08-19T18:00:41 | 2021-08-19T18:00:41 | 397,950,354 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 978 |
java
|
package mypackage;
import java.util.HashMap;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import io.github.bonigarcia.wdm.WebDriverManager;
public class downloadPdfFile30 {
public static void main(String[] args) {
String location = System.getProperty("user.dir") + "\\Downloads\\";
// chrome
HashMap preferences = new HashMap();
preferences.put("plugins.always_open_pdf_externally", true);//for pdf only
preferences.put("download.default_directory", location);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", preferences);
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver(options);
driver.get("https://file-examples.com/index.php/sample-documents-download/sample-doc-download/");
driver.findElement(By.xpath("//tbody/tr[1]/td[5]/a[1]")).click();
}
}
|
[
"[email protected]"
] | |
0e62156c091a49782b22c3ef67a83dc977dd556e
|
f40c5613a833bc38fca6676bad8f681200cffb25
|
/kubernetes-model-generator/openshift-model-miscellaneous/src/generated/java/io/fabric8/openshift/api/model/miscellaneous/metal3/v1alpha1/BareMetalHostStatus.java
|
8abce3d7468d5526ee338e0b1e2473de9671c956
|
[
"Apache-2.0"
] |
permissive
|
rohanKanojia/kubernetes-client
|
2d599e4ed1beedf603c79d28f49203fbce1fc8b2
|
502a14c166dce9ec07cf6adb114e9e36053baece
|
refs/heads/master
| 2023-07-25T18:31:33.982683 | 2022-04-12T13:39:06 | 2022-04-13T05:12:38 | 106,398,990 | 2 | 3 |
Apache-2.0
| 2023-04-28T16:21:03 | 2017-10-10T09:50:25 |
Java
|
UTF-8
|
Java
| false | false | 8,414 |
java
|
package io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.fabric8.kubernetes.api.model.Container;
import io.fabric8.kubernetes.api.model.IntOrString;
import io.fabric8.kubernetes.api.model.KubernetesResource;
import io.fabric8.kubernetes.api.model.LabelSelector;
import io.fabric8.kubernetes.api.model.LocalObjectReference;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.api.model.PersistentVolumeClaim;
import io.fabric8.kubernetes.api.model.PodTemplateSpec;
import io.fabric8.kubernetes.api.model.ResourceRequirements;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.BuildableReference;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"apiVersion",
"kind",
"metadata",
"errorCount",
"errorMessage",
"errorType",
"goodCredentials",
"hardware",
"hardwareProfile",
"lastUpdated",
"operationHistory",
"operationalStatus",
"poweredOn",
"provisioning",
"triedCredentials"
})
@ToString
@EqualsAndHashCode
@Setter
@Accessors(prefix = {
"_",
""
})
@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = {
@BuildableReference(ObjectMeta.class),
@BuildableReference(LabelSelector.class),
@BuildableReference(Container.class),
@BuildableReference(PodTemplateSpec.class),
@BuildableReference(ResourceRequirements.class),
@BuildableReference(IntOrString.class),
@BuildableReference(ObjectReference.class),
@BuildableReference(LocalObjectReference.class),
@BuildableReference(PersistentVolumeClaim.class)
})
public class BareMetalHostStatus implements KubernetesResource
{
@JsonProperty("errorCount")
private Integer errorCount;
@JsonProperty("errorMessage")
private java.lang.String errorMessage;
@JsonProperty("errorType")
private java.lang.String errorType;
@JsonProperty("goodCredentials")
private CredentialsStatus goodCredentials;
@JsonProperty("hardware")
private HardwareDetails hardware;
@JsonProperty("hardwareProfile")
private java.lang.String hardwareProfile;
@JsonProperty("lastUpdated")
private String lastUpdated;
@JsonProperty("operationHistory")
private OperationHistory operationHistory;
@JsonProperty("operationalStatus")
private java.lang.String operationalStatus;
@JsonProperty("poweredOn")
private Boolean poweredOn;
@JsonProperty("provisioning")
private ProvisionStatus provisioning;
@JsonProperty("triedCredentials")
private CredentialsStatus triedCredentials;
@JsonIgnore
private Map<java.lang.String, Object> additionalProperties = new HashMap<java.lang.String, Object>();
/**
* No args constructor for use in serialization
*
*/
public BareMetalHostStatus() {
}
/**
*
* @param operationHistory
* @param operationalStatus
* @param lastUpdated
* @param poweredOn
* @param hardwareProfile
* @param errorType
* @param goodCredentials
* @param errorMessage
* @param provisioning
* @param triedCredentials
* @param errorCount
* @param hardware
*/
public BareMetalHostStatus(Integer errorCount, java.lang.String errorMessage, java.lang.String errorType, CredentialsStatus goodCredentials, HardwareDetails hardware, java.lang.String hardwareProfile, String lastUpdated, OperationHistory operationHistory, java.lang.String operationalStatus, Boolean poweredOn, ProvisionStatus provisioning, CredentialsStatus triedCredentials) {
super();
this.errorCount = errorCount;
this.errorMessage = errorMessage;
this.errorType = errorType;
this.goodCredentials = goodCredentials;
this.hardware = hardware;
this.hardwareProfile = hardwareProfile;
this.lastUpdated = lastUpdated;
this.operationHistory = operationHistory;
this.operationalStatus = operationalStatus;
this.poweredOn = poweredOn;
this.provisioning = provisioning;
this.triedCredentials = triedCredentials;
}
@JsonProperty("errorCount")
public Integer getErrorCount() {
return errorCount;
}
@JsonProperty("errorCount")
public void setErrorCount(Integer errorCount) {
this.errorCount = errorCount;
}
@JsonProperty("errorMessage")
public java.lang.String getErrorMessage() {
return errorMessage;
}
@JsonProperty("errorMessage")
public void setErrorMessage(java.lang.String errorMessage) {
this.errorMessage = errorMessage;
}
@JsonProperty("errorType")
public java.lang.String getErrorType() {
return errorType;
}
@JsonProperty("errorType")
public void setErrorType(java.lang.String errorType) {
this.errorType = errorType;
}
@JsonProperty("goodCredentials")
public CredentialsStatus getGoodCredentials() {
return goodCredentials;
}
@JsonProperty("goodCredentials")
public void setGoodCredentials(CredentialsStatus goodCredentials) {
this.goodCredentials = goodCredentials;
}
@JsonProperty("hardware")
public HardwareDetails getHardware() {
return hardware;
}
@JsonProperty("hardware")
public void setHardware(HardwareDetails hardware) {
this.hardware = hardware;
}
@JsonProperty("hardwareProfile")
public java.lang.String getHardwareProfile() {
return hardwareProfile;
}
@JsonProperty("hardwareProfile")
public void setHardwareProfile(java.lang.String hardwareProfile) {
this.hardwareProfile = hardwareProfile;
}
@JsonProperty("lastUpdated")
public String getLastUpdated() {
return lastUpdated;
}
@JsonProperty("lastUpdated")
public void setLastUpdated(String lastUpdated) {
this.lastUpdated = lastUpdated;
}
@JsonProperty("operationHistory")
public OperationHistory getOperationHistory() {
return operationHistory;
}
@JsonProperty("operationHistory")
public void setOperationHistory(OperationHistory operationHistory) {
this.operationHistory = operationHistory;
}
@JsonProperty("operationalStatus")
public java.lang.String getOperationalStatus() {
return operationalStatus;
}
@JsonProperty("operationalStatus")
public void setOperationalStatus(java.lang.String operationalStatus) {
this.operationalStatus = operationalStatus;
}
@JsonProperty("poweredOn")
public Boolean getPoweredOn() {
return poweredOn;
}
@JsonProperty("poweredOn")
public void setPoweredOn(Boolean poweredOn) {
this.poweredOn = poweredOn;
}
@JsonProperty("provisioning")
public ProvisionStatus getProvisioning() {
return provisioning;
}
@JsonProperty("provisioning")
public void setProvisioning(ProvisionStatus provisioning) {
this.provisioning = provisioning;
}
@JsonProperty("triedCredentials")
public CredentialsStatus getTriedCredentials() {
return triedCredentials;
}
@JsonProperty("triedCredentials")
public void setTriedCredentials(CredentialsStatus triedCredentials) {
this.triedCredentials = triedCredentials;
}
@JsonAnyGetter
public Map<java.lang.String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(java.lang.String name, Object value) {
this.additionalProperties.put(name, value);
}
}
|
[
"[email protected]"
] | |
436bfaf15900b96d26930293365d381bf90865ae
|
ddf162bc38e7e857c26569b5c28114c84b6ef4e5
|
/src/main/java/com/github/dockerjava/api/model/AccessMode.java
|
e0106536870724f4cd1c9e7e9577b5d23c3d04d7
|
[
"Apache-2.0"
] |
permissive
|
rancher/docker-java
|
68afde6371a58ceec24f33f283565b3aa2bb89df
|
330dc4575f04868022ac5996997110b3d5260ef9
|
refs/heads/master
| 2023-08-27T20:17:30.057621 | 2014-10-22T23:30:36 | 2014-10-22T23:30:36 | 25,589,793 | 3 | 1 |
Apache-2.0
| 2021-12-17T11:04:13 | 2014-10-22T15:42:42 |
Java
|
UTF-8
|
Java
| false | false | 332 |
java
|
package com.github.dockerjava.api.model;
/**
* The access mode of a file system or file: <code>read-write</code>
* or <code>read-only</code>.
*/
public enum AccessMode {
/** read-write */
rw,
/** read-only */
ro;
/**
* The default {@link AccessMode}: {@link #rw}
*/
public static final AccessMode DEFAULT = rw;
}
|
[
"[email protected]"
] | |
e414583720bbbca5ae93ac88923b0dab4644e73c
|
bb7bfa4971d27496cb5b331cb6c00b4348b1771d
|
/src/main/java/org/springframework/social/dropbox/api/impl/DropboxTemplate.java
|
b04513f606db42553f0bdac1985cad1a0f5c7cff
|
[] |
no_license
|
RestlessThinker/spring-social-dropbox
|
d785baa491bb1be9356706885100f85967e29d0c
|
cdfb633d7d1fbd99e6d8fadf9624f3ed8f55d2a4
|
refs/heads/master
| 2021-01-17T07:28:18.401901 | 2012-09-11T18:40:14 | 2012-09-11T18:40:14 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,740 |
java
|
package org.springframework.social.dropbox.api.impl;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
import org.springframework.social.dropbox.api.*;
import org.springframework.social.oauth1.AbstractOAuth1ApiBinding;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.ResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriTemplate;
import java.io.InputStream;
import java.net.URI;
import java.util.List;
/**
* @author Bryce Fischer
* @author Robert Drysdale
*/
public class DropboxTemplate extends AbstractOAuth1ApiBinding implements Dropbox {
private final String appFolderUrl;
private ObjectMapper objectMapper;
public DropboxTemplate(String appKey, String appSecret, String accessToken, String accessTokenSecret, boolean appFolder) {
super(appKey, appSecret, accessToken, accessTokenSecret);
appFolderUrl = appFolder ? "sandbox" : "dropbox";
registerDropboxJsonModule(getRestTemplate());
}
public DropboxTemplate() {
super();
appFolderUrl = null;
}
public DropboxUserProfile getUserProfile() {
return getRestTemplate().getForObject(ACCOUNT_INFO_URL, DropboxUserProfile.class);
}
public Metadata getItemMetadata(String path) {
return getRestTemplate().getForObject(METADATA_URL, Metadata.class, appFolderUrl, path);
}
public Metadata restore(String path, String rev) {
return getRestTemplate().getForObject(RESTORE_URL + "?rev=" + rev, Metadata.class, appFolderUrl, path);
}
public Metadata copy(String fromPath, String toPath) {
MultiValueMap<String, String> vars = new LinkedMultiValueMap<String, String>();
vars.add("root", appFolderUrl);
vars.add("from_path", fromPath);
vars.add("to_path", toPath);
return getRestTemplate().postForObject(COPY_URL, vars, Metadata.class);
}
public Metadata createFolder(String folder) {
MultiValueMap<String, String> vars = new LinkedMultiValueMap<String, String>();
vars.add("root", appFolderUrl);
vars.add("path", folder);
return getRestTemplate().postForObject(CREATE_FOLDER_URL, vars, Metadata.class);
}
public Metadata delete(String path) {
MultiValueMap<String, String> vars = new LinkedMultiValueMap<String, String>();
vars.add("root", appFolderUrl);
vars.add("path", path);
return getRestTemplate().postForObject(DELETE_URL, vars, Metadata.class);
}
public Metadata move(String fromPath, String toPath) {
MultiValueMap<String, String> vars = new LinkedMultiValueMap<String, String>();
vars.add("root", appFolderUrl);
vars.add("from_path", fromPath);
vars.add("to_path", toPath);
return getRestTemplate().postForObject(MOVE_URL, vars, Metadata.class);
}
public List<Metadata> getRevisions(String path) {
JsonNode node = getRestTemplate().getForObject(REVISIONS_URL, JsonNode.class, appFolderUrl, path);
try {
return objectMapper.readValue(node, new TypeReference<List<Metadata>>() {});
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public List<Metadata> search(String path, String query) {
JsonNode node = getRestTemplate().getForObject(SEARCH_URL + "?query=" + query, JsonNode.class, appFolderUrl, path);
try {
return objectMapper.readValue(node, new TypeReference<List<Metadata>>() {});
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public DropboxFile getThumbnail(String path) {
try {
UriTemplate uriTemplate = new UriTemplate(THUMBNAILS_URL);
URI uri = uriTemplate.expand(appFolderUrl, path);
ClientHttpResponse response = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.GET).execute();
HttpHeaders headers = response.getHeaders();
return new DropboxFile(
headers.getContentType().toString(),
headers.getContentLength(),
response.getBody());
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public DropboxFile getFile(String path) {
try {
UriTemplate uriTemplate = new UriTemplate(FILE_URL);
URI uri = uriTemplate.expand(appFolderUrl, path);
ClientHttpResponse response = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.GET).execute();
HttpHeaders headers = response.getHeaders();
return new DropboxFile(
headers.getContentType().toString(),
headers.getContentLength(),
response.getBody());
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public FileUrl getMedia(String path) {
return getRestTemplate().getForObject(MEDIA_URL, FileUrl.class, appFolderUrl, path);
}
public FileUrl getShare(String path) {
return getRestTemplate().getForObject(SHARES_URL, FileUrl.class, appFolderUrl, path);
}
public Metadata putFile(String path, byte[] file) {
UriTemplate uriTemplate = new UriTemplate(FILE_PUT_URL);
URI uri = uriTemplate.expand(appFolderUrl, path);
try {
ClientHttpRequest request = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.PUT);
request.getBody().write(file);
ClientHttpResponse response = request.execute();
ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
if (errorHandler.hasError(response)) {
errorHandler.handleError(response);
return null;
}
else {
InputStream stream = response.getBody();
return objectMapper.readValue(stream, Metadata.class);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
private void registerDropboxJsonModule(RestTemplate restTemplate) {
List<HttpMessageConverter<?>> converters = restTemplate.getMessageConverters();
for (HttpMessageConverter<?> converter : converters) {
if (converter instanceof MappingJacksonHttpMessageConverter) {
MappingJacksonHttpMessageConverter jsonConverter = (MappingJacksonHttpMessageConverter) converter;
objectMapper = new ObjectMapper();
objectMapper.registerModule(new DropboxModule());
jsonConverter.setObjectMapper(objectMapper);
}
}
}
public static final String BASE_URL = "https://api.dropbox.com/1/";
public static final String BASE_CONTENT_URL = "https://api-content.dropbox.com/1/";
public static final String ACCOUNT_INFO_URL = BASE_URL + "account/info";
public static final String COPY_URL = BASE_URL + "fileops/copy";
public static final String CREATE_FOLDER_URL = BASE_URL + "fileops/create_folder";
public static final String DELETE_URL = BASE_URL + "fileops/delete";
public static final String FILE_URL = BASE_CONTENT_URL + "files/{appFolderUrl}/{path}";
public static final String FILE_POST_URL = BASE_CONTENT_URL + "files/{appFolderUrl}/{path}";
public static final String FILE_PUT_URL = BASE_CONTENT_URL + "files_put/{appFolderUrl}/{path}";
public static final String MEDIA_URL = BASE_URL + "media/{appFolderUrl}/{path}";
public static final String METADATA_URL = BASE_URL + "metadata/{appFolderUrl}/{path}";
public static final String MOVE_URL = BASE_URL + "fileops/move";
public static final String RESTORE_URL = BASE_URL + "restore/{appFolderUrl}/{path}";
public static final String REVISIONS_URL = BASE_URL + "revisions/{appFolderUrl}/{path}";
public static final String SEARCH_URL = BASE_URL + "search/{appFolderUrl}/{path}";
public static final String SHARES_URL = BASE_URL + "shares/{appFolderUrl}/{path}";
public static final String THUMBNAILS_URL = BASE_CONTENT_URL + "thumbnails/{appFolderUrl}/{path}";
}
|
[
"[email protected]"
] | |
fd81e1d98c3d9c03b12c602933beb1c92355d884
|
f96e56efd69cf536516723735336b3de3a21d31b
|
/shanghai/SJHG/src/com/tydic/digitalcustom/entity/Constant.java
|
560695bf3e9bcf141af68d02c1c43dbd00aef1b5
|
[] |
no_license
|
superman1982/android_demo
|
c94efe19ad1aec110528acf8ad8cc67e6027c121
|
558691665530f451f51f1ba17f14f55abf9cd873
|
refs/heads/master
| 2021-01-18T20:06:11.569432 | 2015-07-26T14:42:07 | 2015-07-26T14:42:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,097 |
java
|
package com.tydic.digitalcustom.entity;
/**
* 所有的有意义的数字都写在这个类来。<br>
* p.s. 写这个的时候,累死我了。O__O"…
*
*/
public class Constant {
public static final int LOGINVIEW = 0;
public static final int TAB_YWL = 10000;
public static final int MENU_YWL = 100;
public static final int CHILD1 = 1;
public static final int THING1 = 40001;
public static final int TAB1MENU1CHILD1 = TAB_YWL + MENU_YWL + CHILD1;
public static final int TAB1MENU1CHILD1THING1 = TAB_YWL+ MENU_YWL + CHILD1
+ THING1;
public static final String[] pinyin = { "a", "ai", "an", "ang", "ao", "ba",
"bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian",
"biao", "bie", "bin", "bing", "bo", "bu", "ca", "cai", "can",
"cang", "cao", "ce", "ceng", "cha", "chai", "chan", "chang",
"chao", "che", "chen", "cheng", "chi", "chong", "chou", "chu",
"chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci", "cong",
"cou", "cu", "cuan", "cui", "cun", "cuo", "da", "dai", "dan",
"dang", "dao", "de", "deng", "di", "dian", "diao", "die", "ding",
"diu", "dong", "dou", "du", "duan", "dui", "dun", "duo", "e", "en",
"er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu",
"ga", "gai", "gan", "gang", "gao", "ge", "gei", "gen", "geng",
"gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun",
"guo", "ha", "hai", "han", "hang", "hao", "he", "hei", "hen",
"heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang", "hui",
"hun", "huo", "ji", "jia", "jian", "jiang", "jiao", "jie", "jin",
"jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka", "kai",
"kan", "kang", "kao", "ke", "ken", "keng", "kong", "kou", "ku",
"kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la", "lai",
"lan", "lang", "lao", "le", "lei", "leng", "li", "lia", "lian",
"liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu",
"lv", "luan", "lue", "lun", "luo", "ma", "mai", "man", "mang",
"mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie",
"min", "ming", "miu", "mo", "mou", "mu", "na", "nai", "nan",
"nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang",
"niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan",
"nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei",
"pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po",
"pu", "qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing",
"qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao",
"re", "ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui",
"run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen",
"seng", "sha", "shai", "shan", "shang", "shao", "she", "shen",
"sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang",
"shui", "shun", "shuo", "si", "song", "sou", "su", "suan", "sui",
"sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng",
"ti", "tian", "tiao", "tie", "ting", "tong", "tou", "tu", "tuan",
"tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen",
"weng", "wo", "wu", "xi", "xia", "xian", "xiang", "xiao", "xie",
"xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya",
"yan", "yang", "yao", "ye", "yi", "yin", "ying", "yo", "yong",
"you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang",
"zao", "ze", "zei", "zen", "zeng", "zha", "zhai", "zhan", "zhang",
"zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu",
"zhua", "zhuai", "zhuan", "zhuang", "zhui", "zhun", "zhuo", "zi",
"zong", "zou", "zu", "zuan", "zui", "zun", "zuo" };
public static final int WEBSERVICE_OVER = 0x0001;
public static final int CONNECT_FAIL = 0x0002;
public static final int VPN_INIT_FAIL = 0x0003;
public static final int VPN_CONNECT_FAIL = 0x0004;
public static final int DATE_FROM = 0;// 设置起始时间dialog编号
public static final int DATE_TO = 1;// 设置结束时间dialog编号
public static final int CUSTOM_CYRB = 2;// 设置结束时间dialog编号
public static final int CUSTOM_TGWZH = 3;// 设置结束时间dialog编号
public static final int CUSTOM_SEARCH = 4;// 对话框查询
public static final int ZOOM_IN = 0x0003;// 放大
public static final int ZOOM_OUT = 0x0004;// 缩小
public static final int CHART = 0x0010;// 图表
public static final int SHEET_IN = 0x0011;// 列表放大
public static final int SHEET_OUT= 0x0012;//列表缩小
public static final int VPN= 0x0013;//vpn接入方式
public static final int PC= 0x0014;//本地服务接入方式
public static final String IP_81 = "http://10.62.1.81:8090/";
//public static final String IP_BAIPC = "http://192.168.0.155:8080/";
public static final String IP_BAIPC = "http://192.168.0.103:8080/";
//菜单项
public static final String ywl_zswg_lazs="23033589-AE7D-4FC8-A4AE-30B8E4444A5B";//立案走私行为案件总数
public static final String ywl_zswg_jckhwzl="40DBE7A1-FC07-490C-97A0-A545C8C33DD3";//进出口货物重量
public static final String zxgz_tgwzh_qgqrbb="271A6503-88E2-4F26-8931-AFFEBBFEDCE1";//全关区日报表
}
|
[
"[email protected]"
] | |
2bb238152a7ce3524c45048fca0dd213b7536311
|
72f750e4a5deb0a717245abd26699bd7ce06777f
|
/ehealth/.svn/pristine/cb/cbfa5df93435b1ac4d1d6cad53a5f3e2b1b88845.svn-base
|
1da79e61c500f7eb809142e138150cb230052484
|
[] |
no_license
|
vadhwa11/newproject3eh
|
1d68525a2dfbd7acb1a87f9d60f150cef4f12868
|
b28c7892e8b0c3f201abb3a730b21e75d9583ddf
|
refs/heads/master
| 2020-05-15T23:20:17.716904 | 2019-04-21T12:14:46 | 2019-04-21T12:14:46 | 182,526,354 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,681 |
package jkt.hrms.masters.business.base;
import java.io.Serializable;
/**
* This is an object that contains data related to the mstr_vendor table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="mstr_vendor"
*/
public abstract class BaseMstrVendor implements Serializable {
public static String REF = "MstrVendor";
public static String PROP_VENDOR_ADDRESS = "VendorAddress";
public static String PROP_COMMENTS = "Comments";
public static String PROP_VENDOR_CONTACT_NO = "VendorContactNo";
public static String PROP_VENDOR_PAN_NO = "VendorPanNo";
public static String PROP_BANK = "Bank";
public static String PROP_LAST_CHG_BY = "LastChgBy";
public static String PROP_VENDOR_CODE = "VendorCode";
public static String PROP_VENDOR_ACC_NO = "VendorAccNo";
public static String PROP_PEREVIOUS_ASSOCIATE = "PereviousAssociate";
public static String PROP_VENDOR_SERVICE = "VendorService";
public static String PROP_VENDOR_CUST_SERV_NO = "VendorCustServNo";
public static String PROP_STATUS = "Status";
public static String PROP_VENDOR_NAME = "VendorName";
public static String PROP_LAST_CHG_DATE = "LastChgDate";
public static String PROP_RATING = "Rating";
public static String PROP_VENDOR_BRANCH = "VendorBranch";
public static String PROP_VENDOR_EMAIL_ID = "VendorEmailId";
public static String PROP_VENDOR_WEB_SITE = "VendorWebSite";
public static String PROP_ID = "Id";
public static String PROP_COMPANY = "Company";
public static String PROP_LAST_CHG_TIME = "LastChgTime";
public static String PROP_VENDOR_FAX_NO = "VendorFaxNo";
// constructors
public BaseMstrVendor () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseMstrVendor (java.lang.Integer id) {
this.setId(id);
initialize();
}
protected void initialize () {}
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.Integer id;
// fields
private java.lang.String vendorName;
private java.lang.String vendorAddress;
private java.lang.String vendorContactNo;
private java.lang.String vendorFaxNo;
private java.lang.String vendorEmailId;
private java.lang.String vendorWebSite;
private java.lang.String vendorCustServNo;
private java.lang.String vendorPanNo;
private java.lang.String vendorBranch;
private java.lang.String vendorAccNo;
private java.lang.String pereviousAssociate;
private java.lang.String comments;
private java.lang.String status;
private java.lang.String vendorCode;
private java.lang.String lastChgBy;
private java.util.Date lastChgDate;
private java.lang.String lastChgTime;
// many to one
private jkt.hms.masters.business.MasBankMaster bank;
private jkt.hms.masters.business.MasHospital company;
private jkt.hrms.masters.business.VendorServiceType vendorService;
private jkt.hrms.masters.business.MstrRating rating;
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="native"
* column="vendor_id"
*/
public java.lang.Integer getId () {
return id;
}
/**
* Set the unique identifier of this class
* @param id the new ID
*/
public void setId (java.lang.Integer id) {
this.id = id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: vendor_name
*/
public java.lang.String getVendorName () {
return vendorName;
}
/**
* Set the value related to the column: vendor_name
* @param vendorName the vendor_name value
*/
public void setVendorName (java.lang.String vendorName) {
this.vendorName = vendorName;
}
/**
* Return the value associated with the column: vendor_address
*/
public java.lang.String getVendorAddress () {
return vendorAddress;
}
/**
* Set the value related to the column: vendor_address
* @param vendorAddress the vendor_address value
*/
public void setVendorAddress (java.lang.String vendorAddress) {
this.vendorAddress = vendorAddress;
}
/**
* Return the value associated with the column: vendor_contact_no
*/
public java.lang.String getVendorContactNo () {
return vendorContactNo;
}
/**
* Set the value related to the column: vendor_contact_no
* @param vendorContactNo the vendor_contact_no value
*/
public void setVendorContactNo (java.lang.String vendorContactNo) {
this.vendorContactNo = vendorContactNo;
}
/**
* Return the value associated with the column: vendor_fax_no
*/
public java.lang.String getVendorFaxNo () {
return vendorFaxNo;
}
/**
* Set the value related to the column: vendor_fax_no
* @param vendorFaxNo the vendor_fax_no value
*/
public void setVendorFaxNo (java.lang.String vendorFaxNo) {
this.vendorFaxNo = vendorFaxNo;
}
/**
* Return the value associated with the column: vendor_email_id
*/
public java.lang.String getVendorEmailId () {
return vendorEmailId;
}
/**
* Set the value related to the column: vendor_email_id
* @param vendorEmailId the vendor_email_id value
*/
public void setVendorEmailId (java.lang.String vendorEmailId) {
this.vendorEmailId = vendorEmailId;
}
/**
* Return the value associated with the column: vendor_web_site
*/
public java.lang.String getVendorWebSite () {
return vendorWebSite;
}
/**
* Set the value related to the column: vendor_web_site
* @param vendorWebSite the vendor_web_site value
*/
public void setVendorWebSite (java.lang.String vendorWebSite) {
this.vendorWebSite = vendorWebSite;
}
/**
* Return the value associated with the column: vendor_cust_serv_no
*/
public java.lang.String getVendorCustServNo () {
return vendorCustServNo;
}
/**
* Set the value related to the column: vendor_cust_serv_no
* @param vendorCustServNo the vendor_cust_serv_no value
*/
public void setVendorCustServNo (java.lang.String vendorCustServNo) {
this.vendorCustServNo = vendorCustServNo;
}
/**
* Return the value associated with the column: vendor_pan_no
*/
public java.lang.String getVendorPanNo () {
return vendorPanNo;
}
/**
* Set the value related to the column: vendor_pan_no
* @param vendorPanNo the vendor_pan_no value
*/
public void setVendorPanNo (java.lang.String vendorPanNo) {
this.vendorPanNo = vendorPanNo;
}
/**
* Return the value associated with the column: vendor_branch
*/
public java.lang.String getVendorBranch () {
return vendorBranch;
}
/**
* Set the value related to the column: vendor_branch
* @param vendorBranch the vendor_branch value
*/
public void setVendorBranch (java.lang.String vendorBranch) {
this.vendorBranch = vendorBranch;
}
/**
* Return the value associated with the column: vendor_acc_no
*/
public java.lang.String getVendorAccNo () {
return vendorAccNo;
}
/**
* Set the value related to the column: vendor_acc_no
* @param vendorAccNo the vendor_acc_no value
*/
public void setVendorAccNo (java.lang.String vendorAccNo) {
this.vendorAccNo = vendorAccNo;
}
/**
* Return the value associated with the column: perevious_associate
*/
public java.lang.String getPereviousAssociate () {
return pereviousAssociate;
}
/**
* Set the value related to the column: perevious_associate
* @param pereviousAssociate the perevious_associate value
*/
public void setPereviousAssociate (java.lang.String pereviousAssociate) {
this.pereviousAssociate = pereviousAssociate;
}
/**
* Return the value associated with the column: comments
*/
public java.lang.String getComments () {
return comments;
}
/**
* Set the value related to the column: comments
* @param comments the comments value
*/
public void setComments (java.lang.String comments) {
this.comments = comments;
}
/**
* Return the value associated with the column: status
*/
public java.lang.String getStatus () {
return status;
}
/**
* Set the value related to the column: status
* @param status the status value
*/
public void setStatus (java.lang.String status) {
this.status = status;
}
/**
* Return the value associated with the column: vendor_code
*/
public java.lang.String getVendorCode () {
return vendorCode;
}
/**
* Set the value related to the column: vendor_code
* @param vendorCode the vendor_code value
*/
public void setVendorCode (java.lang.String vendorCode) {
this.vendorCode = vendorCode;
}
/**
* Return the value associated with the column: last_chg_by
*/
public java.lang.String getLastChgBy () {
return lastChgBy;
}
/**
* Set the value related to the column: last_chg_by
* @param lastChgBy the last_chg_by value
*/
public void setLastChgBy (java.lang.String lastChgBy) {
this.lastChgBy = lastChgBy;
}
/**
* Return the value associated with the column: last_chg_date
*/
public java.util.Date getLastChgDate () {
return lastChgDate;
}
/**
* Set the value related to the column: last_chg_date
* @param lastChgDate the last_chg_date value
*/
public void setLastChgDate (java.util.Date lastChgDate) {
this.lastChgDate = lastChgDate;
}
/**
* Return the value associated with the column: last_chg_time
*/
public java.lang.String getLastChgTime () {
return lastChgTime;
}
/**
* Set the value related to the column: last_chg_time
* @param lastChgTime the last_chg_time value
*/
public void setLastChgTime (java.lang.String lastChgTime) {
this.lastChgTime = lastChgTime;
}
/**
* Return the value associated with the column: bank_id
*/
public jkt.hms.masters.business.MasBankMaster getBank () {
return bank;
}
/**
* Set the value related to the column: bank_id
* @param bank the bank_id value
*/
public void setBank (jkt.hms.masters.business.MasBankMaster bank) {
this.bank = bank;
}
/**
* Return the value associated with the column: company_id
*/
public jkt.hms.masters.business.MasHospital getCompany () {
return company;
}
/**
* Set the value related to the column: company_id
* @param company the company_id value
*/
public void setCompany (jkt.hms.masters.business.MasHospital company) {
this.company = company;
}
/**
* Return the value associated with the column: vendor_service_id
*/
public jkt.hrms.masters.business.VendorServiceType getVendorService () {
return vendorService;
}
/**
* Set the value related to the column: vendor_service_id
* @param vendorService the vendor_service_id value
*/
public void setVendorService (jkt.hrms.masters.business.VendorServiceType vendorService) {
this.vendorService = vendorService;
}
/**
* Return the value associated with the column: rating_id
*/
public jkt.hrms.masters.business.MstrRating getRating () {
return rating;
}
/**
* Set the value related to the column: rating_id
* @param rating the rating_id value
*/
public void setRating (jkt.hrms.masters.business.MstrRating rating) {
this.rating = rating;
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof jkt.hrms.masters.business.MstrVendor)) return false;
else {
jkt.hrms.masters.business.MstrVendor mstrVendor = (jkt.hrms.masters.business.MstrVendor) obj;
if (null == this.getId() || null == mstrVendor.getId()) return false;
else return (this.getId().equals(mstrVendor.getId()));
}
}
public int hashCode () {
if (Integer.MIN_VALUE == this.hashCode) {
if (null == this.getId()) return super.hashCode();
else {
String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
this.hashCode = hashStr.hashCode();
}
}
return this.hashCode;
}
public String toString () {
return super.toString();
}
}
|
[
"[email protected]"
] | ||
a51e3323c1d2cc58470998c6c5ad468e2cc602ad
|
52c4b566dc513c5026fc1b9770889a276c89f27c
|
/Java_May_5/src/this_1.java
|
6a172cc28ccc06ec9c40383575ee0b141c9cd88f
|
[] |
no_license
|
ishmeet1995/Java-Programs
|
ee80677845193782f27128c243d7a91acb90ef9a
|
3578946ec37482d013349b32aec7c4cd8ce7a732
|
refs/heads/master
| 2021-01-25T14:03:40.609856 | 2019-04-15T10:23:28 | 2019-04-15T10:23:28 | 123,643,646 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 471 |
java
|
class test{
private int height = 1;
private int width = 2;
private int depth = 3;
void set(int height,int width,int depth) {
this.height = 10;
this.width = 20;
this.depth = 30;
System.out.println(this); // Printing Object's key
}
public void print() {
System.out.println(height*width*depth);
}
}
public class this_1 {
public static void main(String args[]) {
test obj1 = new test();
obj1.set(10, 20, 30);
obj1.print();
}
}
|
[
"[email protected]"
] | |
46b14e110759869d45271f83e6ce859de6895f6b
|
3a7de7adbffc3b1587ec020b4ea538632815e0fa
|
/ja_8/about_static.java
|
d8a028660916ac1845bdd6be7f760aae2b9651de
|
[] |
no_license
|
sakku-14/java_from_c
|
87937577bf8e7bf2055093c8aa4c77b07216ec75
|
5cf30fecc43177aff04bde1c18e49551f29877d8
|
refs/heads/main
| 2023-08-02T23:00:18.720915 | 2021-09-16T00:21:34 | 2021-09-16T00:21:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 516 |
java
|
public class about_static {
public static void func() {
System.out.println("C-lang style func");
}
public static void main(String args[]) {
NoStaticClass nsc = new NoStaticClass();
nsc.a = 10;
nsc.print();
StaticClass.a = 20;
StaticClass.print();
func();
}
}
class StaticClass{
static int a;
public static void print() {
System.out.println("printメソッド実行" + a);
}
}
class NoStaticClass{
int a;
public void print() {
System.out.println("printメソッド実行" + a);
}
}
|
[
"[email protected]"
] | |
aa9b7cdb3a2dd94d2765c23018f7ced5089ce5b5
|
387cb629c01b476f759dcb712e56a4fd8b249149
|
/plugins/org.vclipse.vcml.ui.actions/src/org/vclipse/bapi/actions/handler/BAPIActionUtils.java
|
517f1c65001e68224e2c52a946d7f3921a8e1faa
|
[] |
no_license
|
webXcerpt/VClipse
|
a9698814e8790de05978896c2b72164fd12457fb
|
50af32db9eecf880ddcbdd83c36648fcb0d3c20c
|
refs/heads/master
| 2020-12-31T00:17:36.069183 | 2016-02-10T14:26:36 | 2016-02-10T14:26:36 | 32,734,621 | 8 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,823 |
java
|
/*******************************************************************************
* Copyright (c) 2010 - 2013 webXcerpt Software GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* webXcerpt Software GmbH - initial creator
* www.webxcerpt.com
******************************************************************************/
package org.vclipse.bapi.actions.handler;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.xtext.resource.EObjectAtOffsetHelper;
import org.eclipse.xtext.resource.XtextResource;
import org.vclipse.vcml.vcml.VCObject;
public class BAPIActionUtils {
public static VCObject getVCObject(EObjectAtOffsetHelper offsetHelper, ITextSelection textSelection, XtextResource resource) {
int offset = textSelection.getOffset();
EObject elementAt = offsetHelper.resolveContainedElementAt(resource, offset);
if(elementAt == null) {
elementAt = offsetHelper.resolveElementAt(resource, offset);
}
if(elementAt instanceof VCObject) {
return (VCObject)elementAt;
}
return null;
}
public static Class<?> getInstanceType(Object object) throws ClassNotFoundException {
return Class.forName(getInstanceTypeName(object));
}
public static String getInstanceTypeName(Object object) {
if(object instanceof EObject) {
return ((EObject)object).eClass().getInstanceTypeName();
} else {
Class<?>[] interfaces = object.getClass().getInterfaces();
if(interfaces.length > 0) {
return interfaces[0].getName();
}
}
return "";
}
}
|
[
"[email protected]"
] | |
8251b37887a350c89bd91a5784f7e42fdf34e761
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/17/17_0fd6223a68b51e3d5b83894a6a2ab16855ab233f/AgentIndexRunner/17_0fd6223a68b51e3d5b83894a6a2ab16855ab233f_AgentIndexRunner_s.java
|
6853b206f65b6438ff3359b1184278bae97bccfd
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null |
UTF-8
|
Java
| false | false | 14,392 |
java
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
package org.opensolaris.opengrok.management;
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.management.ListenerNotFoundException;
import javax.management.MBeanNotificationInfo;
import javax.management.MBeanRegistration;
import javax.management.MBeanServer;
import javax.management.Notification;
import javax.management.NotificationEmitter;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
import javax.management.ObjectName;
import org.opensolaris.opengrok.configuration.RuntimeEnvironment;
import org.opensolaris.opengrok.history.HistoryGuru;
import org.opensolaris.opengrok.index.IndexChangedListener;
import org.opensolaris.opengrok.index.Indexer;
/**
* AgentIndexRunner.
* @author Jan S Berg
*/
public final class AgentIndexRunner implements AgentIndexRunnerMBean, NotificationListener,
MBeanRegistration, Runnable, IndexChangedListener, NotificationEmitter {
private transient static AgentIndexRunner indexerInstance = null;
private final static String NOTIFICATIONACTIONTYPE = "ogaaction";
private final static String NOTIFICATIONEXCEPTIONTYPE = "ogaexception";
private final static String NOTIFICATIONINFOSTRINGTYPE = "ogainfostring";
private final static String NOTIFICATIONINFOLONGTYPE = "ogainfolong";
private boolean enabled;
private transient Thread indexThread = null;
private final static Logger log = Logger.getLogger("org.opensolaris.opengrok");
private final Management jagmgt;
private RuntimeEnvironment env = null;
private long lastIndexStart = 0;
private long lastIndexFinish = 0;
private long lastIndexUsedTime = 0;
private Exception lastException = null;
private final Set<NotificationHolder> notifListeners =
new HashSet<NotificationHolder>();
private static long sequenceNo = 0;
private final StringBuilder notifications = new StringBuilder();
private final static int MAXMESSAGELENGTH = 50000;
/**
* The only constructor is private, so other classes will only get an
* instance through the static factory method getInstance().
*/
private AgentIndexRunner(boolean enabledParam) {
enabled = enabledParam;
jagmgt = Management.getInstance();
}
/**
* Static factory method to get an instance of AgentIndexRunner.
* @param enabledParam if true, the initial instance of the purgatory will
* have purging enabled.
*/
public static synchronized AgentIndexRunner getInstance(boolean enabledParam) {
if (indexerInstance == null) {
indexerInstance = new AgentIndexRunner(enabledParam);
}
return indexerInstance;
}
public ObjectName preRegister(MBeanServer serverParam, ObjectName name) {
return name;
}
public void postRegister(Boolean registrationDone) {
// not used
}
public void preDeregister() {
// not used
}
public void postDeregister() {
// not used
}
public void run() {
try {
//Indexer ind = new Indexer();
log.info("Running...");
lastIndexStart = System.currentTimeMillis();
lastException = null;
doNotify(NOTIFICATIONINFOLONGTYPE, "StartIndexing", Long.valueOf(lastIndexStart));
String configfile = Management.getInstance().getConfigurationFile();
if (configfile == null) {
doNotify(NOTIFICATIONEXCEPTIONTYPE, "Missing Configuration file", "");
}
File cfgFile = new File(configfile);
if (cfgFile.exists()) {
env = RuntimeEnvironment.getInstance();
log.info("Running indexer with configuration " + configfile);
env.readConfiguration(cfgFile);
Indexer index = Indexer.getInstance();
int noThreads = Management.getInstance().getNumberOfThreads().intValue();
boolean update = Management.getInstance().getUpdateIndexDatabase().booleanValue();
String[] sublist = Management.getInstance().getSubFiles();
log.info("Update source repositories");
HistoryGuru.getInstance().updateRepositories();
List<String> subFiles = Arrays.asList(sublist);
log.info("Starting index, update " + update + " noThreads " + noThreads + " subfiles " + subFiles.size());
index.doIndexerExecution(update, noThreads, subFiles, this);
log.info("Finished indexing");
lastIndexFinish = System.currentTimeMillis();
sendNotifications();
doNotify(NOTIFICATIONINFOLONGTYPE, "FinishedIndexing", Long.valueOf(lastIndexFinish));
lastIndexUsedTime = lastIndexFinish - lastIndexStart;
String publishhost = Management.getInstance().getPublishServerURL();
if (publishhost == null) {
log.warning("No publishhost given, not sending updates");
} else {
index.sendToConfigHost(env, publishhost);
doNotify(NOTIFICATIONINFOSTRINGTYPE, "Published index", publishhost);
}
} else {
log.warning("Cannot Run indexing without proper configuration file " + configfile);
doNotify(NOTIFICATIONEXCEPTIONTYPE, "Configuration file not valid", configfile);
}
} catch (Exception e) {
log.log(Level.SEVERE,
"Exception running indexing ", e);
lastException = e;
}
}
/**
* Disables indexer
*/
public void disable() {
enabled = false;
}
/**
* Enables the indexer
*/
public void enable() {
enabled = true;
}
/**
* Handle timer notifications to the purgatory.
* Will start the purger if it is enabled and return immediately.
*/
public void handleNotification(Notification n, Object hb) {
if (n.getType().equals("timer.notification")) {
log.finer("Received timer notification");
if (!enabled) {
log.info("Indexing is disabled, doing nothing");
} else {
index(false);
}
} else {
log.warning("Received unknown notification type: " + n.getType());
}
}
/**
* The index method starts a thread that will
* start indexing part of the opengrok agent.
* @param waitForFinished if false the command returns immediately, if true
* it will return when the indexing is done.
*/
public void index(boolean waitForFinished) {
log.info("Starting indexing.");
/*
* Synchronize here to make sure that you never get more than one
* indexing thread trying to start at the same time.
*/
synchronized (this) {
if (indexThread != null) {
if (indexThread.isAlive()) {
log.warning("Previous indexer is still alive, will not start another.");
return;
} else {
log.fine("Previous indexer is no longer alive, starting a new one.");
}
}
indexThread = new Thread(this);
try {
indexThread.start();
if (!waitForFinished) {
return;
}
log.fine("Waiting for indexer to finish...");
indexThread.join();
log.fine("indexer finished.");
} catch (Exception e) {
log.log(Level.SEVERE,
"Caught Exception while waiting for indexing to finish.", e);
}
return;
}
}
public void fileAdded(String path, String analyzer) {
log.info("Added " + path + " analyzer " + analyzer);
addFileAction("A:", path);
}
public void fileRemoved(String path) {
log.info("File removed " + path);
addFileAction("R:", path);
}
public void fileUpdated(String path) {
log.info("File updated " + path);
addFileAction("U:", path);
}
private void addFileAction(String type, String path) {
notifications.append('\n');
notifications.append(type);
notifications.append(path);
if (notifications.length() > MAXMESSAGELENGTH) {
sendNotifications();
}
}
private void sendNotifications() {
if (notifications.length() > 0) {
doNotify(NOTIFICATIONACTIONTYPE, "FilesInfo", notifications.toString());
notifications.delete(0, notifications.length());
}
}
public long lastIndexTimeFinished() {
return lastIndexFinish;
}
public long lastIndexTimeStarted() {
return lastIndexStart;
}
public long lastIndexTimeUsed() {
return lastIndexUsedTime;
}
public Exception getExceptions() {
return lastException;
}
public void addNotificationListener(NotificationListener notiflistener, NotificationFilter notfilt, Object obj) throws IllegalArgumentException {
log.info("Adds a notiflistner, with obj " + obj.toString());
if (notiflistener == null) {
throw new IllegalArgumentException("Must have legal NotificationListener");
}
synchronized (notifListeners) {
notifListeners.add(new NotificationHolder(notiflistener, notfilt, obj));
}
}
public void removeNotificationListener(NotificationListener notiflistener) throws ListenerNotFoundException {
log.info("removes a notiflistener, no obj");
boolean removed = false;
synchronized (notifListeners) {
Iterator it = notifListeners.iterator();
while (it.hasNext()) {
NotificationHolder mnf = (NotificationHolder) it.next();
if (mnf.getNL().equals(notiflistener)) {
it.remove();
removed = true;
}
}
}
if (!removed) {
throw new ListenerNotFoundException("Didn't remove the given NotificationListener");
}
}
public void removeNotificationListener(NotificationListener notiflistener, NotificationFilter filt, Object obj) throws ListenerNotFoundException {
log.info("removes a notiflistener obj " + obj);
boolean removed = false;
synchronized (notifListeners) {
Iterator it = notifListeners.iterator();
while (it.hasNext()) {
NotificationHolder mnf = (NotificationHolder) it.next();
if (mnf.getNL().equals(notiflistener)
&& ((mnf.getFilter() == null) || mnf.getFilter().equals(filt))
&& ((mnf.getFilter() == null) || mnf.getObj().equals(obj))) {
it.remove();
removed = true;
}
}
}
if (!removed) {
throw new ListenerNotFoundException("Didn't remove the given NotificationListener");
}
}
/**
* Method that the subclass can override, but doesn't have to
* @return MBeanNotificationInfo array of notification (and types) this class can emitt.
*/
public MBeanNotificationInfo[] getNotificationInfo() {
MBeanNotificationInfo[] info = new MBeanNotificationInfo[1];
String[] supptypes = {NOTIFICATIONACTIONTYPE, NOTIFICATIONINFOLONGTYPE, NOTIFICATIONINFOSTRINGTYPE};
String name = "AgentIndexRunner";
String descr = "OpenGrok Indexer Notifications";
MBeanNotificationInfo minfo = new MBeanNotificationInfo(supptypes, name,
descr);
info[0] = minfo;
return info;
}
private void doNotify(String type, String msg, Object userdata) {
try {
log.info("start notifying " + notifListeners.size() + " listeners");
long ts = System.currentTimeMillis();
sequenceNo++;
Notification notif = new Notification(type, this, sequenceNo, ts, msg);
notif.setUserData(userdata);
synchronized (notifListeners) {
for (NotificationHolder nl : notifListeners) {
log.fine("having one with obj " + nl.getObj());
try {
if ((nl.getFilter() == null) ||
nl.getFilter().isNotificationEnabled(notif)) {
nl.getNL().handleNotification(notif, nl.getObj());
}
} catch (Exception exnot) {
log.log(Level.INFO, "Ex " + exnot, exnot);
}
}
}
} catch (Exception ex) {
log.log(Level.SEVERE,
"Exception during notification sending: " + ex.getMessage(),
ex);
}
}
}
|
[
"[email protected]"
] | |
9accbdf7d1a6281a4d4b1f5f5cbbe87cb39aa437
|
e6dcafa847a87cace59076555c92aca8ffe3723b
|
/src/main/java/com/currency/currencycatalog/controller/CurrencyController.java
|
0079a485fa8542473033c802e19489199492bbaf
|
[] |
no_license
|
Khaoulaa/currency-catalog
|
c5c2f1b3cd10e960107945a851f72b6ced195f88
|
426d4692c3ab881ed8a244e93199fe1cdb72c757
|
refs/heads/master
| 2023-01-07T14:39:15.415861 | 2019-08-19T10:48:59 | 2019-08-19T10:48:59 | 203,145,868 | 0 | 0 | null | 2023-01-05T21:55:35 | 2019-08-19T09:54:57 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,841 |
java
|
package com.currency.currencycatalog.controller;
import com.currency.currencycatalog.entity.Currency;
import com.currency.currencycatalog.model.Criteria;
import com.currency.currencycatalog.services.dto.CurrencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@Slf4j
@CrossOrigin(origins = "*", allowedHeaders = "*")
public class CurrencyController {
@Autowired
CurrencyService currencyService;
@PostMapping("/currencies/{pageSize}")
public ResponseEntity<?> getAllCurrencies(@RequestBody Criteria criteria,
@PathVariable("pageSize") int pageSize) throws IOException {
List<Currency> ppl2 = currencyService.generateListInitial();
if(criteria.getField() != null && criteria.getText() != null) {
return new ResponseEntity<>(currencyService.paginationList(currencyService.generateResultCurrencies(criteria, ppl2), pageSize), HttpStatus.OK);
} else {
return new ResponseEntity<>(currencyService.paginationList(ppl2, pageSize), HttpStatus.OK);
}
}
@GetMapping("/currency/{id}")
public ResponseEntity<?> getCurrencyById( @PathVariable("id") String id) throws IOException {
List<Currency> ppl2 = currencyService.generateListInitial();
Currency result = Collections.unmodifiableList(ppl2.stream() // convert list to stream
.filter(line -> line.getId().equals(id)).collect(Collectors.toList())).get(0);
return new ResponseEntity<>(result, HttpStatus.OK);
}
}
|
[
"[email protected]"
] | |
1591973eefe70d9fec3366c58b9e665d5f267da8
|
80ca80e913ebedbcd786965f3033a60907ba239c
|
/src/mypage/controller/MyCoupon.java
|
4884709431d0c62abe5e064a068f9bc4699d4d03
|
[] |
no_license
|
tnqlsdl1300/Logitech
|
6f3bbf0a8c92c6f480869f4f96a9e40418eacdde
|
ae52d3d6a3564b41a3746758358b00478f2af631
|
refs/heads/main
| 2023-05-05T13:33:28.742707 | 2021-05-27T12:25:39 | 2021-05-27T12:25:39 | 309,927,821 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 421 |
java
|
package mypage.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import common.controller.AbstractController;
public class MyCoupon extends AbstractController {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
super.setRedirect(false);
super.setViewPage("/WEB-INF/mypage/mypage_cupon.jsp");
}
}
|
[
"[email protected]"
] | |
ead0bde079e9595c0a9d9e732531f30798c63ee3
|
b1c7d854d6a2257330b0ea137c5b4e24b2e5078d
|
/com/google/android/gms/internal/zzbku.java
|
b77208e1bacd711d3cdf552c944eea18b3a848df
|
[] |
no_license
|
nayebare/mshiriki_android_app
|
45fd0061332f5253584b351b31b8ede2f9b56387
|
7b6b729b5cbc47f109acd503b57574d48511ee70
|
refs/heads/master
| 2020-06-21T20:01:59.725854 | 2017-06-12T13:55:51 | 2017-06-12T13:55:51 | 94,205,275 | 1 | 1 | null | 2017-06-13T11:22:51 | 2017-06-13T11:22:51 | null |
UTF-8
|
Java
| false | false | 2,046 |
java
|
package com.google.android.gms.internal;
import android.content.Context;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import java.util.concurrent.TimeUnit;
public final class zzbku {
public static final zzapn<Boolean> zzbXh;
public static final zzapn<String> zzbXi;
public static final zzapn<Integer> zzbXj;
public static final zzapn<Integer> zzbXk;
public static final zzapn<Integer> zzbXl;
public static final zzapn<Long> zzbXm;
public static final zzapn<Long> zzbXn;
public static final zzapn<Long> zzbXo;
public static final zzapn<Integer> zzbXp;
public static final zzapn<Integer> zzbXq;
public static final zzapn<Long> zzbXr;
public static final zzapn<Integer> zzbXs;
public static final zzapn<Integer> zzbXt;
public static final zzapn<Integer> zzbXu;
static {
zzbXh = zzapn.zzb(0, "crash:enabled", Boolean.valueOf(true));
zzbXi = zzapn.zzc(0, "crash:gateway_url", "https://mobilecrashreporting.googleapis.com/v1/crashes:batchCreate?key=");
zzbXj = zzapn.zzb(0, "crash:log_buffer_capacity", 100);
zzbXk = zzapn.zzb(0, "crash:log_buffer_max_total_size", (int) AccessibilityNodeInfoCompat.ACTION_PASTE);
zzbXl = zzapn.zzb(0, "crash:crash_backlog_capacity", 5);
zzbXm = zzapn.zzb(0, "crash:crash_backlog_max_age", 604800000);
zzbXn = zzapn.zzb(0, "crash:starting_backoff", TimeUnit.SECONDS.toMillis(1));
zzbXo = zzapn.zzb(0, "crash:backoff_limit", TimeUnit.MINUTES.toMillis(60));
zzbXp = zzapn.zzb(0, "crash:retry_num_attempts", 12);
zzbXq = zzapn.zzb(0, "crash:batch_size", 5);
zzbXr = zzapn.zzb(0, "crash:batch_throttle", TimeUnit.MINUTES.toMillis(5));
zzbXs = zzapn.zzb(0, "crash:frame_depth", 60);
zzbXt = zzapn.zzb(0, "crash:receiver_delay", 100);
zzbXu = zzapn.zzb(0, "crash:thread_idle_timeout", 10);
}
public static final void initialize(Context context) {
zzapr.zzCQ();
zzapo.initialize(context);
}
}
|
[
"[email protected]"
] | |
fdb5e63b85750c1a4460d83fc204b3f99bc641be
|
a7e79cc6358ae66a46575fb0dd353599ab9e69f2
|
/src/main/java/ru/grishchenko/configs/MyAppConfig.java
|
6df08990a4daf0992ff05b6b533cd6a4e8cc8648
|
[] |
no_license
|
grisha99/spring-context-hiber
|
058cd6d54242e7d878c14cc5f90ed0503062cbc7
|
e1bf0e523f257d3c93a9f1879fd1bc87ac9ea7c9
|
refs/heads/master
| 2023-02-04T19:38:19.512182 | 2020-12-25T09:02:17 | 2020-12-25T09:02:17 | 323,318,595 | 0 | 0 | null | 2020-12-25T09:02:18 | 2020-12-21T11:38:17 | null |
UTF-8
|
Java
| false | false | 242 |
java
|
package ru.grishchenko.configs;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(value = "ru.grishchenko")
public class MyAppConfig {
}
|
[
"[email protected]"
] | |
0216d3bb4d9c18dc3ba4804ae558dae2be7e6321
|
f9cdbc0fc904dc4400c31891ce65aad88e306e35
|
/src/pojos/Nacimientos.java
|
f181b6331e80ca53b85ae1511739c55740e7d3b3
|
[] |
no_license
|
lpereira1003/Alcaldias
|
0a760a5373b189e16313f08db19d2d67d31d43d7
|
249593bea839f78578c6d8fd04eb519dfbbc82ea
|
refs/heads/master
| 2021-08-29T21:28:35.481242 | 2017-12-13T23:38:47 | 2017-12-13T23:38:47 | 114,179,892 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,201 |
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 pojos;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Master-Pc
*/
@Entity
@Table(name = "nacimientos")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Nacimientos.findAll", query = "SELECT n FROM Nacimientos n")
, @NamedQuery(name = "Nacimientos.findByIdpda", query = "SELECT n FROM Nacimientos n WHERE n.idpda = :idpda")
, @NamedQuery(name = "Nacimientos.findByNombre", query = "SELECT n FROM Nacimientos n WHERE n.nombre = :nombre")
, @NamedQuery(name = "Nacimientos.findByLibro", query = "SELECT n FROM Nacimientos n WHERE n.libro = :libro")
, @NamedQuery(name = "Nacimientos.findByPagina", query = "SELECT n FROM Nacimientos n WHERE n.pagina = :pagina")})
public class Nacimientos implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idpda")
private Integer idpda;
@Column(name = "nombre")
private String nombre;
@Column(name = "libro")
private BigInteger libro;
@Column(name = "pagina")
private BigInteger pagina;
public Nacimientos() {
}
public Nacimientos(Integer idpda) {
this.idpda = idpda;
}
public Integer getIdpda() {
return idpda;
}
public void setIdpda(Integer idpda) {
Integer oldIdpda = this.idpda;
this.idpda = idpda;
changeSupport.firePropertyChange("idpda", oldIdpda, idpda);
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
String oldNombre = this.nombre;
this.nombre = nombre;
changeSupport.firePropertyChange("nombre", oldNombre, nombre);
}
public BigInteger getLibro() {
return libro;
}
public void setLibro(BigInteger libro) {
BigInteger oldLibro = this.libro;
this.libro = libro;
changeSupport.firePropertyChange("libro", oldLibro, libro);
}
public BigInteger getPagina() {
return pagina;
}
public void setPagina(BigInteger pagina) {
BigInteger oldPagina = this.pagina;
this.pagina = pagina;
changeSupport.firePropertyChange("pagina", oldPagina, pagina);
}
@Override
public int hashCode() {
int hash = 0;
hash += (idpda != null ? idpda.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Nacimientos)) {
return false;
}
Nacimientos other = (Nacimientos) object;
if ((this.idpda == null && other.idpda != null) || (this.idpda != null && !this.idpda.equals(other.idpda))) {
return false;
}
return true;
}
@Override
public String toString() {
return "pojos.Nacimientos[ idpda=" + idpda + " ]";
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
}
|
[
"[email protected]"
] | |
1e2b5296fa92808717963ae8e50407577ffc6909
|
0ad57248ba998abc76420e9e4b1e4adb4c7bb2a4
|
/src/javaconditional/Javaconditional.java
|
2572cde43ca22313073025584ab807e7499f63e9
|
[] |
no_license
|
rizal201/tugas-if
|
7b4fdd3975e90a72b59e71bdd6c66f0f9bb5b5c3
|
26235f5c83bd76e7d858a0e83c2e1314e771780d
|
refs/heads/main
| 2023-04-02T11:25:01.004390 | 2021-04-15T09:08:09 | 2021-04-15T09:08:09 | 358,195,172 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 436 |
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 javaconditional;
/**
*
* @author lenovo
*/
public class Javaconditional {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
|
[
"[email protected]"
] | |
1374689e070a24e44dfc8ffdf032836e00b4b465
|
d1ea5077c83cb2e93fe69e3d19a2e26efe894a0e
|
/src/main/java/com/rograndec/feijiayun/chain/business/report/quality/storage/service/GoodsLockReportService.java
|
9513d43a719069d4672c32567fb63ed82e6ca395
|
[] |
no_license
|
Catfeeds/rog-backend
|
e89da5a3bf184e4636169e7492a97dfd0deef2a1
|
109670cfec6cbe326b751e93e49811f07045e531
|
refs/heads/master
| 2020-04-05T17:36:50.097728 | 2018-10-22T16:23:55 | 2018-10-22T16:23:55 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,215 |
java
|
package com.rograndec.feijiayun.chain.business.report.quality.storage.service;
import com.rograndec.feijiayun.chain.business.report.common.vo.BaseGoodsReportTotalVO;
import com.rograndec.feijiayun.chain.business.report.quality.storage.vo.GoodsLockReportVO;
import com.rograndec.feijiayun.chain.business.report.quality.storage.vo.RequestReportGoodsLockVO;
import com.rograndec.feijiayun.chain.common.Page;
import com.rograndec.feijiayun.chain.common.vo.UserVO;
import org.springframework.stereotype.Service;
import java.io.OutputStream;
/**
* 版权:融贯资讯 <br/>
* 作者:[email protected] <br/>
* 生成日期:2017/10/19 <br/>
* 描述:商品锁定报表
*/
@Service
public interface GoodsLockReportService {
/**
* <根据条件查询商品锁定报表数据>
*/
Page getGoodsLockReportList(RequestReportGoodsLockVO requestGoodsLockListVo, Page page, UserVO userVO) throws Exception;
/**
* 导出商品锁定
* @param output
* @param goodsLockReportTotalVO
* @param userVO
*/
void excelExport(OutputStream output, BaseGoodsReportTotalVO<GoodsLockReportVO> goodsLockReportTotalVO, UserVO userVO);
}
|
[
"[email protected]"
] | |
7ca0928a569d0a75a87f66fd394f3fed35def0c5
|
1afc9d0c31ef12e5e36b63f62ee4eec4bf1eac90
|
/src/main/java/io/swagger/configuration/CustomInstantDeserializer.java
|
8083ed5bcc8a98aa44fbc989c0dd2c43c13d0178
|
[] |
no_license
|
tuxing1986/spring-server
|
6d17734a1ae968ab04848932959c6935665a937a
|
c7276d3d3e581c0e6028e0c6c4bde9f566592876
|
refs/heads/master
| 2020-04-05T06:40:56.579754 | 2018-11-14T20:44:38 | 2018-11-14T20:44:38 | 156,646,292 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,207 |
java
|
package io.swagger.configuration;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.temporal.Temporal;
import org.threeten.bp.temporal.TemporalAccessor;
import java.io.IOException;
import java.math.BigDecimal;
/**
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing
* rfc822 format.
*
* @author Nick Williams
*/
public class CustomInstantDeserializer<T extends Temporal> extends ThreeTenDateTimeDeserializerBase<T> {
private static final long serialVersionUID = 1L;
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(Instant.class, DateTimeFormatter.ISO_INSTANT, new Function<TemporalAccessor, Instant>() {
@Override
public Instant apply(TemporalAccessor temporalAccessor) {
return Instant.from(temporalAccessor);
}
}, new Function<FromIntegerArguments, Instant>() {
@Override
public Instant apply(FromIntegerArguments a) {
return Instant.ofEpochMilli(a.value);
}
}, new Function<FromDecimalArguments, Instant>() {
@Override
public Instant apply(FromDecimalArguments a) {
return Instant.ofEpochSecond(a.integer, a.fraction);
}
}, null);
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
new Function<TemporalAccessor, OffsetDateTime>() {
@Override
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
return OffsetDateTime.from(temporalAccessor);
}
}, new Function<FromIntegerArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromIntegerArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
}, new Function<FromDecimalArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromDecimalArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
}, new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
@Override
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
}
});
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
new Function<TemporalAccessor, ZonedDateTime>() {
@Override
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
return ZonedDateTime.from(temporalAccessor);
}
}, new Function<FromIntegerArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromIntegerArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
}, new Function<FromDecimalArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromDecimalArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
}, new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
@Override
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
return zonedDateTime.withZoneSameInstant(zoneId);
}
});
protected final Function<FromIntegerArguments, T> fromMilliseconds;
protected final Function<FromDecimalArguments, T> fromNanoseconds;
protected final Function<TemporalAccessor, T> parsedToValue;
protected final BiFunction<T, ZoneId, T> adjust;
protected CustomInstantDeserializer(Class<T> supportedType, DateTimeFormatter parser, Function<TemporalAccessor, T> parsedToValue, Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds, BiFunction<T, ZoneId, T> adjust) {
super(supportedType, parser);
this.parsedToValue = parsedToValue;
this.fromMilliseconds = fromMilliseconds;
this.fromNanoseconds = fromNanoseconds;
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
@Override
public T apply(T t, ZoneId zoneId) {
return t;
}
} : adjust;
}
@SuppressWarnings("unchecked")
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
super((Class<T>) base.handledType(), f);
parsedToValue = base.parsedToValue;
fromMilliseconds = base.fromMilliseconds;
fromNanoseconds = base.fromNanoseconds;
adjust = base.adjust;
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new CustomInstantDeserializer<T>(this, dtf);
}
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
// NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
// string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId()) {
case JsonTokenId.ID_NUMBER_FLOAT: {
BigDecimal value = parser.getDecimalValue();
long seconds = value.longValue();
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(seconds, nanoseconds, getZone(context)));
}
case JsonTokenId.ID_NUMBER_INT: {
long timestamp = parser.getLongValue();
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
return this.fromNanoseconds.apply(new FromDecimalArguments(timestamp, 0, this.getZone(context)));
}
return this.fromMilliseconds.apply(new FromIntegerArguments(timestamp, this.getZone(context)));
}
case JsonTokenId.ID_STRING: {
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
if (string.endsWith("+0000")) {
string = string.substring(0, string.length() - 5) + "Z";
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
throw _peelDTE(e);
}
return value;
}
}
throw context.mappingException("Expected type float, integer, or string.");
}
private ZoneId getZone(DeserializationContext context) {
// Instants are always in UTC, so don't waste compute cycles
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
}
private static class FromIntegerArguments {
public final long value;
public final ZoneId zoneId;
private FromIntegerArguments(long value, ZoneId zoneId) {
this.value = value;
this.zoneId = zoneId;
}
}
private static class FromDecimalArguments {
public final long integer;
public final int fraction;
public final ZoneId zoneId;
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
this.integer = integer;
this.fraction = fraction;
this.zoneId = zoneId;
}
}
}
|
[
"[email protected]"
] | |
4f9d12a664fc6fdd23f4251bf4ef00cf70793135
|
47b62372ba008ce2a7ec200b9006ba9641e83094
|
/xsnow/src/main/java/com/sjhua/extra/xsnow/permission/OnPermissionCallback.java
|
0e56dad405e9fb813ef4747f54fe98aa44f74dc7
|
[
"Apache-2.0"
] |
permissive
|
jiangcr81/BLE
|
753e2961b74426a4dd98dc7c9401ad2045182d88
|
66ba45be181b13a34945d8d525a38f7c653f53aa
|
refs/heads/master
| 2020-05-20T18:18:20.782466 | 2019-05-09T04:17:02 | 2019-05-09T04:17:02 | 185,703,150 | 0 | 0 |
Apache-2.0
| 2019-05-09T01:19:40 | 2019-05-09T01:19:38 | null |
UTF-8
|
Java
| false | false | 257 |
java
|
package com.sjhua.extra.xsnow.permission;
public interface OnPermissionCallback {
//允许
void onRequestAllow(String permissionName);
//拒绝
void onRequestRefuse(String permissionName);
//不在询问
void onRequestNoAsk(String permissionName);
}
|
[
"[email protected]"
] | |
cef694f2eda2eb10e4949b2e0a3a05ff416ad302
|
c65d2d1376fefb9e98f784de7141f889d2758c34
|
/src/TwoThreeSix.java
|
a422bc395eea570c9f7430d945e33103d5c861fd
|
[] |
no_license
|
fengbs/leetcode
|
6cf2144c3efb4c5859e34b6b16265b6d6abae65c
|
69d6725e7541dc31ce4c1297f0038ed1aae842d8
|
refs/heads/master
| 2022-11-25T17:09:46.675674 | 2020-07-31T03:08:28 | 2020-07-31T03:08:28 | 104,454,142 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 750 |
java
|
import javax.transaction.TransactionRequiredException;
/**
* Created by [email protected] on 19-4-1
*/
public class TwoThreeSix {
private TreeNode res = null;
private int dfs(TreeNode node,TreeNode p,TreeNode q) {
if (node == null) {
return 0;
}
TreeNode resNode = null;
int current = 0 ;
int leftRes = dfs(node.left,p,q);
int rightRes = dfs(node.right,p,q);
if ( p == node ) {
current += 1;
}
if ( q == node ) {
current +=2;
}
if ( leftRes + rightRes + current == 3 ) {
res = node;
return 0;
}
return leftRes + rightRes + current;
}
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
dfs(root,p,q);
return res;
}
public static void main ( String []args ) {
}
}
|
[
"[email protected]"
] | |
a6cb5bcfab1d94be0124f8a5bd8ce7ee790c2189
|
5258119b2dc75638dfda789909930601fbd18acd
|
/src/com/akudrin/io_8/Reverse.java
|
42f9fbff8bbde72b85b672e3996b53b4f49c4b76
|
[] |
no_license
|
akudrin/Java8_OCP_Exam
|
1ffacf3d244e77af26187ba1ab79e7c63e8ba119
|
91027f450b6ddebacb72a597e8e4d2f64040e2d5
|
refs/heads/master
| 2020-04-10T13:14:41.976168 | 2018-12-09T13:58:26 | 2018-12-09T13:58:26 | 161,045,060 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,408 |
java
|
package com.akudrin.io_8;
/*
* 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.
*/
import java.io.*;
import java.net.*;
public class Reverse {
public static void main(String[] args) throws Exception {
System.out.println(args[0] + " " + args[1]);
if (args.length != 2) {
System.err.println("Usage: java Reverse "
+ "http://localhost:8080/ServletApp/ReverseServlet"
+ " string_to_reverse");
System.exit(1);
}
String stringToReverse = URLEncoder.encode(args[1], "UTF-8");
URL url = new URL(args[0]);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
try (OutputStreamWriter out = new OutputStreamWriter(
connection.getOutputStream())) {
out.write("string=" + stringToReverse);
}
try (BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()))) {
String decodedString;
while ((decodedString = in.readLine()) != null) {
System.out.println(decodedString);
}
}
}
}
|
[
"[email protected]"
] | |
4770692d0a3c0d4f02a6ea4ba79fdeb7bff156af
|
20eb38252c9fb8adb3fef52eb8ac52c7a5e0c10c
|
/Backend/src/main/java/com/reddit/reddit/repository/SubredditRepository.java
|
e7efd642738e2b49bac2efc2e3386e8756749792
|
[] |
no_license
|
mosama2050/Reddit-21
|
48ef84651e0141cdfa17133ac16bb847afc89b17
|
bc8e5a926b286fe8b7660dde67da18ef6c6cacf6
|
refs/heads/main
| 2023-07-07T18:28:05.705020 | 2021-08-30T22:13:23 | 2021-08-30T22:13:23 | 401,338,573 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 374 |
java
|
package com.reddit.reddit.repository;
import com.reddit.reddit .model.Subreddit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface SubredditRepository extends JpaRepository<Subreddit, Long> {
Optional<Subreddit> findByName(String subredditName);
}
|
[
"[email protected]"
] | |
9c4035702809776935a65e0c9b7255a22899ad93
|
4ba395e25a7d4c7ea76e974f5f99404dd6a41982
|
/src/main/java/model/thing/hero/commond/LeftCommand.java
|
cfbf21a66a0508b362b2ec0c1d387c48583bd1ba
|
[] |
no_license
|
Lemonstars/GoFight
|
71766e1eeab8b92f2c1bafad3bed7b984a70c203
|
1bdb3f5dc569f403e20331e286bcf8f6aaaf3cb7
|
refs/heads/master
| 2020-04-29T15:05:39.154817 | 2019-03-25T15:15:20 | 2019-03-25T15:15:20 | 176,217,124 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 332 |
java
|
package model.thing.hero.commond;
import model.thing.hero.AbstractHero;
/**
* @author 刘兴
* @version 1.0
* @date 2019/03/24
*/
public class LeftCommand extends AbstractCommand{
public LeftCommand(AbstractHero hero) {
super(hero);
}
@Override
public void execute() {
hero.goLeft();
}
}
|
[
"[email protected]"
] | |
8337719059d195caa48f27e98d6e5b333f123ac7
|
d816e8ba6ed6d463a79f2e34ada83c2e8a1fdc1f
|
/Java_Fun/hangman_game/Hangman.java
|
1de6ab625798fa69e97b4e8780f577d0dbec8bfd
|
[] |
no_license
|
amarinas/Java_web_dev
|
0963fd78c94bfb82dbaa7eddd257d1e86ab4bde6
|
9d7fd076856b89da8eceda005aa7134674cc8592
|
refs/heads/master
| 2021-01-01T04:49:29.674853 | 2017-07-17T19:26:30 | 2017-07-17T19:26:30 | 97,258,513 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 469 |
java
|
public class Hangman{
public static void main(String[] args){
if (args.length ==0){
System.out.println("Usage: java hangmean <answer>");
System.err.println("answer is required");
System.exit(1);
}
Game game = new Game(args[0]);
Promter prompter = new Promter(game);
while(game.getRemainingTries()> 0 && !game.isWon()){
prompter.displayProgress();
prompter.promptForGuess();
}
prompter.displayOutcome();
}
}
|
[
"[email protected]"
] | |
81b5eaf143fba73e7d3a0b400d90de24cc0a7586
|
076044965fb49ab15c2e4fb5987cd799f6506f96
|
/rhjoerg-plexus-starter/src/test/java/ch/rhjoerg/plexus/starter/container/target/TargetComponent.java
|
abd4f5cd949165a69313ef9adf5041a16f2a032f
|
[
"MIT"
] |
permissive
|
rhjoerg/rhjoerg-plexus
|
bde4291131f502b541c3aea4b5e9ff31915cd2ab
|
9e61186b91c59b6dc53fb7afe92ee3eb1bf55641
|
refs/heads/master
| 2022-11-16T14:14:57.410370 | 2020-07-14T09:14:15 | 2020-07-14T09:14:15 | 276,337,088 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 373 |
java
|
package ch.rhjoerg.plexus.starter.container.target;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
@Component(role = TargetComponent.class, hint = "foo", instantiationStrategy = "singleton")
public class TargetComponent
{
@Requirement(hint = "foo")
public NamedTarget namedTarget;
}
|
[
"[email protected]"
] | |
f3ddfe72daaa0ba6576266d4cb44757e4459dcb1
|
8950a78c2e24f50cf8d2f33a508f454d3d8fc2a1
|
/problems/src/com/algo/leet/FriendCircles.java
|
0f3be55ad783313147e8e6b2ea26d5e42680cda4
|
[] |
no_license
|
ashishkumar-mishra/ProblemSolving
|
3113d9507f8cd11189ef48d14af15c32da475385
|
c243f91ab02ac8ae2c2c06777a4504d3cc73501d
|
refs/heads/master
| 2021-06-18T23:34:40.886690 | 2021-02-20T07:17:46 | 2021-02-20T07:17:46 | 134,469,704 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,578 |
java
|
package com.algo.leet;
/**
* There are N students in a class. Some of them are friends, while some are
* not. Their friendship is transitive in nature. For example, if A is a direct
* friend of B, and B is a direct friend of C, then A is an indirect friend of
* C. And we defined a friend circle is a group of students who are direct or
* indirect friends.
*
* Given a N*N matrix M representing the friend relationship between students in
* the class. If M[i][j] = 1, then the ith and jth students are direct friends
* with each other, otherwise not. And you have to output the total number of
* friend circles among all the students.
*
*/
public class FriendCircles {
// This problem is similar to find out the number of components in graph
public int findCircleNum(int[][] matrix) {
int row = matrix.length;
int count = 0;
boolean[] visited = new boolean[row];
for (int i = 0; i < row; i++) {
if (!visited[i]) {
dfs(matrix, visited, i);
count++;
}
}
return count;
}
private void dfs(int[][] matrix, boolean[] visited, int index) {
visited[index] = true;
for (int j = 0; j < matrix.length; j++) {
if (matrix[index][j] == 1 && !visited[j]) {
dfs(matrix, visited, j);
}
}
}
public static void main(String[] args) {
int[][] matrix = { { 1, 1, 0, 0, 0, 0 },
{ 1, 1, 0, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 0 },
{ 0, 0, 1, 1, 0, 0 },
{ 0, 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 0, 1 } };
FriendCircles friendCircles = new FriendCircles();
System.out.println(friendCircles.findCircleNum(matrix));
}
}
|
[
"[email protected]"
] | |
e6f8860f840aae719a26188a4bbf6aa480099773
|
6b3cd09e74547764c29d28c42db3066238234f22
|
/src/video5/task1/Zoo.java
|
13aab09cae049d2e6df3b8cb11c667aa458551a1
|
[] |
no_license
|
DenisKulbachniy/EducationEnc
|
f0bd83964fd306c677e8e7f3389de94d277987f7
|
4d2688cabaa6c8c371e5a7a3015b690b045e5fcb
|
refs/heads/main
| 2023-04-18T01:22:56.176947 | 2020-10-09T06:21:16 | 2020-10-09T06:21:16 | 365,227,396 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 482 |
java
|
package video5.task1;
import java.util.ArrayList;
public class Zoo {
public static void main(String[] args) {
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("Cat");//0
arrayList.add("Dog");//1
arrayList.add("Snake"); //nety
arrayList.add("Bird"); //2
arrayList.add("Monkey"); //nety
arrayList.add("Lion");//3
arrayList.add("Elephant");//4
arrayList.add("Horse"); //nety
}
}
|
[
"[email protected]"
] | |
09184380a05796bcced0a06dd0e7166e90083987
|
54a306f7dfe8ea4ded80818b9cb9bfba51880fd6
|
/flume-ng-channels/flume-disk-backed-memory-channel/src/main/java/org/apache/flume/channel/AbstractWorker.java
|
14747c796522c37ef623e7b5d701d33ef1bf15fd
|
[
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-protobuf",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"BSD-2-Clause"
] |
permissive
|
HarshaKondreddi/scylladb-sink
|
79c82ce89f066f8a05b66a8789687899148ef3c0
|
53fd675bc0c0052b09d0e665d46aae9839470630
|
refs/heads/master
| 2022-11-30T03:36:21.286852 | 2019-06-14T06:54:07 | 2019-06-14T06:54:07 | 191,889,580 | 0 | 0 |
Apache-2.0
| 2022-11-16T08:34:42 | 2019-06-14T06:40:14 |
Java
|
UTF-8
|
Java
| false | false | 3,982 |
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.flume.channel;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import static org.apache.flume.channel.Configuration.DEFAULT_POLL_INTERVAL_MS;
import org.apache.commons.io.FileUtils;
import org.apache.flume.Context;
import org.apache.flume.instrumentation.ChannelCounter;
import org.slf4j.Logger;
public abstract class AbstractWorker extends Thread implements Worker {
private static final int INTERVAL = 500;
Logger logger;
volatile boolean running = true;
public AbstractWorker(String name, Logger logger) {
this.setName(name);
this.logger = logger;
}
@Override
public void doStart() {
logger.info("starting::{}", this.getName());
this.start();
}
@Override
public void run() {
while (running) {
try {
Thread.sleep(getInterval());
doTask();
} catch (InterruptedException ie) {
// expected on shutdown. noop
} catch (Throwable e) {
// don't want to shutdown in any error unless asked to
logger.warn("error occurred in {}", this.getName(), e);
}
}
}
public int getInterval() {
return DEFAULT_POLL_INTERVAL_MS;
}
@Override
public void doStop() {
logger.info("stopping::{}", this.getName());
running = false;
this.interrupt();
}
@Override
public void awaitTermination() {
try {
this.join();
} catch (Exception e) {
logger.warn("error occurred while waiting to stop: {}", this.getName(), e);
}
logger.info("stopped::{}", this.getName());
}
public abstract void doTask() throws Exception;
Integer getInteger(Context ctx, String key, Integer defaultValue, Integer minValue, Integer maxValue) {
int value;
try {
value = ctx.getInteger(key, defaultValue);
} catch (NumberFormatException e) {
value = defaultValue;
logger.warn("invalid {} specified, initializing to default value {}", key, defaultValue);
}
if (value < minValue) {
value = minValue;
logger.warn("{} is out of range, initializing to minimum {}", key, minValue);
}
if (value > maxValue) {
value = maxValue;
logger.warn("{} is out of range, initializing to maximum {}", key, maxValue);
}
return value;
}
FileLock createAndLockDir(File lockFile) throws IOException {
File directory = lockFile.getParentFile();
FileUtils.forceMkdir(directory);
if (!(directory.canExecute() && directory.canRead() && directory.canWrite())) {
throw new IOException(String.format("configured spool directory %s doesn't have " +
"one or many required permissions(rwx).", directory));
}
FileChannel dirLockChannel = new RandomAccessFile(lockFile, "rw").getChannel();
FileLock dirLock = dirLockChannel.tryLock();
if (dirLock == null) {
throw new IOException(String.format("Unable to lock the directory %s. " +
"May be used by some other program.", directory));
}
return dirLock;
}
public ChannelCounter createCounter() {
return new ChannelCounter(getName());
}
}
|
[
"[email protected]"
] | |
74c4eb1f44e86032238cccb2ddb7d4de870358e5
|
11eb399d2b36fdb189ee5592c337ac82b843a76b
|
/BankingSystem/src/main/java/ir/maktab/service/UserService.java
|
1ad1f4b871ea5ac5397df402a9fe1b5549fb4b87
|
[] |
no_license
|
mAhangari/BankingSystem
|
787f128c06a3e817c33efb4590e2afe48b0c895e
|
bfa785e92257f5715cf159800bbc606bbbacbb2f
|
refs/heads/main
| 2023-08-28T16:31:36.858045 | 2021-10-18T12:01:59 | 2021-10-18T12:01:59 | 407,683,303 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 138 |
java
|
package ir.maktab.service;
import ir.maktab.domain.User;
public interface UserService extends BaseUserService<User, String, String> {
}
|
[
"[email protected]"
] | |
ce7904973db5400f49e2efc4f0618078798e6d6a
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/MATE-20_EMUI_11.0.0/src/main/java/com/android/internal/telephony/gsm/HwGSMPhoneReference.java
|
9a70823c38374cacd324491fe3e6ca8278729c06
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 59,056 |
java
|
package com.android.internal.telephony.gsm;
import android.content.BroadcastReceiver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.SQLException;
import android.media.AudioManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Message;
import android.os.PersistableBundle;
import android.preference.PreferenceManager;
import android.provider.HwTelephony;
import android.provider.Settings;
import android.telephony.CarrierConfigManager;
import android.telephony.HwPhoneNumberUtils;
import android.telephony.HwTelephonyManager;
import android.telephony.HwTelephonyManagerInner;
import android.text.TextUtils;
import com.android.ims.HwImsManagerInner;
import com.android.internal.telephony.HwModemCapability;
import com.android.internal.telephony.HwPhoneReferenceBase;
import com.android.internal.telephony.IHwGsmCdmaPhoneInner;
import com.android.internal.telephony.IServiceStateTrackerInner;
import com.android.internal.telephony.PlmnConstants;
import com.android.internal.telephony.fullnetwork.HwFullNetworkConfig;
import com.huawei.android.net.wifi.WifiManagerEx;
import com.huawei.android.os.AsyncResultEx;
import com.huawei.android.os.SystemPropertiesEx;
import com.huawei.android.provider.TelephonyEx;
import com.huawei.android.telephony.RlogEx;
import com.huawei.android.telephony.TelephonyManagerEx;
import com.huawei.hwparttelephonyopt.BuildConfig;
import com.huawei.internal.telephony.CommandsInterfaceEx;
import com.huawei.internal.telephony.MmiCodeExt;
import com.huawei.internal.telephony.NetworkCallBackInteface;
import com.huawei.internal.telephony.OperatorInfoEx;
import com.huawei.internal.telephony.PhoneExt;
import com.huawei.internal.telephony.uicc.IccRecordsEx;
import com.huawei.internal.telephony.uicc.IccUtilsEx;
import com.huawei.internal.telephony.uicc.UiccCardApplicationEx;
import com.huawei.utils.HwPartResourceUtils;
import huawei.cust.HwCfgFilePolicy;
import huawei.cust.HwCustUtils;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Locale;
public class HwGSMPhoneReference extends HwPhoneReferenceBase {
private static final int APNNAME_RULE = 3;
private static final int APN_RULE = 2;
private static final int ECC_NOCARD_INDEX = 4;
private static final int ECC_WITHCARD_INDEX = 3;
private static final int EVENT_GET_AVAILABLE_NETWORKS_DONE = 1;
private static final int EVENT_RADIO_ON = 5;
private static final int EVENT_UPLOAD_AVAILABLE_NETWORKS_DONE = 2;
private static final int GID1_RULE = 1;
private static final int INVALID_INDEX = -1;
private static final boolean IS_HW_VM_NOT_FROM_SIM = SystemPropertiesEx.getBoolean("ro.config.hw_voicemail_sim", false);
private static final boolean IS_MULTI_ENABLE = TelephonyManagerEx.isMultiSimEnabled();
private static final boolean IS_WCDMA_VP_ENABLED = SystemPropertiesEx.get("ro.hwpp.wcdma_voice_preference", "false").equals("true");
private static final String LOG_TAG = "HwGSMPhoneReference";
private static final int MANUAL_SEARCH_NETWORK_FAIL = 1;
private static final int MANUAL_SEARCH_NETWORK_SUCCESS = 0;
private static final int MEID_LENGTH = 14;
private static final int NAME_INDEX = 1;
private static final int NUMERIC_INDEX = 2;
private static final Uri PREFERAPN_NO_UPDATE_URI = Uri.parse("content://telephony/carriers/preferapn_no_update");
private static final String PROPERTY_GLOBAL_FORCE_TO_SET_ECC = "ril.force_to_set_ecc";
private static final String PROP_REDUCE_SAR_SPECIAL_LEVEL = "ro.config.reduce_sar_level";
private static final String PROP_REDUCE_SAR_SPECIAL_TYPE1 = "ro.config.reduce_sar_type1";
private static final String PROP_REDUCE_SAR_SPECIAL_TYPE2 = "ro.config.reduce_sar_type2";
private static final int REDUCE_SAR_NORMAL_HOTSPOT_ON = 8192;
private static final int REDUCE_SAR_NORMAL_WIFI_OFF = 0;
private static final int REDUCE_SAR_NORMAL_WIFI_ON = 4096;
private static final int REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON = 20480;
private static final int REDUCE_SAR_SPECIAL_TYPE1_WIFI_OFF = 12288;
private static final int REDUCE_SAR_SPECIAL_TYPE1_WIFI_ON = 16384;
private static final int REDUCE_SAR_SPECIAL_TYPE2_HOTSPOT_ON = 12287;
private static final int REDUCE_SAR_SPECIAL_TYPE2_WIFI_OFF = 4095;
private static final int REDUCE_SAR_SPECIAL_TYPE2_WIFI_ON = 8191;
private static final int SEARCH_LENGTH = 2;
private static final int SPN_RULE = 0;
private static final int SUB_NONE = -1;
private static final String USSD_IS_OK_FOR_RELEASE = "is_ussd_ok_for_nw_release";
private static final int WIFI_HOTSPOT_TYPE = 2;
private static final int WIFI_OFF_TYPE = 0;
private static final int WIFI_ON_TYPE = 1;
private static boolean mIsQCRilGoDormant = true;
private static Object mQcRilHook = null;
private Handler mHandler = new Handler() {
/* class com.android.internal.telephony.gsm.HwGSMPhoneReference.AnonymousClass1 */
@Override // android.os.Handler
public void handleMessage(Message msg) {
int i = msg.what;
if (i == 1) {
handleGetAvailableNetWorksDone(msg);
} else if (i != 2) {
super.handleMessage(msg);
} else {
handleUploadAvailableNetWorksDone(msg);
}
}
private void handleGetAvailableNetWorksDone(Message msg) {
HwGSMPhoneReference.this.logd("[EVENT_GET_AVAILABLE_NETWORKS_DONE]");
ArrayList<OperatorInfoEx> searchResults = null;
AsyncResultEx ar = AsyncResultEx.from(msg.obj);
Message onComplete = (Message) ar.getUserObj();
ArrayList<OperatorInfoEx> searchResultsFromMessage = OperatorInfoEx.from(ar.getResult());
if (ar.getException() == null && ar.getResult() != null) {
searchResults = HwGSMPhoneReference.this.custAvailableNetworks(searchResultsFromMessage);
}
if (searchResults == null || searchResults.size() == 0) {
searchResults = searchResultsFromMessage;
} else {
HwGSMPhoneReference.this.logd("[EVENT_GET_NETWORKS_DONE] Populated global version cust names for available networks.");
}
if (onComplete != null) {
AsyncResultEx.forMessage(onComplete, OperatorInfoEx.convertToOperatorInfo(searchResults), ar.getException());
if (onComplete.getTarget() != null) {
onComplete.sendToTarget();
return;
}
return;
}
HwGSMPhoneReference.this.loge("[EVENT_GET_NETWORKS_DONE] In EVENT_GET_NETWORKS_DONE, onComplete is null!");
}
private void handleUploadAvailableNetWorksDone(Message msg) {
HwGSMPhoneReference.this.logd("[handleUploadAvailableNetWorksDone]");
AsyncResultEx ar = AsyncResultEx.from(msg.obj);
int result = 0;
if (!(ar == null || ar.getException() == null)) {
HwGSMPhoneReference.this.logd("handleUploadAvailableNetWorksDone exception");
result = 1;
}
if (HwGSMPhoneReference.this.mNetworkCallBackInterface != null) {
HwGSMPhoneReference.this.mNetworkCallBackInterface.endUploadAvailableNetworks(result);
HwGSMPhoneReference.this.mNetworkCallBackInterface = null;
}
}
};
private HwCustHwGSMPhoneReference mHwCustHwGSMPhoneReference;
private HwVpApStatusHandler mHwVpApStatusHandler;
private int mLteReleaseVersion;
private String mMeid;
private NetworkCallBackInteface mNetworkCallBackInterface;
private int mPrevPowerGrade = -1;
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
/* class com.android.internal.telephony.gsm.HwGSMPhoneReference.AnonymousClass2 */
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if (context != null && intent != null) {
if (!"android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE".equals(intent.getAction()) || !HwFullNetworkConfig.IS_FAST_SWITCH_SIMSLOT) {
boolean switchDone = false;
if ("com.huawei.action.ACTION_HW_SWITCH_SLOT_DONE".equals(intent.getAction())) {
int mainSlot = HwTelephonyManager.getDefault().getDefault4GSlotId();
int radioState = HwGSMPhoneReference.this.mPhoneExt.getCi().getRadioState();
if (intent.getIntExtra("HW_SWITCH_SLOT_STEP", 1) == 1 && mainSlot == HwGSMPhoneReference.this.mPhoneId) {
switchDone = true;
}
HwGSMPhoneReference.this.logd("ACTION_HW_SWITCH_SLOT_DONE radio state:" + radioState + " switch done:" + switchDone);
if (switchDone && HwGSMPhoneReference.this.mPhoneExt.getPhoneType() == 1 && radioState == 1) {
HwGSMPhoneReference.this.mPhoneExt.getCi().getLteReleaseVersion(HwGSMPhoneReference.this.mPhoneExt.obtainMessage(108));
}
} else if ("com.huawei.intent.action.ACTION_SUBSCRIPTION_SET_UICC_RESULT".equals(intent.getAction()) && SystemPropertiesEx.getInt("persist.radio.stack_id_0", -1) != -1) {
int subId = intent.getIntExtra("subscription", -1000);
int phoneId = intent.getIntExtra("phone", 0);
int status = intent.getIntExtra("operationResult", 1);
int state = intent.getIntExtra("newSubState", 0);
RlogEx.i(HwGSMPhoneReference.LOG_TAG, "Received ACTION_SUBSCRIPTION_SET_UICC_RESULT on subId: " + subId + "phoneId " + phoneId + " status: " + status + "state: " + state);
if (status == 0 && state == 1) {
CommandsInterfaceEx ci = HwGSMPhoneReference.this.mPhoneExt.getCi();
PhoneExt phoneExt = HwGSMPhoneReference.this.mPhoneExt;
PhoneExt unused = HwGSMPhoneReference.this.mPhoneExt;
ci.getDeviceIdentity(phoneExt.obtainMessage(21));
}
}
} else {
HwGSMPhoneReference.this.mPhoneExt.getCi().getDeviceIdentity(HwGSMPhoneReference.this.mPhoneExt.obtainMessage(21));
}
}
}
};
private Boolean mSarControlServiceExist = null;
private IccRecordsEx mSimRecordsEx;
private WifiManager mWifiManager;
private String mncForSAR = null;
private String preOperatorNumeric = BuildConfig.FLAVOR;
private String redcueSARSpeacialType1 = null;
private String redcueSARSpeacialType2 = null;
private String subTag = ("HwGSMPhoneReference[" + this.mPhoneId + "]");
public HwGSMPhoneReference(IHwGsmCdmaPhoneInner hwGsmCdmaPhoneInner, PhoneExt phoneExt) {
super(hwGsmCdmaPhoneInner, phoneExt);
IntentFilter filter = new IntentFilter("com.huawei.intent.action.ACTION_SUBSCRIPTION_SET_UICC_RESULT");
filter.addAction("android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE");
filter.addAction("com.huawei.action.ACTION_HW_SWITCH_SLOT_DONE");
this.mContext.registerReceiver(this.mReceiver, filter);
this.mWifiManager = (WifiManager) this.mContext.getSystemService("wifi");
if (IS_WCDMA_VP_ENABLED) {
this.mHwVpApStatusHandler = new HwVpApStatusHandler(hwGsmCdmaPhoneInner);
}
this.mHwCustHwGSMPhoneReference = (HwCustHwGSMPhoneReference) HwCustUtils.createObj(HwCustHwGSMPhoneReference.class, new Object[]{this.mPhoneExt});
}
public void setLTEReleaseVersion(int state, Message response) {
this.mPhoneExt.getCi().setLTEReleaseVersion(state, response);
}
public int getLteReleaseVersion() {
logd("getLteReleaseVersion: " + this.mLteReleaseVersion);
return this.mLteReleaseVersion;
}
public void getCallbarringOption(String facility, String serviceClass, Message response) {
logd("getCallbarringOption, facility=" + facility + ", serviceClass=" + serviceClass);
this.mPhoneExt.getCallbarringOption(facility, HwGsmMmiCode.siToServiceClass(serviceClass), response);
}
public void setCallbarringOption(String facility, String password, boolean isActivate, String serviceClass, Message response) {
this.mPhoneExt.setCallbarringOption(facility, password, isActivate, HwGsmMmiCode.siToServiceClass(serviceClass), response);
}
public void getCallbarringOption(String facility, int serviceClass, Message response) {
logd("getCallbarringOption, facility=" + facility + ", serviceClass=" + serviceClass);
this.mPhoneExt.getCallbarringOption(facility, serviceClass, response);
}
public void setCallbarringOption(String facility, String password, boolean isActivate, int serviceClass, Message response) {
logd("setCallbarringOption, facility=" + facility + ", isActivate=" + isActivate + ", serviceClass=" + serviceClass);
this.mPhoneExt.setCallbarringOption(facility, password, isActivate, serviceClass, response);
}
public void changeBarringPassword(String oldPassword, String newPassword, Message response) {
this.mPhoneExt.getCi().changeBarringPassword("AB", oldPassword, newPassword, response);
}
public Message getCustAvailableNetworksMessage(Message response) {
return this.mHandler.obtainMessage(1, response);
}
private String getSelectedApn() {
Cursor cursor;
Context mContext = this.mPhoneExt != null ? this.mPhoneExt.getContext() : null;
if (mContext == null) {
return null;
}
Cursor cursor2 = null;
String apn = null;
try {
if (IS_MULTI_ENABLE) {
cursor = mContext.getContentResolver().query(ContentUris.withAppendedId(PREFERAPN_NO_UPDATE_URI, (long) this.mPhoneExt.getPhoneId()), new String[]{"_id", HwTelephony.NumMatchs.NAME, "apn"}, null, null, HwTelephony.NumMatchs.DEFAULT_SORT_ORDER);
} else {
cursor = mContext.getContentResolver().query(PREFERAPN_NO_UPDATE_URI, new String[]{"_id", HwTelephony.NumMatchs.NAME, "apn"}, null, null, HwTelephony.NumMatchs.DEFAULT_SORT_ORDER);
}
if (cursor != null && cursor.getCount() > 0) {
cursor.moveToFirst();
apn = cursor.getString(cursor.getColumnIndexOrThrow("apn"));
}
if (cursor != null) {
try {
cursor.close();
} catch (SQLException e) {
loge("getSelectedApn close SQLiteException.");
}
}
} catch (SQLException e2) {
loge("getSelectedApn SQLiteException.");
if (0 != 0) {
cursor2.close();
}
} catch (Throwable th) {
if (0 != 0) {
try {
cursor2.close();
} catch (SQLException e3) {
loge("getSelectedApn close SQLiteException.");
}
}
throw th;
}
logd("apn:" + apn);
return apn;
}
public String getSelectedApnName() {
Cursor cursor;
String apnName = null;
Context mContext = this.mHwGsmCdmaPhoneInner != null ? this.mPhoneExt.getContext() : null;
if (mContext == null) {
return null;
}
if (IS_MULTI_ENABLE) {
cursor = mContext.getContentResolver().query(ContentUris.withAppendedId(PREFERAPN_NO_UPDATE_URI, (long) this.mPhoneExt.getPhoneId()), new String[]{"_id", HwTelephony.NumMatchs.NAME, "apn"}, null, null, HwTelephony.NumMatchs.DEFAULT_SORT_ORDER);
} else {
cursor = mContext.getContentResolver().query(PREFERAPN_NO_UPDATE_URI, new String[]{"_id", HwTelephony.NumMatchs.NAME, "apn"}, null, null, HwTelephony.NumMatchs.DEFAULT_SORT_ORDER);
}
if (cursor != null) {
if (cursor.getCount() > 0) {
cursor.moveToFirst();
apnName = cursor.getString(cursor.getColumnIndexOrThrow(HwTelephony.NumMatchs.NAME));
}
cursor.close();
}
logd("apnname" + apnName);
return apnName;
}
public String getCustOperatorName(String rplmn) {
if (this.mHwGsmCdmaPhoneInner != null) {
this.mSimRecordsEx = this.mPhoneExt.getIccRecords();
}
IccRecordsEx iccRecordsEx = this.mSimRecordsEx;
String imsi = iccRecordsEx != null ? iccRecordsEx.getIMSI() : null;
Context context = this.mHwGsmCdmaPhoneInner != null ? this.mPhoneExt.getContext() : null;
String custOperatorString = context != null ? Settings.System.getString(context.getContentResolver(), "hw_cust_operator") : null;
logd("mCustOperatorString" + custOperatorString);
if (TextUtils.isEmpty(custOperatorString) || TextUtils.isEmpty(imsi) || TextUtils.isEmpty(rplmn)) {
return null;
}
int maxLength = 0;
String operatorName = null;
for (String item : custOperatorString.split(";")) {
String[] plmns = item.split(",");
if (plmns.length == 3) {
if (rplmn.equals(plmns[1]) && ((imsi.startsWith(plmns[0]) || "0".equals(plmns[0])) && plmns[0].length() > maxLength)) {
operatorName = plmns[2];
maxLength = plmns[0].length();
logd("operatorName changed" + operatorName);
}
} else if (plmns.length == 5) {
operatorName = getOperatorNameFromFiveParaConf(imsi, rplmn, plmns, operatorName);
} else {
logd("Wrong length");
}
}
return operatorName;
}
private String getOperatorNameFromFiveParaConf(String imsi, String rplmn, String[] plmns, String operatorName) {
String tempOperratorName = operatorName;
if (!rplmn.equals(plmns[3]) || !imsi.startsWith(plmns[1])) {
return tempOperratorName;
}
if ("0".equals(plmns[0]) && isSpnGid1ApnnameMatched(plmns[2], 0)) {
tempOperratorName = plmns[4];
logd("operatorName changed by spn confirg");
}
if ("1".equals(plmns[0]) && isSpnGid1ApnnameMatched(plmns[2], 1)) {
tempOperratorName = plmns[4];
logd("operatorName changed by Gid1 confirg");
}
if ("2".equals(plmns[0]) && isSpnGid1ApnnameMatched(plmns[2], 2)) {
tempOperratorName = plmns[4];
logd("operatorName changed by Apn confirg");
}
if (!"3".equals(plmns[0]) || !isSpnGid1ApnnameMatched(plmns[2], 3)) {
return tempOperratorName;
}
String tempOperratorName2 = plmns[4];
logd("operatorName changed by Apnname confirg");
return tempOperratorName2;
}
public boolean isSpnGid1ApnnameMatched(String spnOrGid1OrApnName, int rule) {
if (rule == 0) {
return handleSpnRule(spnOrGid1OrApnName);
}
if (rule == 1) {
return handleGid1Rule(spnOrGid1OrApnName);
}
if (rule == 2) {
return handleApnRule(spnOrGid1OrApnName);
}
if (rule == 3) {
return handleApnNameRule(spnOrGid1OrApnName);
}
return false;
}
private ArrayList<OperatorInfoEx> getEonsForAvailableNetworks(ArrayList<OperatorInfoEx> searchResult) {
IccRecordsEx iccRecordsEx;
ArrayList<OperatorInfoEx> eonsNetworkNames;
return (HwModemCapability.isCapabilitySupport(5) || (iccRecordsEx = this.mPhoneExt.getIccRecords()) == null || (eonsNetworkNames = iccRecordsEx.getEonsForAvailableNetworks(searchResult)) == null) ? searchResult : eonsNetworkNames;
}
private boolean enableCustOperatorNameBySpn(String hplmn, String plmn) {
if (this.mHwGsmCdmaPhoneInner == null) {
return false;
}
Context context = this.mPhoneExt.getContext();
String custOperatorName = null;
if (TextUtils.isEmpty(plmn) || TextUtils.isEmpty(hplmn)) {
return false;
}
if (context != null) {
custOperatorName = Settings.System.getString(context.getContentResolver(), "hw_enable_srchListNameBySpn");
}
if (TextUtils.isEmpty(custOperatorName)) {
return false;
}
for (String item : custOperatorName.split(";")) {
String[] plmns = item.split(",");
if (2 == plmns.length && hplmn.equals(plmns[0]) && plmn.equals(plmns[1])) {
return true;
}
}
return false;
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private ArrayList<OperatorInfoEx> custAvailableNetworks(ArrayList<OperatorInfoEx> searchResult) {
ArrayList<OperatorInfoEx> searchResult2;
int plmnEnd;
if (searchResult == null || searchResult.size() == 0) {
return searchResult;
}
int i = 0;
if (!SystemPropertiesEx.getBoolean("ro.config.srch_net_sim_ue_pri", false)) {
searchResult2 = getEonsForAvailableNetworks(searchResult);
} else {
searchResult2 = searchResult;
}
ArrayList<OperatorInfoEx> custResults = new ArrayList<>();
String radioTechStr = BuildConfig.FLAVOR;
int i2 = 0;
int listSize = searchResult2.size();
while (i2 < listSize) {
OperatorInfoEx operatorInfo = searchResult2.get(i2);
String plmn = operatorInfo.getOperatorNumericWithoutAct();
if (plmn != null && (plmnEnd = plmn.indexOf(",")) > 0) {
plmn = plmn.substring(i, plmnEnd);
}
String longName = null;
String longNameWithoutAct = null;
IccRecordsEx iccRecords = this.mPhoneExt.getIccRecords();
if (iccRecords != null) {
String hplmn = iccRecords.getOperatorNumeric();
int lastSpaceIndexInLongName = operatorInfo.getOperatorAlphaLong().lastIndexOf(32);
if (lastSpaceIndexInLongName != -1) {
radioTechStr = getRadioTechStr(operatorInfo, lastSpaceIndexInLongName);
longNameWithoutAct = operatorInfo.getOperatorAlphaLong().substring(i, lastSpaceIndexInLongName);
} else {
longNameWithoutAct = operatorInfo.getOperatorAlphaLong();
}
plmn = getPlmnByLastSpaceIndex(plmn, operatorInfo);
longName = getLongNameByCustOperator(plmn, hplmn, null, radioTechStr);
}
if (!TextUtils.isEmpty(longNameWithoutAct)) {
longName = getLongNameWithoutAck(longName, plmn, radioTechStr);
}
if (longName != null) {
custResults.add(OperatorInfoEx.makeOperatorInfoEx(longName, operatorInfo.getOperatorAlphaShort(), operatorInfo.getOperatorNumeric(), operatorInfo.getState(), operatorInfo.getLevel()));
} else {
custResults.add(operatorInfo);
}
i2++;
i = 0;
}
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
return hwCustHwGSMPhoneReference.filterActAndRepeatedItems(custResults);
}
return custResults;
}
private String getRadioTechStr(OperatorInfoEx operatorInfo, int lastSpaceIndexInLongName) {
String radioTechStr = operatorInfo.getOperatorAlphaLong().substring(lastSpaceIndexInLongName);
if (!isRadioTechStr(radioTechStr)) {
return BuildConfig.FLAVOR;
}
return radioTechStr;
}
private String getLongNameWithoutAck(String oriLongName, String plmn, String radioTechStr) {
String data = null;
try {
data = Settings.System.getString(this.mPhoneExt.getContext().getContentResolver(), "plmn");
logd("plmn config = " + data);
} catch (IllegalArgumentException e) {
loge("IllegalArgumentException when got data value");
} catch (Exception e2) {
loge("Exception when got data value");
}
if (TextUtils.isEmpty(data)) {
return oriLongName;
}
PlmnConstants plmnConstants = new PlmnConstants(data);
String longNameCust = plmnConstants.getPlmnValue(plmn, Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry());
if (longNameCust == null) {
longNameCust = plmnConstants.getPlmnValue(plmn, "en_US");
}
logd("longName = " + oriLongName + ", longNameCust = " + longNameCust);
if (oriLongName != null || longNameCust == null) {
return oriLongName;
}
return longNameCust.concat(radioTechStr);
}
private String getPlmnByLastSpaceIndex(String oriPlmn, OperatorInfoEx operatorInfo) {
int lastSpaceIndexInPlmn;
if (operatorInfo == null || (lastSpaceIndexInPlmn = operatorInfo.getOperatorNumeric().lastIndexOf(32)) == -1 || !isRadioTechStr(operatorInfo.getOperatorNumeric().substring(lastSpaceIndexInPlmn)) || oriPlmn == null) {
return oriPlmn;
}
return oriPlmn.substring(0, lastSpaceIndexInPlmn);
}
private boolean isRadioTechStr(String plmnRadioTechStr) {
return " 2G".equals(plmnRadioTechStr) || " 3G".equals(plmnRadioTechStr) || " 4G".equals(plmnRadioTechStr) || " 5G".equals(plmnRadioTechStr);
}
private String getLongNameByCustOperator(String plmn, String hplmn, String oriLongName, String radioTechStr) {
String spn;
String tempName = null;
String longName = oriLongName;
if (plmn != null) {
tempName = getCustOperatorName(plmn);
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
tempName = hwCustHwGSMPhoneReference.getCustOperatorNameBySpn(plmn, tempName);
}
}
if (tempName != null) {
longName = tempName.concat(radioTechStr);
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference2 = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference2 != null) {
longName = hwCustHwGSMPhoneReference2.modifyTheFormatName(plmn, tempName, radioTechStr);
}
}
if ((!"50503".equals(plmn) || !"50503".equals(hplmn)) && !enableCustOperatorNameBySpn(hplmn, plmn)) {
return longName;
}
int rule = this.mPhoneExt.getServiceStateTracker() != null ? this.mPhoneExt.getServiceStateTracker().getCarrierNameDisplayBitmask(this.mPhoneExt.getServiceState()) : 0;
IccRecordsEx iccRecords = this.mPhoneExt.getIccRecords();
if ((rule & 1) != 1 || iccRecords == null || (spn = iccRecords.getServiceProviderName()) == null || spn.trim().length() <= 0) {
return longName;
}
return spn.concat(radioTechStr);
}
private boolean getHwVmNotFromSimValue() {
boolean valueFromProp = IS_HW_VM_NOT_FROM_SIM;
Boolean valueFromCard = (Boolean) HwCfgFilePolicy.getValue("hw_voicemail_sim", this.mPhoneId, Boolean.class);
logd("getHwVmNotFromSimValue, phoneId" + this.mPhoneId + ", card:" + valueFromCard + ", prop: " + valueFromProp);
return valueFromCard != null ? valueFromCard.booleanValue() : valueFromProp;
}
public String getDefaultVoiceMailAlphaTagText(Context mContext, String ret) {
if (mContext == null) {
return ret;
}
if (getHwVmNotFromSimValue() || ret == null || ret.length() == 0 || isCustVoicemailTag(mContext)) {
return mContext.getText(HwPartResourceUtils.getResourceId("defaultVoiceMailAlphaTag")).toString();
}
return ret;
}
private boolean isCustVoicemailTag(Context mContext) {
String carrier;
String strVMTagNotFromConf = Settings.System.getString(mContext.getContentResolver(), "hw_vmtag_follow_language");
if (TelephonyManagerEx.isMultiSimEnabled()) {
carrier = TelephonyManagerEx.getSimOperatorNumericForPhone(this.mPhoneId);
} else {
carrier = TelephonyManagerEx.getDefault().getSimOperator();
}
if (!TextUtils.isEmpty(strVMTagNotFromConf) && !TextUtils.isEmpty(carrier)) {
for (String area : strVMTagNotFromConf.split(",")) {
if (area.equals(carrier)) {
logd("voicemail Tag need follow language");
return true;
}
}
}
logd("voicemail Tag not need follow language");
return false;
}
public String getMeid() {
logd("[HwGSMPhoneReference]getMeid()");
return this.mMeid;
}
public void setMeid(String meid) {
this.mMeid = meid;
}
public String getPesn() {
logd("[HwGSMPhoneReference]getPesn()");
return this.mPhoneExt.getEsn();
}
@Override // com.android.internal.telephony.HwPhoneReferenceBase
public boolean beforeHandleMessage(Message msg) {
logd("beforeHandleMessage what = " + msg.what);
int i = msg.what;
if (i == 105) {
updateReduceSARState();
return true;
} else if (i == 108) {
logd("onGetLteReleaseVersionDone:");
handleGetLteReleaseVersionDone(msg);
return true;
} else if (i == 111) {
logd("beforeHandleMessage handled->EVENT_SET_MODE_TO_AUTO ");
this.mPhoneExt.setNetworkSelectionModeAutomatic((Message) null);
return true;
} else if (i == 118) {
logd("beforeHandleMessage EVENT_UPLOAD_OPERATOR_INFO");
handleAvailableNetWorksUpload(msg);
return true;
} else if (i != 1000) {
return super.beforeHandleMessage(msg);
} else {
if (msg.arg2 == 2) {
logd("start retry get DEVICE_ID_MASK_ALL");
this.mPhoneExt.getCi().getDeviceIdentity(this.mPhoneExt.obtainMessage(21, msg.arg1, 0, (Object) null));
} else {
logd("EVENT_RETRY_GET_DEVICE_ID msg.arg2:" + msg.arg2 + ", error!!");
}
return true;
}
}
private void handleAvailableNetWorksUpload(Message msg) {
ArrayList<OperatorInfoEx> searchResults = null;
AsyncResultEx ar = AsyncResultEx.from(msg.obj);
if (ar == null) {
loge("[EVENT_UPLOAD_OPERATOR_INFO] error, msg obj is null");
return;
}
ArrayList<OperatorInfoEx> searchResultsFromMessage = OperatorInfoEx.from(ar.getResult());
if (ar.getException() == null && ar.getResult() != null) {
searchResults = custAvailableNetworks(searchResultsFromMessage);
}
if (searchResults == null || searchResults.size() == 0) {
searchResults = searchResultsFromMessage;
} else {
logd("[EVENT_UPLOAD_OPERATOR_INFO] Populated global version cust names for available networks.");
}
NetworkCallBackInteface networkCallBackInteface = this.mNetworkCallBackInterface;
if (networkCallBackInteface != null) {
networkCallBackInteface.showAvailableNetworks(OperatorInfoEx.convertToOperatorInfo(searchResults));
} else {
loge("[EVENT_UPLOAD_OPERATOR_INFO] error, callback obj is null!");
}
}
public void afterHandleMessage(Message msg) {
logd("afterHandleMessage what = " + msg.what);
int i = msg.what;
if (i == 1) {
this.mPhoneExt.getCi().getDeviceIdentity(this.mPhoneExt.obtainMessage(21));
logd("[HwGSMPhoneReference]PhoneBaseUtils.EVENT_RADIO_AVAILABLE");
logd("Radio available, get lte release version");
this.mPhoneExt.getCi().getLteReleaseVersion(this.mPhoneExt.obtainMessage(108));
} else if (i != 5) {
logd("unhandle event");
} else {
logd("Radio on, get lte release version");
this.mPhoneExt.getCi().getLteReleaseVersion(this.mPhoneExt.obtainMessage(108));
}
}
public void closeRrc() {
if (mIsQCRilGoDormant) {
qcRilGoDormant();
if (!mIsQCRilGoDormant) {
closeRrcInner();
return;
}
return;
}
closeRrcInner();
}
private void closeRrcInner() {
try {
logd("closeRrcInner in GSMPhone");
this.mPhoneExt.getCi().getClass().getMethod("closeRrc", new Class[0]).invoke(this.mPhoneExt.getCi(), new Object[0]);
} catch (NoSuchMethodException e) {
loge("no such method.");
} catch (Exception e2) {
loge("other exception.");
}
}
private void qcRilGoDormant() {
try {
if (mQcRilHook == null) {
mQcRilHook = Class.forName("com.qualcomm.qcrilhook.QcRilHook").getConstructor(Context.class).newInstance(this.mPhoneExt.getContext());
}
if (mQcRilHook != null) {
mQcRilHook.getClass().getMethod("qcRilGoDormant", String.class).invoke(mQcRilHook, BuildConfig.FLAVOR);
return;
}
logd("mQcRilHook is null");
mIsQCRilGoDormant = false;
} catch (ClassNotFoundException e) {
mIsQCRilGoDormant = false;
loge("the class QcRilHook not exist");
} catch (NoSuchMethodException e2) {
mIsQCRilGoDormant = false;
loge("the class QcRilHook NoSuchMethod: qcRilGoDormant [String]");
} catch (LinkageError e3) {
mIsQCRilGoDormant = false;
loge("class QcRilHook LinkageError", e3);
} catch (InstantiationException e4) {
mIsQCRilGoDormant = false;
loge("class QcRilHook InstantiationException", e4);
} catch (IllegalAccessException e5) {
mIsQCRilGoDormant = false;
loge("class QcRilHook IllegalAccessException", e5);
} catch (IllegalArgumentException e6) {
mIsQCRilGoDormant = false;
loge("class QcRilHook IllegalArgumentException", e6);
} catch (InvocationTargetException e7) {
mIsQCRilGoDormant = false;
loge("class QcRilHook InvocationTargetException", e7);
}
}
private int getCardType() {
this.redcueSARSpeacialType1 = SystemPropertiesEx.get(PROP_REDUCE_SAR_SPECIAL_TYPE1, " ");
this.redcueSARSpeacialType2 = SystemPropertiesEx.get(PROP_REDUCE_SAR_SPECIAL_TYPE2, " ");
this.mncForSAR = SystemPropertiesEx.get("reduce.sar.imsi.mnc", "FFFFF");
String str = this.mncForSAR;
if (str == null || str.equals("FFFFF") || this.mncForSAR.length() < 3) {
return 0;
}
this.mncForSAR = this.mncForSAR.substring(0, 3);
if (this.redcueSARSpeacialType1.contains(this.mncForSAR)) {
return 1;
}
if (this.redcueSARSpeacialType2.contains(this.mncForSAR)) {
return 2;
}
return 0;
}
private int getWifiType(int wifiHotState, int wifiState) {
if (wifiHotState == 13) {
return 2;
}
if (wifiState == 3) {
return 1;
}
return wifiState == 1 ? 0 : 0;
}
private int[][] getGradeData(boolean isReceiveOff) {
return !isReceiveOff ? new int[][]{new int[]{0, REDUCE_SAR_NORMAL_WIFI_ON, REDUCE_SAR_NORMAL_HOTSPOT_ON}, new int[]{REDUCE_SAR_SPECIAL_TYPE1_WIFI_OFF, REDUCE_SAR_SPECIAL_TYPE1_WIFI_ON, REDUCE_SAR_NORMAL_HOTSPOT_ON}, new int[]{REDUCE_SAR_SPECIAL_TYPE2_WIFI_OFF, REDUCE_SAR_SPECIAL_TYPE2_WIFI_ON, REDUCE_SAR_SPECIAL_TYPE2_HOTSPOT_ON}} : new int[][]{new int[]{REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON, REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON, REDUCE_SAR_NORMAL_HOTSPOT_ON}, new int[]{REDUCE_SAR_SPECIAL_TYPE1_WIFI_OFF, REDUCE_SAR_SPECIAL_TYPE1_WIFI_ON, REDUCE_SAR_NORMAL_HOTSPOT_ON}, new int[]{REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON, REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON, REDUCE_SAR_SPECIAL_TYPE1_HOTSPOT_ON}};
}
private void setPowerGrade(int powerGrade) {
if (this.mPrevPowerGrade != powerGrade) {
this.mPrevPowerGrade = powerGrade;
logd("updateReduceSARState() setPowerGrade() : " + powerGrade);
this.mPhoneExt.getCi().setPowerGrade(powerGrade, (Message) null);
}
}
private boolean reduceOldSar() {
if (!SystemPropertiesEx.getBoolean("ro.config.old_reduce_sar", false)) {
return false;
}
int wifiHotState = WifiManagerEx.getWifiApState(this.mWifiManager);
logd("Radio available, set wifiHotState " + wifiHotState);
if (wifiHotState == 13) {
setPowerGrade(1);
} else if (wifiHotState == 11) {
setPowerGrade(0);
} else {
loge("reduceOldSar, hot state is wrong, do nothing");
}
return true;
}
public void resetReduceSARPowerGrade() {
this.mPrevPowerGrade = -1;
}
public void updateReduceSARState() {
Boolean bool = this.mSarControlServiceExist;
boolean isReceiveOFF = true;
if (bool == null) {
try {
this.mSarControlServiceExist = this.mPhoneExt.getContext().getPackageManager().getApplicationInfo("com.huawei.sarcontrolservice", REDUCE_SAR_NORMAL_HOTSPOT_ON) != null;
logd("updateReduceSARState mSarControlServiceExist=" + this.mSarControlServiceExist);
if (this.mSarControlServiceExist.booleanValue() && !SystemPropertiesEx.getBoolean("ro.config.hw_ReduceSAR", false)) {
logd("updateReduceSARState mSarControlServiceExist=true");
return;
}
} catch (PackageManager.NameNotFoundException e) {
this.mSarControlServiceExist = false;
logd("updateReduceSARState mSarControlServiceExist=false");
}
} else if (bool.booleanValue() && !SystemPropertiesEx.getBoolean("ro.config.hw_ReduceSAR", false)) {
return;
}
logd("updateReduceSARState()");
if (!reduceOldSar() && SystemPropertiesEx.getBoolean("ro.config.hw_ReduceSAR", false)) {
AudioManager localAudioManager = (AudioManager) this.mPhoneExt.getContext().getSystemService("audio");
int cardType = getCardType();
int wifiType = getWifiType(WifiManagerEx.getWifiApState(this.mWifiManager), this.mWifiManager.getWifiState());
int state = TelephonyManagerEx.getDefault().getCallState();
boolean isWiredHeadsetOn = localAudioManager.isWiredHeadsetOn();
boolean isSpeakerphoneOn = localAudioManager.isSpeakerphoneOn();
if (!isWiredHeadsetOn && !isSpeakerphoneOn && state == 2) {
isReceiveOFF = false;
}
if (SystemPropertiesEx.getBoolean("persist.gsm.ReceiveTestMode", false)) {
isReceiveOFF = SystemPropertiesEx.getBoolean("persist.gsm.ReceiveTestValue", false);
logd("hw_ReceiveTestMode = true isReceiveOFF = " + isReceiveOFF);
}
int reduceData = getGradeData(isReceiveOFF)[cardType][wifiType];
logd("updateReduceSARState(); isWiredHeadsetOn=" + isWiredHeadsetOn + ", isSpeakerphoneOn=" + isSpeakerphoneOn + ", state=" + state + ", reduceData=" + reduceData);
setPowerGrade(reduceData);
}
}
public void dispose() {
HwVpApStatusHandler hwVpApStatusHandler;
if (IS_WCDMA_VP_ENABLED && (hwVpApStatusHandler = this.mHwVpApStatusHandler) != null) {
hwVpApStatusHandler.dispose();
}
this.mPhoneExt.getContext().unregisterReceiver(this.mReceiver);
}
public void switchVoiceCallBackgroundState(int state) {
this.mHwGsmCdmaPhoneInner.gsmCdmaPhoneSwitchVoiceCallBackgroundState(state);
}
public boolean isMmiCode(String dialString, UiccCardApplicationEx app) {
if (dialString == null || app == null) {
return false;
}
MmiCodeExt mmiCode = new MmiCodeExt();
mmiCode.setGsmMmiCode(dialString, this.mHwGsmCdmaPhoneInner, app);
if (!mmiCode.isNull()) {
return true;
}
switch (dialString.charAt(0)) {
case '0':
case '3':
case '4':
case '5':
if (dialString.length() == 1) {
return true;
}
return false;
case '1':
case '2':
if (dialString.length() <= 2) {
return true;
}
return false;
default:
return false;
}
}
public void getPOLCapabilty(Message response) {
this.mPhoneExt.getCi().getPOLCapabilty(response);
}
public void getPreferedOperatorList(Message response) {
this.mPhoneExt.getCi().getCurrentPOLList(response);
}
public void setPOLEntry(int index, String numeric, int nAct, Message response) {
this.mPhoneExt.getCi().setPOLEntry(index, numeric, nAct, response);
}
public boolean isCTSimCard(int slotId) {
return HwTelephonyManagerInner.getDefault().isCTSimCard(slotId);
}
public String processPlusSymbol(String dialNumber, String imsi) {
if (TextUtils.isEmpty(dialNumber) || !dialNumber.startsWith("+") || TextUtils.isEmpty(imsi) || imsi.length() > 15) {
return dialNumber;
}
int mccNum = -1;
try {
mccNum = Integer.parseInt(imsi.substring(0, 3));
} catch (NumberFormatException e) {
loge("processPlusSymbol NumberFormatException");
}
return HwPhoneNumberUtils.convertPlusByMcc(dialNumber, mccNum);
}
public boolean isSupportCFT() {
boolean isSupportCFTFlag = this.mPhoneExt.isSupportCFT();
logd("isSupportCFT=" + isSupportCFTFlag);
return isSupportCFTFlag;
}
public void setCallForwardingUncondTimerOption(int startHour, int startMinute, int endHour, int endMinute, int commandInterfaceCFAction, int commandInterfaceCFReason, String dialingNumber, Message onComplete) {
this.mPhoneExt.setCallForwardingUncondTimerOption(startHour, startMinute, endHour, endMinute, commandInterfaceCFAction, commandInterfaceCFReason, dialingNumber, onComplete);
}
public boolean getImsSwitch() {
return this.mPhoneExt.getCi().getImsSwitch();
}
public void setImsSwitch(boolean on) {
this.mPhoneExt.getCi().setImsSwitch(on);
}
public void processEccNumber(IServiceStateTrackerInner gSst) {
boolean isUseRplmn = false;
if (SystemPropertiesEx.getBoolean("ro.config.hw_globalEcc", false)) {
logd("EVENT_SIM_RECORDS_LOADED!!!!");
SystemPropertiesEx.set(PROPERTY_GLOBAL_FORCE_TO_SET_ECC, "usim_present");
String hplmn = TelephonyManagerEx.getSimOperatorNumericForPhone(this.mPhoneId);
boolean isRegHomeState = isRegisteredHomeNetworkForTransportType(this.mPhoneId, 1);
String rplmn = getRplmn();
if (SystemPropertiesEx.getBoolean("ro.config.hw_eccNumUseRplmn", false) && !TextUtils.isEmpty(rplmn) && !isRegHomeState) {
isUseRplmn = true;
}
if (TextUtils.isEmpty(hplmn)) {
logd("received EVENT_SIM_RECORDS_LOADED but not hplmn !!!!");
} else if (isUseRplmn) {
logd("processEccNumber: Use Rplmn, isRegHomeState= " + isRegHomeState + ", rplmn=" + rplmn);
globalEccCustom(rplmn);
} else {
globalEccCustom(hplmn);
}
}
}
@Override // com.android.internal.telephony.HwPhoneReferenceBase
public void globalEccCustom(String operatorNumeric) {
String eccListWithCard = null;
String eccListNoCard = null;
String forceEccState = SystemPropertiesEx.get(PROPERTY_GLOBAL_FORCE_TO_SET_ECC, "invalid");
boolean isRegStateChanged = this.mNetworkRegState != getCombinedNetworkRegState(this.mPhoneId);
logd("[SLOT" + this.mPhoneId + "]GECC-globalEccCustom: operator numeric = " + operatorNumeric + "; preOperatorNumeric = " + this.preOperatorNumeric + ";forceEccState = " + forceEccState + ", isRegStateChanged=" + isRegStateChanged);
if (TextUtils.isEmpty(operatorNumeric)) {
return;
}
if (!operatorNumeric.equals(this.preOperatorNumeric) || !forceEccState.equals("invalid") || isRegStateChanged) {
this.preOperatorNumeric = operatorNumeric;
SystemPropertiesEx.set(PROPERTY_GLOBAL_FORCE_TO_SET_ECC, "invalid");
if ((TextUtils.isEmpty(getRplmn()) || isRegisteredHomeNetworkForTransportType(this.mPhoneId, 1)) && virtualNetEccFormCarrier(this.mPhoneId)) {
int slotId = this.mPhoneId;
try {
eccListWithCard = (String) HwCfgFilePolicy.getValue("virtual_ecclist_withcard", slotId, String.class);
eccListNoCard = (String) HwCfgFilePolicy.getValue("virtual_ecclist_nocard", slotId, String.class);
logd("globalEccCustom: Registered Home State, Use VirtualNet Ecc eccListWithCard=" + eccListWithCard + " ecclistNocard=" + eccListNoCard);
} catch (ClassCastException e) {
loge("Failed to get ecclist in carrier ClassCastException");
} catch (Exception e2) {
loge("Failed to get ecclist in carrier");
}
}
String custEcc = getCustEccList(operatorNumeric);
if (!TextUtils.isEmpty(custEcc)) {
String[] custEccArray = custEcc.split(":");
if (custEccArray.length == 3 && custEccArray[0].equals(operatorNumeric) && !TextUtils.isEmpty(custEccArray[1]) && !TextUtils.isEmpty(custEccArray[2])) {
eccListWithCard = custEccArray[1];
eccListNoCard = custEccArray[2];
}
}
setEmergencyByEccList(eccListWithCard, eccListNoCard, operatorNumeric);
}
}
private void setEmergencyByEccList(String oriEccListWithCard, String oriEccListNoCard, String operatorNumeric) {
String eccListWithCard = oriEccListWithCard;
String eccListNoCard = oriEccListNoCard;
if (eccListWithCard == null) {
Cursor cursor = null;
try {
cursor = this.mPhoneExt.getContext().getContentResolver().query(TelephonyEx.GlobalMatchs.CONTENT_URI, new String[]{"_id", HwTelephony.NumMatchs.NAME, "numeric", HwTelephony.VirtualNets.ECC_WITH_CARD, HwTelephony.VirtualNets.ECC_NO_CARD}, "numeric= ?", new String[]{operatorNumeric}, HwTelephony.NumMatchs.DEFAULT_SORT_ORDER);
} catch (SQLException e) {
loge("Query CONTENT_URI error.");
}
if (cursor == null) {
logd("[SLOT" + this.mPhoneId + "]GECC-globalEccCustom: No matched emergency numbers in db.");
this.mPhoneExt.getCi().requestSetEmergencyNumbers(BuildConfig.FLAVOR, BuildConfig.FLAVOR);
return;
}
try {
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
eccListWithCard = cursor.getString(3);
eccListNoCard = cursor.getString(4);
cursor.moveToNext();
}
} catch (Exception e2) {
logd("[SLOT" + this.mPhoneId + "]globalEccCustom: global version cause exception!");
} catch (Throwable th) {
cursor.close();
throw th;
}
cursor.close();
}
logd("[SLOT" + this.mPhoneId + "]GECC-globalEccCustom: ecc_withcard = " + eccListWithCard + ", ecc_nocard = " + eccListNoCard);
String eccListWithCard2 = eccListWithCard != null ? eccListWithCard : BuildConfig.FLAVOR;
String eccListNoCard2 = eccListNoCard != null ? eccListNoCard : BuildConfig.FLAVOR;
if (!eccListWithCard2.equals(BuildConfig.FLAVOR) || !eccListNoCard2.equals(BuildConfig.FLAVOR)) {
this.mPhoneExt.getCi().requestSetEmergencyNumbers(eccListWithCard2, eccListNoCard2);
} else {
this.mPhoneExt.getCi().requestSetEmergencyNumbers(BuildConfig.FLAVOR, BuildConfig.FLAVOR);
}
}
public String getHwCdmaPrlVersion() {
String prlVersion;
int slotId = this.mPhoneExt.getPhoneId();
int simCardState = TelephonyManagerEx.getDefault().getSimState(slotId);
if (simCardState != 5 || !HwTelephonyManagerInner.getDefault().isCDMASimCard(slotId)) {
prlVersion = "0";
} else {
prlVersion = this.mPhoneExt.getCi().getHwPrlVersion();
}
logd("getHwCdmaPrlVersion: prlVersion=" + prlVersion + ", slotId=" + slotId + ", simState=" + simCardState);
return prlVersion;
}
public String getHwCdmaEsn() {
String esn;
int slotId = this.mPhoneExt.getPhoneId();
int simCardState = TelephonyManagerEx.getDefault().getSimState(slotId);
if (simCardState != 5 || !HwTelephonyManagerInner.getDefault().isCDMASimCard(slotId)) {
esn = "0";
} else {
esn = this.mPhoneExt.getCi().getHwUimid();
}
logd("getHwCdmaEsn: esn=" + esn + ", slotId=" + slotId + ", simState=" + simCardState);
return esn;
}
public String getVMNumberWhenIMSIChange() {
if (this.mHwGsmCdmaPhoneInner == null || this.mPhoneExt == null) {
return null;
}
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.mPhoneExt.getContext());
String number = null;
String mIccId = this.mPhoneExt.getIccSerialNumber();
if (!TextUtils.isEmpty(mIccId)) {
String temp = sp.getString(mIccId + this.mPhoneExt.getPhoneId(), null);
if (temp != null) {
number = temp;
}
logd("getVMNumberWhenIMSIChange number= xxxxxx");
}
return number;
}
public boolean setISMCOEX(String setISMCoex) {
this.mPhoneExt.getCi().setISMCOEX(setISMCoex, (Message) null);
return true;
}
private String getCustEccList(String operatorNumeric) {
String custEccList = null;
try {
custEccList = Settings.System.getString(this.mPhoneExt.getContext().getContentResolver(), "hw_cust_emergency_nums");
} catch (IllegalArgumentException e) {
loge("Failed to load vmNum from SettingsEx IllegalArgumentException");
} catch (Exception e2) {
loge("Failed to load vmNum from SettingsEx");
}
if (TextUtils.isEmpty(custEccList) || TextUtils.isEmpty(operatorNumeric)) {
return BuildConfig.FLAVOR;
}
String[] custEccListItems = custEccList.split(";");
for (int i = 0; i < custEccListItems.length; i++) {
String[] custItem = custEccListItems[i].split(":");
if (custItem.length == 3 && custItem[0].equals(operatorNumeric)) {
return custEccListItems[i];
}
}
return BuildConfig.FLAVOR;
}
public void setImsDomainConfig(int domainType) {
this.mPhoneExt.getCi().setImsDomainConfig(domainType, (Message) null);
}
public void getImsDomain(Message response) {
this.mPhoneExt.getCi().getImsDomain(response);
}
public void handleUiccAuth(int auth_type, byte[] rand, byte[] auth, Message response) {
this.mPhoneExt.getCi().handleUiccAuth(auth_type, rand, auth, response);
}
public void handleMapconImsaReq(byte[] Msg) {
this.mPhoneExt.getCi().handleMapconImsaReq(Msg, (Message) null);
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void logd(String msg) {
RlogEx.i(this.subTag, msg);
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void loge(String msg) {
RlogEx.e(this.subTag, msg);
}
private void loge(String msg, Throwable tr) {
RlogEx.e(this.subTag, msg, tr);
}
public void selectCsgNetworkManually(Message response) {
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
hwCustHwGSMPhoneReference.selectCsgNetworkManually(response);
}
}
public void judgeToLaunchCsgPeriodicSearchTimer() {
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
hwCustHwGSMPhoneReference.judgeToLaunchCsgPeriodicSearchTimer();
}
}
public void registerForCsgRecordsLoadedEvent() {
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
hwCustHwGSMPhoneReference.registerForCsgRecordsLoadedEvent();
}
}
public void unregisterForCsgRecordsLoadedEvent() {
HwCustHwGSMPhoneReference hwCustHwGSMPhoneReference = this.mHwCustHwGSMPhoneReference;
if (hwCustHwGSMPhoneReference != null) {
hwCustHwGSMPhoneReference.unregisterForCsgRecordsLoadedEvent();
}
}
public void notifyCellularCommParaReady(int paratype, int pathtype, Message response) {
this.mPhoneExt.getCi().notifyCellularCommParaReady(paratype, pathtype, response);
}
public boolean isDualImsAvailable() {
return HwImsManagerInner.isDualImsAvailable();
}
public boolean isUssdOkForRelease() {
boolean ussdIsOkForRelease = false;
Context mContext = this.mHwGsmCdmaPhoneInner != null ? this.mPhoneExt.getContext() : null;
if (mContext == null) {
return false;
}
CarrierConfigManager configLoader = (CarrierConfigManager) mContext.getSystemService("carrier_config");
PersistableBundle bundle = null;
if (configLoader != null) {
bundle = configLoader.getConfigForSubId(this.mPhoneExt.getSubId());
}
if (bundle != null) {
ussdIsOkForRelease = bundle.getBoolean(USSD_IS_OK_FOR_RELEASE);
}
logd("isUssdOkForRelease: ussdIsOkForRelease " + ussdIsOkForRelease);
return ussdIsOkForRelease;
}
private void handleGetLteReleaseVersionDone(Message msg) {
AsyncResultEx ar = AsyncResultEx.from(msg.obj);
if (ar == null || ar.getException() != null) {
logd("Error in get lte release version.");
return;
}
int[] resultint = (int[]) ar.getResult();
if (resultint == null) {
logd("Error in get lte release version: null resultint");
} else if (resultint.length != 0) {
logd("onGetLteReleaseVersionDone: result=" + resultint[0]);
this.mLteReleaseVersion = resultint[0];
}
}
private boolean handleSpnRule(String spnOrgId1OrApnName) {
IccRecordsEx iccRecordsEx = this.mSimRecordsEx;
if (iccRecordsEx == null || spnOrgId1OrApnName == null) {
return false;
}
String spn = iccRecordsEx.getServiceProviderName();
logd("[EONS] spn = " + spn + ", spnOrgId1OrApnName(gid1 start with 0x) = " + spnOrgId1OrApnName);
if (!spnOrgId1OrApnName.equals(spn)) {
return false;
}
logd("[EONS] ShowPLMN: use the spn rule");
return true;
}
private boolean handleGid1Rule(String spnOrgId1OrApnName) {
byte[] gid1;
IccRecordsEx iccRecordsEx = this.mSimRecordsEx;
if (iccRecordsEx == null || spnOrgId1OrApnName == null || (gid1 = iccRecordsEx.getGID1()) == null || gid1.length <= 0 || spnOrgId1OrApnName.length() <= 2 || !spnOrgId1OrApnName.substring(0, 2).equalsIgnoreCase("0x")) {
return false;
}
logd("[EONS] gid1 = " + ((int) gid1[0]));
byte[] gid1valueBytes = IccUtilsEx.hexStringToBytes(spnOrgId1OrApnName.substring(2));
int i = 0;
while (i < gid1.length && i < gid1valueBytes.length) {
if (gid1[i] != gid1valueBytes[i]) {
return false;
}
i++;
}
logd("[EONS] ShowPLMN: use the Gid1 rule");
return true;
}
private boolean handleApnRule(String spnOrgId1OrApnName) {
if (this.mSimRecordsEx == null || spnOrgId1OrApnName == null) {
return false;
}
String apn = getSelectedApn();
logd("[EONS] apn = " + apn);
if (!spnOrgId1OrApnName.equals(apn)) {
return false;
}
logd("[EONS] ShowPLMN: use the apn rule");
return true;
}
private boolean handleApnNameRule(String spnOrgId1OrApnName) {
if (this.mSimRecordsEx == null || spnOrgId1OrApnName == null) {
return false;
}
String apnname = getSelectedApnName();
logd("[EONS] apnname = " + apnname);
if (!spnOrgId1OrApnName.equals(apnname)) {
return false;
}
logd("[EONS] ShowPLMN: use the apnname rule");
return true;
}
/* access modifiers changed from: protected */
@Override // com.android.internal.telephony.HwPhoneReferenceBase
public boolean isCurrentPhoneType() {
return TelephonyManagerEx.getCurrentPhoneType(this.mSubId) == 1;
}
public void startUploadAvailableNetworks(Object obj) {
if (obj instanceof NetworkCallBackInteface) {
this.mNetworkCallBackInterface = (NetworkCallBackInteface) obj;
this.mPhoneExt.getCi().getAvailableNetworks(this.mHandler.obtainMessage(2));
return;
}
loge("invalid callback object, obj is null " + (obj instanceof Handler));
}
public void stopUploadAvailableNetworks() {
this.mPhoneExt.getCi().setNetworkSelectionModeManual("00000,-1", (Message) null);
this.mNetworkCallBackInterface = null;
}
}
|
[
"[email protected]"
] | |
88d94b4cfb5e702bb526d323a397242481fdea85
|
3e527bdecc030fe3a5495a35ecdf79582277ff05
|
/jbase-cache/src/main/java/com/jayqqaa12/jbase/cache/spring/boot/config/SpringBootRedisPoolConfig.java
|
7a97ca12875f4fdb0b659dbf0341f1739792b528
|
[
"Apache-2.0"
] |
permissive
|
jayqqaa12/jbase
|
e6505ccc60cf00291737664263d8b8c0f2777aff
|
d2af77bd39b005986714c618d39be63c7f7e2943
|
refs/heads/master
| 2022-12-10T05:17:30.158538 | 2022-11-29T11:01:01 | 2022-11-29T11:01:01 | 42,926,308 | 8 | 6 |
Apache-2.0
| 2022-11-16T06:43:05 | 2015-09-22T10:06:23 |
Java
|
UTF-8
|
Java
| false | false | 217 |
java
|
package com.jayqqaa12.jbase.cache.spring.boot.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Created by 12 on 2017/9/21.
*/
public class SpringBootRedisPoolConfig {
}
|
[
"[email protected]"
] | |
70d59ed6c30a0c57da295e1523ee9f9b5a9fdbcf
|
007f2c6c2fae579d9f8987396a884cda81236e3e
|
/src/main/java/fr/esgi/projetannuel/model/Message.java
|
f7b0745f0bccf209bd9b6c6d76ac4252bf21cb71
|
[] |
no_license
|
UgoPerniceni/code-roulette
|
685aae532f546cde5e522a1ff19743ee29dc402c
|
8f9a1c9b7aa0ec2450405af0f39fc3f015cae5c7
|
refs/heads/master
| 2023-06-27T18:19:44.362661 | 2021-07-27T23:03:57 | 2021-07-27T23:03:57 | 386,019,482 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,895 |
java
|
package fr.esgi.projetannuel.model;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.time.LocalDateTime;
@Entity
public class Message {
@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(
name = "UUID",
strategy = "org.hibernate.id.UUIDGenerator"
)
@Column(updatable = false, nullable = false)
private String id;
@Column(columnDefinition="text", nullable = false)
private String text;
@Column(nullable = true)
private String type;
@Column(nullable = true)
private LocalDateTime createdAt;
@OneToOne
private User user;
public Message() {}
public Message(String text, String type, User user){
this.text = text;
this.type = type;
this.user = user;
this.createdAt = LocalDateTime.now();
}
public Message(String id, String text, String type, User user) {
this.id = id;
this.text = text;
this.type = type;
this.user = user;
this.createdAt = LocalDateTime.now();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String formatMessageToChat() {
return String.format("%s : %s", this.user.getUserName(), this.text);
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
|
[
"[email protected]"
] | |
0b4a753d02cbf316726ea7d511a5ea41bdc90dbf
|
ffe2a0a3a26e3c95a61785cf2d945578d6d01618
|
/src/main/java/pageObjects/NavFindPeople_Page.java
|
874b3d0addbf33478fb5a5545011b5f82330e369
|
[] |
no_license
|
adventure-star/java-cucumbercompany
|
46d1497b84914c21eb3370472d0e5eca8c40f15b
|
8e1577dafe51a5fa720146018384092e7c7d3d87
|
refs/heads/master
| 2022-11-30T16:19:52.601528 | 2020-08-14T06:01:24 | 2020-08-14T06:01:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,999 |
java
|
package pageObjects;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.FindBy;
public class NavFindPeople_Page extends BasePage {
public @FindBy(xpath = "//div[@class='row lawyerSearch__results']") WebElement container_RetrievedLawyers;
public @FindBy(xpath = "") WebElement navLinKFindPeople;
public @FindBy(xpath = "//input[@id='lawyer-search-term-nav']") WebElement textField_FPSearch;
public @FindBy(xpath = "//li/a[contains(text(),'Find People')]") WebElement title_FindPeople;
public @FindBy(xpath = "//div[@class='col-sm-4 lawyerSearch__resultItem']/*/span[1]") WebElement resultItem_RetrievedLawyers;
public NavFindPeople_Page() throws IOException {
super();
}
//list can be replaced with a @findall annotation - see findalawyerpage
public NavFindPeople_Page assertRetrievedResultsContainSearchTerm(String searchTerm) throws Exception {
Thread.sleep(3000);
List<WebElement> profileName = driver.findElements(By.xpath("//div[@class='col-sm-4 lawyerSearch__resultItem']/*/span[1]"));
for (WebElement we: profileName) {
String nameIs = we.getText();
nameIs = nameIs.toLowerCase();
System.out.println("search term is " + searchTerm + " and profile reads as " + nameIs);
assertTrue(nameIs.contains(searchTerm));
}
return new NavFindPeople_Page();
}
public NavFindPeople_Page clickInNavFindPeopleSearchBox(String title, String webElement) throws IOException {
Actions action = new Actions(getDriver());
action.moveToElement(title_FindPeople).moveToElement(textField_FPSearch).click().build().perform();
return new NavFindPeople_Page();
}
public NavFindPeople_Page inputKeysToNavLawyerSearch(String searchTerm) throws Exception {
sendKeysToWebElement(textField_FPSearch, searchTerm);
return new NavFindPeople_Page();
}
}
|
[
"[email protected]"
] | |
3514b47c4966a9040b06b596e94f4da804794afc
|
5d90bc814655170d402ac73b216336fcd3a39468
|
/app/src/main/java/mycompany/com/doctorapp/utils/CalendarViewScrollable.java
|
12a9beea0925e17e2af91c7a10a73b72d0b46178
|
[] |
no_license
|
pavan12228/DoctorApp
|
caa48d74d795ac3455e0adbf20b8f7b7aca18bbf
|
669961322f23475d19dbc82770ae98b6b96b479c
|
refs/heads/master
| 2021-01-13T17:21:24.419432 | 2017-02-13T03:36:40 | 2017-02-13T03:36:40 | 81,781,550 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 989 |
java
|
package mycompany.com.doctorapp.utils;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewParent;
import android.widget.CalendarView;
/**
* Created by Dell on 9/15/2016.
*/
public class CalendarViewScrollable extends CalendarView {
public CalendarViewScrollable(Context context) {
super(context);
}
public CalendarViewScrollable(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CalendarViewScrollable(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN)
{
ViewParent p = getParent();
if (p != null)
p.requestDisallowInterceptTouchEvent(true);
}
return false;
}
}
|
[
"[email protected]"
] | |
0ba0f169e2bad5ce2568cafd1a7aef10c35d926d
|
3a4166338445db31f8aaa62520f38552276d17f5
|
/instrumentation/vertx-web-3.0/src/test/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/VertxClientInstrumentationTest.java
|
8aae96229947a0dbc54963d0e384160e3643d434
|
[
"Apache-2.0"
] |
permissive
|
shashank11p/javaagent
|
b061fc04da2576f145db47b7f2cd2942c0419094
|
4a3cf6cffd25da79deb3b9d90b6b348b0b92c45f
|
refs/heads/main
| 2023-04-06T06:44:08.855564 | 2021-04-14T11:59:27 | 2021-04-14T11:59:27 | 335,222,537 | 0 | 0 |
Apache-2.0
| 2021-04-14T16:15:25 | 2021-02-02T08:42:03 |
Java
|
UTF-8
|
Java
| false | false | 3,979 |
java
|
/*
* Copyright The Hypertrace 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 io.opentelemetry.javaagent.instrumentation.hypertrace.vertx;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpMethod;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import org.hypertrace.agent.testing.AbstractHttpClientTest;
public class VertxClientInstrumentationTest extends AbstractHttpClientTest {
private static final Vertx vertx = Vertx.vertx(new VertxOptions());
private final HttpClientOptions clientOptions = new HttpClientOptions();
private final HttpClient httpClient = vertx.createHttpClient(clientOptions);
public VertxClientInstrumentationTest() {
super(false);
}
@Override
public Response doPostRequest(
String uri, Map<String, String> headers, String body, String contentType)
throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(1);
HttpClientRequest request = httpClient.requestAbs(HttpMethod.POST, uri);
for (Map.Entry<String, String> entry : headers.entrySet()) {
request = request.putHeader(entry.getKey(), entry.getValue());
}
request = request.putHeader("Content-Type", contentType);
BufferHandler bufferHandler = new BufferHandler(countDownLatch);
ResponseHandler responseHandler = new ResponseHandler(bufferHandler);
request.handler(responseHandler).end(body);
countDownLatch.await();
return new Response(bufferHandler.responseBody, responseHandler.responseStatus);
}
@Override
public Response doGetRequest(String uri, Map<String, String> headers)
throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(1);
HttpClientRequest request = httpClient.requestAbs(HttpMethod.GET, uri);
for (Map.Entry<String, String> entry : headers.entrySet()) {
request = request.putHeader(entry.getKey(), entry.getValue());
}
BufferHandler bufferHandler = new BufferHandler(countDownLatch);
ResponseHandler responseHandler = new ResponseHandler(bufferHandler);
request.handler(responseHandler).end();
countDownLatch.await();
return new Response(
bufferHandler.responseBody == null || bufferHandler.responseBody.isEmpty()
? null
: bufferHandler.responseBody,
responseHandler.responseStatus);
}
static class ResponseHandler implements Handler<HttpClientResponse> {
int responseStatus;
final BufferHandler bufferHandler;
ResponseHandler(BufferHandler bufferHandler) {
this.bufferHandler = bufferHandler;
}
@Override
public void handle(HttpClientResponse response) {
response.bodyHandler(bufferHandler);
responseStatus = response.statusCode();
}
}
static class BufferHandler implements Handler<Buffer> {
String responseBody;
final CountDownLatch countDownLatch;
BufferHandler(CountDownLatch countDownLatch) {
this.countDownLatch = countDownLatch;
}
@Override
public void handle(Buffer responseBodyBuffer) {
responseBody = responseBodyBuffer.getString(0, responseBodyBuffer.length());
countDownLatch.countDown();
}
}
}
|
[
"[email protected]"
] | |
3b79413395d7e5091352895b38dabd59a3c372b5
|
fb96cac5c9dd130d94aea33583107346a31a22ba
|
/cloudmall-admin/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java
|
0a28dcc0837b4fb5225b511318ea472e9819d7ad
|
[] |
no_license
|
hungwen0425/cloudmall
|
4caf9699eb8b2fb5977555a49f8acef9c16ccf5d
|
8a9f131fb27f60b8b44a51879e6bb9368810542d
|
refs/heads/master
| 2023-04-15T20:34:37.975606 | 2021-05-03T05:48:17 | 2021-05-03T05:48:17 | 290,043,457 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 692 |
java
|
/**
* Copyright (c) 2016-2019 人人開源 All rights reserved.
*
* https://www.renren.io
*
* 版權所有,侵權必究!
*/
package io.renren.modules.sys.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.sys.entity.SysRoleMenuEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 角色與選單對應關係
*
* @author [email protected]
*/
@Mapper
public interface SysRoleMenuDao extends BaseMapper<SysRoleMenuEntity> {
/**
* 根據角色ID,取得選單ID列表
*/
List<Long> queryMenuIdList(Long roleId);
/**
* 根據角色ID陣列,批量删除
*/
int deleteBatch(Long[] roleIds);
}
|
[
"[email protected]"
] | |
7cb32239aaff5a4bda92939a9fbd5a692de5d351
|
26a4c802af9cfb6104250034d01fb349b3d79f4e
|
/src/main/java/com/ibsplc/pageObjects/CRA071.java
|
ed564deaaa2938a19b977a2a41cef0efe7dfac6f
|
[] |
no_license
|
sreenathmohanan/Trucking_2021
|
903503858b5d6d95b599931308295e83fa65ce33
|
cc396354c48d8b425741e610df49a360f17b5306
|
refs/heads/main
| 2023-07-01T21:39:02.508233 | 2021-08-05T17:20:44 | 2021-08-05T17:20:44 | 393,112,647 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 23,527 |
java
|
package com.ibsplc.pageObjects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import com.ibsplc.common.BasePage;
import com.ibsplc.utils.MiscUtility;
import com.ibsplc.utils.PropertyHandler;
/**
* Screen OPR026 - CAPTURE AWB
* Created on 21/12/2017
*
* @author a-7868
*/
public class CRA071 extends BasePage {
public static String FRAME = "iCargoContentFrameCRA071";
public static String screenFrame = "iCargoContentFrameCRA071";
private static String objFilepath = PropertyHandler.getPropValue("resources\\EnvSetup.properties", "CRA_CMT.properties");
private static String genObjPath= PropertyHandler.getPropValue("resources\\EnvSetup.properties", "Generic.properties");
WebDriver driver;
String dataFileName;
private String dataFilePath = PropertyHandler.getPropValue("resources\\EnvSetup.properties", "testDataDirectory");
private By yesBtn,text_agentCode,btn_btnCreate,btn_btnDelete,
dropdown_targetPeriodBasis,btn_targetperiodbasislov,info_msg,
checkbox_targetperiodbasislovcheckBasis8,tbl_chargebasisbasicPopupTable,
btn_targetperiodbasislovbtOk,text_targetAmount,btn_btnListAccEntries,
text_currencyCode,text_payoutCurrency,btn_payoutAmountBasis,btn_targetperiodbasislovbtClear,
chkbox_payoutAmountBasischeckBasis8,btn_payoutAmountBasisbtOk,
btn_addLinkAmt,text_fromAmount1,text_fromAmount2,div_status,btn_noBtn,
text_toAmount1,text_applicablePercentageAmount1,text_toAmount2,btn_btnInactive,
text_applicablePercentageAmount2,btn_btnSave,btn_volumeincentivelov,btn_holdingcodelov,
text_volumeincentivelovagentCode,btn_volumeincentivelovlistButton,checkbox_targetperiodbasischeckBasis10,
chkbox_volumeincentivelovselectCheckBox,btn_volumeincentivelovokButton,btn_closetargetperiodbasislov,
text_volumeIncentiveId,btn_btnList,btn_btnActive,btn_btnClose,dropdown_basisOperator,
btn_ok,txt_basisValue,text_BasisCode8,text_BasisCode10,text_chargeBasis,info_error,
chk_holdingcode,btn_holdingcodebtnOk,txt_volumeIncentiveId,btn_delete;
public CRA071(WebDriver driver, String dataFileName) {
super(driver);
this.driver = driver;
initElements();
this.dataFilePath = this.dataFilePath + dataFileName;
this.dataFileName = dataFileName;
}
/**
* Initializes the page objects required for the class
*/
private void initElements() {
yesBtn = MiscUtility.getWebElement(genObjPath, "Generic_btn_diaYes");
btn_ok = MiscUtility.getWebElement(genObjPath, "Generic_btn_ok");
btn_noBtn = MiscUtility.getWebElement(genObjPath, "Generic_btn_noBtn");
text_agentCode=MiscUtility.getWebElement(objFilepath, "CRA071_text_agentCode");
btn_btnCreate=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnCreate");
dropdown_targetPeriodBasis=MiscUtility.getWebElement(objFilepath, "CRA071_dropdown_targetPeriodBasis");
btn_targetperiodbasislov=MiscUtility.getWebElement(objFilepath, "CRA071_btn_targetperiodbasislov");
checkbox_targetperiodbasislovcheckBasis8=MiscUtility.getWebElement(objFilepath, "CRA071_checkbox_targetperiodbasislovcheckBasis8");
btn_targetperiodbasislovbtOk=MiscUtility.getWebElement(objFilepath, "CRA071_btn_targetperiodbasislovbtOk");
text_targetAmount=MiscUtility.getWebElement(objFilepath, "CRA071_text_targetAmount");
text_currencyCode=MiscUtility.getWebElement(objFilepath, "CRA071_text_currencyCode");
text_payoutCurrency=MiscUtility.getWebElement(objFilepath, "CRA071_text_payoutCurrency");
btn_payoutAmountBasis=MiscUtility.getWebElement(objFilepath, "CRA071_btn_payoutAmountBasis");
chkbox_payoutAmountBasischeckBasis8=MiscUtility.getWebElement(objFilepath, "CRA071_chkbox_payoutAmountBasischeckBasis8");
btn_payoutAmountBasisbtOk=MiscUtility.getWebElement(objFilepath, "CRA071_btn_payoutAmountBasisbtOk");
btn_addLinkAmt=MiscUtility.getWebElement(objFilepath, "CRA071_btn_addLinkAmt");
text_fromAmount1=MiscUtility.getWebElement(objFilepath, "CRA071_text_fromAmount1");
text_toAmount1=MiscUtility.getWebElement(objFilepath, "CRA071_text_toAmount1");
text_applicablePercentageAmount1=MiscUtility.getWebElement(objFilepath, "CRA071_text_applicablePercentageAmount1");
text_fromAmount2=MiscUtility.getWebElement(objFilepath, "CRA071_text_fromAmount2");
text_toAmount2=MiscUtility.getWebElement(objFilepath, "CRA071_text_toAmount2");
text_applicablePercentageAmount2=MiscUtility.getWebElement(objFilepath, "CRA071_text_applicablePercentageAmount2");
btn_btnSave=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnSave");
btn_volumeincentivelov=MiscUtility.getWebElement(objFilepath, "CRA071_btn_volumeincentivelov");
text_volumeincentivelovagentCode=MiscUtility.getWebElement(objFilepath, "CRA071_text_volumeincentivelovagentCode");
btn_volumeincentivelovlistButton=MiscUtility.getWebElement(objFilepath, "CRA071_btn_volumeincentivelovlistButton");
chkbox_volumeincentivelovselectCheckBox=MiscUtility.getWebElement(objFilepath, "CRA071_chkbox_volumeincentivelovselectCheckBox");
btn_volumeincentivelovokButton=MiscUtility.getWebElement(objFilepath, "CRA071_btn_volumeincentivelovokButton");
text_volumeIncentiveId=MiscUtility.getWebElement(objFilepath, "CRA071_text_volumeIncentiveId");
btn_btnList=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnList");
btn_btnActive=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnActive");
btn_btnClose=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnClose");
checkbox_targetperiodbasischeckBasis10=MiscUtility.getWebElement(objFilepath, "CRA071_checkbox_targetperiodbasischeckBasis10");
dropdown_basisOperator=MiscUtility.getWebElement(objFilepath, "CAR071_dropdown_basisOperator");
txt_basisValue=MiscUtility.getWebElement(objFilepath, "CAR071_txt_basisValue");
text_BasisCode8=MiscUtility.getWebElement(objFilepath, "CAR071_text_BasisCode8");
text_BasisCode10=MiscUtility.getWebElement(objFilepath, "CAR071_text_BasisCode10");
tbl_chargebasisbasicPopupTable=MiscUtility.getWebElement(objFilepath, "CRA071_tbl_chargebasisbasicPopupTable");
text_chargeBasis=MiscUtility.getWebElement(objFilepath, "CAR071_text_chargeBasis");
info_error = MiscUtility.getWebElement(genObjPath, "Generic_info_error");
btn_closetargetperiodbasislov=MiscUtility.getWebElement(objFilepath, "CAR071_btn_closetargetperiodbasislov");
//btn_targetperiodbasislovbtClear=MiscUtility.getWebElement(objFilepath, "btn_targetperiodbasislovbtClear");
info_msg = MiscUtility.getWebElement(genObjPath, "Generic_info_msg");
div_status=MiscUtility.getWebElement(objFilepath, "CRA071_div_status");
btn_btnInactive=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnInactive");
btn_btnDelete=MiscUtility.getWebElement(objFilepath, "CRA071_btn_btnDelete");
btn_holdingcodelov=MiscUtility.getWebElement(objFilepath, "CRA071_btn_holdingcodelov");
chk_holdingcode=MiscUtility.getWebElement(objFilepath, "CRA071_chk_holdingcode");
btn_holdingcodebtnOk=MiscUtility.getWebElement(objFilepath, "CRA071_btn_holdingcodebtnOk");
txt_volumeIncentiveId=MiscUtility.getWebElement(objFilepath, "CRA071_txt_volumeIncentiveId");
btn_delete=MiscUtility.getWebElement(objFilepath, "CRA071_btn_delete");
btn_btnListAccEntries=MiscUtility.getWebElement(objFilepath, "CRA203_btn_btnListAccEntries");
}
public CRA071 CreateVolumeIncentive(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
frmdate = PropertyHandler.getPropValue(dataFilePath, frmdate);
toDate=PropertyHandler.getPropValue(dataFilePath, toDate);
currency=PropertyHandler.getPropValue(dataFilePath, currency);
FChargeAddn=PropertyHandler.getPropValue(dataFilePath, FChargeAddn);
enterKeys(text_agentCode, agentCode_new);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
minWait();
waitForFrameAndSwitch(screenFrame);
selectByText(dropdown_targetPeriodBasis, "Bi Monthly");
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
click(btn_targetperiodbasislovbtOk);
minWait();
switchToFirstWindow();
waitForFrameAndSwitch(screenFrame);
enterKeys(text_targetAmount, "50");
enterKeys(text_currencyCode, currency);
enterKeys(text_payoutCurrency, currency);
click(btn_payoutAmountBasis);
waitForNewWindow(2);
switchToSecondWindow();
check(chkbox_payoutAmountBasischeckBasis8);
click(btn_payoutAmountBasisbtOk);
minWait();
switchToFirstWindow();
waitForFrameAndSwitch(screenFrame);
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount1, "0");
enterKeys(text_toAmount1, FChargeAddn);
int FCA = Integer.parseInt(FChargeAddn);
FCA=FCA+1;
String frmrange2=String.valueOf(FCA);
enterKeys(text_applicablePercentageAmount1, "2");
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount2, frmrange2);
enterKeys(text_toAmount2, "0");
enterKeys(text_applicablePercentageAmount2, "5");
click(btn_btnSave);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
minWait();
switchToFirstWindow();
waitForFrameAndSwitch(screenFrame);
String VolIncID=(waitForElement(text_volumeIncentiveId).getAttribute("value"));
System.out.println("Volume Incentive_ID:"+VolIncID);
FChargeAddn=PropertyHandler.setPropValue(dataFilePath, VInc_ID, VolIncID);
click(btn_btnList);
minWait();
Assert.assertTrue(waitForElement(div_status).getText().contains("New"));
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(btn_noBtn);
minWait();
waitForFrameAndSwitch(screenFrame);
Assert.assertTrue(waitForElement(div_status).getText().contains("New"));
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
//minWait();
//driver.switchTo().defaultContent();
//click(btn_ok);
waitForFrameAndSwitch(screenFrame);
Assert.assertTrue(waitForElement(div_status).getText().contains("Active"));
return this;
}
public CRA071 SaveandModifyVolumeIncentive(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
frmdate = PropertyHandler.getPropValue(dataFilePath, frmdate);
toDate=PropertyHandler.getPropValue(dataFilePath, toDate);
currency=PropertyHandler.getPropValue(dataFilePath, currency);
FChargeAddn=PropertyHandler.getPropValue(dataFilePath, FChargeAddn);
enterKeys(text_agentCode, agentCode_new);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
selectByValue(dropdown_targetPeriodBasis, "Bi-Monthly");
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
click(btn_targetperiodbasislovbtOk);
waitForFrameAndSwitch(screenFrame);
enterKeys(text_targetAmount, "50");
enterKeys(text_currencyCode, currency);
enterKeys(text_payoutCurrency, currency);
click(btn_payoutAmountBasis);
waitForNewWindow(2);
switchToSecondWindow();
check(chkbox_payoutAmountBasischeckBasis8);
click(btn_payoutAmountBasisbtOk);
waitForFrameAndSwitch(screenFrame);
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount1, "0");
enterKeys(text_toAmount1, FChargeAddn);
int FCA = Integer.parseInt(FChargeAddn);
FCA=FCA+1;
String frmrange2=String.valueOf(FCA);
enterKeys(text_applicablePercentageAmount1, "2");
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount2, frmrange2);
enterKeys(text_toAmount2, "0");
enterKeys(text_applicablePercentageAmount2, "5");
click(btn_btnSave);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
String VolIncID=(waitForElement(text_volumeIncentiveId).getAttribute("value"));
System.out.println("Volume Incentive_ID:"+VolIncID);
FChargeAddn=PropertyHandler.setPropValue(dataFileName, VInc_ID, VolIncID);
click(btn_btnList);
minWait();
enterKeys(text_targetAmount, "55");
enterKeys(text_applicablePercentageAmount1, "3");
click(btn_btnSave);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
return this;
}
public CRA071 CreateVolumeIncentiveWithHoldingComp(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
frmdate = PropertyHandler.getPropValue(dataFilePath, frmdate);
toDate=PropertyHandler.getPropValue(dataFilePath, toDate);
currency=PropertyHandler.getPropValue(dataFilePath, currency);
FChargeAddn=PropertyHandler.getPropValue(dataFilePath, FChargeAddn);
enterKeys(text_agentCode, agentCode_new);
click(btn_holdingcodelov);
waitForNewWindow(2);
switchToSecondWindow();
check(chk_holdingcode);
click(btn_holdingcodebtnOk);
minWait();
waitForFrameAndSwitch(screenFrame);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
selectByValue(dropdown_targetPeriodBasis, "Bi-Monthly");
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
click(btn_targetperiodbasislovbtOk);
waitForFrameAndSwitch(screenFrame);
enterKeys(text_targetAmount, "50");
enterKeys(text_currencyCode, currency);
enterKeys(text_payoutCurrency, currency);
click(btn_payoutAmountBasis);
waitForNewWindow(2);
switchToSecondWindow();
check(chkbox_payoutAmountBasischeckBasis8);
click(btn_payoutAmountBasisbtOk);
waitForFrameAndSwitch(screenFrame);
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount1, "0");
enterKeys(text_toAmount1, FChargeAddn);
int FCA = Integer.parseInt(FChargeAddn);
FCA=FCA+1;
String frmrange2=String.valueOf(FCA);
enterKeys(text_applicablePercentageAmount1, "2");
click(btn_addLinkAmt);
minWait();
enterKeys(text_fromAmount2, frmrange2);
enterKeys(text_toAmount2, "0");
enterKeys(text_applicablePercentageAmount2, "5");
click(btn_btnSave);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
String VolIncID=(waitForElement(text_volumeIncentiveId).getAttribute("value"));
System.out.println("Volume Incentive_ID:"+VolIncID);
FChargeAddn=PropertyHandler.setPropValue(dataFileName, VInc_ID, VolIncID);
click(btn_btnList);
minWait();
Assert.assertTrue(waitForElement(div_status).getText().contains("New"));
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(btn_noBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("New"));
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
Assert.assertTrue(waitForElement(div_status).getText().contains("Active"));
return this;
}
public CRA071 InactivateVolumeIncentive(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
VInc_ID=PropertyHandler.getPropValue(dataFilePath, VInc_ID);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
click(btn_btnList);
minWait();
click(btn_btnInactive);
minWait();
driver.switchTo().defaultContent();
minWait();
driver.switchTo().defaultContent();
click(btn_noBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("Active"));
click(btn_btnInactive);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(info_msg).getText().contains("Do you want change the status to Inactive?"));
click(yesBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("Inactive"));
return this;
}
public CRA071 CheckModifyingActiveVolInv(String agentCode_new, String frmdate,String toDate,String VInc_ID){
VInc_ID=PropertyHandler.getPropValue(dataFilePath, VInc_ID);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
click(btn_btnList);
minWait();
Assert.assertFalse(waitForElement(text_targetAmount).isEnabled(), "Able to modify Active Volume incentive");
return this;
}
public CRA071 DeleteSavedVol_Inv(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
VInc_ID=PropertyHandler.getPropValue(dataFilePath, VInc_ID);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
click(btn_btnList);
minWait();
click(btn_btnDelete);
minWait();
driver.switchTo().defaultContent();
minWait();
driver.switchTo().defaultContent();
click(btn_noBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("Active"));
click(btn_btnInactive);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(info_msg).getText().contains("Do you want change the status to Inactive?"));
click(yesBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("Inactive"));
return this;
}
public CRA071 ActivateInactiveVolInv(String agentCode_new, String frmdate,String toDate,String currency,String FChargeAddn,String VInc_ID){
VInc_ID=PropertyHandler.getPropValue(dataFilePath, VInc_ID);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
click(btn_btnList);
minWait();
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(btn_noBtn);
minWait();
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(div_status).getText().contains("New"));
click(btn_btnActive);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
minWait();
driver.switchTo().defaultContent();
click(btn_ok);
waitForFrameAndSwitch(screenFrame);
Assert.assertTrue(waitForElement(div_status).getText().contains("Active"));
return this;
}
public CRA071 SelectChargebasis(String agentCode_new){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
enterKeys(text_agentCode, agentCode_new);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
tblSetListValueByColValue(tbl_chargebasisbasicPopupTable, 2, 3, "OCDA", "+");
check(checkbox_targetperiodbasischeckBasis10);
minWait();
Assert.assertTrue(waitForElement(txt_basisValue).getText().contains("MKTCHG+OCDA"),"Error: The selected formula not displayed in the bottom");
check(checkbox_targetperiodbasischeckBasis10);
minWait();
Assert.assertTrue(waitForElement(txt_basisValue).getText().contains("MKTCHG"),"Error: The selected formula not changed in the bottom");
click(btn_targetperiodbasislovbtOk);
minWait();
waitForFrameAndSwitch(screenFrame);
Assert.assertTrue(waitForElement(text_chargeBasis).getText().contains("MKTCHG"),"Error: The selected formula not shown in chargeBasis");
return this;
}
public CRA071 SelectChargebasisWithMissingOperand(String agentCode_new){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
enterKeys(text_agentCode, agentCode_new);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
check(checkbox_targetperiodbasischeckBasis10);
click(btn_targetperiodbasislovbtOk);
minWait();
Assert.assertTrue(waitForElement(info_error).getText().contains("Operand missing.Please select appropriate operand"),"Error: Missing Operand Error not shown");
click(btn_closetargetperiodbasislov);
driver.switchTo().defaultContent();
Assert.assertTrue(waitForElement(info_msg).getText().contains("Unsaved data exists. Do you want to continue?"),"Error: Message not shown");
click(yesBtn);
waitForFrameAndSwitch(screenFrame);
return this;
}
public CRA071 Cleardata(String agentCode_new){
agentCode_new = PropertyHandler.getPropValue(dataFilePath, agentCode_new);
enterKeys(text_agentCode, agentCode_new);
click(btn_btnCreate);
minWait();
driver.switchTo().defaultContent();
click(yesBtn);
click(btn_targetperiodbasislov);
waitForNewWindow(2);
switchToSecondWindow();
check(checkbox_targetperiodbasislovcheckBasis8);
minWait();
Assert.assertTrue(waitForElement(txt_basisValue).getText().contains("MKTCHG"),"Error: The selected formula not changed in the bottom");
click(btn_targetperiodbasislovbtClear);
minWait();
Assert.assertTrue(waitForElement(txt_basisValue).getText().isEmpty(),"Error: The value is not cleared");
waitForFrameAndSwitch(screenFrame);
return this;
}
public CRA071 DeleteVolInv(String agentCode_new,String VInc_ID){
VInc_ID=PropertyHandler.getPropValue(dataFilePath, VInc_ID);
click(btn_volumeincentivelov);
waitForNewWindow(2);
switchToSecondWindow();
enterKeys(text_volumeincentivelovagentCode,agentCode_new);
click(btn_volumeincentivelovlistButton);
minWait();
check(chkbox_volumeincentivelovselectCheckBox);
click(btn_volumeincentivelovokButton);
waitForFrameAndSwitch(screenFrame);
click(btn_btnList);
minWait();
click(btn_btnListAccEntries);
if(driver.getTitle().contains("List Accounting Entries"))
minWait();
waitForFrameAndSwitch(screenFrame);
return this;
}
public HomePage close() {
click(btn_btnClose);
driver.switchTo().defaultContent();
if (verifyElementPresent(yesBtn)) {
click(yesBtn);
}
return new HomePage(driver, dataFileName);
}
}
|
[
"[email protected]"
] | |
8b9e3cb88da812424edf9a55cb42de21632c6d74
|
a275f181abc7b6022158c4c40ac5b3f552dd513a
|
/src/main/java/com/thinkgem/jeesite/modules/turn/FordFulkerson.java
|
e5f728a5816a41ddd104bf8c4fd6554e149aeffc
|
[
"Apache-2.0"
] |
permissive
|
kr11/jeesite
|
1b70bbbce2caebc4be2cb81322b2d103ba302e23
|
b24739260612a0199dec5eb05e9884ab9c0a4ee0
|
refs/heads/master
| 2021-01-01T15:21:43.123674 | 2017-08-03T07:02:34 | 2017-08-03T07:02:34 | 97,602,125 | 0 | 0 | null | 2017-07-18T13:34:28 | 2017-07-18T13:34:28 | null |
UTF-8
|
Java
| false | false | 3,464 |
java
|
package com.thinkgem.jeesite.modules.turn;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
public class FordFulkerson
{
private double residualNetwork[][]=null;
private double flowNetwork[][]=null;
public final int N;
int parent[];
public FordFulkerson(int N)
{
this.N=N;
parent=new int[N];
}
public static void main(String[] args) {
double graph[][]={
{0,16,13,0,0,0},
{0,0,10,12,0,0},
{0,4,0,0,14,0},
{0,0,9,0,0,20},
{0,0,0,7,0,4},
{0,0,0,0,0,0}};
FordFulkerson ford = new FordFulkerson(6);
System.out.println(ford.edmondsKarpMaxFlow(graph,0,5));
}
/**
* 实现FordFulkerson方法的一种算法——edmondsKarp算法
* @param graph
* @param s
* @param t
* @return
*/
public double edmondsKarpMaxFlow(double graph[][],int s,int t)
{
int length=graph.length;
double f[][]=new double[length][length];
for(int i=0;i<length;i++)
{
Arrays.fill(f[i], 0);
}
double r[][]=residualNetwork(graph,f);
double result=augmentPath(r,s,t);
double sum=0;
while(result!=-1)
{
int cur=t;
while(cur!=s)
{
f[parent[cur]][cur]+=result;
f[cur][parent[cur]]=-f[parent[cur]][cur];
r[parent[cur]][cur]-=result;
r[cur][parent[cur]]+=result;
cur=parent[cur];
}
sum+=result;
result=augmentPath(r,s,t);
}
residualNetwork=r;
flowNetwork=f;
return sum;
}
/**
* deepCopy
* @param c
* @param f
* @return
*/
private double[][] residualNetwork(double c[][],double f[][]) {
int length=c.length;
double r[][]=new double[length][length];
for(int i=0;i<length;i++)
{
for(int j=0;j<length;j++)
{
r[i][j]=c[i][j]-f[i][j];
}
}
return r;
}
/**
* 广度优先遍历,寻找增光路径,也是最短增广路径
* @param graph
* @param s
* @param t
* @return
*/
public double augmentPath(double graph[][],int s,int t)
{
double maxflow=Integer.MAX_VALUE;
Arrays.fill(parent, -1);
Queue<Integer> queue=new LinkedList<Integer>();
queue.add(s);
parent[s]=s;
while(!queue.isEmpty())
{
int p=queue.poll();
if(p==t)
{
while(p!=s)
{
if(maxflow>graph[parent[p]][p])
maxflow=graph[parent[p]][p];
p=parent[p];
}
break;
}
for(int i=0;i<graph.length;i++)
{
if(i!=p&&parent[i]==-1&&graph[p][i]>0)
{
//flow[i]=Math.min(flow[p], graph[p][i]);
parent[i]=p;
queue.add(i);
}
}
}
if(parent[t]==-1)
return -1;
return maxflow;
}
public double[][] getResidualNetwork() {
return residualNetwork;
}
public double[][] getFlowNetwork() {
return flowNetwork;
}
}
|
[
"[email protected]"
] | |
d5dd0da5e061a05c75c174b96f5a8c3d51cc2132
|
363233043015c9af70e1381a7d653633da33e2a2
|
/Lab 07/exercise7_1/src/main/java/cs544/exercise7_1/App.java
|
1c8baa0922ab13ea2163ccc3c17fa128b19fdecd
|
[] |
no_license
|
Jivan517/Enterprise-Architecture-Lab-Solutions
|
0531d5e597c7ba505d49d358c18327081804ba1a
|
e1fe71a4eee84c071f82b61d0fab2bffe07a30f2
|
refs/heads/master
| 2021-01-10T16:33:36.984357 | 2016-04-08T03:32:15 | 2016-04-08T03:32:15 | 55,568,660 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 524 |
java
|
package cs544.exercise7_1;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App
{
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"springconfig.xml");
ICustomerService customerService = context.getBean("customerService",
ICustomerService.class);
customerService.addCustomer("Frank Brown", "[email protected]",
"mainstreet 5", "Chicago", "60613");
}
}
|
[
"[email protected]"
] | |
24111fbd14e604395d22272c0f664143fce0a2ed
|
139960e2d7d55e71c15e6a63acb6609e142a2ace
|
/mobile_app1/module608/src/main/java/module608packageJava0/Foo802.java
|
848ff1a67993d5e44af6755067d2aa31f4959a60
|
[
"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 | 351 |
java
|
package module608packageJava0;
import java.lang.Integer;
public class Foo802 {
Integer int0;
Integer int1;
public void foo0() {
new module608packageJava0.Foo801().foo4();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
}
|
[
"[email protected]"
] | |
28eff4f98499bf785295285f95e5be022e589cec
|
77c1a761a5159c0274e5acd2f6b1b6ee7f19f9dc
|
/app/src/main/java/com/app/bemfapetipb/Adapter/MahasiswaAdapter.java
|
95f1e5a2649e4550b7976f19d228cb999c4fe6c0
|
[] |
no_license
|
rezaerbe/bem-fapet-ipb
|
a78e8c4f1e27fcb4a3cf06b53bc02b92b7c891a4
|
2719091bd196b6d1dc25021aae564c134e040a1a
|
refs/heads/master
| 2022-12-23T02:12:42.913142 | 2020-09-24T14:56:55 | 2020-09-24T14:56:55 | 294,335,912 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,992 |
java
|
package com.app.bemfapetipb.Adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.app.bemfapetipb.Model.Mahasiswa;
import com.app.bemfapetipb.R;
import com.app.bemfapetipb.Utils.CustomFilter;
import java.util.ArrayList;
import java.util.List;
public class MahasiswaAdapter extends RecyclerView.Adapter<MahasiswaAdapter.MyViewHolder> implements Filterable {
public List<Mahasiswa> mahasiswaList, mahasiswaFilter;
private Context context;
private RecyclerViewClickListener mListener;
CustomFilter filter;
public MahasiswaAdapter(List<Mahasiswa> mahasiswaList, Context context, RecyclerViewClickListener listener) {
this.mahasiswaList = mahasiswaList;
this.mahasiswaFilter = mahasiswaList;
this.context = context;
this.mListener = listener;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_mahasiswa, parent, false);
return new MyViewHolder(view, mListener);
}
@SuppressLint("CheckResult")
@Override
public void onBindViewHolder(final MyViewHolder holder, int position) {
holder.mNim.setText(mahasiswaList.get(position).getNim());
holder.mNama.setText(mahasiswaList.get(position).getNama());
}
@Override
public int getItemCount() {
return mahasiswaList.size();
}
@Override
public Filter getFilter() {
if (filter == null) {
filter = new CustomFilter((ArrayList<Mahasiswa>) mahasiswaFilter,this);
}
return filter;
}
public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private RecyclerViewClickListener mListener;
private TextView mNim, mNama;
private RelativeLayout mRowContainer;
public MyViewHolder(View itemView, RecyclerViewClickListener listener) {
super(itemView);
mNim = itemView.findViewById(R.id.nim);
mNama = itemView.findViewById(R.id.nama);
mRowContainer = itemView.findViewById(R.id.row_container);
mListener = listener;
mRowContainer.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.row_container:
// mListener.onRowClick(mRowContainer, getAdapterPosition());
break;
default:
break;
}
}
}
public interface RecyclerViewClickListener {
// void onRowClick(View view, int position);
}
}
|
[
"[email protected]"
] | |
363c6926ed8ed5bd23264c1d2fe9c3ec2d4561f2
|
654fd7e54ff39d46040dc01c9bcfaf3bff1f60e4
|
/src/of21/of21.java
|
3065749867aaeb126d661be7cd230ba0f9df3e2f
|
[] |
no_license
|
xingege662/Algorithm
|
09b972e408a899f9d3538c6d24696714b0e3b145
|
b6162e8a60f1acf8c03af5c679a445ee505e7a94
|
refs/heads/master
| 2021-09-11T13:53:59.277126 | 2018-04-08T10:48:31 | 2018-04-08T10:48:31 | 115,639,637 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,170 |
java
|
package of21;
import java.util.LinkedList;
import java.util.Queue;
/**
* Created by xinchang on 2018/3/17.
*/
public class of21 {
static class BinaryTreeNode{
BinaryTreeNode left;
BinaryTreeNode right;
int data;
}
public static void printFromToBottom(BinaryTreeNode node){
if (node != null) {
Queue<BinaryTreeNode> queue = new LinkedList<>();
queue.add(node);
BinaryTreeNode curNode;
while (!queue.isEmpty()) {
curNode = queue.remove();
System.out.print(curNode.data+" ");
if (curNode.left != null) {
queue.add(curNode.left);
}
if (curNode.right != null) {
queue.add(curNode.right);
}
}
}
}
public static void main(String[] args) {
// 8
// / \
// 6 10
// / \ / \
// 5 7 9 11
BinaryTreeNode root = new BinaryTreeNode();
root.data = 8;
root.left = new BinaryTreeNode();
root.left.data = 6;
root.left.left = new BinaryTreeNode();
root.left.left.data = 5;
root.left.right = new BinaryTreeNode();
root.left.right.data = 7;
root.right = new BinaryTreeNode();
root.right.data = 10;
root.right.left = new BinaryTreeNode();
root.right.left.data = 9;
root.right.right = new BinaryTreeNode();
root.right.right.data = 11;
printFromToBottom(root);
// 1
// /
// 3
// /
// 5
// /
// 7
// /
// 9
BinaryTreeNode root2 = new BinaryTreeNode();
root2.data = 1;
root2.left = new BinaryTreeNode();
root2.left.data = 3;
root2.left.left = new BinaryTreeNode();
root2.left.left.data = 5;
root2.left.left.left = new BinaryTreeNode();
root2.left.left.left.data = 7;
root2.left.left.left.left = new BinaryTreeNode();
root2.left.left.left.left.data = 9;
System.out.println("\n");
printFromToBottom(root2);
// 0
// \
// 2
// \
// 4
// \
// 6
// \
// 8
BinaryTreeNode root3 = new BinaryTreeNode();
root3.data = 0;
root3.right = new BinaryTreeNode();
root3.right.data = 2;
root3.right.right = new BinaryTreeNode();
root3.right.right.data = 4;
root3.right.right.right = new BinaryTreeNode();
root3.right.right.right.data = 6;
root3.right.right.right.right = new BinaryTreeNode();
root3.right.right.right.right.data = 8;
System.out.println("\n");
printFromToBottom(root3);
// 1
BinaryTreeNode root4 = new BinaryTreeNode();
root4.data = 1;
System.out.println("\n");
printFromToBottom(root4);
// null
System.out.println("\n");
printFromToBottom(null);
}
}
|
[
"[email protected]"
] | |
bcb43fce7ed9f67f6542802a98670aaec011bfa0
|
656bea2c9f05c895367ad5b8ab13e480df987dfe
|
/src/com/Crawler/main/RunMonthlyCrawler.java
|
484b7591544c9116ab28823821638485fa7aa637
|
[] |
no_license
|
Dongvud00422/MovieCrawler
|
b9de15ec5c2b6ad8e121d996d3196ae3b03045ec
|
9edfc490f992373ab9a9032699dbabc8c1b89ae7
|
refs/heads/master
| 2021-09-02T12:20:28.144923 | 2018-01-02T14:54:14 | 2018-01-02T14:54:14 | 114,091,248 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 954 |
java
|
package com.Crawler.main;
import com.Crawler.controller.CrawlCgvController;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.logging.Logger;
public class RunMonthlyCrawler extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Logger LOG = Logger.getLogger(RunMonthlyCrawler.class.getSimpleName());
LOG.info("Run monthly");
try {
CrawlCgvController cgvCrawler = new CrawlCgvController();
cgvCrawler.getCgvCity();
System.out.println("done city");
cgvCrawler.getTheaterInfo();
System.out.println("done theater");
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
}
|
[
"[email protected]"
] | |
8ca906fdb3b8dd0bbb376a46a1c4cf443aae25f4
|
f5482d13a6e68a236a71ed3a5cdba9833c454e6b
|
/CircRnaDetectDraft/ShareLibrary/ThirdPartyTools/cramtools-3.0/src/main/java/net/sf/cram/fasta/BGZF_ReferenceSequenceFile.java
|
7686cb8863ac5512505078310edebf958e126aab
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
lxwgcool/CircMarker
|
a4d28ef5f259f7c781ec26b83b51007aaab7c8f7
|
d850db5efbd3d04d3b3f10322bf2fd14b96f8127
|
refs/heads/master
| 2021-01-22T01:55:30.715911 | 2020-07-06T06:07:19 | 2020-07-06T06:07:19 | 81,019,813 | 6 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,411 |
java
|
package net.sf.cram.fasta;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Scanner;
import htsjdk.samtools.SAMSequenceDictionary;
import htsjdk.samtools.SAMSequenceRecord;
import htsjdk.samtools.cram.io.InputStreamUtils;
import htsjdk.samtools.reference.ReferenceSequence;
import htsjdk.samtools.reference.ReferenceSequenceFile;
import htsjdk.samtools.seekablestream.SeekableFileStream;
import htsjdk.samtools.util.BlockCompressedInputStream;
import htsjdk.samtools.util.Log;
import net.sf.cram.AlignmentSliceQuery;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.beust.jcommander.converters.FileConverter;
public class BGZF_ReferenceSequenceFile implements ReferenceSequenceFile {
private static Log log = Log.getInstance(BGZF_ReferenceSequenceFile.class);
private LinkedHashMap<String, FAIDX_FastaIndexEntry> index = new LinkedHashMap<String, FAIDX_FastaIndexEntry>();
private Iterator<String> iterator;
private BlockCompressedInputStream is;
private SAMSequenceDictionary dictionary;
public BGZF_ReferenceSequenceFile(File file) throws FileNotFoundException {
if (!file.canRead())
throw new RuntimeException("Cannot find or read fasta file: " + file.getAbsolutePath());
File indexFile = new File(file.getAbsolutePath() + ".fai");
if (!indexFile.canRead())
throw new RuntimeException("Cannot find or read fasta index file: " + indexFile.getAbsolutePath());
Scanner scanner = new Scanner(indexFile);
int seqID = 0;
dictionary = new SAMSequenceDictionary();
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
FAIDX_FastaIndexEntry entry = FAIDX_FastaIndexEntry.fromString(seqID++, line);
index.put(entry.getName(), entry);
dictionary.addSequence(new SAMSequenceRecord(entry.getName(), entry.getLen()));
}
scanner.close();
if (index.isEmpty())
log.warn("No entries in the index: " + indexFile.getAbsolutePath());
is = new BlockCompressedInputStream(new SeekableFileStream(file));
}
public List<String> lookUpByRegex(String regex) {
List<String> list = new ArrayList<String>();
for (String name : index.keySet())
if (name.matches(regex))
list.add(name);
return list;
}
@Override
public SAMSequenceDictionary getSequenceDictionary() {
return dictionary;
}
@Override
public ReferenceSequence nextSequence() {
if (iterator == null)
iterator = index.keySet().iterator();
if (!iterator.hasNext())
return null;
String name = iterator.next();
try {
return findSequence(name, 0, 0);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public void reset() {
iterator = null;
}
@Override
public boolean isIndexed() {
return true;
}
@Override
public ReferenceSequence getSequence(String contig) {
try {
return findSequence(contig, 0, 0);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public ReferenceSequence getSubsequenceAt(String contig, long start, long stop) {
try {
return findSequence(contig, start, stop);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public void close() throws IOException {
}
private ReferenceSequence findSequence(String name, long start, long stop) throws IOException {
if (!index.containsKey(name))
return null;
FAIDX_FastaIndexEntry entry = index.get(name);
if (start < 1)
start = 1;
if (stop < 1)
stop = start + entry.getLen() - 1;
if (stop < start)
throw new RuntimeException("Invalid sequence boundaries.");
int len = (int) (stop - start) + 1;
len = Math.min(entry.getLen(), len);
is.seek(entry.getStartPointer());
int lineBreakLen = entry.getBytesPerLine() - entry.getBasesPerLine();
{ // calculate how many bytes to skip from the beginning of the sequence
// in the file:
long skip = start + (start / entry.getBasesPerLine()) * lineBreakLen;
// System.out.println("skip=" + skip);
is.skip(skip - 1);
}
byte[] data = new byte[len];
int bufPos = 0;
byte b;
while ((b = (byte) is.read()) != -1 && bufPos < len && b != '\r' && b != '\n')
data[bufPos++] = b;
// skip the rest of "new line" bytes:
for (int i = 1; i < entry.getBytesPerLine() - entry.getBasesPerLine(); i++)
is.read();
// read complete lines:
int completeLinesToRead = (len - bufPos) / entry.getBasesPerLine();
for (int line = 0; line < completeLinesToRead; line++) {
InputStreamUtils.readFully(is, data, bufPos, entry.getBasesPerLine());
bufPos += entry.getBasesPerLine();
is.skip(lineBreakLen);
}
// read the rest of the last incomplete line:
while ((b = (byte) is.read()) != -1 && bufPos < len && b != '\r' && b != '\n')
data[bufPos++] = b;
return new ReferenceSequence(entry.getName(), entry.getIndex(), data);
}
public static void main(String[] args) throws FileNotFoundException {
Params params = new Params();
JCommander jc = new JCommander(params);
jc.setProgramName("bquery");
try {
jc.parse(args);
} catch (Exception e) {
jc.usage();
return;
}
if (params.file == null) {
jc.usage();
return;
}
BGZF_ReferenceSequenceFile rsf = new BGZF_ReferenceSequenceFile(params.file);
for (String stringQuery : params.queries) {
AlignmentSliceQuery q = new AlignmentSliceQuery(stringQuery);
if (!params.strictSeqNameMatch) {
List<String> list = lookup(q.sequence, rsf);
if (list.isEmpty()) {
log.warn("Sequence not found: " + q.sequence);
continue;
}
if (params.listMatches) {
for (String seq : list)
System.out.println(seq);
continue;
}
if (list.size() > 1)
q.sequence = chooseOne(q.sequence, list);
}
ReferenceSequence seq = rsf.getSubsequenceAt(q.sequence, q.start, q.end);
if (seq == null)
System.err.println("Nothing found for: " + stringQuery);
else
System.out.println(new String(seq.getBases()));
}
}
private static List<String> lookup(String name, BGZF_ReferenceSequenceFile rsf) {
return rsf.lookUpByRegex("\\b" + name + ".*\\b");
}
private static String chooseOne(String query, List<String> list) {
// grab the one that starts with the query or the first from
// the list:
String best = null;
boolean foundCandidateWhichStartsWithQuery = false;
for (String candidate : list) {
if (candidate.startsWith(query)) {
best = candidate;
foundCandidateWhichStartsWithQuery = true;
break;
}
}
if (!foundCandidateWhichStartsWithQuery)
best = list.get(0);
log.warn(String.format("Assuming '%s' means '%s'", query, best));
return best;
}
@Parameters(commandDescription = "BGZF fasta utility")
static class Params {
@Parameter(names = { "-I" }, description = "Block compressed fasta file.", converter = FileConverter.class)
File file;
@Parameter(description = "Regions to fetch, each region should follow the rule: <seq name>[:<start>][-<stop>]]")
List<String> queries;
@Parameter(names = { "--strict" }, description = "Match sequence names exactly as in the queries. ")
boolean strictSeqNameMatch = false;
@Parameter(names = { "--list-matches" }, description = "Print out a list of matching names.")
boolean listMatches = false;
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.