blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70fe61b1d381d030573c93e6f97f28d68369f2e3 | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201402/cm/AdGroupBidModifierService.java | 8a03c47ff597d47cafa0802db986eff5e7788652 | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,044 | java |
package com.google.api.ads.adwords.jaxws.v201402.cm;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.1
*
*/
@WebServiceClient(name = "AdGroupBidModifierService", targetNamespace = "https://adwords.google.com/api/adwords/cm/v201402", wsdlLocation = "https://adwords.google.com/api/adwords/cm/v201402/AdGroupBidModifierService?wsdl")
public class AdGroupBidModifierService
extends Service
{
private final static URL ADGROUPBIDMODIFIERSERVICE_WSDL_LOCATION;
private final static WebServiceException ADGROUPBIDMODIFIERSERVICE_EXCEPTION;
private final static QName ADGROUPBIDMODIFIERSERVICE_QNAME = new QName("https://adwords.google.com/api/adwords/cm/v201402", "AdGroupBidModifierService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("https://adwords.google.com/api/adwords/cm/v201402/AdGroupBidModifierService?wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
ADGROUPBIDMODIFIERSERVICE_WSDL_LOCATION = url;
ADGROUPBIDMODIFIERSERVICE_EXCEPTION = e;
}
public AdGroupBidModifierService() {
super(__getWsdlLocation(), ADGROUPBIDMODIFIERSERVICE_QNAME);
}
public AdGroupBidModifierService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
/**
*
* @return
* returns AdGroupBidModifierServiceInterface
*/
@WebEndpoint(name = "AdGroupBidModifierServiceInterfacePort")
public AdGroupBidModifierServiceInterface getAdGroupBidModifierServiceInterfacePort() {
return super.getPort(new QName("https://adwords.google.com/api/adwords/cm/v201402", "AdGroupBidModifierServiceInterfacePort"), AdGroupBidModifierServiceInterface.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns AdGroupBidModifierServiceInterface
*/
@WebEndpoint(name = "AdGroupBidModifierServiceInterfacePort")
public AdGroupBidModifierServiceInterface getAdGroupBidModifierServiceInterfacePort(WebServiceFeature... features) {
return super.getPort(new QName("https://adwords.google.com/api/adwords/cm/v201402", "AdGroupBidModifierServiceInterfacePort"), AdGroupBidModifierServiceInterface.class, features);
}
private static URL __getWsdlLocation() {
if (ADGROUPBIDMODIFIERSERVICE_EXCEPTION!= null) {
throw ADGROUPBIDMODIFIERSERVICE_EXCEPTION;
}
return ADGROUPBIDMODIFIERSERVICE_WSDL_LOCATION;
}
}
| [
"[email protected]"
] | |
74d4bfe8cb6ac49ae423d7f70839bb25231513a5 | dfcd2c3a871f2874f769b9053b7f7837f10f63ab | /src/main/java/com/isd/sappu/savari/services/LocationService.java | eb70a45a48288e7068c9e700d71b9868148b4ce6 | [] | no_license | isurudewasurendra/SappuSavari | e81ad1e33f708f0f87839f4f6c9d930566699d21 | 9a67c7e962d96bd1d9731cffae7b18fbad576320 | refs/heads/master | 2021-01-21T04:47:41.214300 | 2016-07-18T11:02:28 | 2016-07-18T11:02:28 | 45,827,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package com.isd.sappu.savari.services;
public interface LocationService {
public double getDistance(double fromLat, double fromLon, double toLat, double toLon, char unit);
}
| [
"[email protected]"
] | |
15c277ac27ad00e197b857b046987d5f11d17f63 | 6643a9f36ca1f3863fe84666d1b85362b8f99168 | /java-task2_stackCalc/src/test/java/ru/nsu/fit/g19202/dmakogon/task2/calc/commands/CommandsTests.java | 9b58dab15889331eb09d74e30054652c1a7c7d49 | [] | no_license | d-makogon/oop-tasks | f9f223043bfd35e51ea38f7b7c74659c89ef05ce | d0dea24afa9f411896f0d4d55b7a9115e0cfb90d | refs/heads/master | 2023-04-25T19:50:55.165670 | 2021-06-11T09:34:22 | 2021-06-11T09:34:22 | 292,892,558 | 1 | 0 | null | 2021-06-11T09:34:22 | 2020-09-04T16:12:36 | C++ | UTF-8 | Java | false | false | 17,492 | java | package ru.nsu.fit.g19202.dmakogon.task2.calc.commands;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import ru.nsu.fit.g19202.dmakogon.task2.calc.CommandContext;
import ru.nsu.fit.g19202.dmakogon.task2.calc.CommandExecutionContext;
import ru.nsu.fit.g19202.dmakogon.task2.calc.exceptions.DefineAlreadyExistsException;
import ru.nsu.fit.g19202.dmakogon.task2.calc.exceptions.EmptyStackException;
import ru.nsu.fit.g19202.dmakogon.task2.calc.exceptions.InvalidParametersException;
import ru.nsu.fit.g19202.dmakogon.task2.calc.exceptions.StackCalculatorException;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class CommandsTests
{
private static final double DOUBLE_DELTA = 1e-10;
@BeforeEach
void turnOffLogging()
{
Configurator.setRootLevel(Level.OFF);
}
@Test
void addAddsTwoNumbers() throws StackCalculatorException
{
// row format: op1, op2, expectedResult
double[][] testValues = {
{1, 2, 3},
{0, 0, 0},
{0.15, -1.12, 0.15 + (-1.12)},
{Double.NaN, 1, Double.NaN},
{Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
};
executeBinaryWithValues(new Add(), testValues);
}
@Test
void addAddsMultipleNumbers() throws StackCalculatorException
{
double[][] testValues = {
{1, 2, 3, 4, 5, 0, 15},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0.12, -1.95, -2.2, 3, (0.12 - 1.95 - 2.2 + 3)},
{Double.NaN, Double.NaN, Double.NaN, Double.NaN},
{
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY
},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
{
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY
},
};
executeBinaryWithValues(new Add(), testValues);
}
@Test
void addFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Add()));
}
@Test
void subtractSubtractsTwoNumbers() throws StackCalculatorException
{
double[][] testValues = {
{1, 2, 1 - 2},
{0, 0, 0},
{0.214, -1.12445, 0.214 - (-1.12445)},
{0.214, -1.12445, 0.214 - (-1.12445)},
{Double.NaN, 2.15, Double.NaN},
{Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN},
};
executeBinaryWithValues(new Subtract(), testValues);
}
@Test
void subtractSubtractsMultipleNumbers() throws StackCalculatorException
{
double[][] testValues = {
// (1 - (2 - (3 - (4 - (5 - 0))))) = 3
{1, 2, 3, 4, 5, 0, 3},
{0, 0, 0, 0, 0, 0, 0},
{0.65, -13, -212.35, -5, 0.65 - (-13 - (-212.35 - (-5)))},
{Double.NaN, Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN},
};
executeBinaryWithValues(new Subtract(), testValues);
}
@Test
void subtractFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Subtract()));
}
@Test
void multiplyMultipliesTwoNumbers() throws StackCalculatorException
{
double[][] testValues = {
{1, 3, 3},
{0, 0, 0},
{1, -1, -1},
{5.12, 1.23, 5.12 * 1.23},
{Double.NaN, 2.15, Double.NaN},
{Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
};
executeBinaryWithValues(new Multiply(), testValues);
}
@Test
void multiplyMultipliesMultipleNumbers() throws StackCalculatorException
{
double[][] testValues = {
// (1 - (2 - (3 - (4 - (5 - 0))))) = 3
{1, 2, 3, 4, 5, 6, 720},
{0, 0, 0, 0, 0, 0, 0},
{1, 2, 3, 0, 0},
{0.65, -13, -212.35, -5, (0.65 * -13 * -212.35 * -5)},
{Double.NaN, Double.NaN, Double.NaN, Double.NaN},
{
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY,
Double.NEGATIVE_INFINITY
},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
{
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY
},
};
executeBinaryWithValues(new Multiply(), testValues);
}
@Test
void multiplyFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Multiply()));
}
@Test
void divideDividesTwoNumbers() throws StackCalculatorException
{
double[][] testValues = {
{1, 2, 0.5},
{0, 1, 0},
{1, -1, -1},
{1.52, -215.15, 1.52 / -215.15},
{Double.NaN, 2.15, Double.NaN},
{Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN},
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN},
};
executeBinaryWithValues(new Divide(), testValues);
}
@Test
void divideDividesMultipleNumbers() throws StackCalculatorException
{
double[][] testValues = {
{1, 2, 3, 4, 5, 6, (1 / (2 / (3 / (4 / (5 / (double) 6)))))},
{1, 1, 1, 1, 1},
{0, 1, 2, 3, 0},
{0.52, 1.123, 223.1, 3551.2555, (0.52 / (1.123 / (223.1 / 3551.2555)))},
{Double.NaN, Double.NaN, Double.NaN, Double.NaN},
{Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN},
};
executeBinaryWithValues(new Divide(), testValues);
}
@Test
void divideFailsWhenDividingByZero()
{
double[][] testValues = {
{Double.NEGATIVE_INFINITY, 1.1, Double.NEGATIVE_INFINITY, 0},
{Double.POSITIVE_INFINITY, 7.25, Double.POSITIVE_INFINITY, 0},
{1, 0, 0},
};
for (var row : testValues)
{
assertThrows(StackCalculatorException.class, () -> executeBinaryWithValues(new Divide(), row));
}
}
@Test
void divideFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Divide()));
}
@Test
void sqrtCalculatesSquareRootCorrectly() throws StackCalculatorException
{
double[][] testValues = {
{0, 0},
{1, 1},
{2, Math.sqrt(2)},
{3, Math.sqrt(3)},
{4, 2},
{-1, Double.NaN},
{-0, 0},
{Double.NaN, Double.NaN},
{Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY},
{Double.NEGATIVE_INFINITY, Double.NaN},
};
executeUnaryWithValues(new Sqrt(), testValues);
}
@Test
void sqrtFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Sqrt()));
}
@Test
void defineDefinesValues() throws StackCalculatorException
{
Object[][] defines = {
{"A", "10.5123"}, {"x", "0"}, {"y", "-1"}
};
Define defineCmd = new Define();
CommandContext context = new CommandExecutionContext();
for (var row : defines)
{
defineCmd.execute(context, row);
}
for (var row : defines)
{
assertEquals(context.getNamedParameter((String) row[0]), Double.parseDouble((String) row[1]));
}
}
@Test
void defineFailsWhenIncorrectValuesAreGiven()
{
Object[][] incorrectDefines = {
{"A", "f112"}, {"x", ""}, {"a", " abc "},
};
Define define = new Define();
CommandContext context = new CommandExecutionContext();
for (var row : incorrectDefines)
{
assertThrows(InvalidParametersException.class, () -> define.execute(context, row));
}
}
@Test
void defineFailsWhenRedefining() throws StackCalculatorException
{
Define define = new Define();
CommandContext context = new CommandExecutionContext();
define.execute(context, new Object[]{"X", "10"});
assertThrows(DefineAlreadyExistsException.class, () -> define.execute(context, new Object[]{"X", "12312.121"}));
}
@Test
void popPopsValues() throws StackCalculatorException
{
CommandContext context = new CommandExecutionContext();
context.push(1);
context.push(20012.312d);
context.push(Double.NaN);
Pop pop = new Pop();
for (int i = 0; i < 2; i++)
{
pop.execute(context, new Object[]{});
}
assertEquals(context.peek(), 1);
}
@Test
void popFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> executeCommandWithEmptyStack(new Pop()));
}
@Test
void pushPushesValues() throws StackCalculatorException
{
Object[] values = {"1", "21412.121", "-0", "-1.12"};
Push push = new Push();
CommandContext context = new CommandExecutionContext();
for (var value : values)
{
push.execute(context, new Object[]{value});
assertEquals(context.peek(), Double.parseDouble((String) value));
}
}
@Test
void pushPushesDefinedValues() throws StackCalculatorException
{
Object[][] defines = {
{"X", "10"}, {"a", "12.3121"}
};
Push push = new Push();
CommandContext context = new CommandExecutionContext();
for (var define : defines)
{
context.addNamedParameter((String) define[0], Double.parseDouble((String) define[1]));
}
for (var define : defines)
{
push.execute(context, new Object[]{define[1]});
assertEquals(context.peek(), Double.parseDouble((String) define[1]));
}
}
@Test
void pushFailsWhenIncorrectValuesAreGiven()
{
Object[] values = {"12.sada", "f", "X", ""};
Push push = new Push();
CommandContext context = new CommandExecutionContext();
for (var ignored : values)
{
assertThrows(InvalidParametersException.class, () -> push.execute(context, new Object[]{values}));
}
}
@Test
void printPrintsValue() throws StackCalculatorException
{
double value = 10.123123d;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
CommandContext context = new CommandExecutionContext(outputStream);
context.push(value);
new Print().execute(context, new Object[]{});
assertEquals(value + String.format("%n"), outputStream.toString(StandardCharsets.UTF_8));
}
@Test
void printFailsWhenStackIsEmpty()
{
assertThrows(EmptyStackException.class, () -> new Print().execute(new CommandExecutionContext(), new Object[]{}));
}
@Test
void commentDoesntDoAnything()
{
double valueInStack = 112.1d;
Object[] comments = {
"COMMENT", "", "DEFINE x 5", "PUSH x", "+"
};
Comment comment = new Comment();
CommandContext context = new CommandExecutionContext();
context.push(valueInStack);
for (var commentStr : comments)
{
comment.execute(context, new Object[]{commentStr});
}
assertEquals(context.peek(), valueInStack);
}
private void executeCommandWithNoParams(Command command, CommandExecutionContext context, int timesToExecute) throws StackCalculatorException
{
for (int i = 0; i < timesToExecute; i++)
{
command.execute(context, new Object[0]);
}
}
private void executeCommandWithEmptyStack(Command command) throws StackCalculatorException
{
executeCommandWithNoParams(command, new CommandExecutionContext(), 1);
}
private void executeBinaryWithValues(Command command, double[] valuesRow) throws StackCalculatorException
{
testResultInStack(command, CommandParameters.FromArrayForBinary(valuesRow));
}
private void executeBinaryWithValues(Command command, double[][] testValues) throws StackCalculatorException
{
for (var row : testValues)
{
testResultInStack(command, CommandParameters.FromArrayForBinary(row));
}
}
private void executeUnaryWithValues(Command command, double[][] testValues) throws StackCalculatorException
{
for (var row : testValues)
{
testResultInStack(command, CommandParameters.FromArrayForUnary(row));
}
}
private void testResultInStack(Command command, CommandParameters params) throws StackCalculatorException
{
CommandExecutionContext context = new CommandExecutionContext();
for (double val : params.stackOperands)
{
context.push(val);
}
executeCommandWithNoParams(command, context, params.timesToExecute);
assertEquals(params.expectedResult, context.pop(), DOUBLE_DELTA);
}
private static class CommandParameters
{
public final double[] stackOperands;
public final double expectedResult;
public final int timesToExecute;
public CommandParameters(double stackOperand, double expectedResult)
{
this(new double[]{stackOperand}, expectedResult);
}
public CommandParameters(double[] stackOperands, double expectedResult)
{
this(stackOperands, expectedResult, 1);
}
public CommandParameters(double stackOperand, double expectedResult, int timesToExecute)
{
this(new double[]{stackOperand}, expectedResult, timesToExecute);
}
public CommandParameters(double[] stackOperands, double expectedResult, int timesToExecute)
{
this.stackOperands = stackOperands;
this.expectedResult = expectedResult;
this.timesToExecute = timesToExecute;
}
public static CommandParameters FromArrayForBinary(double[] array)
{
int arrLen = array.length;
return new CommandParameters(Arrays.copyOf(array, arrLen - 1), array[arrLen - 1], arrLen - 2);
}
public static CommandParameters FromArrayForUnary(double[] array)
{
int arrLen = array.length;
return new CommandParameters(Arrays.copyOf(array, arrLen - 1), array[arrLen - 1], arrLen - 1);
}
}
}
| [
"[email protected]"
] | |
f9fa133b854c760e72a4e03c94a917fbabefb21e | ff1b4f7c01332f4c6a8089e2c531dcd31fa07ad6 | /pacote download/Decisão/Questao16.java | 1ab42e3a77a207be6a9c5aa5251e0e63f8092c05 | [
"MIT"
] | permissive | CauanyRodrigues01/Codigos-Java | b1b7f5723debed0b49c447288338629d4a782d00 | de1bc9192c74c9a7b11f7f11ff27891d0a7a3331 | refs/heads/main | 2022-12-29T20:34:56.647901 | 2020-10-08T23:03:26 | 2020-10-08T23:03:26 | 302,212,903 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,039 | java | package Decisão;
import java.lang.Math;
import java.util.Scanner;
public class Questao16 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("TRIÂNGULO");
System.out.print("Digite um número para a hipotenusa: ");
float a = sc.nextFloat();
if (a<0 && a%1!=0) {
System.out.print("Só pode ser inteiro e positivo");
} else {
System.out.print("Digite um número para um cateto: ");
float b = sc.nextFloat();
if (b<0 && b%1!=0) {
System.out.print("Só pode ser inteiro e positivo");
} else {
System.out.print("Digite um número para outro cateto: ");
float c = sc.nextFloat();
if (c<0 && c%1!=0) {
System.out.print("Só pode ser inteiro e positivo");
} else {
double h_2 = Math.pow(a,2);
double c1_2 = Math.pow(b,2);
double c2_2 = Math.pow(c,2);
if (h_2 == c1_2 + c2_2) {
System.out.print("O triângulo é retangulo");
} else {
System.out.print("O triângulo não é triângulo retângulo");
}
}
}
}
}
} | [
"[email protected]"
] | |
714addb0a88e6a38b246cf53ead3eaaa64ef6af4 | 3e5eb14b2fd0ad097e83bb12c53790875b602827 | /pdf2ppt/src/main/java/com/feng/pdf2ppt/tools/PPTHelper1.java | a93285d05a4bc54f01d2a1ce682a78590c69bf93 | [] | no_license | judelawlee/public-repository | 25331e4f0564f309b6fc15aab5888a777fe7fdb0 | 565dd9ccca9c9f5f97dcac5541c9f6b50c5b3ffc | refs/heads/master | 2021-03-23T22:20:47.584915 | 2020-03-10T02:57:27 | 2020-03-10T02:57:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,391 | java | package com.feng.pdf2ppt.tools;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.poi.sl.usermodel.PictureData;
import org.apache.poi.sl.usermodel.TextParagraph;
import org.apache.poi.sl.usermodel.VerticalAlignment;
import org.apache.poi.xslf.usermodel.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class PPTHelper1 {
private static int PAGESIZE = 3; // 页面大小
private static String BACKGROUND = "C:\\work\\test\\pdf-img\\temp_1546570068959.jpg"; // 背景图片路径,图片格式要一致
private static String[] th = new String[] { "岗位名称", "基本要求", "薪资待遇" };
@SuppressWarnings("resource")
public static void createPPTX(String[][] title, String[][] data, String writePath) {
try {
System.out.println("-------------------------开始生成!------------------------");
XMLSlideShow pptx = new XMLSlideShow();
// 计算页数
int pages = data.length / PAGESIZE;
// 如果有余数,页数加1
if (data.length % PAGESIZE > 0) {
pages += 1;
}
// 初始化每页PPT
XSLFSlide[] slides = new XSLFSlide[pages];
for (int i = 0; i < pages; i++) {
slides[i] = pptx.createSlide();
}
// 循环生成每页PPT
for (int k = 0; k < pages; k++) {
// 设置每页的背景
byte[] pictureData = IOUtils.toByteArray(new FileInputStream(BACKGROUND));
XSLFPictureData pd = pptx.addPicture(pictureData, PictureData.PictureType.PNG);
XSLFPictureShape pic = slides[k].createPicture(pd);
// 图片全铺
pic.setAnchor(new Rectangle2D.Double(0, 0, 720, 550));
XSLFTable titleTB = slides[k].createTable();// 创建Title表格
createTitle(titleTB, title);
XSLFTable headTB = slides[k].createTable();// 创建表头
createTH(headTB, th);
XSLFTable dataTB = slides[k].createTable();// 创建Data表格
if (pages == 1) {
createData(dataTB, data, 0, data.length);
} else {
int start = k * PAGESIZE;// 起始位置
int end = (k + 1) * PAGESIZE;// 结束位置
if (end >= data.length) {
end = data.length;// 如果end>data的长度,取Data的长度
}
createData(dataTB, data, start, end);
}
XSLFTable text = slides[k].createTable();// 生成页码
createPageNum(text, k + 1, pages);
}
pptx.write(new FileOutputStream(writePath));
System.out.println("-------------------------生成成功!------------------------");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
// 创建标题
private static void createTitle(XSLFTable table, String[][] title) {
table.setAnchor(new Rectangle2D.Double(0, 10, 600, 100));
for (int i = 0; i < title.length; i++) {
XSLFTableRow tableRow = table.addRow(); // 创建表格行
for (int j = 0; j < title[i].length; j++) {
XSLFTableCell tableCell = tableRow.addCell();// 创建表格单元格
XSLFTextParagraph p = tableCell.addNewTextParagraph();
XSLFTextRun tr = p.addNewTextRun();
tr.setText(String.valueOf(title[i][j]));
tr.setBold(true);
tr.setFontColor(Color.white);
tr.setFontFamily("宋体 (正文)");
tr.setFontSize(18.);
}
}
table.setColumnWidth(0, 132);
table.setColumnWidth(1, 580);
table.setRowHeight(0, 35);
table.setRowHeight(1, 35);
table.setRowHeight(2, 35);
System.out.println("-------------------------创建标题成功!------------------------");
}
// 创建表头
private static void createTH(XSLFTable table, String[] th) {
table.setAnchor(new Rectangle2D.Double(0, 140, 600, 100));
XSLFTableRow tableRow = table.addRow(); // 创建表格行
for (int i = 0; i < th.length; i++) {
XSLFTableCell tableCell = tableRow.addCell();// 创建表格单元格
XSLFTextParagraph p = tableCell.addNewTextParagraph();
p.setTextAlign(TextParagraph.TextAlign.CENTER);
tableCell.setVerticalAlignment(VerticalAlignment.MIDDLE);
XSLFTextRun tr = p.addNewTextRun();
tr.setText(String.valueOf(th[i]));
tr.setBold(true);
tr.setFontFamily("幼圆");
tr.setFontSize(18.);
}
table.setColumnWidth(0, 132);
table.setColumnWidth(1, 312);
table.setColumnWidth(2, 276);
table.setRowHeight(0, 10);
System.out.println("-------------------------创建表头成功!------------------------");
}
// 创建表格数据
private static void createData(XSLFTable table, String[][] data, int start, int end) {
table.setAnchor(new Rectangle2D.Double(0, 180, 600, 420));
for (int i = start, k = 0; i < end; i++, k++) {
XSLFTableRow tableRow = table.addRow(); // 创建表格行
for (int j = 0; j < data[i].length; j++) {
XSLFTableCell tableCell = tableRow.addCell();// 创建表格单元格
XSLFTextParagraph p = tableCell.addNewTextParagraph();
if (j == 2) {
p.setTextAlign(TextParagraph.TextAlign.LEFT);
} else {
p.setTextAlign(TextParagraph.TextAlign.CENTER);
}
tableCell.setVerticalAlignment(VerticalAlignment.MIDDLE);
XSLFTextRun tr = p.addNewTextRun();
if (data[i][j] != null) {
String value = String.valueOf(data[i][j]);
if (value.length() > 80) {
tr.setText(value.substring(0, 80) + "...");
} else {
tr.setText(String.valueOf(data[i][j]));
}
}
tr.setFontFamily("仿宋");
tr.setFontSize(16.);
}
// 设置行高 因为每页的行数不固定,动态设置
table.setRowHeight(k, 125);
}
// 设置列宽
table.setColumnWidth(0, 132);
table.setColumnWidth(1, 312);
table.setColumnWidth(2, 276);
System.out.println("-------------------------加载数据成功!------------------------");
}
// 创建右上角页码
private static void createPageNum(XSLFTable table, int k, int pages) {
table.setAnchor(new Rectangle2D.Double(560, 10, 200, 0));
XSLFTableRow tableRow = table.addRow(); // 创建表格行
XSLFTableCell tableCell = tableRow.addCell();// 创建表格单元格
XSLFTextParagraph p = tableCell.addNewTextParagraph();
p.setTextAlign(TextParagraph.TextAlign.CENTER);
tableCell.setVerticalAlignment(VerticalAlignment.MIDDLE);
XSLFTextRun tr = p.addNewTextRun();
tr.setText(String.valueOf("第" + k + "页/共" + pages + "页"));
tr.setBold(true);
tr.setFontColor(Color.YELLOW);
tr.setFontFamily("H-新雅兰");
tr.setFontSize(18.);
table.setColumnWidth(0, 200);
}
public static void main(String[] args) throws IOException {
String[][] title = { { "单位名称:", "北京XXXXXXXXXXXXX有限公司" }, { "单位地址:", "北京市XXXXXXXXXXXXXXXX" },
{ "联系电话:", "XXXXXXXX XXXXXXX" } };
String[][] data = {
{ "物业客服", "5人,男女不限,22-35岁,大专以上学历,有物业相关经验者优先。负责办理业主入住、装修手续,接待住户投诉和报修电话、咨询服务",
"1.缴纳五项社会保险\n2.用工形式:直签\n3.签订合同_2_年\n4.月薪:2500-3000(有提成)\n5.其他福利:饭补、绩效奖金浮动" },
{ "社区报纸编辑", "1人,男女不限,25-40岁,大专以上学历,有相关工作经验者优先,负责报纸排版、组稿约稿、稿件的采编和图文编辑",
"1.缴纳五项社会保险\n2.用工形式:直签\n3.签订合同_2_年\n4.月薪:3500-5000\n5.其他福利:饭补、绩效奖金浮动" },
{ "酒店前台", "男女不限,5人,有无经验均可,可接受应届毕业生,中专以上学历,会使用办公软件,包吃、包住、上五险。",
"1.缴纳五项社会保险\n2.用工形式:直签\n3.签订合同_2_年\n4.月薪:3000-3500\n5.其他福利:饭补、绩效奖金浮动" },
{ "家政服务员", "女,6人,五官端正,18-50岁,初中以上学历,有相关工作经验者优先,本地户口优先。包吃,上五险,可根据个人表现晋升增薪。",
"1.缴纳五项社会保险\n2.用工形式:直签\n3.签订合同_2_年\n4.月薪:2300-3000\n5.其他福利:饭补、绩效奖金 " },
{ "保安员", "男,20人,18-40岁,身高175及以上,初中及以上学历,无不良嗜好,无纹身,退伍军人优先,包吃住,五险。",
"1.缴纳五项社会保险\n2.用工形式:直签/派遣\n3.签订合同_2_年\n4.月薪:2800-3500\n5.其他福利:包吃住、绩效奖金" },
{ "保洁员", "男女不限,40-55岁,初中及以上学历,有工作经验者优先,包吃,上五险,可根据个人表现晋升增薪。",
"1.缴纳五项社会保险\n2.用工形式:直签/派遣\n3.签订合同_2_年\n4.月薪:2500-3500\n5.其他福利:包吃、绩效奖金" } };
String writePath = "C:\\work\\test\\pdf-img\\test.ppt";
createPPTX(title, data, writePath);
}
}
| [
"445121408"
] | 445121408 |
2c6abe655bf19c133b9d506926f6f4baa96e2f89 | 63ef7dcb7ad8f9c8476a6171727b72569c87730c | /.svn/pristine/b6/b6cec085a528e12c62afe982441cf6f22ae335e6.svn-base | fe5e33e70e69cdeba175473b0005ff3ebcb5b533 | [] | no_license | kaka3511/SunEjwapi | eabc8714b84b76fb51106d430d30c403c2ad33a4 | d83f97adfdaf4ec396402d28bfe8700ce5a28d81 | refs/heads/master | 2020-05-31T18:26:55.668983 | 2017-06-13T02:42:23 | 2017-06-13T02:42:23 | 94,044,153 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 489 | package com.huaao.sunejwapi.common.util;
import com.huaao.sunejwapi.common.Constants;
import com.huaao.sunejwapi.common.security.Encrypt;
public class TokenUtil {
public static String createToken(String uid){
StringBuffer buff = new StringBuffer();
buff.append("id_"+uid);
buff.append("version_" + Constants.Version);
byte[] encryptResult = Encrypt.encrypt(buff.toString());
String encryptResultStr = Encrypt.parseByte2HexStr(encryptResult);
return encryptResultStr;
}
}
| [
"[email protected]"
] | ||
79a9a5ad94004e038c9186c148bd5cef2ef025c8 | 6071fc260f0949cda38086f8bd26b39ee3f784f3 | /src/main/java/amrelk/fakewpi/first/wpilibj/Relay.java | 495aa910a05cd86e48e06c82243eb16b00429c35 | [] | no_license | amrelk/wpiSimulate | b5f52ac2ea4907837bfdf8556c99fa888a2fefa3 | b56ed34db65e6f03f2c8a36462d1fff169e2e0db | refs/heads/master | 2020-03-22T19:21:12.432484 | 2018-07-11T04:35:11 | 2018-07-11T04:35:11 | 140,522,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,041 | java | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package amrelk.fakewpi.first.wpilibj;
import java.util.Arrays;
import java.util.Optional;
import amrelk.fakewpi.first.wpilibj.hal.FRCNetComm.tResourceType;
import amrelk.fakewpi.first.wpilibj.hal.HAL;
import amrelk.fakewpi.first.wpilibj.hal.RelayJNI;
import amrelk.fakewpi.first.wpilibj.smartdashboard.SendableBuilder;
import amrelk.fakewpi.first.wpilibj.util.UncleanStatusException;
import static java.util.Objects.requireNonNull;
/**
* Class for VEX Robotics Spike style relay outputs. Relays are intended to be connected to Spikes
* or similar relays. The relay channels controls a pair of channels that are either both off, one
* on, the other on, or both on. This translates into two Spike outputs at 0v, one at 12v and one
* at 0v, one at 0v and the other at 12v, or two Spike outputs at 12V. This allows off, full
* forward, or full reverse control of motors without variable speed. It also allows the two
* channels (forward and reverse) to be used independently for something that does not care about
* voltage polarity (like a solenoid).
*/
public class Relay extends SendableBase implements MotorSafety {
private MotorSafetyHelper m_safetyHelper;
/**
* This class represents errors in trying to set relay values contradictory to the direction to
* which the relay is set.
*/
public class InvalidValueException extends RuntimeException {
/**
* Create a new exception with the given message.
*
* @param message the message to pass with the exception
*/
public InvalidValueException(String message) {
super(message);
}
}
/**
* The state to drive a Relay to.
*/
public enum Value {
kOff("Off"),
kOn("On"),
kForward("Forward"),
kReverse("Reverse");
private final String m_prettyValue;
Value(String prettyValue) {
m_prettyValue = prettyValue;
}
public String getPrettyValue() {
return m_prettyValue;
}
public static Optional<Value> getValueOf(String value) {
return Arrays.stream(Value.values()).filter(v -> v.m_prettyValue.equals(value)).findFirst();
}
}
/**
* The Direction(s) that a relay is configured to operate in.
*/
public enum Direction {
/**
* direction: both directions are valid.
*/
kBoth,
/**
* direction: Only forward is valid.
*/
kForward,
/**
* direction: only reverse is valid.
*/
kReverse
}
private final int m_channel;
private int m_forwardHandle;
private int m_reverseHandle;
private Direction m_direction;
/**
* Common relay initialization method. This code is common to all Relay constructors and
* initializes the relay and reserves all resources that need to be locked. Initially the relay is
* set to both lines at 0v.
*/
private void initRelay() {
SensorUtil.checkRelayChannel(m_channel);
int portHandle = HAL.getPort((byte) m_channel);
if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
m_forwardHandle = RelayJNI.initializeRelayPort(portHandle, true);
HAL.report(tResourceType.kResourceType_Relay, m_channel);
}
if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
m_reverseHandle = RelayJNI.initializeRelayPort(portHandle, false);
HAL.report(tResourceType.kResourceType_Relay, m_channel + 128);
}
m_safetyHelper = new MotorSafetyHelper(this);
m_safetyHelper.setSafetyEnabled(false);
setName("Relay", m_channel);
}
/**
* Relay constructor given a channel.
*
* @param channel The channel number for this relay (0 - 3).
* @param direction The direction that the Relay object will control.
*/
public Relay(final int channel, Direction direction) {
m_channel = channel;
m_direction = requireNonNull(direction, "Null Direction was given");
initRelay();
set(Value.kOff);
}
/**
* Relay constructor given a channel, allowing both directions.
*
* @param channel The channel number for this relay (0 - 3).
*/
public Relay(final int channel) {
this(channel, Direction.kBoth);
}
@Override
public void close() {
super.close();
freeRelay();
}
private void freeRelay() {
try {
RelayJNI.setRelay(m_forwardHandle, false);
} catch (UncleanStatusException ignored) {
// do nothing. Ignore
}
try {
RelayJNI.setRelay(m_reverseHandle, false);
} catch (UncleanStatusException ignored) {
// do nothing. Ignore
}
RelayJNI.freeRelayPort(m_forwardHandle);
RelayJNI.freeRelayPort(m_reverseHandle);
m_forwardHandle = 0;
m_reverseHandle = 0;
}
/**
* Set the relay state.
*
* <p>Valid values depend on which directions of the relay are controlled by the object.
*
* <p>When set to kBothDirections, the relay can be set to any of the four states: 0v-0v, 12v-0v,
* 0v-12v, 12v-12v
*
* <p>When set to kForwardOnly or kReverseOnly, you can specify the constant for the direction or
* you can simply specify kOff and kOn. Using only kOff and kOn is recommended.
*
* @param value The state to set the relay.
*/
@SuppressWarnings("PMD.CyclomaticComplexity")
public void set(Value value) {
switch (value) {
case kOff:
if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
RelayJNI.setRelay(m_forwardHandle, false);
}
if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
RelayJNI.setRelay(m_reverseHandle, false);
}
break;
case kOn:
if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
RelayJNI.setRelay(m_forwardHandle, true);
}
if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
RelayJNI.setRelay(m_reverseHandle, true);
}
break;
case kForward:
if (m_direction == Direction.kReverse) {
throw new InvalidValueException("A relay configured for reverse cannot be set to "
+ "forward");
}
if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
RelayJNI.setRelay(m_forwardHandle, true);
}
if (m_direction == Direction.kBoth) {
RelayJNI.setRelay(m_reverseHandle, false);
}
break;
case kReverse:
if (m_direction == Direction.kForward) {
throw new InvalidValueException("A relay configured for forward cannot be set to "
+ "reverse");
}
if (m_direction == Direction.kBoth) {
RelayJNI.setRelay(m_forwardHandle, false);
}
if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
RelayJNI.setRelay(m_reverseHandle, true);
}
break;
default:
// Cannot hit this, limited by Value enum
}
}
/**
* Get the Relay State.
*
* <p>Gets the current state of the relay.
*
* <p>When set to kForwardOnly or kReverseOnly, value is returned as kOn/kOff not
* kForward/kReverse (per the recommendation in Set)
*
* @return The current state of the relay as a Relay::Value
*/
public Value get() {
if (m_direction == Direction.kForward) {
if (RelayJNI.getRelay(m_forwardHandle)) {
return Value.kOn;
} else {
return Value.kOff;
}
} else if (m_direction == Direction.kReverse) {
if (RelayJNI.getRelay(m_reverseHandle)) {
return Value.kOn;
} else {
return Value.kOff;
}
} else {
if (RelayJNI.getRelay(m_forwardHandle)) {
if (RelayJNI.getRelay(m_reverseHandle)) {
return Value.kOn;
} else {
return Value.kForward;
}
} else {
if (RelayJNI.getRelay(m_reverseHandle)) {
return Value.kReverse;
} else {
return Value.kOff;
}
}
}
}
/**
* Get the channel number.
*
* @return The channel number.
*/
public int getChannel() {
return m_channel;
}
@Override
public void setExpiration(double timeout) {
m_safetyHelper.setExpiration(timeout);
}
@Override
public double getExpiration() {
return m_safetyHelper.getExpiration();
}
@Override
public boolean isAlive() {
return m_safetyHelper.isAlive();
}
@Override
public void stopMotor() {
set(Value.kOff);
}
@Override
public boolean isSafetyEnabled() {
return m_safetyHelper.isSafetyEnabled();
}
@Override
public void setSafetyEnabled(boolean enabled) {
m_safetyHelper.setSafetyEnabled(enabled);
}
@Override
public String getDescription() {
return "Relay ID " + getChannel();
}
/**
* Set the Relay Direction.
*
* <p>Changes which values the relay can be set to depending on which direction is used
*
* <p>Valid inputs are kBothDirections, kForwardOnly, and kReverseOnly
*
* @param direction The direction for the relay to operate in
*/
public void setDirection(Direction direction) {
requireNonNull(direction, "Null Direction was given");
if (m_direction == direction) {
return;
}
freeRelay();
m_direction = direction;
initRelay();
}
@Override
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("Relay");
builder.setSafeState(() -> set(Value.kOff));
builder.addStringProperty("Value", () -> get().getPrettyValue(),
value -> set(Value.getValueOf(value).orElse(Value.kOff)));
}
}
| [
"[email protected]"
] | |
b9b6944c3dd387ab2c86cb9f51df98eeb55a0e2b | 66c8722f60b3f4ab8c91c627f4fc7eb15381bdd5 | /src/servlet_examples/Confidentializer.java | 5d45b6b5bb65e8a09d12cad38c34e8669bd3908f | [] | no_license | JuijuiCHEN/SL314 | 3795675cf8e944b3b4e45e2d2e58f3e9e9f46eba | 6f50a34ca5c2c7ee6f21c2d04617879898271bd0 | refs/heads/master | 2021-09-09T15:08:03.043914 | 2018-03-17T08:28:46 | 2018-03-17T08:28:46 | 125,610,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,564 | java | package servlet_examples;
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oreilly.servlet.ServletUtils;
import Acme.JPM.Encoders.GifEncoder;
public class Confidentializer extends HttpServlet {
Frame frame = null;
public void destroy() {
// Clean up resources
if (frame != null) frame.removeNotify();
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
ServletOutputStream out = res.getOutputStream();
Graphics g = null;
try {
// Get the image location from the path info
// Use ServletUtils (Chapter 4) for safety
URL source =
ServletUtils.getResource(getServletContext(), req.getPathInfo());
// Load the image (from bytes to an Image object)
MediaTracker mt = new MediaTracker(frame); // frame acts as ImageObserver
Image image = Toolkit.getDefaultToolkit().getImage(source);
mt.addImage(image, 0);
try {
mt.waitForAll();
}
catch (InterruptedException e) {
res.sendError(res.SC_INTERNAL_SERVER_ERROR,
"Interrupted while loading image: " +
ServletUtils.getStackTraceAsString(e));
return;
}
// Get the width and height
int w = image.getWidth(frame);
int h = image.getHeight(frame);
// Make sure we are reading valid image data
if (w <= 0 || h <= 0) {
res.sendError(res.SC_NOT_FOUND,
"Extra path information must point to a valid image");
return;
}
// Construct a matching-size off screen graphics context
Image offscreen = frame.createImage(w, h);
g = offscreen.getGraphics();
// Draw the image to the off-screen graphics context
g.drawImage(image, 0, 0, frame);
// Write CONFIDENTIAL over its top
g.setFont(new Font("Monospaced", Font.BOLD | Font.ITALIC, 30));
g.drawString("CONFIDENTIAL", 10, 30);
// Encode the off-screen graphics into a GIF and send it to the client
res.setContentType("image/gif");
GifEncoder encoder = new GifEncoder(offscreen, out);
encoder.encode();
}
finally {
// Clean up resources
if (g != null) g.dispose();
}
}
public void init() throws ServletException {
// Construct a reusable unshown frame
frame = new Frame();
frame.addNotify();
}
}
| [
"[email protected]"
] | |
92e43f9f503b17017629777f2050c15f17127077 | 7c848fb92bd7a3f9130771152c3e68895d94a799 | /app/src/main/java/com/junchao/frametest/utils/StringUtil.java | f2aa1f0842347b552a876f74401e4903d7676d26 | [] | no_license | gaoshang0304/MyApplication | acb9dd566324f8ece83d0fe59131cd4ea8ca5f38 | 6cc80d1f1e415e00cfd2af63a1634b10f7a34d6d | refs/heads/master | 2020-03-14T00:47:28.720499 | 2018-04-28T02:26:29 | 2018-04-28T02:26:29 | 131,364,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,139 | java | package com.junchao.frametest.utils;
import android.content.Context;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.StyleSpan;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 文本工具类
*
* @author ZhangMao
* @version 4.2.0
* @since 2015-03-31
*/
public class StringUtil {
/**
* 获取格式化的手机号(将手机号中间4位替换为*号)
*
* @param phone
* @return
*/
public static String getFormattedPhone(String phone) {
return phone.trim().replaceAll("(?<=\\d{3})\\d(?=\\d{4})", "*");
}
/**
* 校验URL
*
* @param url
* @param urlRules
* @return URL是否符合规则
*/
public static boolean checkUrl(String url, List<String> urlRules) {
boolean isUrlOK = false;
if (!TextUtils.isEmpty(url) && urlRules != null) {
for (String urlRule : urlRules) {
String newUrl = url.toLowerCase();
if (newUrl.contains(urlRule)) {
isUrlOK = true;
break;
}
}
}
return isUrlOK;
}
/**
* 判断字符串是否为数字
*
* @param str
* @return
*/
public static boolean isNumeric(String str){
//Pattern pattern = Pattern.compile("[0-9]*");
Pattern pattern = Pattern.compile("^(([1-9]\\d*)(\\.\\d{1,2})?|0\\.([1-9]|\\d[1-9])|0)$");//判断是否为有效金额
Matcher isNum = pattern.matcher(str);
if( !isNum.matches() ){
return false;
}
return true;
}
/**
* 数字,小数点及之后数字变小
*/
public static CharSequence toSpanStringSize(Context context, String string, int size){
SpannableStringBuilder ssb = new SpannableStringBuilder();
ssb.append(string);
StyleSpan ss = new StyleSpan(Typeface.BOLD);
AbsoluteSizeSpan ass = new AbsoluteSizeSpan(size);
char[] chars = string.toCharArray();
ssb.setSpan(ass, chars.length-3, chars.length, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
ssb.setSpan(ss, 0, chars.length-3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
return ssb;
}
/**
* 读取本地json文件
* @param context
* @param fileName
* @return
*/
public static String readLocalJson(Context context, String fileName){
String jsonString;
String resultString="";
try {
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(
context.getResources().getAssets().open(fileName)));
while ((jsonString=bufferedReader.readLine())!=null) {
resultString+=jsonString;
}
} catch (Exception e) {
ToastUtil.showToast(context, e.toString());
}
return resultString;
}
}
| [
"gao6366839"
] | gao6366839 |
32ec20ed0fc2ff07a1cf18deb52eeb7533a7788b | be5c19ece49d9947c30b4df8cba7574a87cb0c11 | /app/src/main/java/in/binplus/selfstudy/utils/ToastMsg.java | c1cfe38c56e4cc2b7c6791ee0be318e0e465b6b9 | [] | no_license | dharinisp4/SmartSelfStudyMaster | 9beb6cf951ac9d1605adc04c3eb0fe97aa8f76e6 | 6c7483d0b3fead681cfa91edc38e49d126447cc7 | refs/heads/master | 2020-12-30T08:41:58.276269 | 2020-02-07T13:36:19 | 2020-02-07T13:36:19 | 238,933,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package in.binplus.selfstudy.utils;
import android.content.Context;
import androidx.cardview.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.binplus.selfstudy.R;
public class ToastMsg {
Context context;
LayoutInflater inflater;
public ToastMsg(Context context) {
this.context=context;
inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
}
public void toastIconError(String s) {
Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG);
//inflate view
View custom_view = inflater.inflate(R.layout.toast_icon_text, null);
((TextView) custom_view.findViewById(R.id.message)).setText(s);
((ImageView) custom_view.findViewById(R.id.icon)).setImageResource(R.drawable.ic_close);
((CardView) custom_view.findViewById(R.id.parent_view)).setCardBackgroundColor(context.getResources().getColor(R.color.red_600));
toast.setView(custom_view);
toast.show();
}
public void toastIconSuccess(String s) {
Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG);
//inflate view
View custom_view = inflater.inflate(R.layout.toast_icon_text, null);
((TextView) custom_view.findViewById(R.id.message)).setText(s);
((ImageView) custom_view.findViewById(R.id.icon)).setImageResource(R.drawable.ic_done);
((CardView) custom_view.findViewById(R.id.parent_view)).setCardBackgroundColor(context.getResources().getColor(R.color.green_500));
toast.setView(custom_view);
toast.show();
}
}
| [
"[email protected]"
] | |
ee99ab852653ff7611ea5a3766009d7c2b5302b6 | 5ed62f088f324352bd878f58788ebeb0ffe5cd2a | /src/main/java/org/assertj/core/error/ShouldBeInSameYear.java | 04e8da2d4a62c39eedbf6c784b81559e82ddd1c0 | [
"Apache-2.0"
] | permissive | jstrachan/assertj-core | 85f7355f8d41c5dfb6c27f0bbe8d576fa4042273 | ac9e201c22c1a7132005bbb9e728ef0bfe2c89cc | refs/heads/master | 2020-12-31T07:19:04.828438 | 2016-04-09T22:15:20 | 2016-04-09T22:15:20 | 56,042,912 | 0 | 1 | null | 2016-04-12T07:58:10 | 2016-04-12T07:58:09 | null | UTF-8 | Java | false | false | 1,459 | 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.
*
* Copyright 2012-2016 the original author or authors.
*/
package org.assertj.core.error;
import java.util.Date;
/**
* Creates an error message indicating that an assertion that verifies that a {@link Date} is in same year as another one failed.
*
* @author Joel Costigliola
*/
public class ShouldBeInSameYear extends BasicErrorMessageFactory {
/**
* Creates a new </code>{@link ShouldBeInSameYear}</code>.
* @param actual the actual value in the failed assertion.
* @param other the value used in the failed assertion to compare the actual value to.
* @return the created {@code ErrorMessageFactory}.
*/
public static ErrorMessageFactory shouldBeInSameYear(Date actual, Date other) {
return new ShouldBeInSameYear(actual, other);
}
private ShouldBeInSameYear(Date actual, Date other) {
super("%nExpecting:%n <%s>%nto be on same year as:%n <%s>", actual, other);
}
}
| [
"[email protected]"
] | |
0a28454a8f38f3bcbf2d450f12bfeffe730823df | 43f584b8adddfaaf95cc7aa74b1c5f0069f0e582 | /Lista 1/src/com/fjps/test/GraphTest.java | 178b40fbd0b01a6bef84290852966f7697efa70e | [] | no_license | FilipJany/ApproximationAlgorithms | b2d3726b87d5d1312baf85f051070c9159b58cfc | e82a0ad406e17797261cf3d84fe092cf5632e941 | refs/heads/master | 2021-01-10T17:19:08.205022 | 2016-04-01T15:27:30 | 2016-04-01T15:27:30 | 52,964,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,067 | java | package com.fjps.test;
import com.fjps.main.graph.Graph;
import com.fjps.main.graph.Vertex;
import com.fjps.main.graph.exceptions.NoSuchVertexException;
import org.junit.Assert;
import org.junit.Test;
/**
* Created by MagnaT on 30/03/16.
*/
public class GraphTest {
@Test
public void assureMetricTest1() {
System.out.println("\n-----------------\nGraphTest: Test 1\n-----------------\n");
Graph<Double> initial = new Graph<>();
Vertex<Double> v0 = initial.addVertex();
Vertex<Double> v1 = initial.addVertex();
Vertex<Double> v2 = initial.addVertex();
Vertex<Double> v3 = initial.addVertex();
initial.connect(v0, v1, 5.0);
initial.connect(v0, v2, 1.2);
initial.connect(v0, v3, 2.5);
initial.connect(v1, v2, 4.0);
initial.connect(v1, v3, 2.0);
initial.connect(v2, v3, 1.1);
System.out.println("Initial: " + initial.toString());
Graph<Double> expected = new Graph<>();
v0 = expected.addVertex();
v1 = expected.addVertex();
v2 = expected.addVertex();
v3 = expected.addVertex();
expected.connect(v0, v1, 4.3);
expected.connect(v0, v2, 1.2);
expected.connect(v0, v3, 2.3);
expected.connect(v1, v2, 3.1);
expected.connect(v1, v3, 2.0);
expected.connect(v2, v3, 1.1);
System.out.println("Expected: " + expected.toString());
Graph<Double> obtained = initial;
obtained.assureMetric();
System.out.println("Obtained: " + obtained.toString());
Assert.assertEquals(expected.getAllVertexes(), obtained.getAllVertexes());
Assert.assertEquals(expected.getAllEdges(), obtained.getAllEdges());
}
@Test
public void assureMetricTest2() {
System.out.println("\n-----------------\nGraphTest: Test 2\n-----------------\n");
Graph<Double> initial = new Graph<>();
Vertex<Double> v0 = initial.addVertex();
Vertex<Double> v1 = initial.addVertex();
Vertex<Double> v2 = initial.addVertex();
Vertex<Double> v3 = initial.addVertex();
Vertex<Double> v4 = initial.addVertex();
initial.connect(v0, v1, 6.2);
initial.connect(v0, v2, 7.0);
initial.connect(v0, v3, 9.8);
initial.connect(v0, v4, 2.0);
initial.connect(v1, v2, 0.5);
initial.connect(v1, v3, 0.6);
initial.connect(v1, v4, 3.1);
initial.connect(v2, v3, 1.2);
initial.connect(v2, v4, 1.2);
initial.connect(v3, v4, 2.7);
System.out.println("Initial: " + initial.toString());
Graph<Double> expected = new Graph<>();
v0 = expected.addVertex();
v1 = expected.addVertex();
v2 = expected.addVertex();
v3 = expected.addVertex();
v4 = expected.addVertex();
expected.connect(v0, v1, 3.7);
expected.connect(v0, v2, 3.2);
expected.connect(v0, v3, 4.3);
expected.connect(v0, v4, 2.0);
expected.connect(v1, v2, 0.5);
expected.connect(v1, v3, 0.6);
expected.connect(v1, v4, 1.7);
expected.connect(v2, v3, 1.1);
expected.connect(v2, v4, 1.2);
expected.connect(v3, v4, 2.3);
System.out.println("Expected: " + expected.toString());
Graph<Double> obtained = initial;
obtained.assureMetric();
System.out.println("Obtained: " + obtained.toString());
Assert.assertEquals(expected.getAllVertexes(), obtained.getAllVertexes());
Assert.assertEquals(expected.getAllEdges(), obtained.getAllEdges());
}
@Test
public void graphOperationsTest1() {
System.out.println("\n-----------------\nGraphTest: Test 3\n-----------------\n");
Graph<Double> graph = new Graph<>();
Vertex<Double> v0 = graph.addVertex();
Vertex<Double> v1 = graph.addVertex();
Vertex<Double> v2 = graph.addVertex();
Vertex<Double> v3 = graph.addVertex();
Assert.assertEquals(4, graph.getNumberVertexes());
try {
graph.connect(v0, v1, 3.0);
graph.connect(v0, v2, 1.8);
graph.connect(v0, v3, 2.2);
graph.connect(v2, v1, 4.7);
graph.connect(v2, v3, 5.2);
graph.connect(v3, v1, 0.5);
} catch (NoSuchVertexException e) {
System.out.println("This exception should not occur.\n\t" + e.getMessage());
}
Assert.assertEquals(6, graph.getNumberEdges());
System.out.println("Result:\n" + graph);
graph.assureMetric();
try {
graph.removeVertex(v1);
} catch (NoSuchVertexException e) {
System.out.println("This exception should not occur.\n\t" + e.getMessage());
}
Assert.assertEquals(3, graph.getNumberVertexes());
Assert.assertEquals(3, graph.getNumberEdges());
Assert.assertEquals(null, graph.getVertex(v1.getID()));
System.out.println("Removing vertex V1");
System.out.println("Result:\n" + graph);
}
}
| [
"[email protected]"
] | |
3bada7a13c3ceedb4299d4286544265877ed00fd | 03e53d59defb46326cc50de2161ef837781c1a04 | /src/com/sizatn/collections/sort/Menu.java | b24e96fedd4df12afe30b10124babc36ac72f769 | [] | no_license | sizatn/sort | 6d2b905a5116dd86681a034a57b1ec9358742c42 | 390f26b7350a0497ffaa9dd8a45b55a56d53f6de | refs/heads/master | 2022-01-30T17:18:20.615947 | 2019-06-19T09:43:36 | 2019-06-19T09:43:36 | 109,562,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.sizatn.collections.sort;
public class Menu {
private String menuName;
private String menuSort;
public Menu() {
super();
}
public Menu(String menuName, String menuSort) {
super();
this.menuName = menuName;
this.menuSort = menuSort;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getMenuSort() {
return menuSort;
}
public void setMenuSort(String menuSort) {
this.menuSort = menuSort;
}
@Override
public String toString() {
return "Menu [menuName=" + menuName + ", menuSort=" + menuSort + "]";
}
}
| [
"[email protected]"
] | |
c40122b16d460e6bca25db9377b85790eb33418c | 71e18ae1d2f0b79df0c3487dec2d0ba22fef9683 | /app/src/main/java/com/github/achenglike/slidingtablayout/MainActivity.java | c3aa5ed39cdbf96b0ff95fae2dd9ee524ea467af | [] | no_license | achenglike/SlidingTab | c700a8a080de0f94dc729b39b555c25d1ef8277f | 54a5e39e39463b3fd317900374eb72e70abcfdd6 | refs/heads/master | 2020-03-19T12:56:31.313626 | 2018-06-08T01:43:21 | 2018-06-08T01:43:21 | 136,551,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.github.achenglike.slidingtablayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
449f3e41b53c58b516d1589fec5e2d89f71bcdb1 | 88fa5202233b149f24aa1640125fcbd7d8c2e9a5 | /src/main/java/concurrence/longguo/providerConsumer/Tmall.java | 2704ae4af283c9cab400b43e460139054dc4355e | [] | no_license | never123450/the-data-structure | 03c89c12a0e12d52d43dd2e83a0ea90a1fbe33dd | 3ca52debe2e00c1e66dbd0dde29b1a9942f471e7 | refs/heads/master | 2020-04-17T00:04:31.576460 | 2019-01-24T14:11:55 | 2019-01-24T14:11:55 | 166,036,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package concurrence.longguo.providerConsumer;
public class Tmall {
private int count;
public final int MAX_COUNT = 10;
public synchronized void push() {
while (count > MAX_COUNT) {
System.out.println(Thread.currentThread().getName() + "库存数量达到上限" );
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
count++;
System.out.println(Thread.currentThread().getName() + "生产者生产,当前库存为:" + count);
notifyAll();
}
public synchronized void take() {
while (count <= 0) {
System.out.println(Thread.currentThread().getName() + "库存数量为0" );
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
count--;
System.out.println(Thread.currentThread().getName() + "消费者消费,当前库存为:" + count);
notifyAll();
}
}
| [
"[email protected]"
] | |
10ada0e90055e8d66432f7945e64a3213391c5e6 | 6dce51d20093687d737d7bfa013e8cff5fc7d15b | /sitebricks-mail/src/main/java/com/google/sitebricks/mail/imap/ListFoldersExtractor.java | f9355244acacd89f7701108a2f8432922691714e | [
"Apache-2.0"
] | permissive | tactile/sitebricks | 30a9f7fabeb56f6d518d0cf57c6961ca3e9dba09 | 29f0e762c91ea6f4f8351ccfc5ce62f760d010b4 | refs/heads/master | 2021-01-17T21:38:22.700266 | 2013-01-11T01:15:26 | 2013-01-11T01:15:26 | 7,551,409 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,101 | java | package com.google.sitebricks.mail.imap;
import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author [email protected] (Dhanji R. Prasanna)
*/
class ListFoldersExtractor implements Extractor<List<String>> {
private static final Pattern QUOTES = Pattern.compile("(\".*\")");
private static final String ROOT_PREFIX = "\"/\"";
@Override
public List<String> extract(List<String> messages) {
ImmutableList.Builder<String> builder = ImmutableList.builder();
for (String message : messages) {
Matcher matcher = QUOTES.matcher(message);
if (matcher.find()) {
String group = matcher.group(1);
if (group.startsWith(ROOT_PREFIX)) {
group = group.substring(ROOT_PREFIX.length()).trim();
}
// Strip quotes.
if (group.startsWith("\"")) {
group = group.substring(1, group.length() - 1);
}
// Generally remove leading "/" and stripquotes
builder.add(group);
}
}
return builder.build();
}
}
| [
"[email protected]"
] | |
6962fd5b4b1855eb33d3f8e97ff673932365ec7e | bdb880513a6d1333b3251e8986fbaa9411b049e8 | /qmt-tlive/qmt-tlive-rpc-core/src/main/java/com/lesports/qmt/tlive/cache/TVoteCache.java | d9abad260f85d2cdbb74110ce283f5b914c2bb9b | [] | no_license | wang-shun/qmt | fe937cffe59781815fdefccdfa88362cef68b113 | c3c2e6a1bd9b4f3d852a698f64b6831b977093d1 | refs/heads/master | 2020-04-12T23:23:29.066091 | 2018-12-17T12:51:58 | 2018-12-17T12:51:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package com.lesports.qmt.tlive.cache;
import com.lesports.qmt.tlive.api.dto.TVote;
import com.lesports.repository.LeCrudRepository;
/**
* Created by lufei1 on 2015/9/16.
*/
public interface TVoteCache extends LeCrudRepository<TVote, Long> {
/**
* 增加投票
*
* @param voteId
* @param optionId
* @return
*/
public int incrVoteNum(long voteId, long optionId);
/**
* 获取投票数
*
* @param voteId
* @param optionId
* @return
*/
public int getVoteNum(long voteId, long optionId);
}
| [
"[email protected]"
] | |
def47e4b42961ff85ef4381e210bf9ee97841434 | 56710f14a5b450e5b61ec40725453a3e7229af31 | /LeetCode/src/main/java/com/binea/www/leetcodepractice/algorithm/LongestWordInDictionary.java | d2a1b83796acc2fc215956f1ed7dd17e18078bb6 | [] | no_license | xu6148152/Algorithm-Practice | f9885707a1dde6841681be0e8e3849af79ce8da8 | f7d7c3303773a7f935e8e332549e009fdf80688a | refs/heads/master | 2022-08-09T07:08:05.193441 | 2022-08-01T11:49:39 | 2022-08-01T11:49:39 | 49,108,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,407 | java | package com.binea.www.leetcodepractice.algorithm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* Created by binea on 3/9/17.
*/
public class LongestWordInDictionary {
/**
* Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.
* <p>
* Example 1:
* Input:
* s = "abpcplea", d = ["ale","apple","monkey","plea"]
* <p>
* Output:
* "apple"
* Example 2:
* Input:
* s = "abpcplea", d = ["a","b","c"]
* <p>
* Output:
* "a"
* Note:
* All the strings in the input will only contain lower-case letters.
* The size of the dictionary won't exceed 1,000.
* The length of all the strings in the input won't exceed 1,000.
*
* @param s
* @param d
* @return
*/
public String findLongestWord(String s, List<String> d) {
String longest = "";
for (String dictWord : d) {
int i = 0;
for (char c : s.toCharArray()) {
if (i < dictWord.length() && c == dictWord.charAt(i)) i++;
}
if (i == dictWord.length() && dictWord.length() >= longest.length()) {
if (dictWord.length() > longest.length() || dictWord.compareTo(longest) < 0) {
longest = dictWord;
}
}
}
return longest;
}
public String findLongestWord_35ms(String s, List<String> d) {
if (s == null || d == null) return "";
Collections.sort(d, new Comparator<String>() {
public int compare(String a, String b) {
if (a.length() != b.length())
return b.length() - a.length();
else return a.compareTo(b);
}
});
char[] searchingWord = s.toCharArray();
char[] wordinDictionary;
int i, j;
for (String word : d) {
wordinDictionary = word.toCharArray();
j = 0;
i = 0;
while (j < searchingWord.length && i < wordinDictionary.length) {
while (j < searchingWord.length && wordinDictionary[i] != searchingWord[j]) j++;
if (j < searchingWord.length && searchingWord[j] == wordinDictionary[i]) i++;
j++;
}
if (i >= wordinDictionary.length) return new String(wordinDictionary);
}
return "";
}
public String findLongestWord_17ms(String s, List<String> d) {
String longest = "";
for (String word : d)
if (isBetter(word, longest) && isSubsequence(word, s))
longest = word;
return longest;
}
private boolean isBetter(String a, String b) {
return a.length() > b.length() ||
a.length() == b.length() && a.compareTo(b) < 0;
}
private boolean isSubsequence(String a, String b) {
int start = -1;
for (int i = 0; i < a.length(); i++) {
start = b.indexOf(a.charAt(i), start + 1);
if (start < 0)
return false;
}
return true;
}
}
| [
"[email protected]"
] | |
d96bad241fd5e422b618c783ffe7a824026216c3 | c90d8076834c22ad24fb4b12d406701c539d3441 | /MoneyBuddy/src/org/tempuri/GetPassword.java | 8447ded69e2d9f4e6d236df994bc8b00ef600806 | [] | no_license | batmaninlondon/MoneyBuddy | 77fd023a61d68b43fcf6760243a848a3644d5440 | 50c27d3202b5c90ff15ecac4e098952f37f13d6c | refs/heads/devMoneyBuddy | 2022-05-02T04:06:25.052121 | 2022-04-15T06:39:27 | 2022-04-15T06:39:27 | 69,157,985 | 0 | 0 | null | 2017-04-23T18:48:59 | 2016-09-25T10:34:14 | JavaScript | UTF-8 | Java | false | false | 1,854 | java |
package org.tempuri;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.datacontract.schemas._2004._07.starmfpaymentgatewayservice.PasswordRequest;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Param" type="{http://schemas.datacontract.org/2004/07/StarMFPaymentGatewayService}PasswordRequest" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"param"
})
@XmlRootElement(name = "GetPassword")
public class GetPassword {
@XmlElementRef(name = "Param", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
protected JAXBElement<PasswordRequest> param;
/**
* Gets the value of the param property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link PasswordRequest }{@code >}
*
*/
public JAXBElement<PasswordRequest> getParam() {
return param;
}
/**
* Sets the value of the param property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link PasswordRequest }{@code >}
*
*/
public void setParam(JAXBElement<PasswordRequest> value) {
this.param = value;
}
}
| [
"[email protected]"
] | |
17119ad304ab610238a4c47b7c843969ed09e528 | 78fff0b93496e0ab73a010dfd1f993bd37471202 | /src/main/java/br/com/j4business/saga/elementoquestao/controller/ElementoQuestaoController.java | 2aa402ed231d79b21c207e4d46cf732a710c7dac | [] | no_license | SergioFeitosa/sgpn | 474386b39c684835fbad2ca26653751765a95917 | d269011d270913e22dc5b1ec1cd4058e41d029f7 | refs/heads/master | 2021-07-14T15:39:55.027199 | 2020-06-02T18:07:45 | 2020-06-02T18:07:45 | 32,646,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,362 | java | package br.com.j4business.saga.elementoquestao.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.PersistenceException;
import javax.validation.Valid;
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import br.com.j4business.saga.elemento.model.ElementoForm;
import br.com.j4business.saga.elemento.service.ElementoService;
import br.com.j4business.saga.UsuarioSeguranca;
import br.com.j4business.saga.agendaevento.model.AgendaEvento;
import br.com.j4business.saga.atributo.enumeration.AtributoPrioridade;
import br.com.j4business.saga.atributo.enumeration.AtributoStatus;
import br.com.j4business.saga.colaborador.service.ColaboradorService;
import br.com.j4business.saga.questao.model.QuestaoForm;
import br.com.j4business.saga.questao.service.QuestaoService;
import br.com.j4business.saga.elementoquestao.model.ElementoQuestao;
import br.com.j4business.saga.elementoquestao.model.ElementoQuestaoByElementoForm;
import br.com.j4business.saga.elementoquestao.model.ElementoQuestaoForm;
import br.com.j4business.saga.elementoquestao.service.ElementoQuestaoService;
@Controller
public class ElementoQuestaoController {
@Autowired
private ElementoService elementoService;
@Autowired
private ColaboradorService colaboradorService;
@Autowired
private ElementoQuestaoService elementoQuestaoService;
@Autowired
private QuestaoService questaoService;
@Autowired
private UsuarioSeguranca usuarioSeguranca;
@RequestMapping(path = "/elementoQuestaoAdd", method = RequestMethod.GET)
public ModelAndView elementoQuestaoAdd(ElementoQuestaoForm elementoQuestaoForm,Pageable pageable) {
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoAdd");
elementoQuestaoForm = elementoQuestaoService.elementoQuestaoParametros(elementoQuestaoForm);
mv.addObject("elementoQuestaoForm", elementoQuestaoForm);
mv.addObject("elementoQuestaoPrioridadeValues", AtributoPrioridade.values());
mv.addObject("elementoQuestaoStatusValues", AtributoStatus.values());
Pageable colaboradorPageable = new PageRequest(0, 200, Direction.ASC, "pessoaNome");
mv.addObject("colaboradorPage", colaboradorService.getColaboradorAll(colaboradorPageable));
Pageable elementoPageable = new PageRequest(0, 200, Direction.ASC, "elementoNome");
mv.addObject("elementoPage", elementoService.getElementoAll(elementoPageable));
Pageable questaoPageable = new PageRequest(0, 200, Direction.ASC, "questaoNome");
mv.addObject("questaoPage", questaoService.getQuestaoAll(questaoPageable));
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoCreate", method = RequestMethod.POST)
public ModelAndView elementoQuestaoCreate(@Valid ElementoQuestaoForm elementoQuestaoForm, BindingResult result, RedirectAttributes attributes,Pageable pageable) {
if (result.hasErrors()) {
return elementoQuestaoAdd(elementoQuestaoForm,pageable);
}
if (elementoQuestaoForm.getElementoQuestaoPK() > 0) {
return this.elementoQuestaoSave(elementoQuestaoForm, result, attributes,pageable);
}
try {
elementoQuestaoService.create(elementoQuestaoForm);
} catch (PersistenceException e) {
ConstraintViolationException t = (ConstraintViolationException) e.getCause();
if (t.getConstraintName().equalsIgnoreCase("elementoQuestaoUnique")) {
ObjectError error = new ObjectError("elementoNome","Relacionamento entre Elemento e Questão já existente no cadastro.");
result.addError(error);
}
return elementoQuestaoAdd(elementoQuestaoForm,pageable);
}
ModelAndView mv = new ModelAndView("redirect:/elementoQuestaoHome");
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado());
mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoDelete/{id}", method = RequestMethod.GET)
public ModelAndView elementoQuestaoDelete(@PathVariable("id") long elementoQuestaoId, @Valid QuestaoForm questaoForm, BindingResult result, RedirectAttributes attributes) {
ModelAndView mv = new ModelAndView("redirect:/elementoQuestaoHome");
ElementoQuestao elementoQuestao = elementoQuestaoService.getElementoQuestaoByElementoQuestaoPK(elementoQuestaoId);
try {
elementoQuestaoService.delete(elementoQuestaoId);
attributes.addFlashAttribute("mensagem", "Relacionamento Elemento/Questao excluído com sucesso");
} catch (Exception e) {
attributes.addFlashAttribute("mensagemErro", "Relacionamento Elemento/Questao não excluído. Existe(m) relacionamento(s) de Elemento/Questao ** "+
elementoQuestao.getElemento().getElementoNome() +
" / " +
elementoQuestao.getQuestao().getQuestaoNome() +
" ** no cadastro.");
}
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoEdit/{elementoQuestaoPK}", method = RequestMethod.GET)
public ModelAndView elementoQuestaoEdit(@PathVariable("elementoQuestaoPK") Long elementoQuestaoPK, Pageable pageable) {
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoEdit");
ElementoQuestao elementoQuestao = elementoQuestaoService.getElementoQuestaoByElementoQuestaoPK(elementoQuestaoPK);
ElementoQuestaoForm elementoQuestaoForm = elementoQuestaoService.converteElementoQuestao(elementoQuestao);
mv.addObject("elementoQuestaoForm", elementoQuestaoForm);
mv.addObject("elementoQuestaoPrioridadeValues", AtributoPrioridade.values());
mv.addObject("elementoQuestaoStatusValues", AtributoStatus.values());
Pageable colaboradorPageable = new PageRequest(0, 200, Direction.ASC, "pessoaNome");
mv.addObject("colaboradorPage", colaboradorService.getColaboradorAll(colaboradorPageable));
Pageable elementoPageable = new PageRequest(0, 200, Direction.ASC, "elementoNome");
mv.addObject("elementoPage", elementoService.getElementoAll(elementoPageable));
Pageable questaoPageable = new PageRequest(0, 200, Direction.ASC, "questaoNome");
mv.addObject("questaoPage", questaoService.getQuestaoAll(questaoPageable));
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoHome", method = RequestMethod.GET)
public ModelAndView elementoQuestaoHome(@Valid ElementoQuestaoByElementoForm elementoQuestaoByElementoForm, BindingResult result,RedirectAttributes attributes,Pageable pageable) {
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoHome");
List<ElementoQuestao> elementoQuestaoList = new ArrayList<ElementoQuestao>();
int elementoQuestaoTotal = 0;
if (elementoQuestaoByElementoForm.getSearchQuestaoNome() == null) {
elementoQuestaoByElementoForm.setSearchElementoNome("");
elementoQuestaoByElementoForm.setSearchQuestaoNome("");
if (elementoQuestaoByElementoForm.getElementoQuestaoSortTipo() == null) {
elementoQuestaoByElementoForm.setElementoQuestaoSortTipo("QuestaoNome");
}
}
if (elementoQuestaoByElementoForm.getElementoQuestaoSortTipo().equalsIgnoreCase("ElementoNome")
|| elementoQuestaoByElementoForm.getElementoQuestaoSortTipo().equalsIgnoreCase("")) {
pageable = new PageRequest(pageable.getPageNumber(), 15, Direction.ASC,"elemento.elementoNome","questao.questaoNome");
} else if (elementoQuestaoByElementoForm.getElementoQuestaoSortTipo().equalsIgnoreCase("QuestaoNome")) {
pageable = new PageRequest(pageable.getPageNumber(), 15, Direction.ASC,"questao.questaoNome","elemento.elementoNome");
}
if ( ! elementoQuestaoByElementoForm.getSearchQuestaoNome().equalsIgnoreCase("")){
elementoQuestaoList = elementoQuestaoService.getByQuestaoNome(elementoQuestaoByElementoForm.getSearchQuestaoNome(),pageable);
elementoQuestaoTotal = elementoQuestaoService.getByQuestaoNome(elementoQuestaoByElementoForm.getSearchQuestaoNome()).size();
} else {
elementoQuestaoList = elementoQuestaoService.getByElementoNome(elementoQuestaoByElementoForm.getSearchElementoNome(),pageable);
elementoQuestaoTotal = elementoQuestaoService.getByElementoNome(elementoQuestaoByElementoForm.getSearchElementoNome()).size();
}
Page<ElementoQuestao> elementoQuestaoPage = new PageImpl<ElementoQuestao>(elementoQuestaoList,pageable,elementoQuestaoTotal+1);
mv.addObject("elementoQuestaoPage", elementoQuestaoPage);
mv.addObject("page",elementoQuestaoPage);
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoSave", method = RequestMethod.POST)
public ModelAndView elementoQuestaoSave(@Valid ElementoQuestaoForm elementoQuestaoForm, BindingResult result, RedirectAttributes attributes,Pageable pageable) {
if (result.hasErrors()) {
return elementoQuestaoAdd(elementoQuestaoForm,pageable);
}
ModelAndView mv = new ModelAndView("redirect:/elementoQuestaoHome");
try {
elementoQuestaoService.save(elementoQuestaoForm);
} catch (Exception e) {
ConstraintViolationException t = (ConstraintViolationException) e.getCause();
if (t.getConstraintName().equalsIgnoreCase("elementoQuestaoUnique")) {
ObjectError error = new ObjectError("elementoNome","Relacionamento entre Elemento e Questão já existente no cadastro.");
result.addError(error);
}
return elementoQuestaoAdd(elementoQuestaoForm,pageable);
}
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoRelMenu", method = RequestMethod.GET)
public ModelAndView elementoQuestaoRelMenu() {
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoRelMenu");
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping("/elementoQuestaoRel001")
public ModelAndView elementoQuestaoRel001(Pageable pageable) {
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoRel001");
Pageable elementoQuestaoPageable = new PageRequest(0, 200, Direction.ASC, "elemento.elementoNome","questao.questaoNome");
mv.addObject("elementoQuestaoPage", elementoQuestaoService.getElementoQuestaoAll(elementoQuestaoPageable));
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
@RequestMapping(path = "/elementoQuestaoView/{id}", method = RequestMethod.GET)
public ModelAndView elementoQuestaoView(@PathVariable("id") Long elementoQuestaoId) {
ElementoQuestao elementoQuestao = elementoQuestaoService.getElementoQuestaoByElementoQuestaoPK(elementoQuestaoId);
ModelAndView mv = new ModelAndView("elementoQuestao/elementoQuestaoView");
ElementoQuestaoForm elementoQuestaoForm = elementoQuestaoService.converteElementoQuestaoView(elementoQuestao);
ElementoForm elementoForm = elementoService.converteElementoView(elementoQuestao.getElemento());
QuestaoForm questaoForm = questaoService.converteQuestaoView(elementoQuestao.getQuestao());
mv.addObject("elementoQuestaoForm", elementoQuestaoForm);
mv.addObject("elementoForm", elementoForm);
mv.addObject("questaoForm", questaoForm);
mv.addObject("usuarioNome",usuarioSeguranca.getUsuarioLogado()); mv.addObject("standardDate",new Date());
return mv;
}
} | [
"[email protected]"
] | |
a54826511562e0094d38b9eac42daced410eb4d3 | 6469ed039a51bdfe90038e0a09c1c2fa11c1db64 | /ServeurPendu/src/serveur/UDPClient.java | 5ff7b586c54248673712031543380f7b44d7b46e | [] | no_license | dsfaraujo/PenduServeur | 86766c3b1a0bce3cc50b352a69699de69062a15e | f037bd15ef854410018529df5c9811eff60e158e | refs/heads/master | 2021-07-04T01:54:28.233994 | 2017-09-26T21:06:35 | 2017-09-26T21:06:35 | 104,495,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,417 | java | package serveur;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
/**
* ********************************************************
* Classe utilitaire permettant de faire appel a un serveur UDP
*
* @author rebecca
*
*/
public final class UDPClient{
public static final String IP = "192.168.9.8";
public static final int PORT = 6112;
/**
* ************************************************
* Envoie une chaine de caractere au serveur UDP et
* retourne la reponse
*
* @param s Le message a envoyer au serveur
* @return La reponse du serveur
*/
public static String envoyerMessage(String message)
{
String reponse = "";
try
{
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress = InetAddress.getByName(IP);
byte[] sendData = new byte[1024];
byte[] receiveData = new byte[1024];
sendData = message.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, PORT);
clientSocket.send(sendPacket);
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
clientSocket.receive(receivePacket);
reponse = new String(receivePacket.getData());
clientSocket.close();
}
catch (IOException e)
{
e.printStackTrace();
}
return reponse.trim();
}
}
| [
"[email protected]"
] | |
a3379cc83228d8eee56e12161c2f6e53ff8cde48 | 85b13379de8d4142d5df878f916ff288f085e18e | /Printing n odd numbers/Main.java | e1f2243193546008c3ac63e21133e02b5fe381df | [] | no_license | THAMIZHINI/Playground | 7dd0e30f69431186567712b8dcb04c46f294c379 | dea7d940bc7cb120cae9d8440da417a14112e1bf | refs/heads/master | 2020-06-01T11:56:23.147870 | 2019-06-14T10:06:23 | 2019-06-14T10:06:23 | 190,771,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | #include <stdio.h>
int main() {
int n;
scanf("%d",&n);
for ( int i=1;i<=2*n;i++)
{
if(i%2==1)
printf("%d\n",i);
}
return 0;
} | [
"[email protected]"
] | |
4ced60d0ffbce9bcd1ba70c04b197c091b8895a8 | f6f6b1d9953cbf5f008566b3880ceda61a53b04b | /src/main/java/io/javabraims/model/CatalogItem.java | 8830c4bbaf9d4023c052f5dec81f7af80f5b2e17 | [] | no_license | HluhovMax/spring-boot-microservices | bd631d67450addb739e43824456d8d4de2687da9 | b7ae3fc6fb9b6c8fdd33713818de37800dc26917 | refs/heads/master | 2020-04-30T10:49:19.911078 | 2019-03-20T17:43:25 | 2019-03-20T17:43:25 | 176,786,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package io.javabraims.model;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* Created by 38066 on 19.03.2019.
*/
@Data
@AllArgsConstructor
public class CatalogItem {
private String name;
private String desc;
private int rating;
}
| [
"[email protected]"
] | |
7769681d3012f19f1c699467e79a8d8c3d5e18cd | b59886bcdfa48f70b584a20cb97c9bc097a35992 | /build/generated/src/org/apache/jsp/index_jsp.java | 376406293d15a5c5ec197406d9d23fbdc5a7c3b2 | [] | no_license | selcukcokkuvvetli/Anket | 990594d0974d612d6284a99bf83e690cadc90d47 | ad3c8d3d3242770246432751a27f57037db11d66 | refs/heads/master | 2020-03-17T15:48:49.547164 | 2018-05-16T21:56:07 | 2018-05-16T21:56:07 | 133,725,035 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,469 | java | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<!DOCTYPE html>\n");
out.write("<html>\n");
out.write(" <head>\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
out.write(" <link rel=\"stylesheet\" href=\"./source/css/bootstrap.min.css\">\n");
out.write(" <title>Register Page</title>\n");
out.write(" <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css\" integrity=\"sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB\" crossorigin=\"anonymous\">\n");
out.write("</head>\n");
out.write("<body>\n");
out.write(" <form action=\"Register\" method=\"POST\">\n");
out.write("<div class=\"container\">\n");
out.write(" <div class=\"row\">\n");
out.write(" <div class=\"col\"></div>\n");
out.write(" <div class=\"col-md-4 col-md-offset-4\" style=\"padding-top:10%;\">\n");
out.write(" <div class=\"panel panel-default\">\n");
out.write(" <div class=\"panel-heading\">\n");
out.write(" <h3 class=\"panel-title\">Sign Up</h3>\n");
out.write(" </div>\n");
out.write(" <div class=\"panel-body\">\n");
out.write(" <form id=\"signup\" name=\"signup\" methot=\"post\" action=\"signup.jsp\">\n");
out.write(" <fieldset>\n");
out.write(" <div class=\"form-group\">\n");
out.write(" <input class=\"form-control\" name=\"first_name\" placeholder=\"Name\" name=\"txtFirstname\" type=\"text\" autofocus>\n");
out.write(" </div>\n");
out.write(" <div class=\"form-group\">\n");
out.write(" <input class=\"form-control\" name=\"last_name\" placeholder=\"Surname\" name=\"txtLastname\" type=\"text\" autofocus>\n");
out.write(" </div>\n");
out.write(" <div class=\"form-group\">\n");
out.write(" <input class=\"form-control\" name=\"email\" placeholder=\"E-mail\" name=\"txtEmail\" type=\"text\" autofocus>\n");
out.write(" </div>\n");
out.write(" <div class=\"form-group\">\n");
out.write(" <input class=\"form-control\" name=\"pass\" placeholder=\"Password\" name=\"txtPassword\" type=\"password\" value=\"\">\n");
out.write(" </div>\n");
out.write(" <!-- Change this to a button or input when using this as a form -->\n");
out.write(" <button type=\"submit\" id=\"signupbtn\" class=\"btn btn-success float-md-right\">Sign Up</button>\n");
out.write(" </fieldset>\n");
out.write(" </form>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"col\"></div>\n");
out.write(" </div>\n");
out.write("</div>\n");
out.write("<script src=\"./source/js/bootstrap.min.js\"></script>\n");
out.write(" </form>\n");
out.write("</body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"[email protected]"
] | |
f24a43f36f4f490e4827b59c278e2a7653e74e1c | 667f6048e2235ac1c79e4293204a4af5e7fcf5dc | /src/main/java/monnef/core/external/javassist/bytecode/SignatureAttribute.java | 2e5bb26c67949c6a59b51491525a445bed3b82d4 | [] | no_license | mnn/monnefcore | 980d1093d49a60827dd4d42a0be0d660c757d0d3 | 9091c5e6c94cd413069797fc45646514e50e81f5 | refs/heads/master | 2021-01-23T13:59:15.490686 | 2014-12-04T17:06:55 | 2014-12-04T17:06:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 34,702 | java | /*
* Javassist, a Java-bytecode translator toolkit.
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. Alternatively, the contents of this file may be used under
* the terms of the GNU Lesser General Public License Version 2.1 or later,
* or the Apache License Version 2.0.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*/
package monnef.core.external.javassist.bytecode;
import monnef.core.external.javassist.CtClass;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
/**
* <code>Signature_attribute</code>.
*/
public class SignatureAttribute extends AttributeInfo {
/**
* The name of this attribute <code>"Signature"</code>.
*/
public static final String tag = "Signature";
SignatureAttribute(ConstPool cp, int n, DataInputStream in)
throws IOException
{
super(cp, n, in);
}
/**
* Constructs a <code>Signature</code> attribute.
*
* @param cp a constant pool table.
* @param signature the signature represented by this attribute.
*/
public SignatureAttribute(ConstPool cp, String signature) {
super(cp, tag);
int index = cp.addUtf8Info(signature);
byte[] bvalue = new byte[2];
bvalue[0] = (byte)(index >>> 8);
bvalue[1] = (byte)index;
set(bvalue);
}
/**
* Returns the generic signature indicated by <code>signature_index</code>.
*
* @see #toClassSignature(String)
* @see #toMethodSignature(String)
* @see #toFieldSignature(String)
*/
public String getSignature() {
return getConstPool().getUtf8Info(ByteArray.readU16bit(get(), 0));
}
/**
* Sets <code>signature_index</code> to the index of the given generic signature,
* which is added to a constant pool.
*
* @param sig new signature.
* @since 3.11
*/
public void setSignature(String sig) {
int index = getConstPool().addUtf8Info(sig);
ByteArray.write16bit(index, info, 0);
}
/**
* Makes a copy. Class names are replaced according to the
* given <code>Map</code> object.
*
* @param newCp the constant pool table used by the new copy.
* @param classnames pairs of replaced and substituted
* class names.
*/
public AttributeInfo copy(ConstPool newCp, Map classnames) {
return new SignatureAttribute(newCp, getSignature());
}
void renameClass(String oldname, String newname) {
String sig = renameClass(getSignature(), oldname, newname);
setSignature(sig);
}
void renameClass(Map classnames) {
String sig = renameClass(getSignature(), classnames);
setSignature(sig);
}
static String renameClass(String desc, String oldname, String newname) {
Map map = new java.util.HashMap();
map.put(oldname, newname);
return renameClass(desc, map);
}
static String renameClass(String desc, Map map) {
if (map == null)
return desc;
StringBuilder newdesc = new StringBuilder();
int head = 0;
int i = 0;
for (;;) {
int j = desc.indexOf('L', i);
if (j < 0)
break;
StringBuilder nameBuf = new StringBuilder();
int k = j;
char c;
try {
while ((c = desc.charAt(++k)) != ';') {
nameBuf.append(c);
if (c == '<') {
while ((c = desc.charAt(++k)) != '>')
nameBuf.append(c);
nameBuf.append(c);
}
}
}
catch (IndexOutOfBoundsException e) { break; }
i = k + 1;
String name = nameBuf.toString();
String name2 = (String)map.get(name);
if (name2 != null) {
newdesc.append(desc.substring(head, j));
newdesc.append('L');
newdesc.append(name2);
newdesc.append(c);
head = i;
}
}
if (head == 0)
return desc;
else {
int len = desc.length();
if (head < len)
newdesc.append(desc.substring(head, len));
return newdesc.toString();
}
}
private static boolean isNamePart(int c) {
return c != ';' && c != '<';
}
static private class Cursor {
int position = 0;
int indexOf(String s, int ch) throws BadBytecode {
int i = s.indexOf(ch, position);
if (i < 0)
throw error(s);
else {
position = i + 1;
return i;
}
}
}
/**
* Class signature.
*/
public static class ClassSignature {
TypeParameter[] params;
ClassType superClass;
ClassType[] interfaces;
/**
* Constructs a class signature.
*
* @param params type parameters.
* @param superClass the super class.
* @param interfaces the interface types.
*/
public ClassSignature(TypeParameter[] params, ClassType superClass, ClassType[] interfaces) {
this.params = params == null ? new TypeParameter[0] : params;
this.superClass = superClass == null ? ClassType.OBJECT : superClass;
this.interfaces = interfaces == null ? new ClassType[0] : interfaces;
}
/**
* Constructs a class signature.
*
* @param p type parameters.
*/
public ClassSignature(TypeParameter[] p) {
this(p, null, null);
}
/**
* Returns the type parameters.
*
* @return a zero-length array if the type parameters are not specified.
*/
public TypeParameter[] getParameters() {
return params;
}
/**
* Returns the super class.
*/
public ClassType getSuperClass() { return superClass; }
/**
* Returns the super interfaces.
*
* @return a zero-length array if the super interfaces are not specified.
*/
public ClassType[] getInterfaces() { return interfaces; }
/**
* Returns the string representation.
*/
public String toString() {
StringBuffer sbuf = new StringBuffer();
TypeParameter.toString(sbuf, params);
sbuf.append(" extends ").append(superClass);
if (interfaces.length > 0) {
sbuf.append(" implements ");
Type.toString(sbuf, interfaces);
}
return sbuf.toString();
}
/**
* Returns the encoded string representing the method type signature.
*/
public String encode() {
StringBuffer sbuf = new StringBuffer();
if (params.length > 0) {
sbuf.append('<');
for (int i = 0; i < params.length; i++)
params[i].encode(sbuf);
sbuf.append('>');
}
superClass.encode(sbuf);
for (int i = 0; i < interfaces.length; i++)
interfaces[i].encode(sbuf);
return sbuf.toString();
}
}
/**
* Method type signature.
*/
public static class MethodSignature {
TypeParameter[] typeParams;
Type[] params;
Type retType;
ObjectType[] exceptions;
/**
* Constructs a method type signature. Any parameter can be null
* to represent <code>void</code> or nothing.
*
* @param tp type parameters.
* @param params parameter types.
* @param ret a return type, or null if the return type is <code>void</code>.
* @param ex exception types.
*/
public MethodSignature(TypeParameter[] tp, Type[] params, Type ret, ObjectType[] ex) {
typeParams = tp == null ? new TypeParameter[0] : tp;
this.params = params == null ? new Type[0] : params;
retType = ret == null ? new BaseType("void") : ret;
exceptions = ex == null ? new ObjectType[0] : ex;
}
/**
* Returns the formal type parameters.
*
* @return a zero-length array if the type parameters are not specified.
*/
public TypeParameter[] getTypeParameters() { return typeParams; }
/**
* Returns the types of the formal parameters.
*
* @return a zero-length array if no formal parameter is taken.
*/
public Type[] getParameterTypes() { return params; }
/**
* Returns the type of the returned value.
*/
public Type getReturnType() { return retType; }
/**
* Returns the types of the exceptions that may be thrown.
*
* @return a zero-length array if exceptions are never thrown or
* the exception types are not parameterized types or type variables.
*/
public ObjectType[] getExceptionTypes() { return exceptions; }
/**
* Returns the string representation.
*/
public String toString() {
StringBuffer sbuf = new StringBuffer();
TypeParameter.toString(sbuf, typeParams);
sbuf.append(" (");
Type.toString(sbuf, params);
sbuf.append(") ");
sbuf.append(retType);
if (exceptions.length > 0) {
sbuf.append(" throws ");
Type.toString(sbuf, exceptions);
}
return sbuf.toString();
}
/**
* Returns the encoded string representing the method type signature.
*/
public String encode() {
StringBuffer sbuf = new StringBuffer();
if (typeParams.length > 0) {
sbuf.append('<');
for (int i = 0; i < typeParams.length; i++)
typeParams[i].encode(sbuf);
sbuf.append('>');
}
sbuf.append('(');
for (int i = 0; i < params.length; i++)
params[i].encode(sbuf);
sbuf.append(')');
retType.encode(sbuf);
if (exceptions.length > 0)
for (int i = 0; i < exceptions.length; i++) {
sbuf.append('^');
exceptions[i].encode(sbuf);
}
return sbuf.toString();
}
}
/**
* Formal type parameters.
*
* @see TypeArgument
*/
public static class TypeParameter {
String name;
ObjectType superClass;
ObjectType[] superInterfaces;
TypeParameter(String sig, int nb, int ne, ObjectType sc, ObjectType[] si) {
name = sig.substring(nb, ne);
superClass = sc;
superInterfaces = si;
}
/**
* Constructs a <code>TypeParameter</code> representing a type parametre
* like <code><T extends ... ><code>.
*
* @param name parameter name.
* @param superClass an upper bound class-type (or null).
* @param superInterfaces an upper bound interface-type (or null).
*/
public TypeParameter(String name, ObjectType superClass, ObjectType[] superInterfaces) {
this.name = name;
this.superClass = superClass;
if (superInterfaces == null)
this.superInterfaces = new ObjectType[0];
else
this.superInterfaces = superInterfaces;
}
/**
* Constructs a <code>TypeParameter</code> representing a type parameter
* like <code><T><code>.
*
* @param name parameter name.
*/
public TypeParameter(String name) {
this(name, null, null);
}
/**
* Returns the name of the type parameter.
*/
public String getName() {
return name;
}
/**
* Returns the class bound of this parameter.
*/
public ObjectType getClassBound() { return superClass; }
/**
* Returns the interface bound of this parameter.
*
* @return a zero-length array if the interface bound is not specified.
*/
public ObjectType[] getInterfaceBound() { return superInterfaces; }
/**
* Returns the string representation.
*/
public String toString() {
StringBuffer sbuf = new StringBuffer(getName());
if (superClass != null)
sbuf.append(" extends ").append(superClass.toString());
int len = superInterfaces.length;
if (len > 0) {
for (int i = 0; i < len; i++) {
if (i > 0 || superClass != null)
sbuf.append(" & ");
else
sbuf.append(" extends ");
sbuf.append(superInterfaces[i].toString());
}
}
return sbuf.toString();
}
static void toString(StringBuffer sbuf, TypeParameter[] tp) {
sbuf.append('<');
for (int i = 0; i < tp.length; i++) {
if (i > 0)
sbuf.append(", ");
sbuf.append(tp[i]);
}
sbuf.append('>');
}
void encode(StringBuffer sb) {
sb.append(name);
if (superClass == null)
sb.append(":Ljava/lang/Object;");
else {
sb.append(':');
superClass.encode(sb);
}
for (int i = 0; i < superInterfaces.length; i++) {
sb.append(':');
superInterfaces[i].encode(sb);
}
}
}
/**
* Type argument.
*
* @see TypeParameter
*/
public static class TypeArgument {
ObjectType arg;
char wildcard;
TypeArgument(ObjectType a, char w) {
arg = a;
wildcard = w;
}
/**
* Constructs a <code>TypeArgument</code>.
* A type argument is <code><String></code>, <code><int[]></code>,
* or a type variable <code><T></code>, etc.
*
* @param t a class type, an array type, or a type variable.
*/
public TypeArgument(ObjectType t) {
this(t, ' ');
}
/**
* Constructs a <code>TypeArgument</code> representing <code><?></code>.
*/
public TypeArgument() {
this(null, '*');
}
/**
* A factory method constructing a <code>TypeArgument</code> with an upper bound.
* It represents <code><? extends ... ></code>
*
* @param t an upper bound type.
*/
public static TypeArgument subclassOf(ObjectType t) {
return new TypeArgument(t, '+');
}
/**
* A factory method constructing a <code>TypeArgument</code> with an lower bound.
* It represents <code><? super ... ></code>
*
* @param t an lower bbound type.
*/
public static TypeArgument superOf(ObjectType t) {
return new TypeArgument(t, '-');
}
/**
* Returns the kind of this type argument.
*
* @return <code>' '</code> (not-wildcard), <code>'*'</code> (wildcard), <code>'+'</code> (wildcard with
* upper bound), or <code>'-'</code> (wildcard with lower bound).
*/
public char getKind() { return wildcard; }
/**
* Returns true if this type argument is a wildcard type
* such as <code>?</code>, <code>? extends String</code>, or <code>? super Integer</code>.
*/
public boolean isWildcard() { return wildcard != ' '; }
/**
* Returns the type represented by this argument
* if the argument is not a wildcard type. Otherwise, this method
* returns the upper bound (if the kind is '+'),
* the lower bound (if the kind is '-'), or null (if the upper or lower
* bound is not specified).
*/
public ObjectType getType() { return arg; }
/**
* Returns the string representation.
*/
public String toString() {
if (wildcard == '*')
return "?";
String type = arg.toString();
if (wildcard == ' ')
return type;
else if (wildcard == '+')
return "? extends " + type;
else
return "? super " + type;
}
static void encode(StringBuffer sb, TypeArgument[] args) {
sb.append('<');
for (int i = 0; i < args.length; i++) {
TypeArgument ta = args[i];
if (ta.isWildcard())
sb.append(ta.wildcard);
if (ta.getType() != null)
ta.getType().encode(sb);
}
sb.append('>');
}
}
/**
* Primitive types and object types.
*/
public static abstract class Type {
abstract void encode(StringBuffer sb);
static void toString(StringBuffer sbuf, Type[] ts) {
for (int i = 0; i < ts.length; i++) {
if (i > 0)
sbuf.append(", ");
sbuf.append(ts[i]);
}
}
}
/**
* Primitive types.
*/
public static class BaseType extends Type {
char descriptor;
BaseType(char c) { descriptor = c; }
/**
* Constructs a <code>BaseType</code>.
*
* @param typeName <code>void</code>, <code>int</code>, ...
*/
public BaseType(String typeName) {
this(Descriptor.of(typeName).charAt(0));
}
/**
* Returns the descriptor representing this primitive type.
*
* @see monnef.core.external.javassist.bytecode.Descriptor
*/
public char getDescriptor() { return descriptor; }
/**
* Returns the <code>CtClass</code> representing this
* primitive type.
*/
public CtClass getCtlass() {
return Descriptor.toPrimitiveClass(descriptor);
}
/**
* Returns the string representation.
*/
public String toString() {
return Descriptor.toClassName(Character.toString(descriptor));
}
void encode(StringBuffer sb) {
sb.append(descriptor);
}
}
/**
* Class types, array types, and type variables.
* This class is also used for representing a field type.
*/
public static abstract class ObjectType extends Type {
/**
* Returns the encoded string representing the object type signature.
*/
public String encode() {
StringBuffer sb = new StringBuffer();
encode(sb);
return sb.toString();
}
}
/**
* Class types.
*/
public static class ClassType extends ObjectType {
String name;
TypeArgument[] arguments;
static ClassType make(String s, int b, int e,
TypeArgument[] targs, ClassType parent) {
if (parent == null)
return new ClassType(s, b, e, targs);
else
return new NestedClassType(s, b, e, targs, parent);
}
ClassType(String signature, int begin, int end, TypeArgument[] targs) {
name = signature.substring(begin, end).replace('/', '.');
arguments = targs;
}
/**
* A class type representing <code>java.lang.Object</code>.
*/
public static ClassType OBJECT = new ClassType("java.lang.Object", null);
/**
* Constructs a <code>ClassType</code>. It represents
* the name of a non-nested class.
*
* @param className a fully qualified class name.
* @param args type arguments or null.
*/
public ClassType(String className, TypeArgument[] args) {
name = className;
arguments = args;
}
/**
* Constructs a <code>ClassType</code>. It represents
* the name of a non-nested class.
*
* @param className a fully qualified class name.
*/
public ClassType(String className) {
this(className, null);
}
/**
* Returns the class name.
*/
public String getName() {
return name;
}
/**
* Returns the type arguments.
*
* @return null if no type arguments are given to this class.
*/
public TypeArgument[] getTypeArguments() { return arguments; }
/**
* If this class is a member of another class, returns the
* class in which this class is declared.
*
* @return null if this class is not a member of another class.
*/
public ClassType getDeclaringClass() { return null; }
/**
* Returns the string representation.
*/
public String toString() {
StringBuffer sbuf = new StringBuffer();
ClassType parent = getDeclaringClass();
if (parent != null)
sbuf.append(parent.toString()).append('.');
sbuf.append(name);
if (arguments != null) {
sbuf.append('<');
int n = arguments.length;
for (int i = 0; i < n; i++) {
if (i > 0)
sbuf.append(", ");
sbuf.append(arguments[i].toString());
}
sbuf.append('>');
}
return sbuf.toString();
}
void encode(StringBuffer sb) {
sb.append('L');
encode2(sb);
sb.append(';');
}
void encode2(StringBuffer sb) {
ClassType parent = getDeclaringClass();
if (parent != null) {
parent.encode2(sb);
sb.append('$');
}
sb.append(name.replace('.', '/'));
if (arguments != null)
TypeArgument.encode(sb, arguments);
}
}
/**
* Nested class types.
*/
public static class NestedClassType extends ClassType {
ClassType parent;
NestedClassType(String s, int b, int e,
TypeArgument[] targs, ClassType p) {
super(s, b, e, targs);
parent = p;
}
/**
* Constructs a <code>NestedClassType</code>.
*
* @param parent the class surrounding this class type.
* @param className a simple class name. It does not include
* a package name or a parent's class name.
* @param args type parameters or null.
*/
public NestedClassType(ClassType parent, String className, TypeArgument[] args) {
super(className, args);
this.parent = parent;
}
/**
* Returns the class that declares this nested class.
* This nested class is a member of that declaring class.
*/
public ClassType getDeclaringClass() { return parent; }
}
/**
* Array types.
*/
public static class ArrayType extends ObjectType {
int dim;
Type componentType;
/**
* Constructs an <code>ArrayType</code>.
*
* @param d dimension.
* @param comp the component type.
*/
public ArrayType(int d, Type comp) {
dim = d;
componentType = comp;
}
/**
* Returns the dimension of the array.
*/
public int getDimension() { return dim; }
/**
* Returns the component type.
*/
public Type getComponentType() {
return componentType;
}
/**
* Returns the string representation.
*/
public String toString() {
StringBuffer sbuf = new StringBuffer(componentType.toString());
for (int i = 0; i < dim; i++)
sbuf.append("[]");
return sbuf.toString();
}
void encode(StringBuffer sb) {
for (int i = 0; i < dim; i++)
sb.append('[');
componentType.encode(sb);
}
}
/**
* Type variables.
*/
public static class TypeVariable extends ObjectType {
String name;
TypeVariable(String sig, int begin, int end) {
name = sig.substring(begin, end);
}
/**
* Constructs a <code>TypeVariable</code>.
*
* @param name the name of a type variable.
*/
public TypeVariable(String name) {
this.name = name;
}
/**
* Returns the variable name.
*/
public String getName() {
return name;
}
/**
* Returns the string representation.
*/
public String toString() {
return name;
}
void encode(StringBuffer sb) {
sb.append('T').append(name).append(';');
}
}
/**
* Parses the given signature string as a class signature.
*
* @param sig the signature obtained from the <code>SignatureAttribute</code>
* of a <code>ClassFile</code>.
* @return a tree-like data structure representing a class signature. It provides
* convenient accessor methods.
* @throws BadBytecode thrown when a syntactical error is found.
* @see #getSignature()
* @since 3.5
*/
public static ClassSignature toClassSignature(String sig) throws BadBytecode {
try {
return parseSig(sig);
}
catch (IndexOutOfBoundsException e) {
throw error(sig);
}
}
/**
* Parses the given signature string as a method type signature.
*
* @param sig the signature obtained from the <code>SignatureAttribute</code>
* of a <code>MethodInfo</code>.
* @return @return a tree-like data structure representing a method signature. It provides
* convenient accessor methods.
* @throws BadBytecode thrown when a syntactical error is found.
* @see #getSignature()
* @since 3.5
*/
public static MethodSignature toMethodSignature(String sig) throws BadBytecode {
try {
return parseMethodSig(sig);
}
catch (IndexOutOfBoundsException e) {
throw error(sig);
}
}
/**
* Parses the given signature string as a field type signature.
*
* @param sig the signature string obtained from the <code>SignatureAttribute</code>
* of a <code>FieldInfo</code>.
* @return the field type signature.
* @throws BadBytecode thrown when a syntactical error is found.
* @see #getSignature()
* @since 3.5
*/
public static ObjectType toFieldSignature(String sig) throws BadBytecode {
try {
return parseObjectType(sig, new Cursor(), false);
}
catch (IndexOutOfBoundsException e) {
throw error(sig);
}
}
/**
* Parses the given signature string as a type signature.
* The type signature is either the field type signature or a base type
* descriptor including <code>void</code> type.
*
* @throws BadBytecode thrown when a syntactical error is found.
* @since 3.18
*/
public static Type toTypeSignature(String sig) throws BadBytecode {
try {
return parseType(sig, new Cursor());
}
catch (IndexOutOfBoundsException e) {
throw error(sig);
}
}
private static ClassSignature parseSig(String sig)
throws BadBytecode, IndexOutOfBoundsException
{
Cursor cur = new Cursor();
TypeParameter[] tp = parseTypeParams(sig, cur);
ClassType superClass = parseClassType(sig, cur);
int sigLen = sig.length();
ArrayList ifArray = new ArrayList();
while (cur.position < sigLen && sig.charAt(cur.position) == 'L')
ifArray.add(parseClassType(sig, cur));
ClassType[] ifs
= (ClassType[])ifArray.toArray(new ClassType[ifArray.size()]);
return new ClassSignature(tp, superClass, ifs);
}
private static MethodSignature parseMethodSig(String sig)
throws BadBytecode
{
Cursor cur = new Cursor();
TypeParameter[] tp = parseTypeParams(sig, cur);
if (sig.charAt(cur.position++) != '(')
throw error(sig);
ArrayList params = new ArrayList();
while (sig.charAt(cur.position) != ')') {
Type t = parseType(sig, cur);
params.add(t);
}
cur.position++;
Type ret = parseType(sig, cur);
int sigLen = sig.length();
ArrayList exceptions = new ArrayList();
while (cur.position < sigLen && sig.charAt(cur.position) == '^') {
cur.position++;
ObjectType t = parseObjectType(sig, cur, false);
if (t instanceof ArrayType)
throw error(sig);
exceptions.add(t);
}
Type[] p = (Type[])params.toArray(new Type[params.size()]);
ObjectType[] ex = (ObjectType[])exceptions.toArray(new ObjectType[exceptions.size()]);
return new MethodSignature(tp, p, ret, ex);
}
private static TypeParameter[] parseTypeParams(String sig, Cursor cur)
throws BadBytecode
{
ArrayList typeParam = new ArrayList();
if (sig.charAt(cur.position) == '<') {
cur.position++;
while (sig.charAt(cur.position) != '>') {
int nameBegin = cur.position;
int nameEnd = cur.indexOf(sig, ':');
ObjectType classBound = parseObjectType(sig, cur, true);
ArrayList ifBound = new ArrayList();
while (sig.charAt(cur.position) == ':') {
cur.position++;
ObjectType t = parseObjectType(sig, cur, false);
ifBound.add(t);
}
TypeParameter p = new TypeParameter(sig, nameBegin, nameEnd,
classBound, (ObjectType[])ifBound.toArray(new ObjectType[ifBound.size()]));
typeParam.add(p);
}
cur.position++;
}
return (TypeParameter[])typeParam.toArray(new TypeParameter[typeParam.size()]);
}
private static ObjectType parseObjectType(String sig, Cursor c, boolean dontThrow)
throws BadBytecode
{
int i;
int begin = c.position;
switch (sig.charAt(begin)) {
case 'L' :
return parseClassType2(sig, c, null);
case 'T' :
i = c.indexOf(sig, ';');
return new TypeVariable(sig, begin + 1, i);
case '[' :
return parseArray(sig, c);
default :
if (dontThrow)
return null;
else
throw error(sig);
}
}
private static ClassType parseClassType(String sig, Cursor c)
throws BadBytecode
{
if (sig.charAt(c.position) == 'L')
return parseClassType2(sig, c, null);
else
throw error(sig);
}
private static ClassType parseClassType2(String sig, Cursor c, ClassType parent)
throws BadBytecode
{
int start = ++c.position;
char t;
do {
t = sig.charAt(c.position++);
} while (t != '$' && t != '<' && t != ';');
int end = c.position - 1;
TypeArgument[] targs;
if (t == '<') {
targs = parseTypeArgs(sig, c);
t = sig.charAt(c.position++);
}
else
targs = null;
ClassType thisClass = ClassType.make(sig, start, end, targs, parent);
if (t == '$' || t == '.') {
c.position--;
return parseClassType2(sig, c, thisClass);
}
else
return thisClass;
}
private static TypeArgument[] parseTypeArgs(String sig, Cursor c) throws BadBytecode {
ArrayList args = new ArrayList();
char t;
while ((t = sig.charAt(c.position++)) != '>') {
TypeArgument ta;
if (t == '*' )
ta = new TypeArgument(null, '*');
else {
if (t != '+' && t != '-') {
t = ' ';
c.position--;
}
ta = new TypeArgument(parseObjectType(sig, c, false), t);
}
args.add(ta);
}
return (TypeArgument[])args.toArray(new TypeArgument[args.size()]);
}
private static ObjectType parseArray(String sig, Cursor c) throws BadBytecode {
int dim = 1;
while (sig.charAt(++c.position) == '[')
dim++;
return new ArrayType(dim, parseType(sig, c));
}
private static Type parseType(String sig, Cursor c) throws BadBytecode {
Type t = parseObjectType(sig, c, true);
if (t == null)
t = new BaseType(sig.charAt(c.position++));
return t;
}
private static BadBytecode error(String sig) {
return new BadBytecode("bad signature: " + sig);
}
}
| [
"[email protected]"
] | |
ff7fcb431ddf4c7f6c4865e404ad426290f1ff41 | f7fac67835a6d6baef4a4e835eedb92d7a1db0ed | /FREIND_MANAGEMENT/friend-management-service/src/main/java/com/cg/fm/dto/FriendEmailListDto.java | b7c2c3f89f675dc0bee7d7fb2cda358bd0b64502 | [] | no_license | pradeepkrathnayaka/Microservices_POC | 8abadc28ac067dbd9cdf4909117fa383b55cc681 | b56efe6b27f2e8687a168d7d87b5e7a78dc45885 | refs/heads/master | 2021-05-24T15:37:41.562901 | 2020-04-14T02:46:31 | 2020-04-14T02:46:31 | 253,634,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.cg.fm.dto;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
/**
* @author Predeep
*
*/
@Getter
@Setter
public class FriendEmailListDto {
private List<String> friends;
} | [
"[email protected]"
] | |
09609a078b9566e2f49df9cda126c4d0df7d9a91 | 44316a54755e5ee4118a3e82352094ea3a35358f | /no.sintef.bvr.table.resolution/src/no/sintef/bvr/table/resolution/custom/VirtualVClassifierImpl.java | 73a9ac03f6303138ae17380150d28d665bb6cccb | [] | no_license | vassik/bvr | 98a811ae7d21fbe5ea0701d04891d28b129f9e9b | 3fa1a48d401aa29fabcd5ea4153c696e7e39da0e | refs/heads/master | 2020-05-25T13:35:27.784701 | 2015-04-29T13:22:36 | 2015-04-29T13:22:36 | 34,623,094 | 0 | 0 | null | 2015-04-26T17:41:13 | 2015-04-26T17:41:12 | null | UTF-8 | Java | false | false | 2,854 | java | /**
*/
package no.sintef.bvr.table.resolution.custom;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import bvr.BvrPackage;
import bvr.VSpecResolution;
import bvr.impl.VSpecResolutionImpl;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>VirtualVClassifier</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link no.sintef.bvr.model.impl.VInstanceImpl#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @generated NOT
*/
public class VirtualVClassifierImpl extends VSpecResolutionImpl implements
VirtualVClassifier {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getType()
* @generated NOT
* @ordered
*/
protected VSpecResolution parent;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
protected VirtualVClassifierImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
protected EClass eStaticClass() {
// This class is not in Bvr Model
return null;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public VSpecResolution getParent() {
if (parent != null && parent.eIsProxy()) {
InternalEObject oldType = (InternalEObject) parent;
parent = (VSpecResolution) eResolveProxy(oldType);
if (parent != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
BvrPackage.VINSTANCE__TYPE, oldType, parent));
}
}
return parent;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public VSpecResolution basicGetParent() {
return parent;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setParent(VSpecResolution newParent) {
parent = newParent;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void eSet(int featureID, Object newValue) {
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void eUnset(int featureID) {
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public boolean eIsSet(int featureID) {
return super.eIsSet(featureID);
}
} // VirtualVClassifierImpl
| [
"[email protected]"
] | |
bc79e6bfd66bbe05a80e6ac0c49030ef899a165f | f1e0b152f2b41b3f16dcbfea13c0a23dc3325008 | /modules/MgkPortlet/MgkPortlet-api/src/main/java/com/mgk/portlet/service/PersonServiceUtil.java | d4ccebde91af47a4945cecfe7a94a8edc484ca2f | [] | no_license | 021Mgk/liferay-portlet-mgk | 9aa1b3d1fc1a46bbd67da3fae2c6034e88f813f5 | 25564484d628b30f7a7446a5847a47f0eb7ec3d5 | refs/heads/master | 2023-08-15T13:27:40.330736 | 2021-09-16T07:48:54 | 2021-09-16T07:48:54 | 401,022,694 | 0 | 1 | null | 2021-09-16T07:48:55 | 2021-08-29T11:19:17 | Java | UTF-8 | Java | false | false | 2,144 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.mgk.portlet.service;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.osgi.util.tracker.ServiceTracker;
/**
* Provides the remote service utility for Person. This utility wraps
* <code>com.mgk.portlet.service.impl.PersonServiceImpl</code> and is an
* access point for service operations in application layer code running on a
* remote server. Methods of this service are expected to have security checks
* based on the propagated JAAS credentials because this service can be
* accessed remotely.
*
* @author 021mgk
* @see PersonService
* @generated
*/
public class PersonServiceUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Add custom service methods to <code>com.mgk.portlet.service.impl.PersonServiceImpl</code> and rerun ServiceBuilder to regenerate this class.
*/
/**
* Returns the OSGi service identifier.
*
* @return the OSGi service identifier
*/
public static String getOSGiServiceIdentifier() {
return getService().getOSGiServiceIdentifier();
}
public static PersonService getService() {
return _serviceTracker.getService();
}
private static ServiceTracker<PersonService, PersonService> _serviceTracker;
static {
Bundle bundle = FrameworkUtil.getBundle(PersonService.class);
ServiceTracker<PersonService, PersonService> serviceTracker =
new ServiceTracker<PersonService, PersonService>(
bundle.getBundleContext(), PersonService.class, null);
serviceTracker.open();
_serviceTracker = serviceTracker;
}
} | [
"[email protected]"
] | |
da5b4f81bef4d8707c531b27b7f184fb4346e02e | 73f8f8634e5d179ef32762ad953eeacbacb5a4db | /Thinking in Java(Fourth Edition)/chapter15/generator/coffee/Coffee.java | 8e6cd37599f240368fc0914623e4246b8ad2e213 | [] | no_license | yueban/java | 46c1a41d86da424d16563a538b3cc5a87d3c002a | 1023e5ae3cbba7db403a9b46fd8b1dafc82107c8 | refs/heads/master | 2021-01-25T04:02:54.017486 | 2014-11-21T02:47:46 | 2014-11-21T02:47:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | package generator.coffee;
public class Coffee{
private static long counter = 0;
private final long id = counter++;
public String toString(){
return getClass().getSimpleName() + " " + id;
}
} | [
"[email protected]"
] | |
fa9b1f273ffe7aa82f8c1fe26b4d01afc5fbced7 | d01ddc583cd4077dcf8cf338fcf2897908daa4ad | /jooby/src/main/java/org/jooby/internal/routes/CorsHandler.java | ef51180e8f9da00cdb9f98c5825ec70123656901 | [
"Apache-2.0"
] | permissive | gustvn/jooby | 61656793a2a8e753d962dffe414a8c668735c94c | d039d466be272c0c35a8ca9c78df4e04a27fc2f5 | refs/heads/master | 2021-01-24T16:48:43.300086 | 2015-07-30T19:42:29 | 2015-07-30T19:42:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,057 | 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.jooby.internal.routes;
import static java.util.Objects.requireNonNull;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.jooby.Cors;
import org.jooby.Request;
import org.jooby.Response;
import org.jooby.Route;
import org.jooby.Route.Chain;
import org.jooby.Status;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
public class CorsHandler implements Route.Filter {
private static final String ORIGIN = "Origin";
private static final String ANY_ORIGIN = "*";
private static final String AC_REQUEST_METHOD = "Access-Control-Request-Method";
private static final String AC_REQUEST_HEADERS = "Access-Control-Request-Headers";
private static final String AC_MAX_AGE = "Access-Control-Max-Age";
private static final String AC_EXPOSE_HEADERS = "Access-Control-Expose-Headers";
private static final String AC_ALLOW_ORIGIN = "Access-Control-Allow-Origin";
private static final String AC_ALLOW_HEADERS = "Access-Control-Allow-Headers";
private static final String AC_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials";
private static final String AC_ALLOW_METHODS = "Access-Control-Allow-Methods";
/** The logging system. */
private final Logger log = LoggerFactory.getLogger(Cors.class);
private Optional<Cors> cors;
public CorsHandler(final Optional<Cors> cors) {
this.cors = requireNonNull(cors, "Cors is required.");
}
@Override
public void handle(final Request req, final Response rsp, final Chain chain) throws Exception {
Optional<String> origin = req.header("Origin").toOptional();
Cors cors = this.cors.orElseGet(() -> req.require(Cors.class));
if (cors.enabled() && origin.isPresent()) {
cors(cors, req, rsp, origin.get());
}
chain.next(req, rsp);
}
private void cors(final Cors cors, final Request req, final Response rsp,
final String origin) throws Exception {
if (cors.allowOrigin(origin)) {
log.debug("allowed origin: {}", origin);
if (preflight(req)) {
log.debug("handling preflight for: {}", origin);
preflight(cors, req, rsp, origin);
} else {
log.debug("handling simple cors for: {}", origin);
if ("null".equals(origin)) {
rsp.header(AC_ALLOW_ORIGIN, ANY_ORIGIN);
} else {
rsp.header(AC_ALLOW_ORIGIN, origin);
if (!cors.anyOrigin()) {
rsp.header("Vary", ORIGIN);
}
if (cors.credentials()) {
rsp.header(AC_ALLOW_CREDENTIALS, true);
}
if (!cors.exposedHeaders().isEmpty()) {
rsp.header(AC_EXPOSE_HEADERS, join(cors.exposedHeaders()));
}
}
}
}
}
private boolean preflight(final Request req) {
return req.method().equals("OPTIONS") && req.header(AC_REQUEST_METHOD).isSet();
}
private void preflight(final Cors cors, final Request req, final Response rsp,
final String origin) {
/**
* Allowed method
*/
boolean allowMethod = req.header(AC_REQUEST_METHOD).toOptional()
.map(cors::allowMethod)
.orElse(false);
if (!allowMethod) {
return;
}
/**
* Allowed headers
*/
List<String> headers = req.header(AC_REQUEST_HEADERS).toOptional().map(header ->
Splitter.on(',').trimResults().omitEmptyStrings().splitToList(header)
).orElse(Collections.emptyList());
if (!cors.allowHeaders(headers)) {
return;
}
/**
* Allowed methods
*/
rsp.header(AC_ALLOW_METHODS, join(cors.allowedMethods()));
List<String> allowedHeaders = cors.anyHeader() ? headers : cors.allowedHeaders();
rsp.header(AC_ALLOW_HEADERS, join(allowedHeaders));
/**
* Allow credentials
*/
if (cors.credentials()) {
rsp.header(AC_ALLOW_CREDENTIALS, true);
}
if (cors.maxAge() > 0) {
rsp.header(AC_MAX_AGE, cors.maxAge());
}
rsp.header(AC_ALLOW_ORIGIN, origin);
if (!cors.anyOrigin()) {
rsp.header("Vary", ORIGIN);
}
rsp.status(Status.OK).end();
}
private String join(final List<String> values) {
return Joiner.on(',').join(values);
}
}
| [
"[email protected]"
] | |
8fe3b03a5aaaa1a8df7af96bf60f2a8712e9b2e1 | 91c9cedc8ea067bdb719538031c7e4bf8d8cf6a3 | /src/ShineyObjects.java | a83319e0b3d819b77608406f335157790df19060 | [] | no_license | TJHL/Level_1 | 8cc0148ea5efa71e4413d75a3d1eb3a63279a3af | 2f9ad3dbf0888e2a97d1376e10f1f061679093b8 | refs/heads/master | 2020-04-06T12:14:32.820204 | 2016-10-01T18:59:01 | 2016-10-01T18:59:01 | 36,262,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 931 | java | import java.net.URL;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.JOptionPane;
public class ShineyObjects {
public static void main(String[] args) {
// 2. Ask the user how many shiny objects they want
String O= JOptionPane.showInputDialog("How many shiny objects they want.");
// 3. Play the sound that many times
int H =Integer.parseInt(O);
for(int A=0;A < H;A++){
// 1. Call the method below
playMisterZee();}
}
public static void playMisterZee() {
try {
AudioInputStream audioInputStream = AudioSystem
.getAudioInputStream(new URL(
"https://github.com/joonspoon/league-jars/blob/master/shiny%20objects.wav?raw=true"));
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
Thread.sleep(3400);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
4db3ace075e368e63592cb4566acec3a3c3d5756 | 0cc6bc0a0c92b9903b163a7aeb4f013c1a9fd795 | /google-speech-protobuf/src/main/java/greco/DecoderEndpointerStreamParamsOuterClass.java | 288b8980cf6e43056dff61da715353fe2d14fca4 | [] | no_license | jackz314/SpeechRecognizer | fe34254727ae44ee3ddd83daad873257df1ac078 | 07ba8ec2a158830b37000bb3750a4f7c622b12d0 | refs/heads/master | 2023-04-08T09:24:19.079178 | 2021-04-12T23:55:33 | 2021-04-12T23:55:33 | 320,767,241 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | true | 97,247 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: speech/greco3/decoder_endpointer/decoder_endpointer_stream_params.proto
package greco;
public final class DecoderEndpointerStreamParamsOuterClass {
private DecoderEndpointerStreamParamsOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
registry.add(greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.id);
registry.add(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.id);
registry.add(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.id);
registry.add(greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.id);
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DecoderEndpointerStreamParamsOrBuilder extends
// @@protoc_insertion_point(interface_extends:greco.DecoderEndpointerStreamParams)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return Whether the micCloserStreamName field is set.
*/
boolean hasMicCloserStreamName();
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The micCloserStreamName.
*/
java.lang.String getMicCloserStreamName();
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The bytes for micCloserStreamName.
*/
com.google.protobuf.ByteString
getMicCloserStreamNameBytes();
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return Whether the prefetcherStreamName field is set.
*/
boolean hasPrefetcherStreamName();
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The prefetcherStreamName.
*/
java.lang.String getPrefetcherStreamName();
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The bytes for prefetcherStreamName.
*/
com.google.protobuf.ByteString
getPrefetcherStreamNameBytes();
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set.
*/
boolean hasPreliminaryResultAcousticSilenceThresholdMs();
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return The preliminaryResultAcousticSilenceThresholdMs.
*/
int getPreliminaryResultAcousticSilenceThresholdMs();
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set.
*/
boolean hasPreliminaryResultSentenceEndCostDecisionThreshold();
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return The preliminaryResultSentenceEndCostDecisionThreshold.
*/
float getPreliminaryResultSentenceEndCostDecisionThreshold();
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return Whether the decoderEndpointerModelFeatureStreamName field is set.
*/
boolean hasDecoderEndpointerModelFeatureStreamName();
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The decoderEndpointerModelFeatureStreamName.
*/
java.lang.String getDecoderEndpointerModelFeatureStreamName();
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The bytes for decoderEndpointerModelFeatureStreamName.
*/
com.google.protobuf.ByteString
getDecoderEndpointerModelFeatureStreamNameBytes();
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return Whether the decoderEndpointerModelParams field is set.
*/
boolean hasDecoderEndpointerModelParams();
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return The decoderEndpointerModelParams.
*/
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams();
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder();
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set.
*/
boolean hasEmitEndOfSpeechBeforeEndOfUtterance();
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return The emitEndOfSpeechBeforeEndOfUtterance.
*/
boolean getEmitEndOfSpeechBeforeEndOfUtterance();
}
/**
* Protobuf type {@code greco.DecoderEndpointerStreamParams}
*/
public static final class DecoderEndpointerStreamParams extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:greco.DecoderEndpointerStreamParams)
DecoderEndpointerStreamParamsOrBuilder {
private static final long serialVersionUID = 0L;
// Use DecoderEndpointerStreamParams.newBuilder() to construct.
private DecoderEndpointerStreamParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DecoderEndpointerStreamParams() {
micCloserStreamName_ = "";
prefetcherStreamName_ = "";
decoderEndpointerModelFeatureStreamName_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DecoderEndpointerStreamParams();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.Builder.class);
}
private int bitField0_;
public static final int MIC_CLOSER_STREAM_NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object micCloserStreamName_;
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return Whether the micCloserStreamName field is set.
*/
@java.lang.Override
public boolean hasMicCloserStreamName() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The micCloserStreamName.
*/
@java.lang.Override
public java.lang.String getMicCloserStreamName() {
java.lang.Object ref = micCloserStreamName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
micCloserStreamName_ = s;
}
return s;
}
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The bytes for micCloserStreamName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMicCloserStreamNameBytes() {
java.lang.Object ref = micCloserStreamName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
micCloserStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PREFETCHER_STREAM_NAME_FIELD_NUMBER = 2;
private volatile java.lang.Object prefetcherStreamName_;
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return Whether the prefetcherStreamName field is set.
*/
@java.lang.Override
public boolean hasPrefetcherStreamName() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The prefetcherStreamName.
*/
@java.lang.Override
public java.lang.String getPrefetcherStreamName() {
java.lang.Object ref = prefetcherStreamName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
prefetcherStreamName_ = s;
}
return s;
}
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The bytes for prefetcherStreamName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPrefetcherStreamNameBytes() {
java.lang.Object ref = prefetcherStreamName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
prefetcherStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PRELIMINARY_RESULT_ACOUSTIC_SILENCE_THRESHOLD_MS_FIELD_NUMBER = 3;
private int preliminaryResultAcousticSilenceThresholdMs_;
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set.
*/
@java.lang.Override
public boolean hasPreliminaryResultAcousticSilenceThresholdMs() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return The preliminaryResultAcousticSilenceThresholdMs.
*/
@java.lang.Override
public int getPreliminaryResultAcousticSilenceThresholdMs() {
return preliminaryResultAcousticSilenceThresholdMs_;
}
public static final int PRELIMINARY_RESULT_SENTENCE_END_COST_DECISION_THRESHOLD_FIELD_NUMBER = 7;
private float preliminaryResultSentenceEndCostDecisionThreshold_;
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set.
*/
@java.lang.Override
public boolean hasPreliminaryResultSentenceEndCostDecisionThreshold() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return The preliminaryResultSentenceEndCostDecisionThreshold.
*/
@java.lang.Override
public float getPreliminaryResultSentenceEndCostDecisionThreshold() {
return preliminaryResultSentenceEndCostDecisionThreshold_;
}
public static final int DECODER_ENDPOINTER_MODEL_FEATURE_STREAM_NAME_FIELD_NUMBER = 4;
private volatile java.lang.Object decoderEndpointerModelFeatureStreamName_;
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return Whether the decoderEndpointerModelFeatureStreamName field is set.
*/
@java.lang.Override
public boolean hasDecoderEndpointerModelFeatureStreamName() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The decoderEndpointerModelFeatureStreamName.
*/
@java.lang.Override
public java.lang.String getDecoderEndpointerModelFeatureStreamName() {
java.lang.Object ref = decoderEndpointerModelFeatureStreamName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
decoderEndpointerModelFeatureStreamName_ = s;
}
return s;
}
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The bytes for decoderEndpointerModelFeatureStreamName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDecoderEndpointerModelFeatureStreamNameBytes() {
java.lang.Object ref = decoderEndpointerModelFeatureStreamName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
decoderEndpointerModelFeatureStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DECODER_ENDPOINTER_MODEL_PARAMS_FIELD_NUMBER = 5;
private greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams decoderEndpointerModelParams_;
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return Whether the decoderEndpointerModelParams field is set.
*/
@java.lang.Override
public boolean hasDecoderEndpointerModelParams() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return The decoderEndpointerModelParams.
*/
@java.lang.Override
public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams() {
return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_;
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
@java.lang.Override
public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder() {
return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_;
}
public static final int EMIT_END_OF_SPEECH_BEFORE_END_OF_UTTERANCE_FIELD_NUMBER = 6;
private boolean emitEndOfSpeechBeforeEndOfUtterance_;
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set.
*/
@java.lang.Override
public boolean hasEmitEndOfSpeechBeforeEndOfUtterance() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return The emitEndOfSpeechBeforeEndOfUtterance.
*/
@java.lang.Override
public boolean getEmitEndOfSpeechBeforeEndOfUtterance() {
return emitEndOfSpeechBeforeEndOfUtterance_;
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code greco.DecoderEndpointerStreamParams}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:greco.DecoderEndpointerStreamParams)
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParamsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.Builder.class);
}
// Construct using greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getDecoderEndpointerModelParamsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
micCloserStreamName_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
prefetcherStreamName_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
preliminaryResultAcousticSilenceThresholdMs_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
preliminaryResultSentenceEndCostDecisionThreshold_ = 0F;
bitField0_ = (bitField0_ & ~0x00000008);
decoderEndpointerModelFeatureStreamName_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
if (decoderEndpointerModelParamsBuilder_ == null) {
decoderEndpointerModelParams_ = null;
} else {
decoderEndpointerModelParamsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
emitEndOfSpeechBeforeEndOfUtterance_ = false;
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstanceForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance();
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams build() {
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams buildPartial() {
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams result = new greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.micCloserStreamName_ = micCloserStreamName_;
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.prefetcherStreamName_ = prefetcherStreamName_;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.preliminaryResultAcousticSilenceThresholdMs_ = preliminaryResultAcousticSilenceThresholdMs_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.preliminaryResultSentenceEndCostDecisionThreshold_ = preliminaryResultSentenceEndCostDecisionThreshold_;
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
to_bitField0_ |= 0x00000010;
}
result.decoderEndpointerModelFeatureStreamName_ = decoderEndpointerModelFeatureStreamName_;
if (((from_bitField0_ & 0x00000020) != 0)) {
if (decoderEndpointerModelParamsBuilder_ == null) {
result.decoderEndpointerModelParams_ = decoderEndpointerModelParams_;
} else {
result.decoderEndpointerModelParams_ = decoderEndpointerModelParamsBuilder_.build();
}
to_bitField0_ |= 0x00000020;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.emitEndOfSpeechBeforeEndOfUtterance_ = emitEndOfSpeechBeforeEndOfUtterance_;
to_bitField0_ |= 0x00000040;
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
private int bitField0_;
private java.lang.Object micCloserStreamName_ = "";
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return Whether the micCloserStreamName field is set.
*/
public boolean hasMicCloserStreamName() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The micCloserStreamName.
*/
public java.lang.String getMicCloserStreamName() {
java.lang.Object ref = micCloserStreamName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
micCloserStreamName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return The bytes for micCloserStreamName.
*/
public com.google.protobuf.ByteString
getMicCloserStreamNameBytes() {
java.lang.Object ref = micCloserStreamName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
micCloserStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @param value The micCloserStreamName to set.
* @return This builder for chaining.
*/
public Builder setMicCloserStreamName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
micCloserStreamName_ = value;
onChanged();
return this;
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @return This builder for chaining.
*/
public Builder clearMicCloserStreamName() {
bitField0_ = (bitField0_ & ~0x00000001);
micCloserStreamName_ = getDefaultInstance().getMicCloserStreamName();
onChanged();
return this;
}
/**
* <code>optional string mic_closer_stream_name = 1;</code>
* @param value The bytes for micCloserStreamName to set.
* @return This builder for chaining.
*/
public Builder setMicCloserStreamNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
micCloserStreamName_ = value;
onChanged();
return this;
}
private java.lang.Object prefetcherStreamName_ = "";
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return Whether the prefetcherStreamName field is set.
*/
public boolean hasPrefetcherStreamName() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The prefetcherStreamName.
*/
public java.lang.String getPrefetcherStreamName() {
java.lang.Object ref = prefetcherStreamName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
prefetcherStreamName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return The bytes for prefetcherStreamName.
*/
public com.google.protobuf.ByteString
getPrefetcherStreamNameBytes() {
java.lang.Object ref = prefetcherStreamName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
prefetcherStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @param value The prefetcherStreamName to set.
* @return This builder for chaining.
*/
public Builder setPrefetcherStreamName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
prefetcherStreamName_ = value;
onChanged();
return this;
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @return This builder for chaining.
*/
public Builder clearPrefetcherStreamName() {
bitField0_ = (bitField0_ & ~0x00000002);
prefetcherStreamName_ = getDefaultInstance().getPrefetcherStreamName();
onChanged();
return this;
}
/**
* <code>optional string prefetcher_stream_name = 2;</code>
* @param value The bytes for prefetcherStreamName to set.
* @return This builder for chaining.
*/
public Builder setPrefetcherStreamNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
prefetcherStreamName_ = value;
onChanged();
return this;
}
private int preliminaryResultAcousticSilenceThresholdMs_ ;
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set.
*/
@java.lang.Override
public boolean hasPreliminaryResultAcousticSilenceThresholdMs() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return The preliminaryResultAcousticSilenceThresholdMs.
*/
@java.lang.Override
public int getPreliminaryResultAcousticSilenceThresholdMs() {
return preliminaryResultAcousticSilenceThresholdMs_;
}
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @param value The preliminaryResultAcousticSilenceThresholdMs to set.
* @return This builder for chaining.
*/
public Builder setPreliminaryResultAcousticSilenceThresholdMs(int value) {
bitField0_ |= 0x00000004;
preliminaryResultAcousticSilenceThresholdMs_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code>
* @return This builder for chaining.
*/
public Builder clearPreliminaryResultAcousticSilenceThresholdMs() {
bitField0_ = (bitField0_ & ~0x00000004);
preliminaryResultAcousticSilenceThresholdMs_ = 0;
onChanged();
return this;
}
private float preliminaryResultSentenceEndCostDecisionThreshold_ ;
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set.
*/
@java.lang.Override
public boolean hasPreliminaryResultSentenceEndCostDecisionThreshold() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return The preliminaryResultSentenceEndCostDecisionThreshold.
*/
@java.lang.Override
public float getPreliminaryResultSentenceEndCostDecisionThreshold() {
return preliminaryResultSentenceEndCostDecisionThreshold_;
}
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @param value The preliminaryResultSentenceEndCostDecisionThreshold to set.
* @return This builder for chaining.
*/
public Builder setPreliminaryResultSentenceEndCostDecisionThreshold(float value) {
bitField0_ |= 0x00000008;
preliminaryResultSentenceEndCostDecisionThreshold_ = value;
onChanged();
return this;
}
/**
* <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code>
* @return This builder for chaining.
*/
public Builder clearPreliminaryResultSentenceEndCostDecisionThreshold() {
bitField0_ = (bitField0_ & ~0x00000008);
preliminaryResultSentenceEndCostDecisionThreshold_ = 0F;
onChanged();
return this;
}
private java.lang.Object decoderEndpointerModelFeatureStreamName_ = "";
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return Whether the decoderEndpointerModelFeatureStreamName field is set.
*/
public boolean hasDecoderEndpointerModelFeatureStreamName() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The decoderEndpointerModelFeatureStreamName.
*/
public java.lang.String getDecoderEndpointerModelFeatureStreamName() {
java.lang.Object ref = decoderEndpointerModelFeatureStreamName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
decoderEndpointerModelFeatureStreamName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return The bytes for decoderEndpointerModelFeatureStreamName.
*/
public com.google.protobuf.ByteString
getDecoderEndpointerModelFeatureStreamNameBytes() {
java.lang.Object ref = decoderEndpointerModelFeatureStreamName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
decoderEndpointerModelFeatureStreamName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @param value The decoderEndpointerModelFeatureStreamName to set.
* @return This builder for chaining.
*/
public Builder setDecoderEndpointerModelFeatureStreamName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
decoderEndpointerModelFeatureStreamName_ = value;
onChanged();
return this;
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @return This builder for chaining.
*/
public Builder clearDecoderEndpointerModelFeatureStreamName() {
bitField0_ = (bitField0_ & ~0x00000010);
decoderEndpointerModelFeatureStreamName_ = getDefaultInstance().getDecoderEndpointerModelFeatureStreamName();
onChanged();
return this;
}
/**
* <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code>
* @param value The bytes for decoderEndpointerModelFeatureStreamName to set.
* @return This builder for chaining.
*/
public Builder setDecoderEndpointerModelFeatureStreamNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
decoderEndpointerModelFeatureStreamName_ = value;
onChanged();
return this;
}
private greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams decoderEndpointerModelParams_;
private com.google.protobuf.SingleFieldBuilderV3<
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder> decoderEndpointerModelParamsBuilder_;
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return Whether the decoderEndpointerModelParams field is set.
*/
public boolean hasDecoderEndpointerModelParams() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
* @return The decoderEndpointerModelParams.
*/
public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams() {
if (decoderEndpointerModelParamsBuilder_ == null) {
return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_;
} else {
return decoderEndpointerModelParamsBuilder_.getMessage();
}
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public Builder setDecoderEndpointerModelParams(greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams value) {
if (decoderEndpointerModelParamsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
decoderEndpointerModelParams_ = value;
onChanged();
} else {
decoderEndpointerModelParamsBuilder_.setMessage(value);
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public Builder setDecoderEndpointerModelParams(
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder builderForValue) {
if (decoderEndpointerModelParamsBuilder_ == null) {
decoderEndpointerModelParams_ = builderForValue.build();
onChanged();
} else {
decoderEndpointerModelParamsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public Builder mergeDecoderEndpointerModelParams(greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams value) {
if (decoderEndpointerModelParamsBuilder_ == null) {
if (((bitField0_ & 0x00000020) != 0) &&
decoderEndpointerModelParams_ != null &&
decoderEndpointerModelParams_ != greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance()) {
decoderEndpointerModelParams_ =
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.newBuilder(decoderEndpointerModelParams_).mergeFrom(value).buildPartial();
} else {
decoderEndpointerModelParams_ = value;
}
onChanged();
} else {
decoderEndpointerModelParamsBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000020;
return this;
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public Builder clearDecoderEndpointerModelParams() {
if (decoderEndpointerModelParamsBuilder_ == null) {
decoderEndpointerModelParams_ = null;
onChanged();
} else {
decoderEndpointerModelParamsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder getDecoderEndpointerModelParamsBuilder() {
bitField0_ |= 0x00000020;
onChanged();
return getDecoderEndpointerModelParamsFieldBuilder().getBuilder();
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder() {
if (decoderEndpointerModelParamsBuilder_ != null) {
return decoderEndpointerModelParamsBuilder_.getMessageOrBuilder();
} else {
return decoderEndpointerModelParams_ == null ?
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_;
}
}
/**
* <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder>
getDecoderEndpointerModelParamsFieldBuilder() {
if (decoderEndpointerModelParamsBuilder_ == null) {
decoderEndpointerModelParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder>(
getDecoderEndpointerModelParams(),
getParentForChildren(),
isClean());
decoderEndpointerModelParams_ = null;
}
return decoderEndpointerModelParamsBuilder_;
}
private boolean emitEndOfSpeechBeforeEndOfUtterance_ ;
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set.
*/
@java.lang.Override
public boolean hasEmitEndOfSpeechBeforeEndOfUtterance() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return The emitEndOfSpeechBeforeEndOfUtterance.
*/
@java.lang.Override
public boolean getEmitEndOfSpeechBeforeEndOfUtterance() {
return emitEndOfSpeechBeforeEndOfUtterance_;
}
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @param value The emitEndOfSpeechBeforeEndOfUtterance to set.
* @return This builder for chaining.
*/
public Builder setEmitEndOfSpeechBeforeEndOfUtterance(boolean value) {
bitField0_ |= 0x00000040;
emitEndOfSpeechBeforeEndOfUtterance_ = value;
onChanged();
return this;
}
/**
* <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code>
* @return This builder for chaining.
*/
public Builder clearEmitEndOfSpeechBeforeEndOfUtterance() {
bitField0_ = (bitField0_ & ~0x00000040);
emitEndOfSpeechBeforeEndOfUtterance_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:greco.DecoderEndpointerStreamParams)
}
// @@protoc_insertion_point(class_scope:greco.DecoderEndpointerStreamParams)
private static final greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams();
}
public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser<DecoderEndpointerStreamParams>
PARSER = new com.google.protobuf.AbstractParser<DecoderEndpointerStreamParams>() {
@java.lang.Override
public DecoderEndpointerStreamParams parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(
builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<DecoderEndpointerStreamParams> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DecoderEndpointerStreamParams> getParserForType() {
return PARSER;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
public static final int ID_FIELD_NUMBER = 107528824;
/**
* <code>extend .greco.Params { ... }</code>
*/
public static final
com.google.protobuf.GeneratedMessage.GeneratedExtension<
greco.ParamsProto.Params,
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams> id = com.google.protobuf.GeneratedMessage
.newMessageScopedGeneratedExtension(
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance(),
0,
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class,
greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance());
}
@java.lang.Deprecated public interface EndpointOnDummyEventsOrBuilder extends
// @@protoc_insertion_point(interface_extends:greco.EndpointOnDummyEvents)
com.google.protobuf.MessageOrBuilder {
}
/**
* Protobuf type {@code greco.EndpointOnDummyEvents}
*/
@java.lang.Deprecated public static final class EndpointOnDummyEvents extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:greco.EndpointOnDummyEvents)
EndpointOnDummyEventsOrBuilder {
private static final long serialVersionUID = 0L;
// Use EndpointOnDummyEvents.newBuilder() to construct.
private EndpointOnDummyEvents(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private EndpointOnDummyEvents() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new EndpointOnDummyEvents();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.Builder.class);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code greco.EndpointOnDummyEvents}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:greco.EndpointOnDummyEvents)
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEventsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.Builder.class);
}
// Construct using greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstanceForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance();
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents build() {
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents buildPartial() {
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents result = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents(this);
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:greco.EndpointOnDummyEvents)
}
// @@protoc_insertion_point(class_scope:greco.EndpointOnDummyEvents)
private static final greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents();
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser<EndpointOnDummyEvents>
PARSER = new com.google.protobuf.AbstractParser<EndpointOnDummyEvents>() {
@java.lang.Override
public EndpointOnDummyEvents parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(
builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<EndpointOnDummyEvents> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<EndpointOnDummyEvents> getParserForType() {
return PARSER;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
public static final int ID_FIELD_NUMBER = 114998299;
/**
* <code>extend .greco.Params { ... }</code>
*/
public static final
com.google.protobuf.GeneratedMessage.GeneratedExtension<
greco.ParamsProto.Params,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents> id = com.google.protobuf.GeneratedMessage
.newMessageScopedGeneratedExtension(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance(),
0,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance());
}
public interface EndpointOnFrameTimeForInitialSilenceOrBuilder extends
// @@protoc_insertion_point(interface_extends:greco.EndpointOnFrameTimeForInitialSilence)
com.google.protobuf.MessageOrBuilder {
}
/**
* Protobuf type {@code greco.EndpointOnFrameTimeForInitialSilence}
*/
public static final class EndpointOnFrameTimeForInitialSilence extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:greco.EndpointOnFrameTimeForInitialSilence)
EndpointOnFrameTimeForInitialSilenceOrBuilder {
private static final long serialVersionUID = 0L;
// Use EndpointOnFrameTimeForInitialSilence.newBuilder() to construct.
private EndpointOnFrameTimeForInitialSilence(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private EndpointOnFrameTimeForInitialSilence() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new EndpointOnFrameTimeForInitialSilence();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.Builder.class);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code greco.EndpointOnFrameTimeForInitialSilence}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:greco.EndpointOnFrameTimeForInitialSilence)
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilenceOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.Builder.class);
}
// Construct using greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstanceForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance();
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence build() {
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence buildPartial() {
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence result = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence(this);
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:greco.EndpointOnFrameTimeForInitialSilence)
}
// @@protoc_insertion_point(class_scope:greco.EndpointOnFrameTimeForInitialSilence)
private static final greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence();
}
public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence>
PARSER = new com.google.protobuf.AbstractParser<EndpointOnFrameTimeForInitialSilence>() {
@java.lang.Override
public EndpointOnFrameTimeForInitialSilence parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(
builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence> getParserForType() {
return PARSER;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
public static final int ID_FIELD_NUMBER = 127479911;
/**
* <code>extend .greco.Params { ... }</code>
*/
public static final
com.google.protobuf.GeneratedMessage.GeneratedExtension<
greco.ParamsProto.Params,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence> id = com.google.protobuf.GeneratedMessage
.newMessageScopedGeneratedExtension(
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance(),
0,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class,
greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance());
}
@java.lang.Deprecated public interface AddSilenceBeforeFirstSpeechOrBuilder extends
// @@protoc_insertion_point(interface_extends:greco.AddSilenceBeforeFirstSpeech)
com.google.protobuf.MessageOrBuilder {
}
/**
* Protobuf type {@code greco.AddSilenceBeforeFirstSpeech}
*/
@java.lang.Deprecated public static final class AddSilenceBeforeFirstSpeech extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:greco.AddSilenceBeforeFirstSpeech)
AddSilenceBeforeFirstSpeechOrBuilder {
private static final long serialVersionUID = 0L;
// Use AddSilenceBeforeFirstSpeech.newBuilder() to construct.
private AddSilenceBeforeFirstSpeech(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AddSilenceBeforeFirstSpeech() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AddSilenceBeforeFirstSpeech();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.Builder.class);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code greco.AddSilenceBeforeFirstSpeech}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:greco.AddSilenceBeforeFirstSpeech)
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeechOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable
.ensureFieldAccessorsInitialized(
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.Builder.class);
}
// Construct using greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstanceForType() {
return greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance();
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech build() {
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech buildPartial() {
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech result = new greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech(this);
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:greco.AddSilenceBeforeFirstSpeech)
}
// @@protoc_insertion_point(class_scope:greco.AddSilenceBeforeFirstSpeech)
private static final greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech();
}
public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech>
PARSER = new com.google.protobuf.AbstractParser<AddSilenceBeforeFirstSpeech>() {
@java.lang.Override
public AddSilenceBeforeFirstSpeech parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(
builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech> getParserForType() {
return PARSER;
}
@java.lang.Override
public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
public static final int ID_FIELD_NUMBER = 114989147;
/**
* <code>extend .greco.Params { ... }</code>
*/
public static final
com.google.protobuf.GeneratedMessage.GeneratedExtension<
greco.ParamsProto.Params,
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech> id = com.google.protobuf.GeneratedMessage
.newMessageScopedGeneratedExtension(
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance(),
0,
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class,
greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance());
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_greco_DecoderEndpointerStreamParams_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_greco_EndpointOnDummyEvents_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\nGspeech/greco3/decoder_endpointer/decod" +
"er_endpointer_stream_params.proto\022\005greco" +
"\032\037speech/greco3/core/params.proto\032Fspeec" +
"h/greco3/decoder_endpointer/decoder_endp" +
"ointer_model_params.proto\"\331\003\n\035DecoderEnd" +
"pointerStreamParams\022\036\n\026mic_closer_stream" +
"_name\030\001 \001(\t\022\036\n\026prefetcher_stream_name\030\002 " +
"\001(\t\0228\n0preliminary_result_acoustic_silen" +
"ce_threshold_ms\030\003 \001(\005\022B\n7preliminary_res" +
"ult_sentence_end_cost_decision_threshold" +
"\030\007 \001(\002:\0010\0224\n,decoder_endpointer_model_fe" +
"ature_stream_name\030\004 \001(\t\022L\n\037decoder_endpo" +
"inter_model_params\030\005 \001(\0132#.greco.Decoder" +
"EndpointerModelParams\0222\n*emit_end_of_spe" +
"ech_before_end_of_utterance\030\006 \001(\0102B\n\002id\022" +
"\r.greco.Params\030\370\204\2433 \001(\0132$.greco.DecoderE" +
"ndpointerStreamParams\"W\n\025EndpointOnDummy" +
"Events2:\n\002id\022\r.greco.Params\030\233\370\3526 \001(\0132\034.g" +
"reco.EndpointOnDummyEvents:\002\030\001\"q\n$Endpoi" +
"ntOnFrameTimeForInitialSilence2I\n\002id\022\r.g" +
"reco.Params\030\347\340\344< \001(\0132+.greco.EndpointOnF" +
"rameTimeForInitialSilence\"c\n\033AddSilenceB" +
"eforeFirstSpeech2@\n\002id\022\r.greco.Params\030\333\260" +
"\3526 \001(\0132\".greco.AddSilenceBeforeFirstSpee" +
"ch:\002\030\001B\002H\002"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
greco.ParamsProto.getDescriptor(),
greco.DecoderEndpointerModelParamsOuterClass.getDescriptor(),
});
internal_static_greco_DecoderEndpointerStreamParams_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_greco_DecoderEndpointerStreamParams_descriptor,
new java.lang.String[] { "MicCloserStreamName", "PrefetcherStreamName", "PreliminaryResultAcousticSilenceThresholdMs", "PreliminaryResultSentenceEndCostDecisionThreshold", "DecoderEndpointerModelFeatureStreamName", "DecoderEndpointerModelParams", "EmitEndOfSpeechBeforeEndOfUtterance", });
internal_static_greco_EndpointOnDummyEvents_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_greco_EndpointOnDummyEvents_descriptor,
new java.lang.String[] { });
internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor,
new java.lang.String[] { });
internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor,
new java.lang.String[] { });
greco.ParamsProto.getDescriptor();
greco.DecoderEndpointerModelParamsOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"[email protected]"
] | |
9679442a315f080d776c0a42212fb3eff766ba69 | 2fecec2600a64f973dcd6f3361f40fcdec807329 | /app/src/main/java/com/udacity/adibella/whatsinmyfridge/provider/RecipeContract.java | bf35bf45c713afa3b8d842191d9ad7e611bc4381 | [] | no_license | dibellaa/Capston-Project | fd1b6ae9a17506df64c1e5f2f9d52017ebb79946 | a7709b621da6a8f3036f71802829ba2ee8c0c37d | refs/heads/master | 2020-03-23T15:38:21.173021 | 2018-08-12T23:25:04 | 2018-08-12T23:25:04 | 141,763,763 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | package com.udacity.adibella.whatsinmyfridge.provider;
import android.net.Uri;
import android.provider.BaseColumns;
import com.udacity.adibella.whatsinmyfridge.BuildConfig;
public class RecipeContract {
public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".provider";
public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + AUTHORITY);
public static final String PATH_RECIPES = "favoriteRecipes";
public static final class RecipeEntry implements BaseColumns {
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
.appendPath(PATH_RECIPES)
.build();
public static final String TABLE_NAME = "favoriteRecipes";
public static final String COLUMN_RECIPE_ID = "recipeId";
public static final String COLUMN_TITLE = "title";
public static final String COLUMN_IMAGE = "image";
public static final String COLUMN_SUMMARY = "summary";
public static final String COLUMN_INGREDIENTS = "ingredients";
public static final String COLUMN_INSTRUCTIONS = "instructions";
public static final String COLUMN_SOURCE_URL = "sourceUrl";
public static final String COLUMN_SOURCE_NAME = "sourceName";
}
} | [
"[email protected]"
] | |
c9e5dd292a95beef2c9e8a48a4076a9859d5f8c3 | bfb18fb441a97e4091eba85b0afff6d4d254337c | /2.JavaCore/src/com/javarush/task/task15/task1503/Solution.java | a2ce54acc6cab9dbfc54c4ff0453232d4ca972e1 | [] | no_license | HappyRomio/JavaRushTasks | 75a184f890e08d8b821594e65bbd4f8a5ac3df4b | 4e0936eb6faacf170042b3a20ded5a589698486c | refs/heads/master | 2021-04-17T09:55:07.472906 | 2020-03-23T13:37:31 | 2020-03-23T13:37:31 | 249,435,804 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,463 | java | package com.javarush.task.task15.task1503;
/*
ООП - машинки
*/
public class Solution {
public static void main(String[] args) {
new Solution.LuxuriousCar().printlnDesire();
new Solution.CheapCar().printlnDesire();
new Solution.Ferrari().printlnDesire();
new Solution.Lanos().printlnDesire();
}
public static class Ferrari extends LuxuriousCar {
public void printlnDesire() {
System.out.println(Constants.WANT_STRING + Constants.FERRARI_NAME);
}
}
public static class Lanos extends CheapCar {
public void printlnDesire() {
System.out.println(Constants.WANT_STRING + Constants.LANOS_NAME);
}
}
public static class Constants {
public static String WANT_STRING = "Я хочу ездить на ";
public static String LUXURIOUS_CAR = "роскошной машине";
public static String CHEAP_CAR = "дешевой машине";
public static String FERRARI_NAME = "Феррари";
public static String LANOS_NAME = "Ланосе";
}
public static class LuxuriousCar {
protected void printlnDesire() {
System.out.println(Constants.WANT_STRING + Constants.LUXURIOUS_CAR );
}
}
public static class CheapCar {
protected void printlnDesire() {
System.out.println(Constants.WANT_STRING + Constants.CHEAP_CAR);
}
}
}
| [
"[email protected]"
] | |
0deb3d28f307ca2df59114c0d320eb4cbaeb75f8 | 94979810799868172fc73d8a16fc7cc630cf7f30 | /gc/CMS.java | 7010caff06000b278065b9f744ca4b6bfdd2eb73 | [] | no_license | shitsurei/JVM | 6abce231355b0e077e16a121a5c0c6a1796b6b90 | 850d88bf11b6e8f513d38d5e1f7fb62a8691bbd3 | refs/heads/master | 2021-01-03T17:32:38.683448 | 2020-03-10T03:47:20 | 2020-03-10T03:47:20 | 240,170,861 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,982 | java | package gc;
/**
* 05
* 枚举根节点:当执行系统停下来之后并不需要一个不漏的检查所有执行上下文和全局引用的位置,虚拟机能够直接得知存放对象引用的地方,Hotspot中通过OopMap这一数据结构实现
* OopMap:
* 安全点(SafePoint):在OopMap的帮助下Hotspot可以快速完成GC Root枚举,但是每条指令都生成OopMap空间成本较高,因此只在“安全点”记录;即程序执行过程中并非可以在任何位置暂停进行GC,只有到达安全点才可以
* 【安全点既不能太少(GC等待时间太长)又不能太多(运行负载高),选定标准:“是否具有让程序长时间运行的特征”,例如方法跳转、循环跳转、异常跳转等指令序列复用】
* 如何让GC发生时让所有线程(除了JNI)都跑到安全点上再停顿?
* 1 抢占式中断(Preemptive Suspension)
* 不需要线程的执行代码主动配合,GC发生时将所有业务线程中断,如果有线程不在安全点上,就让他恢复运行,跑到安全点上再停下来
* 2 主动式中断(Voluntary Suspension)【主流方式】
* GC需要中断线程时设置标志(轮询标志与安全点重合)供各个线程轮询,线程主动轮询主动中断挂起
* 安全区域(SafeRegion):用于解决线程处于休眠或阻塞状态,无法响应JVM的中断请求的状态
*
* CMS(Concurrent Mark Sweep)并发【指GC线程可以和用户线程同时运行,不会出现较长时间的STW】 标记-清除GC
* 以获取最短的回收停顿时间为目标,多用于互联网项目或B/S架构服务器系统中
* 步骤:
* 1 初始标记(需要STW):只标记【GC Root引用或年轻代存活对象引用】的对象,速度很快
* 2 并发标记:进行GC Root Tracing,根据初始标记的对象找到所有被引用的存活对象(因为和用户线程并发,其引用关系可能发生改变)
* 3 并发预清理
* 4 并发可失败的预清理
* 5 重新标记(需要STW):【修正并发标记期间因为用户程序运行导致的标记产生变动的记录】,速度慢于初始标记但远快于并发标记,通常会在新生代尽可能干净的情况下运行,可以避免连续的STW(新生代存活对象多也会导致老年代设计的存活对象多)
* 6 并发清除
* 7 重置线程
* 优点:并发,低停顿
* 缺点:
* 1 对CPU资源敏感
* 2 无法处理浮动垃圾:由于并发标记和并发清理阶段用户线程并未停止,此时生成新的垃圾对象只能留待下一次GC处理,如果老年代空间不足容纳新对象则会产生“Concurrent Mode Failure”
* 【对于“Concurrent Mode Failure”,虚拟机会采用Serial Old收集器作为备选方案对老年代重新收集,这样STW停顿时间就会变长】
* 【参数-XX:CMSInitiatingOccupancyFraction=88用来设置老年代中对象占比超过多少百分比时触发CMS收集,该参数设置太小会频繁触发CMS,设置太大会产生“Concurrent Mode Failure”问题】
* 【JDK1.5中该参数默认为68,JDK1.6中提升至92】
* 3 收集结束后老年代会产生大量碎片:无连续空间存放大对象时容易触发Full GC(默认开启的参数-XX:+UseCMSCompactAtFullCollection用于在老年代触发Full GC之前先进行内存碎片整理,整理过程无法并发需等待)
*
* 空间分配担保:在发生Minor GC之前虚拟机会做一次判断,老年代最大可用连续空间是否大于新生代所有对象总大小?
* 1 大于,此次GC时安全的,存在GC之后新生代大量对象都是存活的情况,Survivor空间无法容纳直接进入老年代
* 2 不足,触发Full GC(判断条件是以往晋升老年代的对象容量的平均值)
*/
public class CMS {
/**
* -verbose:gc
* -Xms20m
* -Xmx20m
* -Xmn10m
* -XX:+PrintGCDetails
* -XX:SurvivorRatio=8
* -XX:+UseConcMarkSweepGC
*/
public static void main(String[] args) {
int size = 1024 * 1024;
byte[] myAlloc1 = new byte[4 * size];
// Thread.sleep(1000);
System.out.println("-------1--------");
byte[] myAlloc2 = new byte[4 * size];
System.out.println("-------2--------");
byte[] myAlloc3 = new byte[4 * size];
System.out.println("-------3--------");
byte[] myAlloc4 = new byte[2 * size];
System.out.println("-------4--------");
}
}
/**
* -------1--------
* [GC (Allocation Failure) [ParNew: 6109K->644K(9216K), 0.0044451 secs] 6109K->4742K(19456K), 0.0050749 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
* -------2--------
* [GC (Allocation Failure) [ParNew: 4979K->248K(9216K), 0.0028341 secs] 9077K->9067K(19456K), 0.0028672 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代初始标记】
* [GC (CMS Initial Mark) [1 CMS-initial-mark: 8819K(10240K)] 13163K(19456K), 0.0001764 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代并发标记开始】
* [CMS-concurrent-mark-start]
* -------3--------
* -------4--------
* [CMS-concurrent-mark: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代并发预清理开始】
* [CMS-concurrent-preclean-start]
* [CMS-concurrent-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代可失败的并发预清理开始】
* [CMS-concurrent-abortable-preclean-start]
* [CMS-concurrent-abortable-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代重新标记】
* [GC (CMS Final Remark) [YG occupancy: 6604 K (9216 K)][Rescan (parallel) , 0.0001322 secs][weak refs processing, 0.0000178 secs][class unloading, 0.0003763 secs][scrub symbol table, 0.0006500 secs][scrub string table, 0.0001478 secs][1 CMS-remark: 8819K(10240K)] 15423K(19456K), 0.0014295 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代并发清除开始】
* [CMS-concurrent-sweep-start]
* [CMS-concurrent-sweep: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* 【老年代并发重置开始】
* [CMS-concurrent-reset-start]
* [CMS-concurrent-reset: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
* Heap
* par new generation total 9216K, used 6850K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
* eden space 8192K, 80% used [0x00000000fec00000, 0x00000000ff272848, 0x00000000ff400000)
* from space 1024K, 24% used [0x00000000ff400000, 0x00000000ff43e0d0, 0x00000000ff500000)
* to space 1024K, 0% used [0x00000000ff500000, 0x00000000ff500000, 0x00000000ff600000)
* concurrent mark-sweep generation total 10240K, used 8818K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
* Metaspace used 3220K, capacity 4496K, committed 4864K, reserved 1056768K
* class space used 349K, capacity 388K, committed 512K, reserved 1048576K
*/
| [
"[email protected]"
] | |
8be6e3cda3aa0c7af1a6ce2500dca93a5d414cc3 | 1159309a7bfffc255fa6d550c25df6a3dd7974b0 | /maven/release/src/main/java/org/release/service/UserService.java | 5e0daf566e0d84cba0a92cfe3f884c97aaa1dfb2 | [] | no_license | KBLGC/study-repository | d2ccfba6943f50badad37f2a21d46ec15974cc6f | 55f4ec5744adfccc318b4e489cb0e6881d6981db | refs/heads/master | 2020-03-29T21:43:27.313975 | 2018-11-19T10:53:31 | 2018-11-19T10:53:31 | 150,383,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | package org.release.service;
import org.release.entity.User;
public interface UserService {
public User getUserById(Long id);
}
| [
"[email protected]"
] | |
3b7aadab8a9614ee0300dd6667baaaec0a3c6116 | 1aa4e4f5354f85c9f5d0a653280fa75a48d9061f | /app/src/main/java/com/example/saket/blockcaller/Blacklist.java | 198e935921081104ae0098fa19bde1e8bca57ac2 | [] | no_license | saket147/BlockCaller | 9b013acda53b6c86f06d34d09fe6358e95516cb4 | e11f9d64684197178b0dfca36870f2c42991e57d | refs/heads/master | 2021-06-05T17:14:39.865695 | 2016-10-14T22:20:50 | 2016-10-14T22:20:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package com.example.saket.blockcaller;
/**
* Created by saket on 15-Oct-16.
*/
public class Blacklist {
// Two mapping fields for the database table blacklist
public long id;
public String phoneNumber;
// Default constructor
public Blacklist() {
}
// To easily create Blacklist object, an alternative constructor
public Blacklist(final String phoneMumber) {
this.phoneNumber = phoneMumber;
}
// Overriding the default method to compare between the two objects bu phone number
@Override
public boolean equals(final Object obj) {
// If passed object is an instance of Blacklist, then compare the phone numbers, else return false as they are not equal
if(obj.getClass().isInstance(new Blacklist()))
{
// Cast the object to Blacklist
final Blacklist bl = (Blacklist) obj;
// Compare whether the phone numbers are same, if yes, it defines the objects are equal
if(bl.phoneNumber.equalsIgnoreCase(this.phoneNumber))
return true;
}
return false;
}
} | [
"[email protected]"
] | |
8dbce498111449c9e9fc5c222fccdb9056755804 | e44941d8e08cc06a5ae762517f088323dd47b05e | /L20-inheritance2/src/lesson20/inreitance2/Wolf.java | 3cfd6f4f5853fb6aad2300583d4c8773b24b6339 | [] | no_license | amitrofanov82/ItStepSharedWS | cf5ceb3389a04651ebb67038e008f89dadc2ddf7 | 5fe0a9bffaca4d1bfb695d1c0c69d8f7427c0ae4 | refs/heads/master | 2020-03-21T21:01:33.156587 | 2018-12-20T18:34:42 | 2018-12-20T18:34:42 | 139,042,600 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package lesson20.inreitance2;
public final class Wolf extends Animal{
final static String S_FIELD = null;
final static String S_FIELD2 = "str";
final static Object S_FIELD3 = new Cat();
final static int S_FIELD4 = 4;
final Object oField = new Cat();
public Wolf() {
}
final public void makeSound() {
System.out.println("Pppppppp");
}
final public void feed(String foodType, final int massa) {
final int i;
if (foodType.equals("заяц")) {
System.out.println("Спасибо, любимый хозяин");
} else {
System.out.println("Сам это жри");
}
}
public void aport(){
System.out.println("Сам бегай за своей палкой");
}
}
| [
"[email protected]"
] | |
7cb655e62792873dacb8ca032f7f4e8c8f57b6e1 | eb5e537de5ecd144b9efcd34e5d6734f871f01d9 | /mycode/mavencode/cocktail-service/src/main/java/com/liquidpresentaion/cocktailservice/services/AmazonClient.java | fad6613d7fc0419dfc68324bb0de1aee1dfa96ff | [] | no_license | tbiinfotech/pipeline | 42a3a3a6182a1ef66563b1849d0d25265205987d | 5cc43f64e50c32ae272f271e9de689fe14f11356 | refs/heads/master | 2023-08-09T18:29:04.612334 | 2020-02-20T07:07:22 | 2020-02-20T07:07:22 | 241,816,436 | 0 | 0 | null | 2023-07-23T06:15:17 | 2020-02-20T07:05:10 | Java | UTF-8 | Java | false | false | 3,260 | java | package com.liquidpresentaion.cocktailservice.services;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.ObjectMetadata;
import com.amazonaws.services.s3.model.PutObjectRequest;
@Service
public class AmazonClient {
private AmazonS3 s3client;
@Value("${amazonProperties.endpointUrl}")
private String endpointUrl;
@Value("${amazonProperties.bucketName}")
private String bucketName;
@Value("${amazonProperties.accessKey}")
private String accessKey;
@Value("${amazonProperties.secretKey}")
private String secretKey;
@Value("${amazonProperties.region}")
private String region;
@PostConstruct
private void initializeAmazon() {
AWSCredentials credentials = new BasicAWSCredentials(this.accessKey, this.secretKey);
this.s3client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(region).build();
}
public String uploadFile(MultipartFile multipartFile) {
String fileUrl = "";
try {
File file = convertMultiPartToFile(multipartFile);
String fileName = generateFileName(multipartFile);
fileUrl = endpointUrl + "/" + fileName;
uploadFileTos3bucket(fileName, file);
file.delete();
} catch (Exception e) {
e.printStackTrace();
}
return fileUrl;
}
private void uploadFileTos3bucket(String fileName, File file) {
s3client.putObject(
new PutObjectRequest(bucketName, fileName, file).withCannedAcl(CannedAccessControlList.PublicRead));
}
public String uploadImageInputStream(String fileName, InputStream inputStream, long length) {
String fileUrl = "";
try {
ObjectMetadata md = new ObjectMetadata();
md.setContentLength(length);
md.setContentType("application/octet-stream");
fileUrl = endpointUrl + "/" + fileName;
inputSteamTos3bucket(fileName, inputStream, md);
} catch (Exception e) {
e.printStackTrace();
}
return fileUrl;
}
private void inputSteamTos3bucket(String fileName, InputStream inputStream, ObjectMetadata md) {
s3client.putObject(
new PutObjectRequest(bucketName, fileName, inputStream, md).withCannedAcl(CannedAccessControlList.PublicRead));
}
private String generateFileName(MultipartFile multiPart) {
return new Date().getTime() + "-" + multiPart.getOriginalFilename().replace(" ", "_");
}
private File convertMultiPartToFile(MultipartFile file) throws IOException {
File convFile = new File(file.getOriginalFilename());
FileOutputStream fos = new FileOutputStream(convFile);
fos.write(file.getBytes());
fos.close();
return convFile;
}
}
| [
"[email protected]"
] | |
086f0d0a6ea076f813a0e0e7c004e1693b8a4cca | d2ca913dfff1a2faee30101feee5395fbcaf598d | /app/src/main/java/com/oddcn/screensharetobrowser/recorder/RecordService.java | 4a3d17b345b33b2cff6e7c7b515c391e2d52790a | [
"Apache-2.0"
] | permissive | jedsada-gh/screen-share-to-browser | 13a39996aa8847c74ab3064dba5a5c54c7d3b18b | 48eebd1fae6532f92204bf5683e614911c15cb88 | refs/heads/master | 2023-05-25T06:19:42.774406 | 2019-01-02T07:57:52 | 2019-01-02T07:57:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,834 | java | package com.oddcn.screensharetobrowser.recorder;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.Image;
import android.media.ImageReader;
import android.media.projection.MediaProjection;
import android.os.Binder;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.WindowManager;
import com.oddcn.screensharetobrowser.RxBus;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
public class RecordService extends Service {
private static final String TAG = "RecordService";
private MediaProjection mediaProjection;
private ImageReader imageReader;
private VirtualDisplay virtualDisplay;
private boolean running;
private int width;
private int height;
private int dpi;
private ScreenHandler screenHandler;
private int threadCount;
private ExecutorService executorService;
private Scheduler scheduler;
private long imgFlag = 0;
private long postedImgFlag = 0;
private RecordServiceListener recordServiceListener;
public void setListener(RecordServiceListener listener) {
recordServiceListener = listener;
}
public void removeListener() {
recordServiceListener = null;
}
private CompositeDisposable compositeDisposable = new CompositeDisposable();
private class ScreenHandler extends Handler {
public ScreenHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
}
@Override
public IBinder onBind(Intent intent) {
return new RecordBinder();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
@Override
public void onCreate() {
super.onCreate();
HandlerThread serviceThread = new HandlerThread("service_thread", android.os.Process.THREAD_PRIORITY_BACKGROUND);
serviceThread.start();
running = false;
threadCount = Runtime.getRuntime().availableProcessors();
Log.d(TAG, "onCreate: threadCount" + threadCount);
executorService = Executors.newFixedThreadPool(threadCount);
HandlerThread handlerThread = new HandlerThread("Screen Record");
handlerThread.start();
screenHandler = new ScreenHandler(handlerThread.getLooper());
//get the size of the window
WindowManager mWindowManager = (WindowManager) getApplication().getSystemService(Context.WINDOW_SERVICE);
// width = mWindowManager.getDefaultDisplay().getWidth() + 40;
width = mWindowManager.getDefaultDisplay().getWidth();
height = mWindowManager.getDefaultDisplay().getHeight();
//height = 2300;
Log.i(TAG, "onCreate: w is " + width + " h is " + height);
imageReader = ImageReader.newInstance(width, height, PixelFormat.RGBA_8888, 2);
scheduler = Schedulers.from(executorService);
// Disposable disposable =
// getByteBufferObservable()
// .subscribeOn(Schedulers.io())
// .observeOn(scheduler)
// .map(getBitmapFunction())
// .subscribe(getBitmapConsumer());
// compositeDisposable.add(disposable);
}
@Override
public void onDestroy() {
super.onDestroy();
stopRecord();
compositeDisposable.dispose();
}
public void setMediaProject(MediaProjection project) {
mediaProjection = project;
}
public boolean isRunning() {
return running;
}
public void setConfig(int width, int height, int dpi) {
this.width = width;
this.height = height;
this.dpi = dpi;
}
public boolean startRecord() {
if (mediaProjection == null || running) {
return false;
}
executorService = Executors.newFixedThreadPool(threadCount);
imageReader = ImageReader.newInstance(width, height, PixelFormat.RGBA_8888, 2);
createVirtualDisplayForImageReader();
running = true;
if (recordServiceListener != null) {
recordServiceListener.onRecorderStatusChanged(running);
}
return true;
}
public boolean stopRecord() {
if (!running) {
return false;
}
running = false;
if (virtualDisplay != null) {
virtualDisplay.release();
virtualDisplay = null;
}
if (mediaProjection != null) {
mediaProjection.stop();
mediaProjection = null;
}
if (executorService != null && !executorService.isShutdown()) {
executorService.shutdown();
executorService = null;
}
if (imageReader != null)
imageReader.close();
if (recordServiceListener != null) {
recordServiceListener.onRecorderStatusChanged(running);
}
return true;
}
private void createVirtualDisplayForImageReader() {
virtualDisplay = mediaProjection.createVirtualDisplay("MainScreen", width, height, dpi
, DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC, imageReader.getSurface()
, null, screenHandler);
imageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() {
@Override
public void onImageAvailable(ImageReader imageReader) {
try {
Image img = imageReader.acquireLatestImage();
if (img != null) {
Log.d(TAG, "onImageAvailable: ");
int width = img.getWidth();
int height = img.getHeight();
Image.Plane[] planes = img.getPlanes();
ByteBuffer buffer = planes[0].getBuffer();
int pixelStride = planes[0].getPixelStride();
int rowStride = planes[0].getRowStride();
int rowPadding = rowStride - pixelStride * width;
img.close();
ImageInfo imageInfo = new ImageInfo(width, height, buffer, pixelStride, rowPadding);
Observable.just(new FlagImageInfo(imageInfo, imgFlag++))
.subscribeOn(scheduler)
.observeOn(scheduler)
.map(getBitmapFunction())
.subscribe(getBitmapConsumer());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}, screenHandler);
}
// private ObservableEmitter<ImageInfo> imageInfoObservableEmitter;
//
// private Observable<ImageInfo> getByteBufferObservable() {
// return Observable.create(new ObservableOnSubscribe<ImageInfo>() {
// @Override
// public void subscribe(ObservableEmitter<ImageInfo> e) throws Exception {
// imageInfoObservableEmitter = e;
// Log.d(TAG, "subscribe: " + Process.myTid());
// }
// });
// }
private Function<FlagImageInfo, FlagBitmap> getBitmapFunction() {
return new Function<FlagImageInfo, FlagBitmap>() {
@Override
public FlagBitmap apply(FlagImageInfo flagImageInfo) throws Exception {
ImageInfo imageInfo = flagImageInfo.imageInfo;
Bitmap bitmap = Bitmap.createBitmap(imageInfo.width + imageInfo.rowPadding / imageInfo.pixelStride, imageInfo.height,
Bitmap.Config.ARGB_8888);
bitmap.copyPixelsFromBuffer(imageInfo.byteBuffer);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height);
return new FlagBitmap(bitmap, flagImageInfo.flag);
}
};
}
private Consumer<FlagBitmap> getBitmapConsumer() {
return new Consumer<FlagBitmap>() {
@Override
public void accept(FlagBitmap flagBitmap) throws Exception {
Bitmap bitmap = flagBitmap.bitmap;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 10, byteArrayOutputStream);
byte[] b = byteArrayOutputStream.toByteArray();
String base64Str = org.java_websocket.util.Base64.encodeBytes(b);
if (flagBitmap.flag > postedImgFlag) {
postedImgFlag = flagBitmap.flag;
RxBus.getDefault().post(base64Str);
}
try {
byteArrayOutputStream.flush();
byteArrayOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
bitmap.recycle();
}
}
};
}
public class RecordBinder extends Binder {
public RecordService getRecordService() {
return RecordService.this;
}
}
private class ImageInfo {
private int width;
private int height;
private ByteBuffer byteBuffer;
private int pixelStride;
private int rowPadding;
public ImageInfo(int width, int height, ByteBuffer byteBuffer, int pixelStride, int rowPadding) {
this.width = width;
this.height = height;
this.byteBuffer = byteBuffer;
this.pixelStride = pixelStride;
this.rowPadding = rowPadding;
}
}
private class FlagImageInfo {
private ImageInfo imageInfo;
private long flag;
public FlagImageInfo(ImageInfo imageInfo, long flag) {
this.imageInfo = imageInfo;
this.flag = flag;
}
}
private class FlagBitmap {
private Bitmap bitmap;
private long flag;
public FlagBitmap(Bitmap bitmap, long flag) {
this.bitmap = bitmap;
this.flag = flag;
}
}
} | [
"[email protected]"
] | |
88d64d84ff3ceb26ff09d3aeb3d591dbc664c539 | 1318f833a081b169f60a4002e1a629d65f652b22 | /src/main/java/com/widget/apitest/Widget.java | 1e1ccbcae8f5afb1f6c9988f3c013e157f60c38d | [] | no_license | JSiie/widgetapi_test | 7537a8cb2c500f92d6d27528f28fbd54a8232910 | 4b68eea60cc4c261cfa4e37805528dbfb37d2246 | refs/heads/master | 2022-12-01T01:34:07.506686 | 2020-08-15T15:43:12 | 2020-08-15T15:43:12 | 287,637,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,229 | java | package com.widget.apitest;
import java.util.Comparator;
import java.util.Map;
import java.util.UUID;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public class Widget {
//UUID is pratically unique. id could also be an atomic counter. But in case of a distributed system it can be tricky
private UUID id;
private int zindex, x, y, width, height;
private Instant lastModified;
public Widget() {
this.id = UUID.randomUUID();
this.lastModified = Instant.now();
}
public Widget(int x, int y, int width, int height, int zindex) {
this.id = UUID.randomUUID();
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.zindex = zindex;
this.lastModified = Instant.now();
}
private void setX(int x) {
this.x = x;
this.lastModified = Instant.now();
}
private void setY(int y) {
this.y = y;
this.lastModified = Instant.now();
}
private void setWidth(int width) {
this.width = width;
this.lastModified = Instant.now();
}
private void setHeight(int height) {
this.height = height;
this.lastModified = Instant.now();
}
private void setZIndex(int zindex) {
this.zindex = zindex;
this.lastModified = Instant.now();
}
public void set(Map<String, Integer> args) {
synchronized(this) {
if(args.containsKey("x")) {
this.setX(args.get("x"));
}
if(args.containsKey("y")) {
this.setY(args.get("y"));
}
if(args.containsKey("width")) {
this.setWidth(args.get("width"));
}
if(args.containsKey("height")) {
this.setHeight(args.get("height"));
}
if(args.containsKey("zindex")) {
this.setZIndex(args.get("zindex"));
}
}
return;
}
public UUID getId() {
return this.id;
}
public int getX() {
synchronized(this) {
return this.x;
}
}
public int getY() {
synchronized(this) {
return this.y;
}
}
public int getWidth() {
synchronized(this) {
return this.width;
}
}
public int getHeight() {
synchronized(this) {
return this.height;
}
}
public int getZIndex() {
synchronized(this) {
return this.zindex;
}
}
public ZonedDateTime getLastModified() {
return ZonedDateTime.ofInstant(this.lastModified, ZoneId.of("Europe/Amsterdam"));
}
//sort by name
public static Comparator<Widget> sortByZIndex = new Comparator<Widget>() {
@Override
public int compare(Widget wgt1, Widget wgt2) {
//sort in ascending order
if(wgt1.zindex < wgt2.zindex)
return -1;
else if (wgt1.zindex > wgt2.zindex)
return 1;
else
return 0;
}
};
}
| [
"[email protected]"
] | |
248ccad401aff8752c9068621ff29fab3f0a2866 | 38517e4228e08bf295776219c6b213f6a074d9fb | /src/main/java/pjatk/project/Model/PriceValidator.java | 99dd273d84a3573f79e6d8cb5d8d70704c85f7ea | [] | no_license | s20156/poprawa_poj | a26cf93a129b52647124387585cd3484c8897812 | 12c9a17066c4ecd0c79da83de2ba190b168fd2b0 | refs/heads/master | 2023-05-08T17:04:14.600066 | 2020-06-13T11:30:56 | 2020-06-13T11:30:56 | 271,972,679 | 0 | 0 | null | 2021-06-04T22:20:31 | 2020-06-13T08:47:00 | Java | UTF-8 | Java | false | false | 412 | java | package pjatk.project.Model;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class PriceValidator implements ConstraintValidator<Price, Double> {
@Override
public void initialize(Price Price) {}
@Override
public boolean isValid(Double price, ConstraintValidatorContext constraintValidatorContext) {
return price != null;
}
}
| [
"[email protected]"
] | |
4cf779a18b5c65f523b869c1eb7ba86ddeda4e85 | f9fcde801577e7b9d66b0df1334f718364fd7b45 | /icepdf-5.0.3/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImagePool.java | 3d2a78bb889fecd987e5d505e06a5e2e3fac0650 | [
"Apache-2.0"
] | permissive | numbnet/icepdf_FULL-versii | 86d74147dc107e4f2239cd4ac312f15ebbeec473 | b67e1ecb60aca88cacdca995d24263651cf8296b | refs/heads/master | 2021-01-12T11:13:57.107091 | 2016-11-04T16:43:45 | 2016-11-04T16:43:45 | 72,880,329 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,761 | java | /*
* Copyright 2006-2013 ICEsoft Technologies Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.icepdf.core.pobjects.graphics;
import org.icepdf.core.pobjects.Reference;
import org.icepdf.core.util.Defs;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Logger;
/**
* The Image pool is a Map of the most recently used images. The pools size
* by default is setup to be 1/4 the heap size. So as the pool grows it
* will self trim to keep the memory foot print at the specified max. The
* max pool size can be specified by using the org.icepdf.core.views.imagePoolSize
* system property. The value is specified in MB.
* <p/>
* The pool also contains an executor pool for processing Images. The executor
* allows the pageInitialization thread to continue while the executor processes
* the image data on another thread.
*
* @since 5.0
*/
public class ImagePool {
private static final Logger log =
Logger.getLogger(ImagePool.class.toString());
// Image pool
private final LinkedHashMap<Reference, BufferedImage> fCache;
private static int defaultSize;
static {
// Default size is 1/4 of heap size.
defaultSize = (int) ((Runtime.getRuntime().maxMemory() / 1024L / 1024L) / 4L);
defaultSize = Defs.intProperty("org.icepdf.core.views.imagePoolSize", defaultSize);
}
public ImagePool() {
this(defaultSize * 1024 * 1024);
}
public ImagePool(long maxCacheSize) {
fCache = new MemoryImageCache(maxCacheSize);
}
public void put(Reference ref, BufferedImage image) {
// create a new reference so we don't have a hard link to the page
// which will likely keep a page from being GC'd.
fCache.put(new Reference(ref.getObjectNumber(), ref.getGenerationNumber()), image);
}
public BufferedImage get(Reference ref) {
return fCache.get(ref);
}
private static class MemoryImageCache extends LinkedHashMap<Reference, BufferedImage> {
private final long maxCacheSize;
private long currentCacheSize;
public MemoryImageCache(long maxCacheSize) {
super(16, 0.75f, true);
this.maxCacheSize = maxCacheSize;
}
@Override
public BufferedImage put(Reference key, BufferedImage value) {
if (containsKey(key)) {
BufferedImage removed = remove(key);
currentCacheSize = currentCacheSize - sizeOf(removed) + sizeOf(value);
super.put(key, value);
return removed;
} else {
currentCacheSize += sizeOf(value);
return super.put(key, value);
}
}
private long sizeOf(BufferedImage image) {
if (image == null) {
return 0L;
}
DataBuffer dataBuffer = image.getRaster().getDataBuffer();
int dataTypeSize;
switch (dataBuffer.getDataType()) {
case DataBuffer.TYPE_BYTE:
dataTypeSize = 1;
break;
case DataBuffer.TYPE_SHORT:
case DataBuffer.TYPE_USHORT:
dataTypeSize = 2;
break;
case DataBuffer.TYPE_INT:
case DataBuffer.TYPE_FLOAT:
dataTypeSize = 4;
break;
case DataBuffer.TYPE_DOUBLE:
case DataBuffer.TYPE_UNDEFINED:
default:
dataTypeSize = 8;
break;
}
return dataBuffer.getSize() * dataTypeSize;
}
@Override
protected boolean removeEldestEntry(Map.Entry<Reference, BufferedImage> eldest) {
boolean remove = currentCacheSize > maxCacheSize;
if (remove) {
long size = sizeOf(eldest.getValue());
currentCacheSize -= size;
}
return remove;
}
}
}
| [
"patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74"
] | patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74 |
eae104ab7031310a2fa88dac9f88acd618c97083 | ff3a0f87565e7b5ce523a59a29072b175a95fbd4 | /Reltrabcfg/src/main/java/br/com/agrofauna/model/Empresa.java | a81c1cb1e92c65c8cc2af091ce73f27b010b4999 | [] | no_license | wesleyhsm/ControleUsuarios | f1861129af9f14a69134fbbb50b7031ecc685359 | a319701d52f156cf5cd0530e8e256d6e41773932 | refs/heads/master | 2021-01-20T09:54:46.471416 | 2017-05-04T19:13:26 | 2017-05-04T19:13:26 | 90,299,633 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,082 | java | package br.com.agrofauna.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.validator.constraints.NotBlank;
import br.com.agrofauna.model.Pessoa;
@Entity
@Table(name="empresa")
@PrimaryKeyJoinColumn(name="id_pessoa")
@DiscriminatorValue("EMPRESA")
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@NamedQueries({
@NamedQuery(name="Empresa.todos", query="SELECT e FROM Empresa e"),
@NamedQuery(name="Empresa.existeCnpj", query="SELECT e FROM Empresa e WHERE e.nmCnpjCpf = :cnpjcpf"),
@NamedQuery(name="Empresa.id", query="SELECT e FROM Empresa e WHERE e.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.email", query="SELECT e FROM Email e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.endereco", query="SELECT e FROM Endereco e join fetch e.estado WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.telefone", query="SELECT e FROM Telefone e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.nfeConfiguraor", query="SELECT e FROM NfeConfiguracao e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.emailExcluir", query="DELETE FROM Email e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.enderecoExcluir", query="DELETE FROM Endereco e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.telefoneExcluir", query="DELETE FROM Telefone e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.nfeConfiguraorExcluir", query="DELETE FROM NfeConfiguracao e WHERE e.pessoa.idPessoa=:idPessoa"),
@NamedQuery(name="Empresa.funcionarioEmpresas", query="SELECT e FROM Empresa e join e.usuarioEmpresas u WHERE u.usuario.idUsuario=:idUsuario")
})
public class Empresa extends Pessoa implements Serializable{
private static final long serialVersionUID = 1L;
private String nmRazaoSocial;
private String nmFantasia;
private String nmFilial;
private String nmInscricaoEstadual;
private Date dtFundacao;
private Date dtCriacao;
private Date dtAlteracao;
private Boolean snStatus = true;
private List<UsuarioEmpresa> usuarioEmpresas;
@NotBlank
@Column(name="nm_razao_social")
public String getNmRazaoSocial() {
return nmRazaoSocial;
}
public void setNmRazaoSocial(String nmRazaoSocial) {
this.nmRazaoSocial = nmRazaoSocial;
}
@NotBlank
@Column(name="nm_fantasia")
public String getNmFantasia() {
return nmFantasia;
}
public void setNmFantasia(String nmFantasia) {
this.nmFantasia = nmFantasia;
}
@NotBlank
@Column(name="nm_filial")
public String getNmFilial() {
return nmFilial;
}
public void setNmFilial(String nmFilial) {
this.nmFilial = nmFilial;
}
@Column(name="nm_inscricao_estadual")
public String getNmInscricaoEstadual() {
return nmInscricaoEstadual;
}
public void setNmInscricaoEstadual(String nmInscricaoEstadual) {
this.nmInscricaoEstadual = nmInscricaoEstadual;
}
@NotNull
@Temporal(TemporalType.DATE)
@Column(name="dt_fundacao")
public Date getDtFundacao() {
return dtFundacao;
}
public void setDtFundacao(Date dtFundacao) {
this.dtFundacao = dtFundacao;
}
@NotNull
@Temporal(TemporalType.TIMESTAMP)
@Column(name="dt_criacao")
public Date getDtCriacao() {
return dtCriacao;
}
public void setDtCriacao(Date dtCriacao) {
this.dtCriacao = dtCriacao;
}
@NotNull
@Temporal(TemporalType.TIMESTAMP)
@Column(name="dt_alteracao")
public Date getDtAlteracao() {
return dtAlteracao;
}
public void setDtAlteracao(Date dtAlteracao) {
this.dtAlteracao = dtAlteracao;
}
@Column(name="sn_status")
public Boolean getSnStatus() {
return snStatus;
}
public void setSnStatus(Boolean snStatus) {
this.snStatus = snStatus;
}
@OneToMany(mappedBy="empresa", fetch=FetchType.LAZY)
public List<UsuarioEmpresa> getUsuarioEmpresas() {
return usuarioEmpresas;
}
public void setUsuarioEmpresas(List<UsuarioEmpresa> usuarioEmpresas) {
this.usuarioEmpresas = usuarioEmpresas;
}
@PrePersist
@PreUpdate
public void configuraDataCriacaoAlteracao(){
this.dtAlteracao = new Date();
if(this.dtCriacao == null){
this.dtCriacao = new Date();
}
}
@Override
public String toString() {
return "Empresa [nmRazaoSocial=" + nmRazaoSocial + ", nmFantasia=" + nmFantasia + ", nmFilial=" + nmFilial
+ ", nmInscricaoEstadual=" + nmInscricaoEstadual + ", dtFundacao=" + dtFundacao + ", dtCriacao="
+ dtCriacao + ", dtAlteracao=" + dtAlteracao + ", snStatus=" + snStatus + "]";
}
}
| [
"[email protected]"
] | |
15fb0f1198ba99d2ceb62ccc9d1216b2cbe190c0 | 0a4131ea64c6c70148cc3dde4b87274a88f68e5b | /app/src/main/java/com/marco/santdelivery/MainActivity.java | 6bb4c3cc31ec134a21c1163862c4834ffb82d86a | [] | no_license | MarcoAntonioMamani/appcliente | 68dabfe25d2165774e4cfde183ad237015c13e36 | 301e7f6c6834275e53984da3dbacb7a415c0ff94 | refs/heads/master | 2022-09-24T09:37:19.916760 | 2020-06-01T02:45:55 | 2020-06-01T02:45:55 | 268,303,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,048 | java | package com.marco.santdelivery;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.Manifest;
import android.app.AlertDialog;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;
import com.marco.santdelivery.Carrito.CarritoFragment;
import com.marco.santdelivery.Empresas.EmpresasFragment;
import com.marco.santdelivery.ShareUtil.DataCache;
import com.marco.santdelivery.ShareUtil.DataPreferences;
import com.marco.santdelivery.ShareUtil.LocationGeo;
import java.util.List;
import java.util.concurrent.ExecutionException;
public class MainActivity extends AppCompatActivity {
private DrawerLayout drawerLayout;
private Toolbar toolbar;
private ActionBar actionBar;
private Handler switchHandler = new Handler();
private Context mContext;
private NavigationView navigationView;
boolean doubleBackToExitPressedOnce = false;
private Boolean bolBienvenida =true;
private TextView titleMenu;
MenuItem menucli;
@Override
public void onResume() {
super.onResume();
this.setTitle("");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LocationGeo.getInstance(getApplicationContext(),this);
LocationGeo.PedirPermisoApp();
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mContext = this;
actionBar = getSupportActionBar();
actionBar.setHomeAsUpIndicator(R.mipmap.ic_menu_white_24dp);
actionBar.setDisplayHomeAsUpEnabled(true);
titleMenu=(TextView)findViewById(R.id.id_title_main);
DataCache.tvTitleMenu =titleMenu;
drawerLayout = (DrawerLayout) findViewById(R.id.navigation_drawer_layout);
navigationView = (NavigationView) findViewById(R.id.id_navigation_view);
if (navigationView != null) {
setupNavigationDrawerContent(navigationView);
}
setupNavigationDrawerContent(navigationView);
//First start (Inbox Fragment)
setFragment(2);
setupUserBox();
IniciarServicio();
menucli.setChecked(true);
}
public void IniciarServicio(){
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 120);
return;
}
}
private void setupNavigationDrawerContent(NavigationView navigationView) {
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
// String roles = UserPrefs.getInstance(getApplicationContext()).getRoles();
switch (item.getItemId()) {
case R.id.item_navigation_drawer_sincronizar:
item.setChecked(true);
setFragment(1);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
case R.id.item_store:
item.setChecked(true);
setFragment(2);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
case R.id.item_carrito:
setFragment(3);
item.setChecked(true);
//setFragment(2);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
case R.id.item_navigation_drawer_entregados:
setFragment(4);
item.setChecked(true);
//setFragment(2);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
case R.id.item_navigation_drawer_mapa:
setFragment(5);
item.setChecked(true);
//setFragment(2);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
case R.id.item_navigation_drawer_help_and_feedback:
item.setChecked(true);
setFragment(21);
drawerLayout.closeDrawer(GravityCompat.START);
return true;
}
return true;
}
});
}
public void setFragment(int position){
Fragment frag = null;
String tag = "";
boolean switchFrag = true;
switch (position){
case 0:
loadWelcomeFragment();
break;
case 1:
returnToMain();
/* frag = new SincronizarFragment();
tag = Constantes.TAG_SINCRONIZACION;*/
break;
case 2:
returnToMain();
frag = new EmpresasFragment();
tag = "Empresas";
break;
case 3:
returnToMain();
frag = new CarritoFragment();
tag = "Ver Carrito";
break;
case 4:
returnToMain();
/*frag = new ListPedidosFragment(3);
tag = Constantes.TAG_PEDIDOS;*/
break;
case 21:
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder
.setTitle("Tu Entrega")
.setMessage("Está seguro(a) de finalizar la sesión?.")
.setIcon(R.drawable.ic_iinfo)
.setPositiveButton(mContext.getResources().getString(R.string.accept), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
/*startActivity(new Intent(MainActivity.this, LoginActivity.class));
finish();*/
}
});
}
})
.setNegativeButton(mContext.getResources().getString(R.string.cancel), null)
.show();
break;
}
if (switchFrag) {
switchFragment(frag,tag);
//addFragment(new WelcomeFragment(),frag,tag);
}
}
public void switchFragment(final Fragment frag, final String tag){
switchHandler.postDelayed(new Runnable() {
@Override
public void run() {
try{
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.setCustomAnimations(R.transition.left_in,R.transition.left_out);
ft.addToBackStack(tag)
.replace(R.id.fragmentMain, frag,tag)
.commit();
}catch(Exception e){}
}
}, 100);
}
private void setupUserBox() {
// TODO: Poblar más views, agregar más acciones
// Poner email
TextView userNameView = (TextView) navigationView.getHeaderView(0).findViewById(R.id.menu_name);
TextView userEmailView = (TextView) navigationView.getHeaderView(0).findViewById(R.id.menu_email);
/* String userName = UserPrefs.getInstance(mContext).getUserName();
String userEmail = UserPrefs.getInstance(mContext).getUserEmail();*/
String nameRepartidor= DataPreferences.getPref("cliente",getApplicationContext());
/*userNameView.setText("Bienvenido : ");
userEmailView.setText(nameRepartidor);*/
userNameView.setText("Bienvenido : Usuario Invitado");
userEmailView.setText("Telf: S/N");
MenuItem menulcv = navigationView.getMenu().findItem(R.id.item_navigation_drawer_sincronizar);
menucli= navigationView.getMenu().findItem(R.id.item_store);
MenuItem menuped = navigationView.getMenu().findItem(R.id.item_carrito);
MenuItem menuMapa = navigationView.getMenu().findItem(R.id.item_navigation_drawer_mapa);
MenuItem menupedEntregados = navigationView.getMenu().findItem(R.id.item_navigation_drawer_entregados);
menulcv.setVisible(true);
menucli.setVisible(true);
menuped.setVisible(true);
menuMapa.setVisible(true);
menupedEntregados.setVisible(true);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
switch (keyCode){
case KeyEvent.KEYCODE_BACK:
if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
drawerLayout.closeDrawer(GravityCompat.START);
} else if (getSupportFragmentManager().getBackStackEntryCount() > 1){
//getSupportFragmentManager().popBackStack("WELCOMEFRAGMENT", 0);
getSupportFragmentManager().popBackStack();
} else {
if (getSupportFragmentManager().getFragments().size() >1){
removeAllFragments();
loadWelcomeFragment();
return true;
}
if (doubleBackToExitPressedOnce){
super.onBackPressed();
finish();
return true;
}
this.doubleBackToExitPressedOnce = true;
Toast.makeText(mContext, "Click nuevamente para salir.", Toast.LENGTH_SHORT).show();
//Please click BACK again to exit
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
doubleBackToExitPressedOnce=false;
}
}, 2000);
return true;
}
return true;
default:
return super.onKeyUp(keyCode, event);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.byte_code, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
drawerLayout.openDrawer(GravityCompat.START);
return true;
}
return super.onOptionsItemSelected(item);
}
private void loadWelcomeFragment(){
/* switchHandler.post(new Runnable() {
@Override
public void run() {
getSupportFragmentManager()
.beginTransaction()
.addToBackStack("WELCOMEFRAGMENT")
.replace(R.id.fragmentMain, new EmpresasFragment())
.commit();
}
});*/
}
public void CambiarFragment(final Fragment fragmento, final String tag){
switchHandler.postDelayed(new Runnable() {
@Override
public void run() {
try{
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(tag)
.replace(R.id.fragmentMain, fragmento,tag)
.commit();
}catch(Exception e){}
}
}, 100);
}
public void returnToMain(){
//getSupportFragmentManager().popBackStack("WELCOMEFRAGMENT",0);
removeAllFragments();
loadWelcomeFragment();
}
public void removeAllFragments() {
if (getSupportFragmentManager().getFragments().size() > 0) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
for (Fragment activeFragment : getSupportFragmentManager().getFragments()) {
fragmentTransaction.remove(activeFragment);
}
getSupportFragmentManager().getFragments().clear();
fragmentTransaction.commit();
getSupportFragmentManager().popBackStackImmediate();
}
}
}
| [
"[email protected]"
] | |
626e9e09c53559568767f814660ac05b6c0f4f99 | 12e507dd7b7c5e8d379a8b8fb3c71ea367228414 | /src/main/java/com/nam/_000/acmp_0006/Main.java | 8c82e16885ec50791fb425aedcbafe8fbc40cb0f | [] | no_license | YershovAleksandr/Java_020_ACMP | 20f4be6627da6fb6b8f499d1f57eabb58da343f3 | 0349206072fcb289fb46cc50c3f7a83412e04db0 | refs/heads/master | 2020-03-30T01:25:03.686715 | 2019-02-16T18:01:17 | 2019-02-16T18:01:17 | 150,574,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,566 | java | package com.nam._000.acmp_0006;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
String step = in.nextLine();
if (!isCorrectValue(step)){
out.println("ERROR");
} else if (isCorrectStep(step)){
out.println("YES");
} else {
out.println("NO");
}
out.flush();
}
public static boolean isCorrectValue(String step){
if ((step.length() != 5) || (step.charAt(2) != '-')
|| step.charAt(0) < 'A' || step.charAt(0) > 'H'
|| step.charAt(3) < 'A' || step.charAt(3) > 'H'
|| step.charAt(1) < '1' || step.charAt(1) > '8'
|| step.charAt(4) < '1' || step.charAt(4) > '8'){
return false;
}
return true;
}
public static boolean isCorrectStep(String step) {
int vStep = step.charAt(1) - step.charAt(4);
int hStep = step.charAt(0) - step.charAt(3);
if ((vStep == -2 && hStep == -1)
|| (vStep == -2 && hStep == 1)
|| (vStep == 2 && hStep == -1)
|| (vStep == 2 && hStep == 1)
|| (vStep == -1 && hStep == 2)
|| (vStep == -1 && hStep == -2)
|| (vStep == 1 && hStep == 2)
|| (vStep == 1 && hStep == -2)){
return true;
}
return false;
}
}
| [
"[email protected]"
] | |
3d46059c1e191742e8e5c38dd7cbe3e91c4c9ff2 | 0ea4b7df1934507f2f98bfef98a171071bed14dc | /ArgsSeprator.java | ca8ce9bdd0bddcc690241dd23a00de3fb6ef14f9 | [] | no_license | vishnumishra/wc_java | b99dfe35bd66e581abe805256d28e8b991bba734 | e501098620fa92d52e392362429e792f62a80275 | refs/heads/master | 2016-09-06T19:31:19.643997 | 2015-02-20T15:04:24 | 2015-02-20T15:04:24 | 30,903,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 818 | java | import java.io.File;
public class ArgsSeprator {
public String[] files;
public String[] flags;
private String[] argvs;
public ArgsSeprator(String[] argv){
this.argvs = argv;
this.files = getFiles();
this.flags = getFlags();
};
private boolean isValidFlag(String str){
String validFlags[] = {"-l","-L","-w","-c"};
for(String flag:validFlags){
if(flag == str) return true;
}
return false;
}
public String[] getFlags(){
String[] flags = new String[argvs.length];
int i=0;
for(String argv:argvs ){
if(isValidFlag(argv)){
flags[i] = argv;
i++;
}
}
return flags;
}
public String[] getFiles(){
String[] files = new String[argvs.length];
int i=0;
for(String argv:argvs ){
if(new File(argv).isFile()){
files[i] = argv;
i++;
}
}
return files;
}
} | [
"[email protected]"
] | |
779c1966dab126d6ea28d91d18e40275ce6c9659 | 27eb9f687d8f035f4201ca4da39c10cae5734847 | /src/java/streams/LongestName.java | 6e149ae8c4c8dd800c6572e7e3a4c4ee945c1c45 | [
"MIT"
] | permissive | LakinduOshadha/java-streams | c1b2a5e4ffbf9c035a62929e702e199ea9ff2bed | 75593d349d839f0b8d709b70a989388479605263 | refs/heads/main | 2023-06-28T09:17:05.512964 | 2021-07-26T19:01:09 | 2021-07-26T19:01:09 | 389,739,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,078 | java | package java.streams;
import java.util.Comparator;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* LongestName_4a finds the longest name.
*
* @author Lakindu Oshadha ([email protected])
*/
public class LongestName {
/**
* printLongestName prints the longest name.
*
* @param names Stream of names
*/
public static void printLongestName(Stream<String> names) {
System.out.println(names.collect(Collectors.maxBy(Comparator.comparing(name->name.length()))).get());
// prints the longest name with reduce function
// System.out.println(names.reduce((c,e) -> c.length() < e.length() ? e : c).orElse("null"));
}
/**
* main
*
* @param args null
*/
public static void main(String[] args) {
Stream<String> names = Stream.of("John Lennon", "Paul McCartney",
"George Harrison", "Ringo Starr", "Pete Best", "Stuart Sutcliffe");
printLongestName(names); // Calling printLongestName method
}
}
| [
"[email protected]"
] | |
db7bf89c22e432b1dc4d1213b43086724dc5eab0 | ef8e7192cc0366cad6aec24fb00187d7e1bc954d | /comet/CoCoLauncher/src/com/iLoong/launcher/SetupMenu/Actions/DesktopAction.java | 5fefd9367c65a9b1a86e17b0f079c0f3d9988b85 | [] | no_license | srsman/daima111 | 44c89d430d5e296f01663fcf02627ccc4a0ab8fd | b8c1fb8a75d390f6542c53eaec9e46c6c505f022 | refs/heads/master | 2021-01-22T16:31:23.754703 | 2015-03-26T05:40:59 | 2015-03-26T05:40:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,853 | java | package com.iLoong.launcher.SetupMenu.Actions;
import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Message;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import com.iLoong.launcher.Desktop3D.Log;
import android.widget.Toast;
import com.iLoong.RR;
import com.iLoong.launcher.Desktop3D.DefaultLayout;
import com.iLoong.launcher.Desktop3D.R3D;
import com.iLoong.launcher.SetupMenu.CopyDirectory;
import com.iLoong.launcher.SetupMenu.SetupMenu;
import com.iLoong.launcher.UI3DEngine.ParticleManager;
import com.iLoong.launcher.desktop.iLoongApplication;
import com.iLoong.launcher.desktop.iLoongLauncher;
import com.iLoong.launcher.update.UpdateTask;
import com.umeng.analytics.MobclickAgent;
public class DesktopAction extends Action {
private static final String DATABASE_NAME = "launcher.db";
public DesktopAction(int actionid, String action) {
super(actionid, action);
putIntentAction(SetupMenu.getContext(), DesktopSettingActivity.class);
}
public static void Init() {
SetupMenuActions.getInstance().RegisterAction(
ActionSetting.ACTION_DESKTOP_SETTINGS,
new DesktopAction(ActionSetting.ACTION_DESKTOP_SETTINGS,
DesktopAction.class.getName()));
}
@Override
protected void OnRunAction() {
// ClingManager.getInstance().cancelSettingCling();
SynRunAction();
}
@Override
protected void OnActionFinish() {
}
@Override
protected void OnPutValue(String key) {
if (key.equals(SetupMenu.getKey(RR.string.setting_key_desktopeffects))) {
mBundle.putInt(key, Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "0")));
} else if (key.equals(SetupMenu
.getKey(RR.string.setting_key_appeffects))) {
mBundle.putInt(key, Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "0")));
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.setting_key_vibrator))) {
int val = 0;
val = PreferenceManager.getDefaultSharedPreferences(
SetupMenu.getContext()).getBoolean(key, true) ? 1 : 0;
mBundle.putInt(key, val);
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.setting_key_circled))) {
int val = 0;
val = PreferenceManager.getDefaultSharedPreferences(
SetupMenu.getContext()).getBoolean(key, false) ? 1 : 0;
mBundle.putInt(key, val);
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.setting_key_resetwizard))) {
mBundle.putInt(key, 1);
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.setting_key_shake_wallpaper))) {
mBundle.putBoolean(key, PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getBoolean(key, false));
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.icon_size_key))) {
mBundle.putString(key, PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "-1"));
// xiatian add start //Widget3D adaptation "Naked eye 3D"
} else if (key.equals(DesktopSettingActivity
.getKey(RR.string.setting_key_sensor))
&& (DefaultLayout.show_sensor)) {
mBundle.putBoolean(key, PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getBoolean(key, DefaultLayout.default_open_sensor));
// xiatian add end
} else if (key.equals(DesktopSettingActivity // added by zhenNan.ye begin
.getKey(RR.string.setting_key_particle)))
{
mBundle.putBoolean(key, PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getBoolean(key, ParticleManager.particleManagerEnable));
} // added by zhenNan.ye end
//xiatian add start //Mainmenu Bg
else if (key.equals(DesktopSettingActivity
.getKey(RR.string.mainmenu_bg_key))) {
mBundle.putString(key, PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "-1"));
}
//xiatian add end
}
public static class DesktopSettingActivity extends PreferenceActivity
implements OnPreferenceChangeListener,
Preference.OnPreferenceClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(RR.xml.desktopsetting);
showitem();
callback();
}
private void callback() {
if (findPreference(getKey(RR.string.setting_key_desktopeffects)) != null)
findPreference(getKey(RR.string.setting_key_desktopeffects))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_appeffects)) != null)
findPreference(getKey(RR.string.setting_key_appeffects))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_exit)) != null)
findPreference(getKey(RR.string.setting_key_exit))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_backup)) != null)
findPreference(getKey(RR.string.setting_key_backup))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_restore)) != null)
findPreference(getKey(RR.string.setting_key_restore))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_restart)) != null)
findPreference(getKey(RR.string.setting_key_restart))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_share)) != null)
findPreference(getKey(RR.string.setting_key_share))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_update)) != null)
findPreference(getKey(RR.string.setting_key_update))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_feedback)) != null)
findPreference(getKey(RR.string.setting_key_feedback))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_vibrator)) != null)
findPreference(getKey(RR.string.setting_key_vibrator))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_circled)) != null)
findPreference(getKey(RR.string.setting_key_circled))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_installhelp)) != null)
findPreference(getKey(RR.string.setting_key_installhelp))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_resetwizard)) != null)
findPreference(getKey(RR.string.setting_key_resetwizard))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.setting_key_shake_wallpaper)) != null)
findPreference(getKey(RR.string.setting_key_shake_wallpaper))
.setOnPreferenceClickListener(this);
if (findPreference(getKey(RR.string.icon_size_key)) != null) {
findPreference(getKey(RR.string.icon_size_key))
.setOnPreferenceClickListener(this);
}
// xiatian add start //Widget3D adaptation "Naked eye 3D"
if (findPreference(getKey(RR.string.setting_key_sensor)) != null
&& (DefaultLayout.show_sensor))
findPreference(getKey(RR.string.setting_key_sensor))
.setOnPreferenceClickListener(this);
// xiatian add end
if (findPreference(getKey(RR.string.setting_update_desktop)) != null) {
findPreference(getKey(RR.string.setting_update_desktop))
.setOnPreferenceClickListener(this);
}
/************** added by zhenNan.ye begin*******************/
if (findPreference(getKey(RR.string.setting_key_particle)) != null)
{
findPreference(getKey(RR.string.setting_key_particle))
.setOnPreferenceClickListener(this);
}
/************** added by zhenNan.ye end*******************/
//xiatian add start //Mainmenu Bg
if (findPreference(getKey(RR.string.mainmenu_bg_key)) != null) {
findPreference(getKey(RR.string.mainmenu_bg_key))
.setOnPreferenceClickListener(this);
}
//xiatian add end
}
private void showitem() {
Resources res = SetupMenu.getContext().getResources();
String key = res.getString(RR.string.setting_key_desktopeffects);
ListPreference pf = (ListPreference) findPreference(key);
pf.setOnPreferenceChangeListener(this);
CharSequence[] summarys = pf.getEntries();
pf.setSummary(summarys[Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "0"))]);
key = SetupMenu.getContext().getResources()
.getString(RR.string.setting_key_appeffects);
pf = (ListPreference) findPreference(key);
pf.setOnPreferenceChangeListener(this);
summarys = pf.getEntries();
pf.setSummary(summarys[Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "0"))]);
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(this);
boolean autoStart = prefs.getBoolean(
res.getString(RR.string.setting_key_vibrator), true);
CheckBoxPreference vibratorpf = (CheckBoxPreference) findPreference(res
.getString(RR.string.setting_key_vibrator));
if (autoStart) {
vibratorpf.setChecked(autoStart);
}
autoStart = prefs.getBoolean(
res.getString(RR.string.setting_key_circled), false);
vibratorpf = (CheckBoxPreference) findPreference(res
.getString(RR.string.setting_key_circled));
if (DefaultLayout.disable_circled) {
PreferenceCategory category = (PreferenceCategory) this
.findPreference(res
.getString(RR.string.setting_key_basic_setting));
if (vibratorpf != null)
category.removePreference(vibratorpf);
} else {
if (autoStart) {
vibratorpf.setChecked(autoStart);
}
}
autoStart = prefs
.getBoolean(res
.getString(RR.string.setting_key_shake_wallpaper),
false);
CheckBoxPreference shake_wallpaper = (CheckBoxPreference) findPreference(res
.getString(RR.string.setting_key_shake_wallpaper));
if (DefaultLayout.disable_shake_wallpaper) {
PreferenceCategory category = (PreferenceCategory) this
.findPreference(res
.getString(RR.string.setting_key_basic_setting));
if (shake_wallpaper != null)
category.removePreference(shake_wallpaper);
} else {
if (autoStart) {
shake_wallpaper.setChecked(autoStart);
}
}
key = res.getString(RR.string.icon_size_key);
pf = (ListPreference) findPreference(key);
if (pf != null) {
pf.setOnPreferenceChangeListener(this);
if (!DefaultLayout.show_icon_size) {
PreferenceCategory category = (PreferenceCategory) this
.findPreference(res
.getString(RR.string.setting_key_effect_setting));
if (pf != null && category != null)
category.removePreference(pf);
} else {
summarys = pf.getEntries();
pf.setSummary(summarys[Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, "0"))]);
}
}
// xiatian add start //Widget3D adaptation "Naked eye 3D"
autoStart = prefs.getBoolean(
res.getString(RR.string.setting_key_sensor),
DefaultLayout.default_open_sensor);
CheckBoxPreference sensorcbpf = (CheckBoxPreference) findPreference(res
.getString(RR.string.setting_key_sensor));
if (!DefaultLayout.show_sensor) {
PreferenceCategory category = (PreferenceCategory) this
.findPreference(res
.getString(RR.string.setting_key_basic_setting));
if (sensorcbpf != null)
category.removePreference(sensorcbpf);
} else {
sensorcbpf.setOnPreferenceChangeListener(this);
if (autoStart) {
sensorcbpf.setChecked(autoStart);
}
}
// xiatian add end
/************** added by zhenNan.ye begin*******************/
autoStart = prefs.getBoolean(res.getString(RR.string.setting_key_particle), true);
CheckBoxPreference particleCbpf = (CheckBoxPreference) findPreference(res
.getString(RR.string.setting_key_particle));
if (!DefaultLayout.enable_particle || !ParticleManager.switchForTheme)
{
PreferenceCategory category = (PreferenceCategory) this.findPreference(res.
getString(RR.string.setting_key_basic_setting));
if (particleCbpf != null)
{
category.removePreference(particleCbpf);
}
}
else
{
if (autoStart)
{
particleCbpf.setChecked(autoStart);
}
}
/************** added by zhenNan.ye end*******************/
if (DefaultLayout.hide_backup_and_restore) {
PreferenceScreen screen = (PreferenceScreen) this
.findPreference(res
.getString(RR.string.setting_key_desktop_setting));
PreferenceCategory temp_category = (PreferenceCategory) this
.findPreference(res
.getString(RR.string.setting_key_backup_and_restore));
// Preference preference1 = (Preference) this
// .findPreference(res
// .getString(RR.string.backup_desktop));
// Preference preference2 = (Preference) this
// .findPreference(res
// .getString(RR.string.restore_desktop));
// temp_category.removePreference(preference1);
// temp_category.removePreference(preference2);
if (temp_category != null)
screen.removePreference(temp_category);
} else {
key = res.getString(RR.string.setting_key_restore);
Preference pfrestore = (Preference) findPreference(key);
if (!checkBackup()) {
pfrestore.setEnabled(false);
} else {
pfrestore.setEnabled(true);
}
}
//xiatian add start //Mainmenu Bg
key = res.getString(RR.string.mainmenu_bg_key);
pf = (ListPreference) findPreference(key);
if (pf != null)
{
pf.setOnPreferenceChangeListener(this);
summarys = pf.getEntries();
pf.setSummary(summarys[Integer.valueOf(PreferenceManager
.getDefaultSharedPreferences(SetupMenu.getContext())
.getString(key, DefaultLayout.defaultMainmenuBgIndex + ""))]);
}
//xiatian add end
}
private boolean checkBackup() {
boolean bret = false;
String key = SetupMenu.getContext().getResources()
.getString(RR.string.setting_key_backup);
Preference pf = (Preference) findPreference(key);
File file = new File(iLoongApplication.getBackupPath(),
DATABASE_NAME);
String strSumm = new String();
if (file.exists()) {
long createtime = file.lastModified();
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(createtime);
strSumm = R3D.getString(RR.string.backup_latest) + " "
+ cal.getTime().toLocaleString();
bret = true;
} else {
strSumm = R3D.getString(RR.string.backup_no_back);
}
pf.setSummary(strSumm);
return bret;
}
private void backdialog(String title, String msg) {
AlertDialog.Builder builder = new Builder(this);
builder.setMessage(msg);
builder.setTitle(title);
builder.setPositiveButton(
R3D.getString(RR.string.circle_ok_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
bakcupdb();
showitem();
}
});
builder.setNegativeButton(
R3D.getString(RR.string.circle_cancel_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
private void restoredialog(String title, String msg) {
AlertDialog.Builder builder = new Builder(this);
builder.setMessage(msg);
builder.setTitle(title);
builder.setPositiveButton(
R3D.getString(RR.string.circle_ok_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
if (restoredb()) {
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_RESTART);
}
}
});
builder.setNegativeButton(
R3D.getString(RR.string.circle_cancel_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
private void resetClingdialog(String title, String msg) {
AlertDialog.Builder builder = new Builder(this);
builder.setMessage(msg);
builder.setTitle(title);
builder.setPositiveButton(
R3D.getString(RR.string.circle_ok_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_RESET_WIZARD);
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_RESTART);
}
});
builder.setNegativeButton(
R3D.getString(RR.string.circle_cancel_action),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
public void bakcupdb() {
String sourceDir = iLoongApplication.getInstance()
.getDatabasePath(DATABASE_NAME).getParent();
String targetDir = iLoongApplication.getBackupPath();
// String sourcepath =
// iLoongApplication.getInstance().getDatabasePath(DATABASE_NAME).getPath();
// String targetpath = iLoongApplication.getBackupPath() + "/" +
// DATABASE_NAME;
// File sourceFile = new File(sourcepath);
// File targetFile = new File(targetpath);
try {
CopyDirectory.copyDirectiory(sourceDir, targetDir);
// CopyDirectory.copyFile(sourceFile, targetFile);
Toast.makeText(this, R3D.getString(RR.string.backup_success),
Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(this, R3D.getString(RR.string.backup_fail),
Toast.LENGTH_SHORT).show();
}
}
public boolean restoredb() {
boolean bret = true;
String targetDir = iLoongApplication.getInstance()
.getDatabasePath(DATABASE_NAME).getParent();
String sourceDir = iLoongApplication.getBackupPath();
// String targetpath =
// iLoongApplication.getInstance().getDatabasePath(DATABASE_NAME).getPath();
// String sourcepath = iLoongApplication.getBackupPath() + "/" +
// DATABASE_NAME;
// File sourceFile = new File(sourcepath);
// File targetFile = new File(targetpath);
try {
CopyDirectory.copyDirectiory(sourceDir, targetDir);
// CopyDirectory.copyFile(sourceFile, targetFile);
} catch (IOException e) {
bret = false;
Toast.makeText(this, R3D.getString(RR.string.restore_fail),
Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
return bret;
}
private void updateDesktop() {
UpdateTask updateTask = new UpdateTask(this);
if (updateTask.IsHaveInternet(this) == false) {
Toast.makeText(iLoongLauncher.getInstance(),
RR.string.update_err, Toast.LENGTH_SHORT).show();
} else {
updateTask.checkUpdate(1);
}
}
public static String getKey(int key) {
return SetupMenu.getKey(key);
}
@Override
protected void onResume() {
super.onResume();
//友盟统计
MobclickAgent.onResume(this);
}
@Override
protected void onPause() {
if (this.isFinishing()) {
SetupMenuActions.getInstance().ActivityFinish(
ActionSetting.ACTION_DESKTOP_SETTINGS);
}
super.onPause();
//友盟统计
MobclickAgent.onPause(this);
}
protected void onStop() {
if (this.isFinishing()) {
SetupMenuActions.getInstance().ActivityFinish(
ActionSetting.ACTION_DESKTOP_SETTINGS);
}
super.onStop();
}
@Override
public boolean onPreferenceClick(Preference preference) {
String key = preference.getKey();
if (key == null)
return false;
if (key.equals(getKey(RR.string.setting_key_exit))) {
finish();
iLoongApplication.getInstance().StopServer();
Message msg = iLoongLauncher.getInstance().mMainHandler
.obtainMessage(7777);
iLoongLauncher.getInstance().mMainHandler.sendMessage(msg);
} else if (key.equals(getKey(RR.string.setting_key_restart))) {
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_RESTART);
} else if (key.equals(getKey(RR.string.setting_key_backup))) {
if (iLoongApplication.getSDPath() == null) {
Toast.makeText(this,
R3D.getString(RR.string.backup_pls_insert_SD),
Toast.LENGTH_SHORT).show();
} else {
backdialog(R3D.getString(RR.string.backup_title_back),
R3D.getString(RR.string.backup_back_to_SD));
}
} else if (key.equals(getKey(RR.string.setting_key_restore))) {
restoredialog(R3D.getString(RR.string.backup_title_restore),
R3D.getString(RR.string.backup_restore));
} else if (key.equals(getKey(RR.string.setting_key_update))) {
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_UPDATE);
} else if (key.equals(getKey(RR.string.setting_key_share))) {
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_SHARE);
} else if (key.equals(getKey(RR.string.setting_key_feedback))) {
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_FEEDBACK);
} else if (key.equals(getKey(RR.string.setting_key_desktopeffects))
|| key.equals(getKey(RR.string.setting_key_appeffects))
|| key.equals(getKey(RR.string.setting_key_vibrator))
|| key.equals(getKey(RR.string.setting_key_circled))
|| key.equals(getKey(RR.string.setting_key_shake_wallpaper))
|| key.equals(getKey(RR.string.icon_size_key))
|| (key.equals(getKey(RR.string.setting_key_sensor)) && (DefaultLayout.show_sensor))// xiatian
// add
// start
// //Widget3D
// adaptation
// "Naked eye 3D"
|| key.equals(getKey(RR.string.setting_key_particle)) // added by zhenNan.ye
|| key.equals(getKey(RR.string.icon_size_key)) //xiatian add //Mainmenu Bg
) {
mKey.add(key);
} else if (key.equals(getKey(RR.string.setting_key_installhelp))) {
// mKey.add(key);
finish();
SetupMenuActions.getInstance().Handle(
ActionSetting.ACTION_INSTALL_HELP);
} else if (key.equals(getKey(RR.string.setting_key_resetwizard))) {
resetClingdialog(R3D.getString(RR.string.guide_title),
R3D.getString(RR.string.guide_proceed));
} else if (key.equals(getKey(RR.string.setting_update_desktop))) {
updateDesktop();
}
return false;
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
Log.v("preference", "preference=" + preference + ";;newValue="
+ newValue);
String desktopkey = SetupMenu.getContext().getResources()
.getString(RR.string.setting_key_desktopeffects);
String appkey = SetupMenu.getContext().getResources()
.getString(RR.string.setting_key_appeffects);
String iconSizeKey = SetupMenu.getContext().getResources()
.getString(RR.string.icon_size_key);
// xiatian add start //Widget3D adaptation "Naked eye 3D"
String sensorkey = SetupMenu.getContext().getResources()
.getString(RR.string.setting_key_sensor);
// xiatian add end
String mainmenu_bg_key = SetupMenu.getContext().getResources()
.getString(RR.string.mainmenu_bg_key); //xiatian add //Mainmenu Bg
if (preference.getKey().equals(desktopkey)
|| preference.getKey().equals(appkey)
|| preference.getKey().equals(iconSizeKey)
|| preference.getKey().equals(mainmenu_bg_key) //xiatian add //Mainmenu Bg
) {
ListPreference pf = (ListPreference) preference;
CharSequence[] summarys = pf.getEntries();
pf.setSummary(summarys[Integer.valueOf((String) newValue)]);
}
// xiatian add start //Widget3D adaptation "Naked eye 3D"
else if (preference.getKey().equals(sensorkey)
&& (DefaultLayout.show_sensor)) {
if (!iLoongLauncher.getInstance().isPhoneSupportSensor()) {
Toast.makeText(
iLoongLauncher.getInstance(),
SetupMenu.getContext().getResources()
.getString(RR.string.sensor_not_supported),
Toast.LENGTH_SHORT).show();
return false;
}
}
// xiatian add end
return true;
}
}
}
| [
"[email protected]"
] | |
bb729bd65f640f93c77056bec450d05093422872 | 0a8c35c200dd0b817979abd5913ef8fe468b7224 | /app/src/main/java/com/example/archek/gamesinfo/PrefsConst.java | bac45d94bcc4f6e99250627d86edbeca2e39267f | [] | no_license | ArchkWay/GamesInfo | ec37486512c9785d486da0b9492f2db37a026dc4 | c2eb3b7b421ded195d37c802f9a9e6e54175cac1 | refs/heads/master | 2020-03-22T04:57:32.839642 | 2018-09-21T10:02:32 | 2018-09-21T10:02:32 | 139,532,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 236 | java | package com.example.archek.gamesinfo;
public interface PrefsConst {
int SETTING_DEFAULT_AMOUNT = 10;
String SETTINGS_GAME_AMOUNT = "SETTINGS_GAMES_AMOUNT";
String SETTINGS_COMPANIES_AMOUNT = "SETTINGS_COMPANIES_AMOUNT";
}
| [
"[email protected]"
] | |
f916b6f19fe7963af1feec2ef236542f77c0a9fa | 5862355bdd793c8fca35ab7fd559adffa7c1d16e | /src/test/java/com/test/DependencyGroupsTestUsingAnnotation.java | 670f8e7f650cded10f534db4faf06a899b0134ba | [] | no_license | toddlerya/LearnTestNG | 37d6120d76acaa320e2e31f4c8f2b36d14e9bbb8 | 68c254b4666131a8bcbdd0d7b2332d79c311f883 | refs/heads/master | 2021-01-05T21:27:39.794913 | 2020-02-22T16:05:24 | 2020-02-22T16:05:24 | 241,139,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | package com.test;
import com.demo.MessageUtil;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @Author evi1
* @Create 2020/2/18 15:09
*/
public class DependencyGroupsTestUsingAnnotation {
String message = "Thor";
MessageUtil messageUtil = new MessageUtil(message);
@Test(groups = {"init"})
public void testPrintMessage() {
System.out.println("inside DependencyGroups testPrintMessage()");
Assert.assertEquals(messageUtil.printMessage(), message);
}
@Test(dependsOnGroups = {"init.*"})
public void testSalutationMessage() {
System.out.println("inside DependencyGroups testSalutationMessage()");
message = "Hi!" + message;
Assert.assertEquals(messageUtil.salutationMessage(), message);
}
@Test(groups = {"init"})
public void initEnvironmentTest() {
System.out.println("This is DependencyGroups EnvironmentTest");
}
}
| [
"[email protected]"
] | |
e601b7385b9e74dc57d2d0b1162c73c1db7aa0e1 | f02d639343b03162226143600e47af59a4338d27 | /src/main/java/dev/webapi/repository/CollaborateurRepository.java | 0483140ed44f0d16806a161158e929317cbb2eb7 | [] | no_license | hmerciol/sirh-gestion-personnel-webapi | 7e7392711f25623e3db694b41baf17e4b55bcbca | 4c83a8241f16c22a28eb59c395a7bd2dca85cc0c | refs/heads/master | 2021-05-02T12:06:41.510915 | 2018-02-08T13:46:07 | 2018-02-08T13:46:07 | 120,736,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package dev.webapi.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import dev.webapi.entite.Collaborateur;
public interface CollaborateurRepository extends JpaRepository<Collaborateur, Integer> {
}
| [
"[email protected]"
] | |
4d5faaa58e43ba47234d6e39298ff21c7effddda | 7101fb712143092126af62835223dbc22394c08d | /app/src/main/java/it/unimib/librichepassione/SearchDetailFragment.java | b0fb5bec2519d6d092ec989f9246f5922af93838 | [] | no_license | gmele9/LibriChePassione | 31a9af7228a93dad42bfb65237cedf5a0f3eea9c | f8a3eb86152c9c1ae836a312165aa80a5e863b67 | refs/heads/master | 2022-11-28T15:48:06.137113 | 2020-07-16T15:46:04 | 2020-07-16T15:46:04 | 277,797,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,175 | java | package it.unimib.librichepassione;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.squareup.picasso.Picasso;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import it.unimib.librichepassione.model.BookInfo;
public class SearchDetailFragment extends Fragment {
private TextView textViewTitle;
private TextView textViewAuthor;
private TextView textViewPublisher;
private TextView textViewPublisherDate;
private TextView textViewISBN;
private TextView textViewCategories;
private ImageView imageViewThumbnail;
private Button buttonAddPreferences;
private SharedPreferences sp;
private static final String TAG = "SearchDetailFragment";
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_search_detail, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
textViewTitle = view.findViewById(R.id.textViewSearchDetailTitle);
textViewAuthor = view.findViewById(R.id.textViewSearchDetailAuthor);
textViewPublisher = view.findViewById(R.id.textViewSearchDetailPublisher);
textViewPublisherDate = view.findViewById(R.id.textViewSearchDetailPublisherDate);
textViewISBN = view.findViewById(R.id.textViewSearchDetailISBN);
textViewCategories = view.findViewById(R.id.textViewSearchDetailCategories);
imageViewThumbnail = view.findViewById(R.id.imageViewSearchDetail);
BookInfo book = SearchDetailFragmentArgs.fromBundle(getArguments()).getBook();
Log.d(TAG, "book" + book);
Log.d(TAG, "titolo: " + book.getTitle());
if(book.getTitle() != null) {
textViewTitle.setText(book.getTitle());
}
Log.d(TAG, "autore: " + book.getAuthor());
if(book.getAuthor() != null) {
textViewAuthor.setText(book.getAuthor());
}
Log.d(TAG, "publisher: " + book.getPublisher());
if(book.getPublisher() != null) {
textViewPublisher.setText(book.getPublisher());
}
Log.d(TAG, "data: " + book.getPublishedDate());
if(book.getPublishedDate() != null) {
textViewPublisherDate.setText(book.getPublishedDate());
}
Log.d(TAG, "cat: " + book.getCategories());
if(book.getCategories() != null) {
textViewCategories.setText(book.getCategories());
}
String isbn = "";
Log.d(TAG, "ID: " + book.getIndustryIdentifiers());
for (int i = 0; i < book.getIndustryIdentifiers().size(); i++) {
if (i == book.getIndustryIdentifiers().size() - 1) {
if(book.getIndustryIdentifiers().get(i).getType() != null)
isbn = isbn + book.getIndustryIdentifiers().get(i).getType().replace("_", " ") + "= " +
book.getIndustryIdentifiers().get(i).getIdentifier();
}
else {
if(book.getIndustryIdentifiers().get(i).getType() != null)
isbn = isbn + book.getIndustryIdentifiers().get(i).getType().replace("_", " ") + "= " +
book.getIndustryIdentifiers().get(i).getIdentifier() + "\n";
}
}
textViewISBN.setText(isbn);
String url;
if(book.getThumbnail() != null) {
url = book.getThumbnail().replace("http", "https");
Picasso.get().load(url).into(imageViewThumbnail);
}
else{
url = "https://cdn1.iconfinder.com/data/icons/error-warning-triangles/24/more-alt-triangle-128.png";
Picasso.get().load(url).into(imageViewThumbnail);
}
buttonAddPreferences = view.findViewById(R.id.buttonAddPreferences);
//SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("MY_USER_PREF", Context.MODE_PRIVATE);
buttonAddPreferences.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addFavorite(book);
}
});
}
public void addFavorite(BookInfo bookInfo) {
Boolean trovato = false;
String gStringInput;
List<BookInfo> bookInfoList = new ArrayList<>();
SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("MY_USER_PREF", Context.MODE_PRIVATE);
String gString = sharedPreferences.getString("list", "");
Gson gson = new Gson();
Type type = new TypeToken<List<BookInfo>>() {}.getType();
bookInfoList = gson.fromJson(gString, type);
Log.d(TAG, "booklist" + bookInfoList);
if (bookInfoList != null) {
for (int i = 0; i < bookInfoList.size(); i++) {
if (bookInfo.getIndustryIdentifiers().get(0).getIdentifier()
.equals(bookInfoList.get(i).getIndustryIdentifiers().get(0).getIdentifier())) {
trovato = true;
break;
}
}
if (trovato) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.ErrorTitle);
builder.setMessage("'" + bookInfo.getTitle() + "' " + getResources().getString(R.string.ErrorFavorites));
builder.show();
} else {
Toast toast = Toast.makeText(getActivity(), bookInfo.getTitle() + " "
+ getResources().getString(R.string.AddedToFavorites), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
bookInfoList.add(bookInfo);
gStringInput = gson.toJson(bookInfoList);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("list", gStringInput);
editor.commit();
}
}
else {
Log.d(TAG,"dentro else");
List<BookInfo> infoList = new ArrayList<>();
infoList.add(bookInfo);
gStringInput = gson.toJson(infoList);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("list", gStringInput);
editor.commit();
}
}
} | [
"[email protected]"
] | |
e4d688acef6b46c983050a520417079d325aacce | 17be6cc29f7fd76f83eea525449a3443acef53ca | /mg.alpha.gestion.operations.shared/src/mg/alpha/gestion/operations/shared/ui/desktop/outlines/pages/forms/operations/ISelectionnerDonneesService.java | be4976becea1918128529b7ed0932d05bd3a294c | [] | no_license | didaRatsimba/alphaGDOEclipseScout | d29fbeb44f88d07facd4264abd424f40e4ffcc31 | bf9bcafd98419d147ba60d3758e27135b00e6a8e | refs/heads/master | 2021-06-04T00:18:48.627554 | 2018-10-26T19:51:54 | 2018-10-26T19:51:54 | 39,316,425 | 0 | 0 | null | 2018-10-26T19:51:54 | 2015-07-18T23:52:47 | Java | UTF-8 | Java | false | false | 1,398 | java | /**
*
*/
package mg.alpha.gestion.operations.shared.ui.desktop.outlines.pages.forms.operations;
import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.rt.shared.validate.IValidationStrategy;
import org.eclipse.scout.rt.shared.validate.InputValidation;
import org.eclipse.scout.service.IService;
/**
* @author Dida
*/
@InputValidation(IValidationStrategy.PROCESS.class)
public interface ISelectionnerDonneesService extends IService {
/**
* @param formData
* @return
* @throws org.eclipse.scout.commons.exception.ProcessingException
*/
SelectionnerDonneesFormData create(SelectionnerDonneesFormData formData) throws ProcessingException;
/**
* @param formData
* @return
* @throws org.eclipse.scout.commons.exception.ProcessingException
*/
SelectionnerDonneesFormData load(SelectionnerDonneesFormData formData) throws ProcessingException;
/**
* @param formData
* @return
* @throws org.eclipse.scout.commons.exception.ProcessingException
*/
SelectionnerDonneesFormData prepareCreate(SelectionnerDonneesFormData formData) throws ProcessingException;
/**
* @param formData
* @return
* @throws org.eclipse.scout.commons.exception.ProcessingException
*/
SelectionnerDonneesFormData store(SelectionnerDonneesFormData formData) throws ProcessingException;
} | [
"[email protected]"
] | |
385abbd3bafab21c11d337020da301450621b1df | e6d716fde932045d076ab18553203e2210c7bc44 | /bluesky-pentaho-kettle/engine/src/main/java/org/pentaho/di/trans/steps/monetdbagilemart/MonetDBRowLimitException.java | 9224432eb3d5e508b9b27a2e961659d272770fe3 | [] | no_license | BlueCodeBoy/bluesky | d04032e6c0ce87a18bcbc037191ca20d03aa133e | 6fc672455b6047979527da9ba8e3fc220d5cee37 | refs/heads/master | 2020-04-18T10:47:20.434313 | 2019-01-25T03:30:47 | 2019-01-25T03:30:47 | 167,478,568 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,719 | java | /*! ******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
package org.pentaho.di.trans.steps.monetdbagilemart;
import org.pentaho.di.core.exception.KettleException;
/**
* Custom exception to indicate that the row limit has been reached User: RFellows Date: 10/31/12
*/
public class MonetDBRowLimitException extends KettleException {
private static final long serialVersionUID = -2456127057531651057L;
/**
* Constructs a new {@link Throwable} with null as its detail message.
*/
public MonetDBRowLimitException() {
super();
}
/**
* Constructs a new {@link Throwable} with the specified detail message.
*
* @param message
* - the detail message. The detail message is saved for later retrieval by the getMessage() method.
*/
public MonetDBRowLimitException( String message ) {
super( message );
}
/**
* Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : cause.toString())
* (which typically contains the class and detail message of cause).
*
* @param cause
* the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and
* indicates that the cause is nonexistent or unknown.)
*/
public MonetDBRowLimitException( Throwable cause ) {
super( cause );
}
/**
* Constructs a new throwable with the specified detail message and cause.
*
* @param message
* the detail message (which is saved for later retrieval by the getMessage() method).
* @param cause
* the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and
* indicates that the cause is nonexistent or unknown.)
*/
public MonetDBRowLimitException( String message, Throwable cause ) {
super( message, cause );
}
}
| [
"[email protected]"
] | |
0b52bb906c2da04f88e62aa63de068928d41c74c | e096c758789d6091351d922a8f30f6f6fa5ed60c | /src/com/nv/youNeverWait/user/bl/validation/DoctorValidator.java | a1cdaf7b8efbe4ffeecd44b2695025b4c44c9cb4 | [] | no_license | netvarth/netmdportal | 0487f5221bdc6f7a0e9156f96d122dcea42ff191 | a60171d76e82b02fbf074db4a7dd2814a10d0866 | refs/heads/master | 2021-03-16T09:54:50.043949 | 2016-08-04T10:53:34 | 2016-08-04T10:53:34 | 63,756,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,668 | java | /**
* DoctorValidator.java
*
* Dec 19, 2012
*
* @author Asha Chandran
*/
package com.nv.youNeverWait.user.bl.validation;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.nv.youNeverWait.common.Constants;
import com.nv.youNeverWait.exception.ServiceException;
import com.nv.youNeverWait.pl.entity.ErrorCodeEnum;
import com.nv.youNeverWait.pl.entity.NetmdUserTypeEnum;
import com.nv.youNeverWait.rs.dto.DoctorAchievementDTO;
import com.nv.youNeverWait.rs.dto.DoctorDetail;
import com.nv.youNeverWait.rs.dto.DoctorExperienceDTO;
import com.nv.youNeverWait.rs.dto.DoctorExpertiseDTO;
import com.nv.youNeverWait.rs.dto.DoctorMembershipDTO;
import com.nv.youNeverWait.rs.dto.DoctorQualificationDTO;
import com.nv.youNeverWait.rs.dto.HeaderDTO;
import com.nv.youNeverWait.rs.dto.LoginDTO;
import com.nv.youNeverWait.rs.dto.Parameter;
public class DoctorValidator {
/**
* Validates userName and password
*
* @param userName
* @param password
*/
public void validateUserNameAndPassword(String userName, String password) {
if (userName == null || userName.isEmpty()) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidUserName);
se.setDisplayErrMsg(true);
throw se;
}
if (password == null || password.isEmpty()) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidPassword);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Validates doctor details
*
* @param doctor
* @param header
*/
public void validateCreateDoctor(DoctorDetail doctor, HeaderDTO header) {
validateHeaderDetails(header);
if (!isValidName(doctor.getFirstName())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidName);
se.setDisplayErrMsg(true);
throw se;
}
if (!isValidName(doctor.getEmail())) {
ServiceException se = new ServiceException(ErrorCodeEnum.EmailNull);
se.setDisplayErrMsg(true);
throw se;
}
if (doctor.getEmail() != null && !doctor.getEmail().equals("")) {
if (!doctor
.getEmail()
.matches(
"[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidMailId);
se.setDisplayErrMsg(true);
throw se;
}
}
if (doctor.getPhone() != null && !doctor.getPhone().equals("")) {
if (!doctor.getPhone().matches("^0?[1-9]{1}[0-9]{9}$")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidPhoneFormat);
se.setDisplayErrMsg(true);
throw se;
}
}
if (doctor.getMobile() != null && !doctor.getMobile().equals("")) {
if (!doctor.getMobile().matches("\\d{10}")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidMobileFormat);
se.setDisplayErrMsg(true);
throw se;
}
}
if (doctor.getDateOfBirth() != null) {
if (!doctor.getDateOfBirth().matches("\\d{4}-\\d{2}-\\d{2}")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidDateFormat);
se.setDisplayErrMsg(true);
throw se;
}
DateFormat df = new SimpleDateFormat(
Constants.DATE_FORMAT_WITHOUT_TIME);
try {
Date dob = df.parse(doctor.getDateOfBirth());
} catch (ParseException e) {
e.printStackTrace();
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidDateFormat);
se.setDisplayErrMsg(true);
throw se;
}
}
if (!doctor.getDoctorExperience().isEmpty()) {
for (DoctorExperienceDTO doctorExperience : doctor
.getDoctorExperience()) {
// Validate doctor experience details
validateDoctorExperience(doctorExperience);
}
}
if (!doctor.getDoctorQualifications().isEmpty()) {
for (DoctorQualificationDTO doctorQualificaton : doctor
.getDoctorQualifications()) {
// Validate doctor educational qualification details
validateDoctorQualification(doctorQualificaton);
}
}
if (!doctor.getAchievement().isEmpty()) {
for (DoctorAchievementDTO doctorAchievement : doctor
.getAchievement()) {
// Validate doctor achievemnet details
validateDoctorAchievement(doctorAchievement);
}
}
if (!doctor.getMembership().isEmpty()) {
for (DoctorMembershipDTO doctorMembership : doctor.getMembership()) {
// Validate doctor membership details
validateDoctorMembership(doctorMembership);
}
}
if (!doctor.getExpertise().isEmpty()) {
for (DoctorExpertiseDTO doctorExpertise : doctor.getExpertise()) {
// Validate doctor membership details
validateDoctorExpertise(doctorExpertise);
}
}
}
/**
* Validates doctor qualification details
*
* @param doctorQualificaton
*/
public void validateDoctorQualification(
DoctorQualificationDTO doctorQualificaton) {
if (doctorQualificaton.getPassedOutDate() == null) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidDateFormat);
se.setDisplayErrMsg(true);
throw se;
}
if (!isValidName(doctorQualificaton.getEducationalDegree())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidName);
se.setDisplayErrMsg(true);
throw se;
}
if (!isValidName(doctorQualificaton.getInstitution())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidName);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Validates doctor experience details
*
* @param doctorExperience
*/
public void validateDoctorExperience(DoctorExperienceDTO doctorExperience) {
if (doctorExperience.getFromDate() != null
&& doctorExperience.getToDate() != null) {
if (!doctorExperience.getFromDate().matches("\\d{4}-\\d{2}-\\d{2}")
|| !doctorExperience.getToDate().matches(
"\\d{4}-\\d{2}-\\d{2}")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidDateFormat);
se.setDisplayErrMsg(true);
throw se;
}
DateFormat df1 = new SimpleDateFormat(
Constants.DATE_FORMAT_WITHOUT_TIME);
Date fromDate;
Date toDate;
try {
fromDate = df1.parse(doctorExperience.getFromDate());
toDate = df1.parse(doctorExperience.getToDate());
if (fromDate.after(toDate)) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidFromToDate);
se.setDisplayErrMsg(true);
throw se;
}
} catch (ParseException e) {
e.printStackTrace();
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidDateFormat);
se.setDisplayErrMsg(true);
throw se;
}
}
}
/**
* Validates doctor acheivement details
*
* @param doctorAchievement
*/
public void validateDoctorAchievement(DoctorAchievementDTO doctorAchievement) {
if (!isValidName(doctorAchievement.getAchievement())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidAchievement);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Validates doctor membership details
*
* @param doctorMembership
*/
public void validateDoctorMembership(DoctorMembershipDTO doctorMembership) {
if (!isValidName(doctorMembership.getMembership())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidMemberShip);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Validates doctor expertise details
*
* @param doctorExpertise
*/
public void validateDoctorExpertise(DoctorExpertiseDTO doctorExpertise) {
if (!isValidName(doctorExpertise.getExpertise())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidExpertise);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Method performed to validate login details
*
* @param user
* @return ErrorDTO
*/
public void validateCreateUser(LoginDTO user) {
if (!isValidName(user.getUserName())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.UserNameNull);
se.setDisplayErrMsg(true);
throw se;
}
if (!isValidName(user.getPassword())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.PasswordNull);
se.setDisplayErrMsg(true);
throw se;
}
if (!isValidName(user.getUserType())) {
ServiceException se = new ServiceException(
ErrorCodeEnum.UserTypeNull);
se.setDisplayErrMsg(true);
throw se;
}
NetmdUserTypeEnum usertype= NetmdUserTypeEnum.getEnum(user.getUserType());
}
/**
* Method to validte doctor details for updation
*
* @param doctor
* @param header
* @return ErrorDTO
*/
public void validateUpdateDoctor(DoctorDetail doctor, HeaderDTO header) {
if (doctor.getGlobalId() <= 0) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidGlobalId);
se.setDisplayErrMsg(true);
throw se;
}
validateCreateDoctor(doctor, header);
}
/**
* Method for null checking
*
* @param value
*/
private boolean isValidName(String value) {
if (value != null && !value.equals("")) {
return true;
}
return false;
}
/**
* Method to validate header details
*
* @param header
* @return ErrorDTO
*/
public void validateHeaderDetails(HeaderDTO header) {
if (header.getHeadOfficeId() <= 0) {
ServiceException se = new ServiceException(
ErrorCodeEnum.NetMdIdNull);
se.setDisplayErrMsg(true);
throw se;
}
if (header.getPassPhrase() == null || header.getPassPhrase().equals("")) {
ServiceException se = new ServiceException(
ErrorCodeEnum.PassPhraseNull);
se.setDisplayErrMsg(true);
throw se;
}
if (header.getBranchId() <= 0) {
ServiceException se = new ServiceException(
ErrorCodeEnum.BranchMissMatch);
se.addParam(new Parameter(Constants.ID, Integer.toString(header.getBranchId())));
se.setDisplayErrMsg(true);
throw se;
}
if (header.getMacId() == null || header.getMacId().equals("")) {
ServiceException se = new ServiceException(ErrorCodeEnum.MacIdNull);
se.setDisplayErrMsg(true);
throw se;
}
}
/**
* Method to validate global Id and header details
*
* @param globalId
* @param header
* @return ErrorDTO
*/
public void validateGlobalId(int globalId) {
if (globalId <= 0) {
ServiceException se = new ServiceException(
ErrorCodeEnum.InvalidGlobalId);
se.setDisplayErrMsg(true);
throw se;
}
}
}
| [
"manikandan@33b5678d-7e6b-764b-8695-d616d715c8b5"
] | manikandan@33b5678d-7e6b-764b-8695-d616d715c8b5 |
3893c52bd484ccd851b9f9f5948669a21642775a | c5215075d6e2e91cb4f6cbe7706e3b379d111185 | /src/main/java/com/lcc/service/impl/RolePermissionsServiceImpl.java | 051cfece919a4422fbb9e34a5d99e8830a18fe42 | [] | no_license | liangchengcheng/springmvc_admin_master | 59e378271c5120a6fa18dbd12b771c3321fb4489 | d57dece5045e4c457250c066b8a83a8a372a31d5 | refs/heads/master | 2021-01-12T07:05:06.173532 | 2016-12-24T06:16:35 | 2016-12-24T06:16:35 | 76,905,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,807 | java | package com.lcc.service.impl;
import java.util.List;
import com.lcc.bean.Result;
import com.lcc.bean.entity.RcRolePermissions;
import com.lcc.dao.RolePermissionsDao;
import com.lcc.service.RolePermissionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RolePermissionsServiceImpl implements RolePermissionsService {
@Autowired
private RolePermissionsDao dao;
@Override
public Result<RcRolePermissions> query(long id) {
Result<RcRolePermissions> result = new Result<RcRolePermissions>();
if (id < 0) {
result.setErrMsg("此id无效");
return result;
}
RcRolePermissions rcRolePermissions = dao.selectById(id);
if (rcRolePermissions != null) {
result.setErrCode(0);
result.setStatus(true);
result.setResultData(rcRolePermissions);
}
return result;
}
@Override
public Result<List<RcRolePermissions>> queryByRoleId(long id) {
Result<List<RcRolePermissions>> result = new Result<List<RcRolePermissions>>();
if (id < 0) {
result.setErrMsg("此id无效");
return result;
}
List<RcRolePermissions> resultList = dao.selectByRoleId(id);
if (resultList.size() > 0) {
result.setErrCode(0);
result.setStatus(true);
result.setResultData(resultList);
}
return result;
}
@Override
public Result<Integer> insert(RcRolePermissions rcRolePermissions) {
Result<Integer> result = new Result<Integer>();
if (rcRolePermissions.getRoleId() < 0) {
result.setErrMsg("此角色id无效");
return result;
}
if (rcRolePermissions.getPermissionId() < 0) {
result.setErrMsg("此权限id无效");
return result;
}
int resultNum = dao.insert(rcRolePermissions);
if (resultNum > 0) {
result.setErrCode(0);
result.setStatus(true);
}
return result;
}
@Override
public Result<Integer> update(RcRolePermissions rcRolePermissions) {
Result<Integer> result = new Result<Integer>();
if (rcRolePermissions.getRoleId() < 0) {
result.setErrMsg("此角色id无效");
return result;
}
if (rcRolePermissions.getPermissionId() < 0) {
result.setErrMsg("此权限id无效");
return result;
}
int resultNum = dao.update(rcRolePermissions);
if (resultNum > 0) {
result.setErrCode(0);
result.setStatus(true);
}
return result;
}
@Override
public Result<Integer> delete(long id) {
Result<Integer> result = new Result<Integer>();
if (id < 0) {
result.setErrMsg("此id无效");
return result;
}
int resultNum = dao.deleteById(id);
if (resultNum > 0) {
result.setErrCode(0);
result.setStatus(true);
}
return result;
}
@Override
public Result<Integer> deleteByRolePermissions(RcRolePermissions rcRolePermissions) {
Result<Integer> result = new Result<Integer>();
if (rcRolePermissions.getRoleId() < 0) {
result.setErrMsg("此角色id无效");
return result;
}
if (rcRolePermissions.getPermissionId() < 0) {
result.setErrMsg("此权限id无效");
return result;
}
int resultNum = dao.delectByRolePermissions(rcRolePermissions);
if (resultNum > 0) {
result.setErrCode(0);
result.setStatus(true);
}
return result;
}
}
| [
"[email protected]"
] | |
48bff4deb0290cec8c8ef3763ca2e116c09351ae | 18543d61b93bf20680ef4960c78c842552d2c830 | /AbstractTree.java | 540c0772d23581b9a7cc6f5d9153472d63475b0d | [] | no_license | Vazyri/stupid-fucking-morsey-translator | 98f6ae029a609d3e4ba8ac960b87195d62c21523 | 64dbc14a2c6bad4071452d065c839c53a79ab555 | refs/heads/main | 2023-05-26T02:52:22.520135 | 2021-06-03T03:58:12 | 2021-06-03T03:58:12 | 373,373,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,268 | java | import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Morsey
* AbstractTree abstract class of generic type K implements Tree of generic type K
* ElementIterator static inner class of generic type K implements Iterator of generic type K
* @author Von Jamora
*/
public abstract class AbstractTree<K> implements Tree<K> {
private class ElementIterator implements Iterator<K> {
Iterator<Position<K>> posIterator = positions().iterator();
/**
* Returns boolean based on whether Iterator has an element available after the current one it is accessing.
*
* @return boolean value
*/
public boolean hasNext() {
return posIterator.hasNext();
}
/**
* Returns value of generic type K of the next element in Iterator.
*
* @return generic type K value
*/
public K next() {
return posIterator.next().getElement();
}
/**
* Removes the last element returnec by Iterator.
*/
public void remove() {
posIterator.remove();
}
/**
* Returns a String representation of ElementIterator. Includes all elements in Iterator.
*
* @return String value
*/
public String toString() {
StringBuilder print = new StringBuilder();
while(posIterator.hasNext()) {
print.append(posIterator.next() + ", ");
}
print.delete(print.length()-2, print.length()-1);
return print.toString();
}
}// end of inner ElementIterator class
// ************************************************** Traversal **************************************************
/**
* Returns Iterator object containing elements of each Node in tree.
*
* @return Iterator object of generic type K
*/
public Iterator<K> iterator() {
return new ElementIterator();
}
/**
* Returns Iterable object with tree nodes in order defined by the chosen traversal method.
*
* @return Iterable object of type Position of generic type K
*/
public Iterable<Position<K>> positions() {
return preorder(); // preorder traversal as default tree traversal method
//return postorder(); // for postorder traversal
//return breadthfirst(); // for breadth-first traversal
}
/**
* Adds position of subtree rooted at provided Position to given snapshot.
*
* @param p Position object of generic type K
* @param snappity List object of type Position of generic type K
*/
private void preorderSubtree(Position<K> p, List<Position<K>> snappity) {
snappity.add(p);
for(Position<K> c : children(p)) {
preorderSubtree(c, snappity);
}
}
/**
* Returns Iterable collection containing Positions in tree reported in preorder.
*
* @return Iterable object of type Position of generic type K
*/
public Iterable<Position<K>> preorder() {
List<Position<K>> snappity = new ArrayList<>();
if(!isEmpty()) {
preorderSubtree(root(), snappity);
}
return snappity;
}
/**
* Adds positions of subtree rooted at provided Position to given snapshot.
*
* @param p Position object of generic type K
* @param snappity List object of type Position of generic type K
*/
private void postorderSubtree(Position<K> p, List<Position<K>> snappity) {
for(Position<K> c : children(p)) {
postorderSubtree(c, snappity);
}
snappity.add(p); // add p AFTER traversing subtrees
}
/**
* Returns Iterable collection containing Positions in tree reported in postorder.
*
* @return Iterable object of type Position of generic type K
*/
public Iterable<Position<K>> postorder() {
List<Position<K>> snappity = new ArrayList<>();
if(!isEmpty()) {
postorderSubtree(root(), snappity);
}
return snappity;
}
/**
* Returns Iterable collection containing Positions in tree reported in breadth-first order (traverse each node frmo left to right).
*
* @return Iterable object of type Position of generic type K
*/
public Iterable<Position<K>> breadthfirst() {
List<Position<K>> snappity = new ArrayList<>();
if(!isEmpty()) {
Queue<Position<K>> pringels = new ArrayQueue<>();
pringels.enqueue(root()); // starts with roots
while(!pringels.isEmpty()) {
Position<K> p = pringels.dequeue(); // remove from front
snappity.add(p); // visited element
for(Position<K> c : children(p)) {
pringels.enqueue(c); // add children to queue
}
}
}
return snappity;
}
// ************************************************** Traversal **************************************************
/**
* Returns boolean value based on whether the Node located at the provided Position object is an internal Node (atleast one child).
*
* Originates from Tree interface and is defined in AbstractTree abstract class.
*
* @param p Position object
* @return boolean value
*/
public boolean isInternal(Position<K> p) {
return numChildren(p) > 0;
}
/**
* Returns boolean value based on whether the Node located at the provided Position object is an external Node (no children).
*
* Originates from Tree interface and is defined in AbstractTree abstract class.
*
* @param p Position object
* @return boolean value
*/
public boolean isExternal(Position<K> p) {
return numChildren(p) == 0;
}
/**
* Returns boolean value based on whether the Node located at the provided Position object is the root of the tree.
*
* Originates from Tree interface and is defined in AbstractTree abstract class.
*
* @param p Position object
* @return boolean value
*/
public boolean isRoot(Position<K> p) {
return p == root();
}
/**
* Returns boolean based on whether tree has any Node objects.
*
* Originates from Tree interface and is defined in AbstractTree abstract class.
*
* @return boolean value
*/
public boolean isEmpty() {
return size() == 0;
}
/**
* Returns number of levels separating provided Position from root.
*
* @param p Position object of generic type K
* @return integer value
*/
public int depth(Position<K> p) {
if(isRoot(p)) {
return 0;
} else {
return 1 + depth(parent(p));
}
}
/**
* Returns height of subtree rooted at provided Position.
*
* @param p Position object of generic type K
* @return integer value
*/
public int height(Position<K> p) {
int h=0;
for(Position<K> c : children(p)) {
h = Math.max(h, 1 + height(c));
}
return h;
}
}
| [
"[email protected]"
] | |
6b8659a60f5903589a16e7aaa19df38b401cec7e | 64bbfaab56176144560f000418fb3cb35e5eaff9 | /src/main/java/com/uniovi/UvisClient/validator/WalletFormValidator.java | 7bff75719c5bb5fc4a0e7cbd2651f323f4486bca | [] | no_license | PelayoDiaz/UvisClient | 56253a8b67da05ad5c5e2e5486e39182f56bba4e | 64047a27403ec40db703694ab98afad6d148a9ee | refs/heads/master | 2022-12-15T11:45:25.313050 | 2019-11-20T21:07:08 | 2019-11-20T21:07:08 | 191,362,104 | 0 | 0 | null | 2022-12-04T21:16:23 | 2019-06-11T11:56:01 | CSS | UTF-8 | Java | false | false | 1,444 | java | package com.uniovi.UvisClient.validator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import com.uniovi.UvisClient.entities.Wallet;
import com.uniovi.UvisClient.services.impl.WalletServiceImpl;
import com.uniovi.UvisClient.services.security.SecurityService;
/**
* Validator for the create wallet form.
* It checks if the data introduced is correct.
*
* @author Pelayo Díaz Soto
*
*/
@Component
public class WalletFormValidator implements Validator {
@Autowired
private WalletServiceImpl walletService;
@Autowired
private SecurityService securityService;
@Override
public boolean supports(Class<?> aClass) {
return Wallet.class.equals(aClass);
}
@Override
public void validate(Object target, Errors errors) {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.empty");
Wallet wallet = (Wallet) target;
String loggedUsername = securityService.findLoggedInUsername();
if (wallet.getName().length() < 4 || wallet.getName().length() > 25) {
errors.rejectValue("name", "error.wallet.name.length");
}
if (this.walletService.getWalletByNameAndUsername(wallet.getName(), loggedUsername) != null) {
errors.rejectValue("name", "error.wallet.name.duplicated");
}
}
}
| [
"[email protected]"
] | |
d1f1f34f58997012761431fd464e7281d30b4d13 | ca070e4ae34a73de18ef17d3dd009f4ed7f488a6 | /2.2.3/sources/android/support/v7/widget/AppCompatEditText.java | 125076b1c4199d0d481e47d2189d0792236f01b5 | [] | no_license | stven0king/InstantRun-ApkParse | 611c49fc56852d2e1538b477b1670813808e7316 | 5bc938ab615ae6bb3c4941f65b6c2c6d7d30a8d5 | refs/heads/master | 2020-03-17T20:21:20.221813 | 2018-05-18T05:21:52 | 2018-05-18T05:21:52 | 133,905,354 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,487 | java | package android.support.v7.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.support.v4.view.TintableBackgroundView;
import android.support.v7.appcompat.R;
import android.util.AttributeSet;
import android.widget.EditText;
public class AppCompatEditText extends EditText implements TintableBackgroundView {
private AppCompatBackgroundHelper mBackgroundTintHelper;
private AppCompatTextHelper mTextHelper;
public AppCompatEditText(Context context) {
this(context, null);
}
public AppCompatEditText(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.editTextStyle);
}
public AppCompatEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(TintContextWrapper.wrap(context), attrs, defStyleAttr);
this.mBackgroundTintHelper = new AppCompatBackgroundHelper(this);
this.mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
this.mTextHelper = AppCompatTextHelper.create(this);
this.mTextHelper.loadFromAttributes(attrs, defStyleAttr);
this.mTextHelper.applyCompoundDrawablesTints();
}
public void setBackgroundResource(@DrawableRes int resId) {
super.setBackgroundResource(resId);
if (this.mBackgroundTintHelper != null) {
this.mBackgroundTintHelper.onSetBackgroundResource(resId);
}
}
public void setBackgroundDrawable(Drawable background) {
super.setBackgroundDrawable(background);
if (this.mBackgroundTintHelper != null) {
this.mBackgroundTintHelper.onSetBackgroundDrawable(background);
}
}
@RestrictTo({Scope.LIBRARY_GROUP})
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (this.mBackgroundTintHelper != null) {
this.mBackgroundTintHelper.setSupportBackgroundTintList(tint);
}
}
@Nullable
@RestrictTo({Scope.LIBRARY_GROUP})
public ColorStateList getSupportBackgroundTintList() {
return this.mBackgroundTintHelper != null ? this.mBackgroundTintHelper.getSupportBackgroundTintList() : null;
}
@RestrictTo({Scope.LIBRARY_GROUP})
public void setSupportBackgroundTintMode(@Nullable Mode tintMode) {
if (this.mBackgroundTintHelper != null) {
this.mBackgroundTintHelper.setSupportBackgroundTintMode(tintMode);
}
}
@Nullable
@RestrictTo({Scope.LIBRARY_GROUP})
public Mode getSupportBackgroundTintMode() {
return this.mBackgroundTintHelper != null ? this.mBackgroundTintHelper.getSupportBackgroundTintMode() : null;
}
protected void drawableStateChanged() {
super.drawableStateChanged();
if (this.mBackgroundTintHelper != null) {
this.mBackgroundTintHelper.applySupportBackgroundTint();
}
if (this.mTextHelper != null) {
this.mTextHelper.applyCompoundDrawablesTints();
}
}
public void setTextAppearance(Context context, int resId) {
super.setTextAppearance(context, resId);
if (this.mTextHelper != null) {
this.mTextHelper.onSetTextAppearance(context, resId);
}
}
}
| [
"[email protected]"
] | |
b2bdcf36f1ecb47f7291a0520beb5f2fa991c9b2 | b4cd00e9241dc52d97ae6052bf8b3b8c1adef350 | /tes-tsvc/src/main/java/com/qingqing/test/client/PassportPiClient.java | 9ccea9279458ea50cb506d45fc4f9760f3123ebf | [] | no_license | AntinZhu/QingTest | 17aa1a8dbcaceb1de32a9d7d26688cd167ffef1d | 6b4863db50b3e75f3b4570c5f387a1bcd5cf99f0 | refs/heads/master | 2022-06-29T11:38:35.367432 | 2021-08-18T02:32:40 | 2021-08-18T02:32:40 | 146,688,664 | 2 | 1 | null | 2022-06-22T19:15:01 | 2018-08-30T03:06:18 | JavaScript | UTF-8 | Java | false | false | 1,860 | java | package com.qingqing.test.client;
import com.qingqing.api.passort.proto.PassportLoginProto.PassportLoginResponse;
import com.qingqing.api.passort.proto.PassportLoginProto.PassportTkLoginRequestV2;
import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserInfoRequest;
import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserInfoResponse;
import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserPhoneNumberRequest;
import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserPhoneNumberResponse;
import com.qingqing.common.web.protobuf.ProtoResponseBody;
import com.qingqing.test.config.feign.MyPiFeignConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
* Created by zhujianxing on 2017/8/15.
*/
@FeignClient(value = "passportPiClient", url = "http://gateway.{env}.idc.cedu.cn/passportsvc/api/pi", configuration = MyPiFeignConfiguration.class)
public interface PassportPiClient {
/*
protobuf
*/
@PostMapping(value = "/v2/auth/refresh", consumes="application/x-protobuf", produces = "application/x-protobuf")
@ProtoResponseBody
PassportLoginResponse getTokenAndSession(PassportTkLoginRequestV2 request);
/*
protobuf
*/
@PostMapping(value = "/v1/account/query_user_phone_number", consumes="application/x-protobuf", produces = "application/x-protobuf")
@ProtoResponseBody
PassportQueryUserPhoneNumberResponse queryUserPhoneNumber(PassportQueryUserPhoneNumberRequest request);
/*
protobuf
*/
@PostMapping(value = "/v1/account/query_user_by_account", consumes="application/x-protobuf", produces = "application/x-protobuf")
@ProtoResponseBody
PassportQueryUserInfoResponse queryUserByAccount(PassportQueryUserInfoRequest request);
}
| [
"[email protected]"
] | |
1ade226a3b3f66c332774d2d3cc9228682275b39 | c22461e080d694ab8495288995210223e4211b4a | /NeighborhoodSustainability/app/src/main/java/creu/neighborhoodsustainability/InformationDisplay.java | 16d0913da232593a1d367cf846dc150cf9f0e5af | [] | no_license | HalcyonAura/CREU | 938ad278cd3f3447f08b989f02d2d0cf002af86f | bc925b39a5571a3a0d8ed84c7d8cbe7dc44b3860 | refs/heads/master | 2021-01-21T11:36:54.284050 | 2018-05-06T01:59:16 | 2018-05-06T01:59:16 | 102,019,421 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,290 | java | package creu.neighborhoodsustainability;
import android.content.Intent;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
public class InformationDisplay extends AppCompatActivity {
/*
* This is the swipe tab view that will be populated with the
* information from the server containing the links,
* scoring, etc.
*/
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
private PagerAdapter mSectionsPagerAdapter;
//private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
String currentCity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_information_display);
Intent intent = getIntent();
int pageNum = intent.getIntExtra("PageNumber", 0);
currentCity = intent.getStringExtra("CityName");
if (currentCity == null)
currentCity = "CityName";
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
/*getSupportActionBar().setDisplayHomeAsUpEnabled(true);*/
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new PagerAdapter(getSupportFragmentManager());
//mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
mViewPager.setCurrentItem(pageNum);
Toast.makeText(this, "Swipe left/right to access more information", Toast.LENGTH_LONG).show();
}
public class PagerAdapter extends FragmentPagerAdapter {
int numTabs = 4;
public PagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
//return EconomyFragment.newInstance();
switch (position) {
case 0:
//EconomyFragment economy = new EconomyFragment();
return EconomyFragment.newInstance();
case 1:
//SocialFragment social = new SocialFragment();
return SocialFragment.newInstance();
case 2:
//EcologyFragment ecology = new EcologyFragment();
return EcologyFragment.newInstance();
case 3:
//OntologyFragment ontology = new OntologyFragment();
return OntologyFragment.newInstance();
default:
return null;
}
}
@Override
public int getCount() {
return numTabs;
}
}
@Override
public void onBackPressed(){
Intent intent = new Intent(InformationDisplay.this, BreakDown.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("CityName", currentCity);
Log.d("Information class", currentCity);
startActivity(intent);
}
}
| [
"[email protected]"
] | |
12da7cc2aecf06bf4610ccab160e83390b96dfec | d56c589262e9338ec9b917a954aeff798b01bd29 | /app/src/test/java/bit/ihainan/me/bitunionforandroid/ExampleUnitTest.java | 4dbc8f8a6bbd2c382658f69e5dc5f4756c12aaf9 | [] | no_license | ztlm/BITUnion-for-Android | d7f2682739b06796c923fab3ebd8fb98e8c738a7 | 9aeb38ea27915a314df71df2f2f85b61b95a59bd | refs/heads/master | 2021-01-12T21:36:07.255189 | 2016-03-20T14:03:57 | 2016-03-20T14:03:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package bit.ihainan.me.bitunionforandroid;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
264aa8aee030de451e17a5bbd8eb93299de7b7dd | 9216ec7959de16732284c87372fe8ab388b5e384 | /service/hive/src/main/java/org/saarus/service/sql/io/TableRCFileWriter.java | ee4e7a95016e00b25e7b1c8252a3e731e9d5debc | [] | no_license | tuan08/Saarus | 9d4c3061052bea8dd0d79a2301d62966a33860ac | b7d6fca9ffe71ab813a58b44c002590772e1aeab | refs/heads/master | 2020-07-15T11:34:04.654042 | 2015-02-15T12:34:20 | 2015-02-15T12:34:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,808 | java | package org.saarus.service.sql.io;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.io.RCFile;
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable;
import org.apache.hadoop.hive.serde2.columnar.BytesRefWritable;
import org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.compress.DefaultCodec;
public class TableRCFileWriter implements TableWriter {
private FileSystem fs ;
private String file ;
private RCFile.Writer writer ;
private ColumnarSerDe serDe ;
public TableRCFileWriter(FileSystem fs, String file, String[] colNames, Map<String, String> meta) throws Exception {
this.fs = fs ;
this.file = file ;
Configuration conf = fs.getConf() ;
Text[] textHeader = null ;
if(meta == null ) {
textHeader = new Text[] {} ;
} else {
textHeader = new Text[meta.size() * 2] ;
Iterator<Map.Entry<String, String>> i = meta.entrySet().iterator() ;
int count = 0 ;
while(i.hasNext()) {
Map.Entry<String, String> entry = i.next() ;
textHeader[count] = new Text(entry.getKey()) ;
textHeader[count + 1] = new Text(entry.getValue()) ;
count += 2 ;
}
}
conf.setInt(RCFile.COLUMN_NUMBER_CONF_STR, colNames.length) ;
writer = new RCFile.Writer(fs, conf, new Path(file), null, RCFile.createMetadata(textHeader), new DefaultCodec());
serDe = new ColumnarSerDe();
serDe.initialize(conf, createProperties());
}
public void writeRow(String ... data) throws IOException {
BytesRefArrayWritable bytes = new BytesRefArrayWritable(data.length);
for(int i = 0; i < data.length; i++) {
byte[] buf = null ;
if(data[i] == null) buf = "NULL".getBytes("UTF-8");
else buf = data[i].getBytes("UTF-8") ;
bytes.set(i, new BytesRefWritable(buf, 0, buf.length));
}
writer.append(bytes);
bytes.clear();
}
public void close() throws IOException {
writer.close() ;
}
static Properties createProperties() {
Properties tbl = new Properties();
// Set the configuration parameters
tbl.setProperty(serdeConstants.SERIALIZATION_FORMAT, "9");
tbl.setProperty("columns", "abyte,ashort,aint,along,adouble,astring,anullint,anullstring");
tbl.setProperty("columns.types","tinyint:smallint:int:bigint:double:string:int:string");
tbl.setProperty(serdeConstants.SERIALIZATION_NULL_FORMAT, "NULL");
return tbl;
}
}
| [
"[email protected]"
] | |
028263e3fca846d3a55a015ee5b550f1d8c8bbf2 | 4ea067acb246d315612ec24697f0c8739820a51a | /app/src/main/java/com/example/lhilf/leistungensammler/CameraActivity.java | 899c1059557f30539a11bf87fe225c300c02316b | [] | no_license | Luke004/gerichtesammler | 6da1f6203d0b3bc7e817c2be3d038e6acc0ae2c8 | acee27765aab9252e72105fb744f923ab9f2ac8c | refs/heads/master | 2022-12-08T17:22:57.777088 | 2020-08-31T14:44:41 | 2020-08-31T14:44:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,853 | java | package com.example.lhilf.leistungensammler;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import java.io.File;
import java.io.IOException;
import io.fotoapparat.Fotoapparat;
import io.fotoapparat.result.PendingResult;
import io.fotoapparat.result.PhotoResult;
import io.fotoapparat.view.CameraView;
import kotlin.Unit;
public class CameraActivity extends AppCompatActivity {
private String m_current_photo_path;
private Fotoapparat fotoapparat;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
CameraView cameraView = findViewById(R.id.camera_view);
fotoapparat = new Fotoapparat(this, cameraView);
findViewById(R.id.take_photo_btn).setOnClickListener(v -> {
PhotoResult photoResult = fotoapparat.takePicture();
File photoFile = null;
try {
photoFile = Helper.createImageFile(this);
m_current_photo_path = photoFile.getAbsolutePath();
} catch (IOException ex) {
// Error occurred while creating the File
}
PendingResult<Unit> pendingResult = photoResult.saveToFile(photoFile);
pendingResult.whenDone(unit -> {
Intent returnIntent = new Intent();
returnIntent.putExtra("photo_path", m_current_photo_path);
setResult(Activity.RESULT_OK, returnIntent);
finish();
});
});
}
@Override
protected void onStart() {
super.onStart();
fotoapparat.start();
}
@Override
protected void onStop() {
super.onStop();
fotoapparat.stop();
}
}
| [
"[email protected]"
] | |
ef44a569bb16581ab6af79bd3dcad8fe2b35b5b2 | 76cc84817463d57da6ebfce3cc998b54f0ce608f | /src/Task03/Scanner_Practice.java | a3bdaec5c8c9b28f8a807230917f03215f51a2c7 | [] | no_license | IssB20/Day3-Repo | 0c19301b13ebcb51351f34440ec7d1e9e17a1bdc | 99bfb2966afe65307bd93bc2f94da23b16e14ed9 | refs/heads/main | 2023-01-04T23:14:05.231470 | 2020-10-31T14:55:14 | 2020-10-31T14:55:14 | 308,898,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package Task03;
import java.util.Scanner;
public class Scanner_Practice {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter your first number:");
int num1 = scan.nextInt();
System.out.println("enter you second number:");
int num2 = scan.nextInt();
int sum = num1+num2;
System.out.println( "you total is:"+sum);
}
}
| [
"[email protected]"
] | |
785013f80a756aa2d5847208afcaaebf40a8f813 | e25797fe32281f11f3f773ab72949d88b80291e6 | /src/controller/login.java | 7bbd1cacfca116b6dcd24a111f2d46cdbe9cf832 | [] | no_license | yylou15/Internet_plus | 807d8beb308a8aa6ae1b7dd14448a6dd985c8588 | edeac4fe3c041ececc2db586ae2098865914d448 | refs/heads/master | 2020-05-16T05:01:34.722003 | 2019-05-03T02:07:10 | 2019-05-03T02:07:10 | 182,799,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,579 | java | package controller;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class login {
@FXML
private TextField username;
@FXML
private TextField password;
@FXML
protected void loginButtonClick() throws Exception {
if(username.getText().equals("")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setContentText("请输入用户名");
alert.show();return;
}
if(password.getText().equals("")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setContentText("请输入密码");
alert.show();return;
}
if(username.getText().equals("admin") && password.getText().equals("123456")){
Parent root = FXMLLoader.load(getClass().getResource("../view/main.fxml"));
((Stage) username.getScene().getWindow()).hide();
Stage mainStage = new Stage();
mainStage.setScene(new Scene(root,1000,500));
mainStage.setTitle("此处为系统名称");
mainStage.show();
mainStage.setResizable(false);
// System.out.println("登录成功");
}else{
// System.out.println("登录失败");
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setContentText("用户名或密码错误,请重试!");
alert.show();
}
}
}
| [
"[email protected]"
] | |
e80109a0a4d096c0fee9040f91176265d553b525 | b8f3536f21400859ea8163963c27dc090b96a9bf | /src/Enums/CookingInstruction.java | 6b0653ce43347e8b2d9bd3b8e1474023068caaae | [] | no_license | Awesomium40/PizzaOrderingGUI | 2cd2738720a803df841c93d3e97e72fcf796e3d6 | 051c5bf7d5dfa041ef84da12928de1225576e4ff | refs/heads/main | 2023-06-20T11:37:27.016010 | 2021-07-14T02:41:27 | 2021-07-14T02:41:27 | 124,742,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | package Enums;
public enum CookingInstruction
{
NORMAL, LIGHT_BAKE, WELL_DONE;
private static final String[] names = {"Normal Bake", "Light Bake", "Well Done"};
public boolean isDefault()
{
return this.ordinal() == 0;
}
public String toString()
{
return names[this.ordinal()];
}
}
| [
"[email protected]"
] | |
798cde5205996caa33e4848617845dc04ee44321 | 29b7d5f853966195f2534514a79d1866b5f0881e | /src/main/java/com/example/pedidos/controller/dto/PedidoDto.java | b4236d6bbf0eb4ee0bb7bce4bb9f5a705926bbf0 | [] | no_license | ruhangon/spring-pedidos | c29aab47780ffbea25b2ba9dc02c1ba55652ba7f | ea658a8cb2dd51b0792f830ff99c2ce72cad7c5a | refs/heads/master | 2023-06-19T03:24:09.520305 | 2021-07-09T22:21:41 | 2021-07-09T22:21:41 | 382,085,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package com.example.pedidos.controller.dto;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
import com.example.pedidos.model.Pedido;
import lombok.Getter;
@Getter
public class PedidoDto {
private Long id;
private String nome;
private String descricao;
private String marca;
private LocalDate data;
public PedidoDto(Pedido pedido) {
this.id = pedido.getId();
this.nome = pedido.getNome();
this.descricao = pedido.getDescricao();
this.marca = pedido.getMarca();
this.data = pedido.getData();
}
public static List<PedidoDto> converter(List<Pedido> pedidos) {
return pedidos.stream().map(PedidoDto::new).collect(Collectors.toList());
}
}
| [
"[email protected]"
] | |
a8da1771b33960b64833693164f35a2c7b077fd8 | 632d577f4963a4ef4a857944f6d9a08b1df56091 | /Registration.java | 14a11109d0aafc998bb430d2086cc22244a4d25b | [] | no_license | shivaconceptsolution/JDBC-PREPARE-CALLABLE | b72aa9e19f4dbe2308bb7d7b57b9ac90cc77c512 | f51d4cc9d6e78245498b102f407ece711967d831 | refs/heads/main | 2023-03-28T14:55:59.482761 | 2021-03-24T05:41:07 | 2021-03-24T05:41:07 | 350,222,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | package scs;
import java.sql.*;
public class Registration {
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbcdemo","root","");
CallableStatement st = conn.prepareCall("{call insertreg(?,?,?,?)}");
st.setString(1,"mno123");
st.setString(2,"12345");
st.setString(3,"[email protected]");
st.setString(4,"7890123456");
int x = st.executeUpdate();
if(x!=0)
{
System.out.println("Reg successfull");
}
else
{
System.out.println("Reg not successfull");
}
conn.close();
}
}
| [
"[email protected]"
] | |
666df82dc8fd20fa16571ceecfd6fbffc6359ec3 | d977ad2b740b1bed5514810512d694acc0f95778 | /Module 2/src/_qly_Sdt/commons/FileUtils.java | 715a81c3276db6ae13bd129b8d1488e9fcc0ca80 | [] | no_license | quoctrung1012/C0720G1-TruongQuocTrung | 37385f3b81e02ffd014e408926ac5be17b928041 | 68de69a5126db4d591d6f97063d7eaaaff272596 | refs/heads/master | 2023-02-19T10:17:27.000968 | 2021-01-19T02:37:02 | 2021-01-19T02:37:02 | 282,783,074 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,315 | java | package _qly_Sdt.commons;
import _qly_Sdt.models.TelephoneDirectory;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class FileUtils {
static FileWriter fileWriter;
static BufferedWriter bufferedWriter;
static FileReader fileReader;
static BufferedReader bufferedReader;
public static void writeFile(String pathFile, List<String> listLine) {
try {
fileWriter = new FileWriter(pathFile);
bufferedWriter = new BufferedWriter(fileWriter);
for (String line : listLine) {
bufferedWriter.write(line);
bufferedWriter.newLine();
}
bufferedWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public static List<String> readAllFile(String pathFile) {
List<String> stringList = new ArrayList<>();
try {
fileReader = new FileReader(pathFile);
bufferedReader = new BufferedReader(fileReader);
String line;
while ((line = bufferedReader.readLine()) != null) {
stringList.add(line);
}
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return stringList;
}
}
| [
"[email protected] config --global user.name quoctrung1012"
] | [email protected] config --global user.name quoctrung1012 |
aaf882e544d27154cd9f86cb9065d771ed353280 | 5dc9c6735574f8167075232b261a596dd1b8607b | /session21/hitcounter/src/main/java/com/codegym/model/MyCounter.java | 35b37e79134553fff69aa8d6b327f3e8c507c715 | [] | no_license | rong9x/Module-2-Java-Web-Back-end | b258508655d3245648ea6729d8c59428a5c641c8 | 88e2957dda34b0dce6b3b5fa17a90e0afd133449 | refs/heads/master | 2022-12-22T11:49:09.752211 | 2019-07-30T07:41:19 | 2019-07-30T07:41:19 | 189,560,196 | 0 | 0 | null | 2022-12-16T10:24:09 | 2019-05-31T08:43:40 | Java | UTF-8 | Java | false | false | 392 | java | package com.codegym.model;
public class MyCounter {
private int count;
public MyCounter() {
}
public MyCounter(int count) {
this.count = count;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int increase() {
return count++;
}
}
| [
"[email protected]"
] | |
d929ec9956b736103a30cbe6a81ee724b8329dc3 | 4e409edb21bb1cd47b0d787cd6a03a8d9cf3f3d3 | /SummerProject/src/main/java/pages/Programs.java | 7f51941c3a98abb287c5bce8bb1fe0a8338325cb | [] | no_license | aman1310verma/TESTING-proj | 9aa14796632050b72db55c385c80b2d9c856d6c4 | 28ca8f7103aafb11eb2e01526b77ebaf1c8966fc | refs/heads/master | 2023-03-17T11:13:09.886333 | 2021-02-21T15:57:43 | 2021-02-21T15:57:43 | 340,939,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package pages;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class Programs {
WebDriver driver;
//Constructor that will be automatically called as soon as the object of the class is created
public Programs(WebDriver driver) {
this.driver=driver;
}
By lrnBtn = By.xpath("//a[@href='/programs/workshops/glimpses-for-kids-workshop/'][@class='button-w3layouts hvr-rectangle-out']");
By glimpsesPoster = By.xpath("//img[@src='/images/glimpses-poster.png']");
By mentorshipBtn = By.xpath("//li[@class='button-w3layouts hvr-rectangle-out tsf-button']//a[text()='Student Mentorship Program']");
By para = By.xpath("//div[@class='col-md-12 test-grid1']//p[@class='para-w3-agile']");
public void learnMore() {
driver.findElement(lrnBtn).click();
//Storing window handles in an array list
ArrayList<String> tabs = new ArrayList<String> (driver.getWindowHandles());
//Switching to the new tab
driver.switchTo().window(tabs.get(1));
//Checking if the expected image is present
boolean pstr = driver.findElement(glimpsesPoster).isDisplayed();
if(pstr=true) {
System.out.println("The poster is present and we are on Glimpses for kidz page.....");
}
else {
System.out.println("Looks like its not the page we were looking for!!!");
}
//Closing the tab
driver.close();
//Switching to the parent window
driver.switchTo().window(tabs.get(0));
}
public void mentorshipProgram() {
driver.findElement(mentorshipBtn).click();
System.out.println("The quote on the page is - "+driver.findElement(para).getText());
}
}
| [
"[email protected]"
] | |
b494f24246eb705c5cec191ad769b9711e8aabdb | 919cb1eb0e9b0cc8605f909764f018172bcb3063 | /app/src/main/java/com/example/toshiba/ternakku/ui/Startup.java | 2a6a715fc02f968c8f8d8b89037d7711d7012b6f | [] | no_license | asywalulfikri/ternakku | 94d668f4edbef85b3a88b38330e4e522fe7fb228 | 8f9a92fff22b7f9bdce69a54a0805567c6d0186b | refs/heads/master | 2016-08-12T03:15:28.712963 | 2015-12-28T03:21:52 | 2015-12-28T03:21:52 | 47,543,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,956 | java | package com.example.toshiba.ternakku.ui;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.widget.ProgressBar;
import com.example.toshiba.ternakku.R;
import com.example.toshiba.ternakku.helper.AlertDialogManager;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.http.HttpParameters;
public class Startup extends Activity {
// this for send message text using intent
public final static String EXTRA_MESSAGE = "lisa";
EditText etRequestToken;
String getToken, rawToken, tokenMessage;
ProgressBar pbStartup;
OAuthConsumer consumer;
AlertDialogManager alert = new AlertDialogManager();
@SuppressWarnings("unchecked")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.startup_layout);
etRequestToken = (EditText) findViewById(R.id.etRequestToken);
pbStartup = (ProgressBar) findViewById(R.id.pbStartup);
// Check Connection
if (isOnline()) {
new getToken().execute();
} else {
alert.showAlertDialog(Startup.this, "Error", "No Network Connection", false);
}
// This for move to Login Form
Thread timer = new Thread() {
public void run() {
try {
sleep(2000);
} catch (InterruptedException e) {
// TODO: handle exception
e.printStackTrace();
}finally {
Intent intent = new Intent(Startup.this, LoginActivity.class);
// String message = etRequestToken.getText().toString();
String message = tokenMessage;
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
};
timer.start();
}
@SuppressWarnings("rawtypes")
private class getToken extends AsyncTask {
@Override
protected Object doInBackground(Object... params) {
// TODO Auto-generated method stub
// HttpManager manage = new HttpManager();
try {
getRequestToken();
} catch (OAuthMessageSignerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthCommunicationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
// This for check Connection
protected boolean isOnline() {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
} else {
return false;
}
}
// This for get Request Token from REST API
private void getRequestToken() throws IOException,
OAuthMessageSignerException, OAuthExpectationFailedException,
OAuthCommunicationException {
final String uri = "https://accounts.8villages.com/oauth/request-token";
URL url = new URL(uri);
HttpURLConnection urlConnection = (HttpURLConnection) url
.openConnection();
urlConnection.setRequestProperty("Accept", "application/json");
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
consumer = new DefaultOAuthConsumer("Ha4MbCabE3XBlALPUMIz5P0EUE0.",
"Qr5cwJPq4pN0gil3SbmXLIsrYy_EpULHNa2bmpM9l0w.");
HttpParameters doubleEncodedParams = new HttpParameters();
doubleEncodedParams.put("realm", uri);
consumer.setAdditionalParameters(doubleEncodedParams);
consumer.sign(urlConnection);
try {
int rawCode = urlConnection.getResponseCode();
String statusCode = String.valueOf(rawCode);
Log.d("Status Code", statusCode);
InputStream in = new BufferedInputStream(
urlConnection.getInputStream());
@SuppressWarnings("resource")
String inputStreamString = new Scanner(in, "UTF-8").useDelimiter(
" ").next();
String[] temp = inputStreamString.split("&");
String tempToken = temp[0].toString();
rawToken = tempToken.substring(12, 40);
Log.d("request token", rawToken);
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
} finally {
urlConnection.disconnect();
}
// etRequestToken.setText(rawToken);
tokenMessage = rawToken;
}
// This for destroy app
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
finish();
}
}
| [
"[email protected]"
] | |
7a477ddfad68dde9a04c363eb6a6ea2b8a26f938 | ef57e360945d470583da667567b9befc3215ca80 | /Lorry-master/app/src/main/java/name/marinchenko/lorryvision/util/net/NetView.java | 2e2ff4921633b8e210e7e17de3a23cde4be2c565 | [] | no_license | drill2010/LorryVision | a0e34ed6b8129408496481c7fc6d9efb9d0ce6c9 | 35e14507939257e65851c2430768b81ce078fb00 | refs/heads/master | 2020-04-15T02:15:58.861164 | 2019-02-24T13:07:03 | 2019-02-24T13:07:03 | 164,308,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,747 | java | package name.marinchenko.lorryvision.util.net;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
/**
* NetView contains data for viewing in the networks list.
*/
public class NetView {
public static String BUNDLE_KEY_LIST_SSID = "bundle_key_list_ssid";
public static String BUNDLE_KEY_LIST_TYPE = "bundle_key_list_type";
public static String BUNDLE_KEY_LIST_WAS_DETACHED = "bundle_key_list_was_detached";
public static String BUNDLE_KEY_LIST_HIGHLIGHTED = "bundle_key_list_highlighted";
public static String BUNDLE_KEY_LIST_LEVEL = "bundle_key_list_level";
private final String ssid;
private final NetType type;
private final boolean wasDetached;
private final boolean highlighted;
private final int level;
public NetView(final String ssid,
final boolean type,
final boolean wasDetached,
final boolean highlighted,
final int level) {
this.ssid = ssid;
this.type = type ? NetType.lorryNetwork : NetType.wifiNetwork;
this.wasDetached = wasDetached;
this.highlighted = highlighted;
this.level = level;
}
public String getSsid() { return this.ssid; }
public NetType getType() { return this.type; }
public boolean wasDetached() { return this.wasDetached; }
public boolean getHighlighted() { return this.highlighted; }
public int getSignalIcon() {
if (this.level > -56) return 4;
else if (this.level > -67) return 3;
else if (this.level > -78) return 2;
else if (this.level > -89) return 1;
else return 0;
}
public static List<NetView> getNetViewList(final Bundle bundle) {
final ArrayList<NetView> netViews = new ArrayList<>();
final ArrayList<String> ssidList = bundle.getStringArrayList(BUNDLE_KEY_LIST_SSID);
final boolean typeArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_TYPE);
final boolean wasDetachedArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_WAS_DETACHED);
final boolean highlightedArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_HIGHLIGHTED);
final int levelArray[] = bundle.getIntArray(BUNDLE_KEY_LIST_LEVEL);
if (ssidList != null && typeArray != null && wasDetachedArray != null
&& highlightedArray != null && levelArray != null) {
for (int i = 0; i < ssidList.size(); i++) {
netViews.add(new NetView(
ssidList.get(i),
typeArray[i],
wasDetachedArray[i],
highlightedArray[i],
levelArray[i]
));
}
}
return netViews;
}
public static Bundle getBundle(final List<Net> nets) {
final Bundle bundle = new Bundle();
bundle.putStringArrayList(BUNDLE_KEY_LIST_SSID, getSsidList(nets));
bundle.putBooleanArray(BUNDLE_KEY_LIST_TYPE, getTypeArray(nets));
bundle.putBooleanArray(BUNDLE_KEY_LIST_WAS_DETACHED, getWasDetachedArray(nets));
bundle.putBooleanArray(BUNDLE_KEY_LIST_HIGHLIGHTED, getHighlightedArray(nets));
bundle.putIntArray(BUNDLE_KEY_LIST_LEVEL, getLevelArray(nets));
return bundle;
}
public static ArrayList<String> getSsidList(final List<Net> nets) {
final ArrayList<String> ssidList = new ArrayList<>();
for (Net net : nets) {
ssidList.add(net.getSsid());
}
return ssidList;
}
public static boolean[] getTypeArray(final List<Net> nets) {
final boolean typeArray[] = new boolean[nets.size()];
for (int i = 0; i < typeArray.length; i++) {
typeArray[i] = nets.get(i).getType() == NetType.lorryNetwork;
}
return typeArray;
}
public static boolean[] getWasDetachedArray(final List<Net> nets) {
final boolean wasDetachedArray[] = new boolean[nets.size()];
for (int i = 0; i < wasDetachedArray.length; i++) {
wasDetachedArray[i] = nets.get(i).wasDetached();
}
return wasDetachedArray;
}
public static boolean[] getHighlightedArray(final List<Net> nets) {
final boolean higlightedArray[] = new boolean[nets.size()];
for (int i = 0; i < higlightedArray.length; i++) {
higlightedArray[i] = nets.get(i).getHighlighted();
}
return higlightedArray;
}
public static int[] getLevelArray(final List<Net> nets) {
final int levelArray[] = new int[nets.size()];
for (int i = 0; i < levelArray.length; i++) {
levelArray[i] = nets.get(i).getLevel();
}
return levelArray;
}
}
| [
"[email protected]"
] | |
b5f36d5b59970d4626e4662239822ecf09a2d3dc | c5d93c0a4db767ba5333edf0b57767fa9b253f3c | /src/test/java/runners/ParallelRunner.java | 740a1f54b4e1ff74aa82e678ca3fab8453fc2c32 | [] | no_license | girijadeo/MRIautomation | b8c6729427dada26abd0b2a396fe31701fa2f08a | d26f78142df2d28905731106379486d8a4546ef3 | refs/heads/master | 2020-03-29T08:23:50.689956 | 2018-09-21T04:18:54 | 2018-09-21T04:18:54 | 149,709,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,827 | java | package runners;
import com.cognizant.Craft.DriverScript;
import com.cognizant.framework.selenium.*;
import com.cognizant.framework.FrameworkParameters;
/**
* Class to facilitate parallel execution of test scripts
* @author Cognizant
*/
class ParallelRunner implements Runnable {
private final SeleniumTestParameters testParameters;
private int testBatchStatus = 0;
/**
* Constructor to initialize the details of the test case to be executed
* @param testParameters The {@link SeleniumTestParameters} object (passed from the {@link Allocator})
*/
ParallelRunner(SeleniumTestParameters testParameters) {
super();
this.testParameters = testParameters;
}
/**
* Function to get the overall test batch status
* @return The test batch status (0 = Success, 1 = Failure)
*/
public int getTestBatchStatus() {
return testBatchStatus;
}
@Override
public void run() {
FrameworkParameters frameworkParameters = FrameworkParameters.getInstance();
String testReportName, executionTime, testStatus;
if(frameworkParameters.getStopExecution()) {
testReportName = "N/A";
executionTime = "N/A";
testStatus = "Aborted";
testBatchStatus = 1; // Non-zero outcome indicates failure
} else {
DriverScript driverScript = new DriverScript(this.testParameters);
driverScript.driveTestExecution();
testReportName = driverScript.getReportName();
executionTime = driverScript.getExecutionTime();
testStatus = driverScript.getTestStatus();
if ("failed".equalsIgnoreCase(testStatus)) {
testBatchStatus = 1; // Non-zero outcome indicates failure
}
}
ResultSummaryManager resultSummaryManager = ResultSummaryManager.getInstance();
resultSummaryManager.updateResultSummary(testParameters, testReportName,
executionTime, testStatus);
}
} | [
"[email protected]"
] | |
4e508e17bd26c890f56e957b818e5dc2dae53d61 | 578a45a81f619d07be0b8ac615e8f92abf7b93bf | /src/main/java/com/thoughtworks/model/Jail.java | aeca72c4a8fae1bd4404c5b5ac89d68ec73d38f6 | [] | no_license | nigamkartik96/monopoly | d9629c4d3a06b992a220e11d5812ff254d52173e | c63b3ac43f3c7d3c8d0bec0f40100c963789c9bb | refs/heads/master | 2020-09-03T17:37:18.620697 | 2019-11-04T14:40:03 | 2019-11-04T14:40:03 | 219,522,501 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | package com.thoughtworks.model;
import com.thoughtworks.constants.Constants;
import com.thoughtworks.game.Board;
public class Jail extends Cell {
@Override
public void doAction(Player player, Board board) {
if (player.getMoney().getAmount() < Constants.JAIL_FINE) {
player.subMoney(Constants.JAIL_FINE);
player.setCanContinue(false);
System.err.println(player.getName() + " went broke!");
} else {
System.out.println(player.getName() + " lost " + Constants.JAIL_FINE + " in Jail");
player.subMoney(Constants.JAIL_FINE);
board.addMoneyToBank(Constants.JAIL_FINE);
}
}
}
| [
"[email protected]"
] | |
6377eeff013acaf4fe858c0c1f5b781a2b90ee97 | 667129f3278213ebe621ff2c67b400755d294d62 | /aTalk/src/main/java/org/atalk/impl/neomedia/rtp/remotebitrateestimator/RemoteBitrateEstimatorAbsSendTime.java | 2941c3dac2b844d4193c5e30b977178134debbd1 | [
"Apache-2.0"
] | permissive | rutura/atalk-android | 6f196d85d4a431a73bb65778700c63d86c2e067b | b4705cecb64b8f8c41ae18e0e6ab0ba64e44580e | refs/heads/master | 2021-05-14T01:22:19.579096 | 2018-01-14T05:05:57 | 2018-01-14T05:05:57 | 116,563,805 | 1 | 0 | null | 2018-01-07T12:31:11 | 2018-01-07T12:31:11 | null | UTF-8 | Java | false | false | 26,509 | java | /*
* Copyright @ 2015 Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.atalk.impl.neomedia.rtp.remotebitrateestimator;
import org.ice4j.util.*;
import org.atalk.service.neomedia.rtp.*;
import org.atalk.util.Logger;
import java.util.*;
/**
* webrtc.org abs_send_time implementation as of June 26, 2017.
* commit ID: 23fbd2aa2c81d065b84d17b09b747e75672e1159
*
* @author Julian Chukwu
* @author George Politis
*/
public class RemoteBitrateEstimatorAbsSendTime implements RemoteBitrateEstimator
{
/**
* The <tt>Logger</tt> used by the
* <tt>RemoteBitrateEstimatorAbsSendTime</tt> class and its instances for
* logging output.
*/
private static final Logger logger
= Logger.getLogger(RemoteBitrateEstimatorAbsSendTime.class);
/**
* Defines the number of digits in the AST representation (24 bits, 6.18
* fixed point) after the radix.
*/
private final static int kAbsSendTimeFraction = 18;
/**
* Defines the upshift (left bit-shift) to apply to AST (24 bits, 6.18 fixed
* point) to make it inter-arrival compatible (expanded AST, 32 bits, 6.26
* fixed point).
*/
private final static int kAbsSendTimeInterArrivalUpshift = 8;
/**
* This is used in the {@link InterArrival} computations. In this estimator
* a timestamp group is defined as all packets with a timestamp which are at
* most 5ms older than the first timestamp in that group.
*/
private final static int kTimestampGroupLengthMs = 5;
/**
* Defines the number of digits in the expanded AST representation (32 bits,
* 6.26 fixed point) after the radix.
*/
private final static int kInterArrivalShift
= kAbsSendTimeFraction + kAbsSendTimeInterArrivalUpshift;
/**
* Converts the {@link #kTimestampGroupLengthMs} into "ticks" for use with
* the {@link InterArrival}.
*/
private static final long kTimestampGroupLengthTicks
= (kTimestampGroupLengthMs << kInterArrivalShift) / 1000;
/**
* Defines the expanded AST (32 bits) to millis conversion rate. Units are
* ms per timestamp
*/
private static final double
kTimestampToMs = (double) 1000 / (1 << kInterArrivalShift);
/**
* Defines the maximum distance between the send time delta (of a probe
* packet from the previous probe packet) and the cluster mean send time
* delta above which the probe is no longer considered part of the cluster.
*/
private final static float kMaxSendTimeDeltaMsDistance = 2.5f;
/**
* Defines the minimum size of a packet to be considered a probe. We
* currently assume that only packets larger than 200 bytes are paced by the
* sender.
*/
private final static long kMinProbePacketSize = 200;
/**
* Defines the initial probing period (in millis) after the first packet is
* received.
*/
private final static int kInitialProbingIntervalMs = 2000;
/**
* Defines the minimum cluster size for the cluster to be considered valid.
*/
private final static int kMinClusterSize = 4;
/**
* Defines the maximum number of probe packets.
*/
private final static int kMaxProbePackets = 15;
/**
* Defines the expected number of probe packets.
*/
private final static int kExpectedNumberOfProbes = 3;
/**
* Reduces the effects of allocations and garbage collection of the method
* {@code incomingPacket}.
*/
private final long[] deltas = new long[3];
/**
* Reduces the effects of allocations and garbage collection of the method
* {@link #incomingPacketInfo(long, long, int, long)}} by promoting the
* {@code RateControlInput} instance from a local variable to a field and
* reusing the same instance across method invocations. (Consequently, the
* default values used to initialize the field are of no importance because
* they will be overwritten before they are actually used.)
*/
private final RateControlInput input
= new RateControlInput(BandwidthUsage.kBwNormal, 0L, 0D);
/**
* The set of synchronization source identifiers (SSRCs) currently being
* received. Represents an unmodifiable copy/snapshot of the current keys of
* {@link #ssrcsMap} suitable for public access and introduced for
* the purposes of reducing the number of allocations and the effects of
* garbage collection.
*/
private Collection<Long> ssrcs
= Collections.unmodifiableList(Collections.EMPTY_LIST);
/**
* A map of SSRCs -> time first seen (in millis).
*/
private final Map<Long, Long> ssrcsMap = new TreeMap<>();
/**
* The list of probes that this instance has received.
*/
private final List<Probe> probes = new ArrayList<>();
/**
* The total number of probing packets we've seen so far.
*/
private long totalProbesReceived;
/**
* The time (in millis) when we saw the first packet. Useful to determine
* the probing period.
*/
private long firstPacketTimeMs;
/**
* Keeps track of the last time (in millis) that we updated the bitrate
* estimate.
*/
private long lastUpdateMs;
/**
* The observer to notify on bitrate estimation changes.
*/
private final RemoteBitrateObserver observer;
/**
* The rate control implementation based on additive increases of bitrate
* when no over-use is detected and multiplicative decreases when over-uses
* are detected.
*/
private final AimdRateControl remoteRate = new AimdRateControl();
/**
* Holds the {@link InterArrival}, {@link OveruseEstimator} and
* {@link OveruseDetector} instances of this RBE.
*/
private Detector detector;
/**
* Keeps track of how much data we're receiving.
*/
private RateStatistics incomingBitrate;
/**
* Determines whether or not the incoming bitrate is initialized or not.
*/
private boolean incomingBitrateInitialized;
/**
* Ctor.
*
* @param observer the observer to notify on bitrate estimation changes.
*/
public RemoteBitrateEstimatorAbsSendTime(RemoteBitrateObserver observer)
{
this.observer = observer;
this.incomingBitrate = new RateStatistics(kBitrateWindowMs, kBitrateScale);
this.incomingBitrateInitialized = false;
this.totalProbesReceived = 0;
this.firstPacketTimeMs = -1;
this.lastUpdateMs = -1;
}
/**
* Determines whether a {@link Probe} belongs to a cluster or not, by
* examining its send time delta distance from the cluster mean.
*
* @param sendDeltaMs the send time delta of the probe we examine (probe
* send time - previous probe send time).
* @param clusterAggregate the {@link Cluster} that aggregates the probes.
*
* @return true if the probe is within the cluster bounds, false otherwise.
*/
private static boolean isWithinClusterBounds(
long sendDeltaMs, Cluster clusterAggregate)
{
if (clusterAggregate.count == 0)
{
return true;
}
double clusterMean = clusterAggregate.meanSendDeltaMs /
(double) clusterAggregate.count;
return Math.abs(
(double) sendDeltaMs - clusterMean) < kMaxSendTimeDeltaMsDistance;
}
/**
* Finalizes the cluster (computes the means from the sums) and adds it to
* the clusters list.
*
* @param clusters the clusters list to add the cluster.
* @param cluster the cluster to finalize and add to the clusters list.
*/
private static void addCluster(List<Cluster> clusters, Cluster cluster)
{
cluster.meanSendDeltaMs /= (double) cluster.count;
cluster.meanRecvDeltaMs /= (double) cluster.count;
cluster.meanSize /= cluster.count;
clusters.add(cluster);
}
/**
* Computes the list of clusters from the list of probes.
*
* @param probes the list of probes
* @return the computed list of clusters.
*/
private static List<Cluster> computeClusters(List<Probe> probes)
{
List<Cluster> clusters = new ArrayList<>();
Cluster current = new Cluster();
long prevSendTime = -1;
long prevRecvTime = -1;
for (Probe probe : probes)
{
if (prevSendTime >= 0)
{
long sendDeltaMs = probe.sendTimeMs - prevSendTime;
long recvDeltaMs = probe.recvTimeMs - prevRecvTime;
if (sendDeltaMs >= 1 && recvDeltaMs >= 1)
{
++current.numAboveMinDelta;
}
if (!isWithinClusterBounds(sendDeltaMs, current))
{
if (current.count >= kMinClusterSize)
{
addCluster(clusters, current);
}
current = new Cluster();
}
current.meanSendDeltaMs += sendDeltaMs;
current.meanRecvDeltaMs += recvDeltaMs;
current.meanSize += probe.payloadSize;
++current.count;
}
prevSendTime = probe.sendTimeMs;
prevRecvTime = probe.recvTimeMs;
}
if (current.count >= kMinClusterSize)
{
addCluster(clusters, current);
}
return clusters;
}
/**
* Finds the probe cluster with the highest bitrate.
*
* @param clusters the list of clusters
* @return the cluster with the highest bitrate
*/
private static Cluster findBestProbe(List<Cluster> clusters)
{
long highestProbeBitrateBps = 0;
Cluster bestIt = new Cluster();
for (Cluster cluster : clusters)
{
if (cluster.meanSendDeltaMs == 0 || cluster.meanRecvDeltaMs == 0)
continue;
if (cluster.numAboveMinDelta > cluster.count / 2 &&
(cluster.meanRecvDeltaMs - cluster.meanSendDeltaMs <= 2.0f &&
cluster.meanSendDeltaMs - cluster.meanRecvDeltaMs <= 5.0f))
{
long probeBitrateBps = Math.min(
cluster.getSendBitrateBps(), cluster.getRecvBitrateBps());
if (probeBitrateBps > highestProbeBitrateBps)
{
highestProbeBitrateBps = probeBitrateBps;
bestIt = cluster;
}
}
else
{
double sendBitrateBps = cluster.meanSize * 8 * 1000
/ cluster.meanSendDeltaMs;
double recvBitrateBps = cluster.meanSize * 8 * 1000
/ cluster.meanRecvDeltaMs;
logger.warn("Probe failed, sent at " + sendBitrateBps
+ " bps, received at " + recvBitrateBps
+ " bps. Mean send delta: " + cluster.meanSendDeltaMs
+ " ms, mean recv delta: " + cluster.meanRecvDeltaMs
+ " ms, num probes: " + cluster.count);
break;
}
}
return bestIt;
}
/**
* Processes the received clusters and maybe updates the remote bitrate.
* It returns the processing result.
*
* @param nowMs the current time in millis.
*
* @return true if the remote bitrate was updated, false otherwise.
*/
private synchronized boolean processClusters(long nowMs)
{
List<Cluster> clusters = computeClusters(probes);
if (clusters.isEmpty())
{
// If we reach the max number of probe packets and still
// have no clusters, we will remove the oldest one.
if (probes.size() >= kMaxProbePackets)
{
probes.remove(0);
}
return false;
}
Cluster bestProbe = findBestProbe(clusters);
long probeBitrateBps = Math.min(
bestProbe.getSendBitrateBps(), bestProbe.getRecvBitrateBps());
// Make sure that a probe sent on a lower bitrate than our estimate
// can't reduce the estimate.
if (isBitrateImproving(probeBitrateBps))
{
logger.warn("Probe successful, sent at "
+ bestProbe.getSendBitrateBps() +
" bps, received at "
+ bestProbe.getRecvBitrateBps()
+ " bps. Mean send delta: " + bestProbe.meanSendDeltaMs
+ " ms, mean recv delta: " + bestProbe.meanRecvDeltaMs
+ " ms, num probes: " + bestProbe.count);
remoteRate.setEstimate(probeBitrateBps, nowMs);
return true;
}
// Not probing and received non-probe packet, or finished with current
// set of probes.
if (clusters.size() >= kExpectedNumberOfProbes)
{
probes.clear();
}
return false;
}
/**
* Determines whether or not the specified bitrate is an improvement over
* our current estimate.
*
* @param newBitrateBps the new bitrate to compare with our estimate.
*
* @return true if the bitrate is improving, false otherwise.
*/
private synchronized boolean isBitrateImproving(long newBitrateBps)
{
boolean initialProbe
= !remoteRate.isValidEstimate() && newBitrateBps > 0;
boolean bitrateAboveEstimate = remoteRate.isValidEstimate()
&& newBitrateBps > remoteRate.getLatestEstimate();
return initialProbe || bitrateAboveEstimate;
}
/**
* Notifies this instance of an incoming packet.
*
* @param arrivalTimeMs the arrival time of the packet in millis.
* @param sendTime24bits the send time of the packet in AST format
* (24 bits, 6.18 fixed point).
* @param payloadSize the payload size of the packet.
* @param ssrc the SSRC of the packet.
*/
@Override
public void incomingPacketInfo(
long arrivalTimeMs,
long sendTime24bits,
int payloadSize,
long ssrc)
{
if (logger.isTraceEnabled())
{
logger.trace("incoming_packet," + hashCode()
+ "," + arrivalTimeMs
+ "," + sendTime24bits
+ "," + payloadSize
+ "," + ssrc);
}
// Shift up send time to use the full 32 bits that inter_arrival
// works with, so wrapping works properly.
long timestamp = sendTime24bits << kAbsSendTimeInterArrivalUpshift;
// Convert the expanded AST (32 bits, 6.26 fixed point) to millis.
long sendTimeMs = (long) (timestamp * kTimestampToMs);
// XXX The arrival time should be the earliest we've seen this packet,
// not now. In our code however, we don't have access to the arrival
// time.
long nowMs = System.currentTimeMillis();
// should be broken out from here.
// Check if incoming bitrate estimate is valid, and if it
// needs to be reset.
long incomingBitrate_ = incomingBitrate.getRate(arrivalTimeMs);
if (incomingBitrate_ != 0)
{
incomingBitrateInitialized = true;
}
else if (incomingBitrateInitialized)
{
// Incoming bitrate had a previous valid value, but now not
// enough data point are left within the current window.
// Reset incoming bitrate estimator so that the window
// size will only contain new data points.
incomingBitrate = new RateStatistics(kBitrateWindowMs, kBitrateScale);
incomingBitrateInitialized = false;
}
incomingBitrate.update(payloadSize, arrivalTimeMs);
if (firstPacketTimeMs == -1)
{
firstPacketTimeMs = nowMs;
}
boolean updateEstimate = false;
long targetBitrateBps = 0;
synchronized (this)
{
timeoutStreams(nowMs);
ssrcsMap.put(ssrc, nowMs);
if (!ssrcs.contains(ssrc))
{
ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet());
}
// For now only try to detect probes while we don't have a valid
// estimate.
if (payloadSize > kMinProbePacketSize &&
(!remoteRate.isValidEstimate() ||
nowMs - firstPacketTimeMs < kInitialProbingIntervalMs))
{
if (totalProbesReceived < kMaxProbePackets)
{
long sendDeltaMs = -1;
long recvDeltaMs = -1;
if (!probes.isEmpty())
{
sendDeltaMs = sendTimeMs - probes.get(probes.size() - 1).sendTimeMs;
recvDeltaMs = arrivalTimeMs - probes.get(probes.size() - 1).recvTimeMs;
}
logger.warn("Probe packet received: send time="
+ sendTimeMs
+ " ms, recv time=" + arrivalTimeMs
+ " ms, send delta=" + sendDeltaMs
+ " ms, recv delta=" + recvDeltaMs + " ms.");
}
probes.add(
new Probe(sendTimeMs, arrivalTimeMs, payloadSize));
++totalProbesReceived;
// Make sure that a probe which updated the bitrate immediately
// has an effect by calling the
// OnReceiveBitrateChanged callback.
if (processClusters(nowMs))
{
updateEstimate = true;
}
}
long[] deltas = this.deltas;
/* long timestampDelta */ deltas[0] = 0;
/* long timeDelta */ deltas[1] = 0;
/* int sizeDelta */ deltas[2] = 0;
if (detector == null)
{
detector = new Detector(new OverUseDetectorOptions(), true);
if (logger.isTraceEnabled())
{
logger.trace("new_detector," + hashCode()
+ "," + remoteRate.hashCode()
+ "," + detector.detector.hashCode()
+ "," + detector.estimator.hashCode()
+ "," + detector.interArrival.hashCode());
}
}
if (detector.interArrival.computeDeltas(
timestamp, arrivalTimeMs, payloadSize, deltas, nowMs))
{
double tsDeltaMs = deltas[0] * kTimestampToMs;
detector.estimator.update(
/* timeDelta */ deltas[1],
/* timestampDelta */ tsDeltaMs,
/* sizeDelta */ (int) deltas[2],
detector.detector.getState(), nowMs);
detector.detector.detect(
detector.estimator.getOffset(), tsDeltaMs,
detector.estimator.getNumOfDeltas(), arrivalTimeMs);
}
if (!updateEstimate)
{
// Check if it's time for a periodic update or if we
// should update because of an over-use.
if (lastUpdateMs == -1
|| nowMs - lastUpdateMs > remoteRate.getFeedBackInterval())
{
updateEstimate = true;
}
else if (
detector.detector.getState() == BandwidthUsage.kBwOverusing)
{
long incomingRate_ = incomingBitrate.getRate(arrivalTimeMs);
if (incomingRate_ > 0 && remoteRate
.isTimeToReduceFurther(nowMs, incomingBitrate_))
{
updateEstimate = true;
}
}
}
if (updateEstimate)
{
// The first overuse should immediately trigger a new estimate.
// We also have to update the estimate immediately if we are
// overusing and the target bitrate is too high compared to
// what we are receiving.
input.bwState = detector.detector.getState();
input.incomingBitRate = incomingBitrate.getRate(arrivalTimeMs);
input.noiseVar = detector.estimator.getVarNoise();
remoteRate.update(input, nowMs);
targetBitrateBps = remoteRate.updateBandwidthEstimate(nowMs);
updateEstimate = remoteRate.isValidEstimate();
}
}
if (updateEstimate)
{
lastUpdateMs = nowMs;
if (observer != null)
{
observer.onReceiveBitrateChanged(getSsrcs(), targetBitrateBps);
}
}
}
/**
* Timeouts SSRCs that have not received any data for
* kTimestampGroupLengthMs millis.
*
* @param nowMs the current time in millis.
*/
private synchronized void timeoutStreams(long nowMs)
{
boolean removed = false;
Iterator<Map.Entry<Long, Long>> itr = ssrcsMap.entrySet().iterator();
while (itr.hasNext())
{
Map.Entry<Long, Long> entry = itr.next();
if ((nowMs - entry.getValue() > kStreamTimeOutMs))
{
removed = true;
itr.remove();
}
}
if (removed)
{
ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet());
}
if (detector != null && ssrcsMap.isEmpty())
{
// We can't update the estimate if we don't have any active streams.
detector = null;
// We deliberately don't reset the first_packet_time_ms_
// here for now since we only probe for bandwidth in the
// beginning of a call right now.
}
}
/**
* {@inheritDoc}
*/
@Override
public synchronized void onRttUpdate(long avgRttMs, long maxRttMs)
{
remoteRate.setRtt(avgRttMs);
}
/**
* {@inheritDoc}
*/
@Override
public synchronized long getLatestEstimate()
{
long bitrateBps;
if (!remoteRate.isValidEstimate())
{
return -1;
}
if (ssrcsMap.isEmpty())
{
bitrateBps = 0;
}
else
{
bitrateBps = remoteRate.getLatestEstimate();
}
return bitrateBps;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<Long> getSsrcs()
{
return ssrcs;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized void removeStream(long ssrc)
{
if (ssrcsMap.remove(ssrc) != null)
{
ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet());
}
}
/**
* {@inheritDoc}
*/
@Override
public synchronized void setMinBitrate(int minBitrateBps)
{
// Called from both the configuration thread and the network thread.
// Shouldn't be called from the network thread in the future.
remoteRate.setMinBitrate(minBitrateBps);
}
/**
* Keeps meta information about a cluster of probes.
*/
private static class Cluster
{
double meanSendDeltaMs = 0L;
double meanRecvDeltaMs = 0L;
int meanSize = 0;
int count = 0;
int numAboveMinDelta = 0;
Cluster() {
}
long getSendBitrateBps()
{
//RTC_CHECK_GT(this.meanSendDeltaMs, 0.0f);
return (long) (this.meanSize * 8 * 1000 / meanSendDeltaMs);
}
long getRecvBitrateBps()
{
// RTC_CHECK_GT(this.meanRecvDeltaMs, 0.0f);
return (long) (this.meanSize * 8 * 1000 / this.meanRecvDeltaMs);
}
}
/**
* Keeps meta information about a probe packet.
*/
private class Probe
{
long sendTimeMs = -1L;
long recvTimeMs = -1L;
long payloadSize = 0;
Probe(long sendTimeMs, long recvTimeMs, long payloadSize)
{
this.sendTimeMs = sendTimeMs;
this.recvTimeMs = recvTimeMs;
this.payloadSize = payloadSize;
}
}
/**
* Holds the {@link InterArrival}, {@link OveruseEstimator} and
* {@link OveruseDetector} instances that estimate the remote bitrate of a
* stream.
*/
private static class Detector
{
/**
* Computes the send-time and recv-time deltas to feed to the estimator.
*/
private InterArrival interArrival;
/**
* The Kalman filter implementation that estimates the jitter.
*/
private OveruseEstimator estimator;
/**
* The overuse detector that compares the jitter to an adaptive threshold.
*/
private final OveruseDetector detector;
/**
* Ctor.
*
* @param options
* @param enableBurstGrouping
*/
public Detector(OverUseDetectorOptions options,
boolean enableBurstGrouping)
{
this.interArrival = new InterArrival(
kTimestampGroupLengthTicks, kTimestampToMs, enableBurstGrouping);
this.estimator = new OveruseEstimator(options);
this.detector = new OveruseDetector(options);
}
}
/**
* Converts rtp timestamps to 24bit timestamp equivalence
* @param timeMs is the RTP timestamp e.g System.currentTimeMillis().
* @return time stamp representation in 24 bit representation.
*/
public static long convertMsTo24Bits(long timeMs)
{
return (((timeMs << kAbsSendTimeFraction) + 500) / 1000) & 0x00FFFFFF;
}
}
| [
"[email protected]"
] | |
629fb4fee87cc4d8cb3dbf57516d04dcb04fcfaf | dd01522057d622e942cc7c9058cbca61377679aa | /hybris/bin/platform/bootstrap/gensrc/de/hybris/platform/acceleratorservices/data/RequestContextData.java | 8707071e4001def71b524714a83db83a816acc4b | [] | no_license | grunya404/bp-core-6.3 | 7d73db4db81015e4ae69eeffd43730f564e17679 | 9bc11bc514bd0c35d7757a9e949af89b84be634f | refs/heads/master | 2021-05-19T11:32:39.663520 | 2017-09-01T11:36:21 | 2017-09-01T11:36:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,065 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN!
* --- Generated at 25 Aug 2017 4:31:24 PM
* ----------------------------------------------------------------
*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*/
package de.hybris.platform.acceleratorservices.data;
import de.hybris.platform.category.model.CategoryModel;
import de.hybris.platform.commerceservices.search.pagedata.SearchPageData;
import de.hybris.platform.core.model.product.ProductModel;
/**
* Holds context data for rendering the current request
*/
public class RequestContextData implements java.io.Serializable
{
/** <i>Generated property</i> for <code>RequestContextData.product</code> property defined at extension <code>acceleratorcms</code>. */
private ProductModel product;
/** <i>Generated property</i> for <code>RequestContextData.category</code> property defined at extension <code>acceleratorcms</code>. */
private CategoryModel category;
/** <i>Generated property</i> for <code>RequestContextData.search</code> property defined at extension <code>acceleratorcms</code>. */
private SearchPageData search;
public RequestContextData()
{
// default constructor
}
public void setProduct(final ProductModel product)
{
this.product = product;
}
public ProductModel getProduct()
{
return product;
}
public void setCategory(final CategoryModel category)
{
this.category = category;
}
public CategoryModel getCategory()
{
return category;
}
public void setSearch(final SearchPageData search)
{
this.search = search;
}
public SearchPageData getSearch()
{
return search;
}
} | [
"[email protected]"
] | |
a9c2d26dc86e9fb6723b44056e2d60324cfc7bcc | f85f9ca71ccb631bba986635ba31439146c86faf | /P3_Patrones_Java/src/main/java/ec/edu/ups/Expression.java | bdc50bf2f9e314d73b02fa3c9c6701c3e99a6beb | [] | no_license | Jhon14DEA/P1_ProgramacionGenerica | 93f63a6857a74cb8b13100fb364c1e1f11bf4f6e | 4aa5feec43ddf2a2ff431edd2963e7a68be7e325 | refs/heads/master | 2023-01-24T16:07:48.326216 | 2020-12-04T00:21:41 | 2020-12-04T00:21:41 | 312,735,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | 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 ec.edu.ups;
/**
*
* @author ASUS
*/
public abstract class Expression {
public abstract String one();
public abstract String four();
public abstract String five();
public abstract String nine();
public abstract int multiplier();
public void interpreter(Context context){
if (context.entrada.startsWith(nine())) {
context.salida += 9*multiplier();
context.entrada = context.entrada.substring(2);
} else if (context.entrada.startsWith(four())){
context.salida += (4*multiplier());
context.entrada = context.entrada.substring(2);
}else if( context.entrada.startsWith(five())){
context.salida += 5* multiplier();
context.entrada = context.entrada.substring(1);
}while (context.entrada.startsWith(one())){
context.salida += 1*multiplier();
context.entrada = context.entrada.substring(1);
}
}
}
| [
"[email protected]"
] | |
bb3b0c7f74cd528b026f5d32889e653fffb30fee | 439e0946983d314ed674ffec4e6a1e55a32d9bde | /app/src/main/java/com/digital/assignment/ValueFormatter.java | 26299bde28a85136cb2e8ebc1efeee5a26c5e2c7 | [] | no_license | MehmoodU-stratagile/ili.assignment | ed842f6dd7ab1c84e2a6a07c99eb91f07d695d2c | f0dc96e0f9b6cd30fb309b7e5ebd589b73494126 | refs/heads/main | 2023-03-01T09:23:30.065940 | 2021-02-12T07:51:44 | 2021-02-12T07:51:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,850 | java | package com.digital.assignment;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.data.BubbleEntry;
import com.github.mikephil.charting.data.CandleEntry;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.PieEntry;
import com.github.mikephil.charting.data.RadarEntry;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.formatter.IValueFormatter;
import com.github.mikephil.charting.utils.ViewPortHandler;
public abstract class ValueFormatter implements IAxisValueFormatter, IValueFormatter {
/**
* <b>DO NOT USE</b>, only for backwards compatibility and will be removed in future versions.
*
* @param value the value to be formatted
* @param axis the axis the value belongs to
* @return formatted string label
*/
@Override
@Deprecated
public String getFormattedValue(float value, AxisBase axis) {
return getFormattedValue(value);
}
/**
* <b>DO NOT USE</b>, only for backwards compatibility and will be removed in future versions.
* @param value the value to be formatted
* @param entry the entry the value belongs to - in e.g. BarChart, this is of class BarEntry
* @param dataSetIndex the index of the DataSet the entry in focus belongs to
* @param viewPortHandler provides information about the current chart state (scale, translation, ...)
* @return formatted string label
*/
@Override
@Deprecated
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
return getFormattedValue(value);
}
/**
* Called when drawing any label, used to change numbers into formatted strings.
*
* @param value float to be formatted
* @return formatted string label
*/
public String getFormattedValue(float value) {
return String.valueOf(value);
}
/**
* Used to draw axis labels, calls {@link #getFormattedValue(float)} by default.
*
* @param value float to be formatted
* @param axis axis being labeled
* @return formatted string label
*/
public String getAxisLabel(float value, AxisBase axis) {
return getFormattedValue(value);
}
/**
* Used to draw bar labels, calls {@link #getFormattedValue(float)} by default.
*
* @param barEntry bar being labeled
* @return formatted string label
*/
public String getBarLabel(BarEntry barEntry) {
return getFormattedValue(barEntry.getY());
}
/**
* Used to draw stacked bar labels, calls {@link #getFormattedValue(float)} by default.
*
* @param value current value to be formatted
* @param stackedEntry stacked entry being labeled, contains all Y values
* @return formatted string label
*/
public String getBarStackedLabel(float value, BarEntry stackedEntry) {
return getFormattedValue(value);
}
/**
* Used to draw line and scatter labels, calls {@link #getFormattedValue(float)} by default.
*
* @param entry point being labeled, contains X value
* @return formatted string label
*/
public String getPointLabel(Entry entry) {
return getFormattedValue(entry.getY());
}
/**
* Used to draw pie value labels, calls {@link #getFormattedValue(float)} by default.
*
* @param value float to be formatted, may have been converted to percentage
* @param pieEntry slice being labeled, contains original, non-percentage Y value
* @return formatted string label
*/
public String getPieLabel(float value, PieEntry pieEntry) {
return getFormattedValue(value);
}
/**
* Used to draw radar value labels, calls {@link #getFormattedValue(float)} by default.
*
* @param radarEntry entry being labeled
* @return formatted string label
*/
public String getRadarLabel(RadarEntry radarEntry) {
return getFormattedValue(radarEntry.getY());
}
/**
* Used to draw bubble size labels, calls {@link #getFormattedValue(float)} by default.
*
* @param bubbleEntry bubble being labeled, also contains X and Y values
* @return formatted string label
*/
public String getBubbleLabel(BubbleEntry bubbleEntry) {
return getFormattedValue(bubbleEntry.getSize());
}
/**
* Used to draw high labels, calls {@link #getFormattedValue(float)} by default.
*
* @param candleEntry candlestick being labeled
* @return formatted string label
*/
public String getCandleLabel(CandleEntry candleEntry) {
return getFormattedValue(candleEntry.getHigh());
}
}
| [
"[email protected]"
] | |
0bc3edbde77d1bde3ea5a3c8cbecfed58dfbf378 | 8b656bbb29caa5a9538e9932d36c8267bd4af221 | /GroupProject1/test/HareTest.java | c725bbe129c26176ff6918206ddbcea887bbbadb | [] | no_license | croznik/programmingskills2 | 90416599502db24311645d6524da331718679294 | 9af19e4faafebd70afb0163bd5582c820d6b3039 | refs/heads/master | 2021-03-12T20:40:52.942288 | 2014-11-07T13:36:03 | 2014-11-07T13:36:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,074 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testing;
import groupproject.*;
import org.junit.*;
import static org.junit.Assert.*;
/**
*
* @author Main
*/
public class HareTest {
private Hare hare = new Hare();
private static double TOLERANCE = 1e-10;
@Test
public void testIsPrey(){
assertEquals("Test hare is prey", false, hare.isPredator());
}
@Test
public void testDefaultBirthRate(){
assertEquals("Test Default birth rate is 0.08",0.08,hare.getBirthRate(),TOLERANCE);
}
@Test
public void testDefaultDiffusionRate(){
assertEquals("Test Default diffusion rate is 0.2",0.2,hare.getDiffusionRate(),TOLERANCE);
}
@Test
public void testDefaultMortalityRate(){
assertEquals("Test default mortality rate is 0.00",0.00,hare.getMortalityRate(),TOLERANCE);
}
@Test
public void testDefaultPredationRate(){
assertEquals("Test default predation rate is 0.00 ",0.00,hare.getPredationRate(),TOLERANCE);
}
} | [
"Main@main-Satellite-C660.(none)"
] | Main@main-Satellite-C660.(none) |
496eaae2551c71576d1898d83efea13ecdf6a84c | fbcc22b603fdcfff37dfdf4da4c69b0096a44fa3 | /springboot/SpringBoot-shiro/SpringBoot-Shiro-Vue/back/src/main/java/com/heeexy/example/config/exception/GlobalExceptionHandler.java | 1b671326cee275e65c79361e72f32a253e2d1f27 | [] | no_license | chunchengmeigui/dalyNote | 0d4b40866ce142ec915f9aadb587f79bafe96b3a | deb9a4a634952d05e4a5a34bebc8cc51294a70b6 | refs/heads/master | 2021-06-15T07:10:48.307819 | 2021-04-23T09:54:03 | 2021-04-23T09:54:03 | 175,994,544 | 3 | 0 | null | 2020-12-14T15:45:13 | 2019-03-16T16:13:05 | Java | UTF-8 | Java | false | false | 3,064 | java | package com.heeexy.example.config.exception;
import com.alibaba.fastjson.JSONObject;
import com.heeexy.example.util.CommonUtil;
import com.heeexy.example.util.constants.ErrorEnum;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* @author: hxy
* @description: 统一异常拦截
* @date: 2017/10/24 10:31
*/
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {
private Logger logger = LoggerFactory.getLogger(this.getClass().getName());
@ExceptionHandler(value = Exception.class)
public JSONObject defaultErrorHandler(HttpServletRequest req, Exception e) {
String errorPosition = "";
//如果错误堆栈信息存在
if (e.getStackTrace().length > 0) {
StackTraceElement element = e.getStackTrace()[0];
String fileName = element.getFileName() == null ? "未找到错误文件" : element.getFileName();
int lineNumber = element.getLineNumber();
errorPosition = fileName + ":" + lineNumber;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", ErrorEnum.E_400.getErrorCode());
jsonObject.put("msg", ErrorEnum.E_400.getErrorMsg());
JSONObject errorObject = new JSONObject();
errorObject.put("errorLocation", e.toString() + " 错误位置:" + errorPosition);
jsonObject.put("info", errorObject);
logger.error("异常", e);
return jsonObject;
}
/**
* GET/POST请求方法错误的拦截器
* 因为开发时可能比较常见,而且发生在进入controller之前,上面的拦截器拦截不到这个错误
* 所以定义了这个拦截器
*/
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public JSONObject httpRequestMethodHandler() {
return CommonUtil.errorJson(ErrorEnum.E_500);
}
/**
* 本系统自定义错误的拦截器
* 拦截到此错误之后,就返回这个类里面的json给前端
* 常见使用场景是参数校验失败,抛出此错,返回错误信息给前端
*/
@ExceptionHandler(CommonJsonException.class)
public JSONObject commonJsonExceptionHandler(CommonJsonException commonJsonException) {
return commonJsonException.getResultJson();
}
/**
* 权限不足报错拦截
*/
@ExceptionHandler(UnauthorizedException.class)
public JSONObject unauthorizedExceptionHandler() {
return CommonUtil.errorJson(ErrorEnum.E_502);
}
/**
* 未登录报错拦截
* 在请求需要权限的接口,而连登录都还没登录的时候,会报此错
*/
@ExceptionHandler(UnauthenticatedException.class)
public JSONObject unauthenticatedException() {
return CommonUtil.errorJson(ErrorEnum.E_20011);
}
}
| [
"d903321643"
] | d903321643 |
1207cf96b4725dfc84f584d68d5123df86be89ae | c6341ffd87bb65eba6ad0bd60e17b959a0cd7469 | /src/test/java/com/chocol/arithmetic/aug2021/Day8Test.java | 3ccbf14aa9ad66fa69f5ec946b69bd9c5040e634 | [] | no_license | MrChocol/arithmetic-upgrade | 34cdaa85ee28141e2c31a26d527f9034175a12fa | dac9170adda3117923d081e321c7590d8f651ce4 | refs/heads/master | 2023-08-01T05:38:20.566556 | 2021-09-27T14:46:20 | 2021-09-27T14:46:20 | 374,708,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,806 | java | package com.chocol.arithmetic.aug2021;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
/**
* Description:
*
* @author 陈力
* @date 2021/6/8
* @since
*/
@SpringBootTest
public class Day8Test {
@Test
public void test01() {
int[] nums = {1, 3, 5, 7, 9};
int result = numberOfArithmeticSlices(nums);
assert result == 6;
}
/**
* 如果一个数列 至少有三个元素 ,并且任意两个相邻元素之差相同,则称该数列为等差数列。
*
* 例如,[1,3,5,7,9]、[7,7,7,7] 和 [3,-1,-5,-9] 都是等差数列。 给你一个整数数组 nums ,返回数组 nums 中所有为等差数组的 子数组 个数。
*
* 子数组 是数组中的一个连续序列。
*
*
* 定义状态:dp[i]表示从nums[0]到nums[i]且以nums[i]为结尾的等差数列子数组的数量。
*
* 状态转移方程:dp[i] = dp[i-1]+1 if nums[i]-nums[i-1]==nums[i-1]-nums[i-2] else 0
*
* 解释:如果nums[i]能和nums[i-1]nums[i-2]组成等差数列,则以nums[i-1]结尾的等差数列均可以nums[i]结尾,且多了一个新等差数列[nums[i],nums[i-1],nums[i-2]]
*
* @param nums
* @return
*/
public int numberOfArithmeticSlices(int[] nums) {
if (nums == null || nums.length < 3) {
return 0;
}
int[] memo = new int[nums.length];
if (nums[0] - nums[1] == nums[1] - nums[2]) {
memo[2] = 1;
}
int res = memo[2];
for (int i = 3; i < nums.length; i++) {
if (nums[i - 2] - nums[i - 1] == nums[i - 1] - nums[i]) {
memo[i] = memo[i - 1] + 1;
}
res += memo[i];
}
return res;
}
}
| [
"[email protected]"
] | |
5a304ba707dea4761bca6553de95e760e4b7cc58 | c6de84d4fa400856bc1420cc1269024b97eb4fa0 | /dynamic_programming/LongestCommonSubsequence.java | b6a123e4677307ad0422674e27189112d5ee02c5 | [] | no_license | princewillzz/algorithms_and_data_structures | 1ce662546f550c696485398d3a7058ed83b91925 | abb3d6daef91bbb208885fa831d3eb768a8b8aa8 | refs/heads/master | 2021-10-08T04:15:01.676592 | 2021-10-03T11:27:46 | 2021-10-03T11:27:46 | 253,177,833 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,391 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class LongestCommonSubsequence {
public static void main(String argv[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine().trim();
String str2 = br.readLine().trim();
System.out.println(
solve(str, str.length(), str2, str2.length(), new Integer[str.length() + 1][str2.length() + 1]));
System.out.println(bottomUp(str, str2));
}
static String string = new String();
static int bottomUp(String s1, String s2) {
int memo[][] = new int[s1.length() + 1][s2.length() + 1];
for (int i = 0; i < memo.length; i++) {
for (int j = 0; j < memo[i].length; j++) {
if (i == 0 || j == 0) {
memo[i][j] = 0;
} else {
if (s1.charAt(i - 1) == s2.charAt(j - 1)) {
memo[i][j] = memo[i - 1][j - 1] + 1;
} else {
memo[i][j] = Math.max(memo[i - 1][j], memo[i][j - 1]);
}
}
}
}
String s = "";
StringBuilder st = new StringBuilder();
int row = s1.length(), col = s2.length();
while (row > 0 && col > 0) {
if (s1.charAt(row - 1) == s2.charAt(col - 1)) {
s = s1.charAt(row - 1) + s;
st.append(s1.charAt(row - 1));
row--;
col--;
} else {
if (memo[row - 1][col] > memo[row][col - 1]) {
row--;
} else
col--;
}
}
System.out.println(s);
System.out.println(st.reverse());
return memo[s1.length()][s2.length()];
}
static int solve(String s1, int n1, String s2, int n2, Integer memo[][]) {
if (n1 == 0 || n2 == 0)
return 0;
if (memo[n1][n2] != null)
return memo[n1][n2];
if (s1.charAt(n1 - 1) == s2.charAt(n2 - 1)) {
memo[n1][n2] = solve(s1, n1 - 1, s2, n2 - 1, memo) + 1;
} else {
memo[n1][n2] = Math.max(solve(s1, n1 - 1, s2, n2, memo), solve(s1, n1, s2, n2 - 1, memo));
}
return memo[n1][n2];
}
} | [
"[email protected]"
] | |
fd90f648bb782b36e03acc6e8e5c63ae49d961b8 | 3fbe8559e6690c360c4948521170df29a771c095 | /SLA/src/main/java/com/inapp/cms/utils/RandomString.java | eda4403705e0d90afd0e8c549e783ba06a4a7721 | [] | no_license | cibye221b/SLA | b6ddf25b7f5fa8d72b6ea2b2e06d4068e0af2132 | 624468806873e324546b5c2cb1670ea33d412a6e | refs/heads/master | 2020-12-11T03:38:30.447001 | 2016-09-03T10:21:07 | 2016-09-03T10:21:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | java | package com.inapp.cms.utils;
/**
* @author Jinesh George
*/
import java.util.Random;
public class RandomString {
private static char[] symbols;
static {
StringBuilder tmp = new StringBuilder();
for (char ch = '0'; ch <= '9'; ++ch)
tmp.append(ch);
for (char ch = 'a'; ch <= 'z'; ++ch)
tmp.append(ch);
symbols = tmp.toString().toCharArray();
}
private final Random random = new Random();
private final char[] buf;
public RandomString(int length) {
if (length < 1)
throw new IllegalArgumentException("length < 1: " + length);
buf = new char[length];
}
public String nextString() {
for (int idx = 0; idx < buf.length; ++idx)
buf[idx] = symbols[random.nextInt(symbols.length)];
return new String(buf);
}
} | [
"[email protected]"
] | |
49cb643999df005228f462b1d8dda2055bde584f | 0fbd372915d09df44cf65271beae89a97d2fcdf2 | /src/main/java/com/hermes/infrastructure/dataaccess/services/CargoServiceImpl.java | 0c26522c83358a2bd870e60e09beea4c4270f0f1 | [] | no_license | netcrackerschool/hermes | 799811ff882ae857e707a4aab829d04fcb2b8daa | 381bec35232c8ac6962b12884d40f552392ceb1c | refs/heads/master | 2021-08-08T04:24:54.086142 | 2017-11-09T15:22:48 | 2017-11-09T15:22:48 | 110,107,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.hermes.infrastructure.dataaccess.services;
import com.hermes.domain.cargo.AbstractCargo;
/**
* 05.10.15.
*/
public class CargoServiceImpl extends GenericServiceImpl<AbstractCargo> implements CargoService {
public CargoServiceImpl(GenericRepository<AbstractCargo> repository) {
super(repository);
}
}
| [
"[email protected]"
] | |
cf9e38356cdc9bb2d5cf3bc6f5c3dedf6e532a84 | 19f7e40c448029530d191a262e5215571382bf9f | /decompiled/instagram/sources/p000X/DD9.java | b81edb45a2f6db7c41d9296c77926e31a87b0d3e | [] | no_license | stanvanrooy/decompiled-instagram | c1fb553c52e98fd82784a3a8a17abab43b0f52eb | 3091a40af7accf6c0a80b9dda608471d503c4d78 | refs/heads/master | 2022-12-07T22:31:43.155086 | 2020-08-26T03:42:04 | 2020-08-26T03:42:04 | 283,347,288 | 18 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,393 | java | package p000X;
import com.facebook.react.uimanager.BaseViewManager;
import java.nio.ByteBuffer;
/* renamed from: X.DD9 */
public final class DD9 extends DDK implements C29869DEe {
public final void ABR(ByteBuffer byteBuffer, int i) {
int A00 = DD3.A00(byteBuffer, i, 0);
if (A00 != 0) {
byteBuffer.getInt(A00);
}
DDP ddp = (DDP) DD3.A02(byteBuffer, i, 1, DDP.class);
if (ddp != null) {
this.A03 = ddp;
float f = BaseViewManager.CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER;
int A002 = DD3.A00(byteBuffer, i, 2);
if (A002 != 0) {
f = byteBuffer.getFloat(A002);
}
this.A01 = f;
float f2 = BaseViewManager.CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER;
int A003 = DD3.A00(byteBuffer, i, 3);
if (A003 != 0) {
f2 = byteBuffer.getFloat(A003);
}
this.A00 = f2;
C29846DDh dDh = (C29846DDh) DD3.A01(byteBuffer, i, 4, C29845DDg.class);
if (dDh != null) {
this.A02 = dDh;
this.A04 = (C29877DEm[]) DD3.A08(byteBuffer, i, 5, DDI.class);
return;
}
throw new IllegalArgumentException("root layer cannot be null");
}
throw new IllegalArgumentException("size cannot be null");
}
}
| [
"[email protected]"
] | |
8355b1adf17cf8b4befcc9cd1c0d3a51c2aa21b8 | ba7279b2abcd1a3630e464777d8ab219cbcd09b5 | /app/src/main/java/com/renyu/androidcommonlibrary/activity/RetrofitActivity.java | 1e65921a6517a92e36d12740b2605262a2656db9 | [] | no_license | mingfenghappy/AndroidCommonLibrary | 29995f66edc5c3e031c89bd5699e516a99d43c4a | eb0a8841ade570ed079f1b455875be03d0dcad74 | refs/heads/master | 2020-03-25T02:09:52.729433 | 2018-07-24T09:36:47 | 2018-07-24T09:36:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,630 | java | package com.renyu.androidcommonlibrary.activity;
import android.graphics.Color;
import android.widget.Toast;
import com.renyu.androidcommonlibrary.ExampleApp;
import com.renyu.androidcommonlibrary.bean.AccessTokenResponse;
import com.renyu.androidcommonlibrary.api.RetrofitImpl;
import com.renyu.androidcommonlibrary.di.module.ReposModule;
import com.renyu.commonlibrary.baseact.BaseActivity;
import com.renyu.commonlibrary.commonutils.Utils;
import com.renyu.commonlibrary.network.BaseObserver;
import com.renyu.commonlibrary.network.Retrofit2Utils;
import com.renyu.commonlibrary.network.RetryFunction;
import com.trello.rxlifecycle2.android.ActivityEvent;
import javax.inject.Inject;
public class RetrofitActivity extends BaseActivity {
@Inject
RetrofitImpl retrofitImpl = null;
@Override
public void initParams() {
((ExampleApp) (com.blankj.utilcode.util.Utils.getApp())).appComponent.plusAct(new ReposModule()).inject(this);
}
@Override
public int initViews() {
return 0;
}
@Override
public void loadData() {
getAccessToken();
}
@Override
public int setStatusBarColor() {
return Color.BLACK;
}
@Override
public int setStatusBarTranslucent() {
return 0;
}
private void getAccessToken() {
int timestamp = (int) (System.currentTimeMillis() / 1000);
String random = "abcdefghijklmn";
String signature = "app_id=46877648&app_secret=kCkrePwPpHOsYYSYWTDKzvczWRyvhknG&device_id=" +
Utils.getUniquePsuedoID() + "&rand_str=" + random + "×tamp=" + timestamp;
retrofitImpl.getAccessToken("nj",
timestamp,
"46877648",
random,
Utils.getMD5(signature),
Utils.getUniquePsuedoID(),
"v1.0",
0,
1,
6000)
.retryWhen(new RetryFunction(3, 3))
.compose(Retrofit2Utils.background())
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.subscribe(new BaseObserver<AccessTokenResponse>(this) {
@Override
public void onNext(AccessTokenResponse accessTokenResponse) {
String access_token = accessTokenResponse.getAccess_token();
Toast.makeText(RetrofitActivity.this, access_token, Toast.LENGTH_SHORT).show();
networkLoadingDialog.close();
}
});
}
}
| [
"[email protected]"
] | |
43739054330747ae96669338b8dd575553059302 | eeab34a5c9fd86be3fa22816842755c1098b284b | /arquillian-recorder-reporter/arquillian-recorder-reporter-impl/src/main/java/org/arquillian/recorder/reporter/impl/ReporterLifecycleObserver.java | 67f07c36f4d745ae241c6027292a5a46c414a8a3 | [
"Apache-2.0"
] | permissive | mattfred/arquillian-recorder | 889df4494ecf6029f0fb31021c19e0cb6e602b0b | b117d5802ab809275b27caf168de791dfba440ac | refs/heads/master | 2020-02-26T13:59:58.999600 | 2015-07-13T14:51:00 | 2015-07-13T14:51:00 | 38,843,571 | 0 | 0 | null | 2015-07-09T20:29:31 | 2015-07-09T20:29:30 | null | UTF-8 | Java | false | false | 12,893 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.arquillian.recorder.reporter.impl;
import org.arquillian.recorder.reporter.ReportFrequency;
import org.arquillian.recorder.reporter.ReportMessage;
import org.arquillian.recorder.reporter.Reporter;
import org.arquillian.recorder.reporter.ReporterConfiguration;
import org.arquillian.recorder.reporter.ReporterCursor;
import org.arquillian.recorder.reporter.event.ExportReport;
import org.arquillian.recorder.reporter.event.InTestResourceReport;
import org.arquillian.recorder.reporter.event.PropertyReportEvent;
import org.arquillian.recorder.reporter.model.ContainerReport;
import org.arquillian.recorder.reporter.model.DeploymentReport;
import org.arquillian.recorder.reporter.model.ExtensionReport;
import org.arquillian.recorder.reporter.model.TestClassReport;
import org.arquillian.recorder.reporter.model.TestMethodReport;
import org.arquillian.recorder.reporter.model.TestSuiteReport;
import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor;
import org.jboss.arquillian.config.descriptor.api.ExtensionDef;
import org.jboss.arquillian.container.spi.Container;
import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription;
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy;
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.core.api.Event;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.test.spi.TestResult;
import org.jboss.arquillian.test.spi.TestResult.Status;
import org.jboss.arquillian.test.spi.event.suite.After;
import org.jboss.arquillian.test.spi.event.suite.AfterClass;
import org.jboss.arquillian.test.spi.event.suite.AfterSuite;
import org.jboss.arquillian.test.spi.event.suite.AfterTestLifecycleEvent;
import org.jboss.arquillian.test.spi.event.suite.BeforeClass;
import org.jboss.arquillian.test.spi.event.suite.BeforeSuite;
import org.jboss.arquillian.test.spi.event.suite.BeforeTestLifecycleEvent;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.sql.Date;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Observes events from Arquillian and delegates them to {@link Reporter} implementation.<br>
* <br>
* Fires:
* <ul>
* <li>{@link ExportReport} on observing {@link AfterSuite}</li>
* </ul>
*
* @author <a href="[email protected]">Stefan Miklosovic</a>
*
*/
public class ReporterLifecycleObserver {
private static final Map<Method, Integer> lifecycleCountRegister = new HashMap<Method, Integer>();
@Inject
private Instance<Reporter> reporter;
@Inject
private Instance<ReporterConfiguration> configuration;
@Inject
private Instance<ArquillianDescriptor> descriptor;
@Inject
private Event<ExportReport> exportReportEvent;
@Inject
private Event<InTestResourceReport> inTestResourceReportEvent;
public void observeBeforeSuite(@Observes(precedence = Integer.MAX_VALUE) BeforeSuite event) {
TestSuiteReport testSuiteReport = new TestSuiteReport();
reporter.get().getReport().getTestSuiteReports().add(testSuiteReport);
reporter.get().setTestSuiteReport(testSuiteReport);
}
public void observeBeforeStart(@Observes Container event) {
ContainerReport containerReport = new ContainerReport();
containerReport.setQualifier(event.getName());
containerReport.setConfiguration(event.getContainerConfiguration().getContainerProperties());
reporter.get().getLastTestSuiteReport().getContainerReports().add(containerReport);
reporter.get().setContainerReport(containerReport);
}
public void observeBeforeDeploy(@Observes BeforeDeploy event) {
DeploymentReport deploymentReport = new DeploymentReport();
DeploymentDescription description = event.getDeployment();
deploymentReport.setArchiveName(description.getArchive().getName());
deploymentReport.setName(description.getName());
int order = description.getOrder();
if (order > 0) {
deploymentReport.setOrder(order);
}
String protocol = description.getProtocol().getName();
if (!protocol.equals("_DEFAULT_")) {
deploymentReport.setProtocol(protocol);
} else {
deploymentReport.setProtocol("_DEFAULT_");
}
deploymentReport.setTarget(description.getTarget().getName());
boolean reported = false;
for (ContainerReport containerReport : reporter.get().getLastTestSuiteReport().getContainerReports()) {
if (containerReport.getQualifier().equals(deploymentReport.getTarget())) {
containerReport.getDeploymentReports().add(deploymentReport);
reported = true;
break;
}
}
if (!reported) {
if (reporter.get().getLastTestSuiteReport().getContainerReports().size() == 1) {
reporter.get().getLastTestSuiteReport().getContainerReports().get(0).getDeploymentReports().add(deploymentReport);
}
}
}
public void observeBeforeClass(@Observes(precedence = Integer.MAX_VALUE) BeforeClass event) {
TestClassReport testClassReport = new TestClassReport();
testClassReport.setTestClassName(event.getTestClass().getName());
testClassReport.setRunAsClient(event.getTestClass().isAnnotationPresent(RunAsClient.class));
testClassReport.setReportMessage(ReportMessageParser.parseTestClassReportMessage(event.getTestClass().getJavaClass()));
reporter.get().getLastTestSuiteReport().getTestClassReports().add(testClassReport);
reporter.get().setTestClassReport(testClassReport);
}
public void observeBeforeTest(@Observes(precedence = Integer.MAX_VALUE) BeforeTestLifecycleEvent event) {
Integer c = lifecycleCountRegister.get(event.getTestMethod());
int count = (c != null ? c.intValue() : 0);
if (count == 0) {
TestMethodReport testMethodReport = new TestMethodReport();
testMethodReport.setName(event.getTestMethod().getName());
if (event.getTestMethod().isAnnotationPresent(OperateOnDeployment.class)) {
OperateOnDeployment ood = event.getTestMethod().getAnnotation(OperateOnDeployment.class);
testMethodReport.setOperateOnDeployment(ood.value());
} else {
testMethodReport.setOperateOnDeployment("_DEFAULT_");
}
testMethodReport.setRunAsClient(event.getTestMethod().isAnnotationPresent(RunAsClient.class));
reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport);
reporter.get().setTestMethodReport(testMethodReport);
}
lifecycleCountRegister.put(event.getTestMethod(), ++count);
}
public void observeAfterTest(@Observes(precedence = Integer.MIN_VALUE) AfterTestLifecycleEvent event, TestResult result) {
System.out.println("Test: " + event.getTestMethod().getName() + "," + result.toString());
int count = lifecycleCountRegister.get(event.getTestMethod());
lifecycleCountRegister.put(event.getTestMethod(), --count);
if (lifecycleCountRegister.get(event.getTestMethod()) == 0) {
TestMethodReport testMethodReport = reporter.get().getLastTestMethodReport();
testMethodReport.setStatus(result.getStatus());
testMethodReport.setDuration(result.getEnd() - result.getStart());
testMethodReport.setReportMessage(ReportMessageParser.parseTestReportMessage(event.getTestMethod()));
if (result.getStatus() == Status.FAILED && result.getThrowable() != null) {
testMethodReport.setException(getStackTrace(result.getThrowable()));
}
inTestResourceReportEvent.fire(new InTestResourceReport());
reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestClassReport()));
report(event, descriptor.get());
lifecycleCountRegister.remove(event.getTestMethod());
}
}
public void observeAfterClass(@Observes(precedence = Integer.MIN_VALUE) AfterClass event) {
reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestSuiteReport()));
report(event, descriptor.get());
}
public void observeAfterSuite(@Observes(precedence = Integer.MIN_VALUE) AfterSuite event) {
reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis()));
reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis()));
exportReportEvent.fire(new ExportReport(reporter.get().getReport()));
}
public void observeReportEvent(@Observes PropertyReportEvent event) {
reporter.get().getReporterCursor().getCursor().getPropertyEntries().add(event.getPropertyEntry());
}
private void report(org.jboss.arquillian.core.spi.event.Event event, ArquillianDescriptor descriptor) {
if (shouldReport(event, configuration.get().getReportAfterEvery())) {
List<ExtensionReport> extensionReports = reporter.get().getReport().getExtensionReports();
if (extensionReports.isEmpty()) {
extensionReports.addAll(getExtensionReports(descriptor));
}
reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis()));
reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis()));
exportReportEvent.fire(new ExportReport(reporter.get().getReport()));
}
}
private boolean shouldReport(org.jboss.arquillian.core.spi.event.Event event, String frequency) {
if (event instanceof AfterClass && ReportFrequency.CLASS.toString().equals(frequency)) {
return true;
} else if (event instanceof After && ReportFrequency.METHOD.toString().equals(frequency)) {
return true;
}
return false;
}
private Collection<? extends ExtensionReport> getExtensionReports(ArquillianDescriptor descriptor) {
List<ExtensionReport> extensionReports = new ArrayList<ExtensionReport>();
for (ExtensionDef extensionDef : descriptor.getExtensions()) {
ExtensionReport extensionReport = new ExtensionReport();
extensionReport.setQualifier(extensionDef.getExtensionName());
extensionReport.setConfiguration(extensionDef.getExtensionProperties());
extensionReports.add(extensionReport);
}
return extensionReports;
}
private String getStackTrace(Throwable aThrowable) {
StringBuilder sb = new StringBuilder();
String newLine = System.getProperty("line.separator");
sb.append(aThrowable.toString());
sb.append(newLine);
for (StackTraceElement element : aThrowable.getStackTrace()) {
sb.append(element);
sb.append(newLine);
}
return sb.toString();
}
private static final class ReportMessageParser {
public static String parseTestReportMessage(Method testMethod) {
return getReportMessage(testMethod.getAnnotations());
}
public static String parseTestClassReportMessage(Class<?> testClass) {
return getReportMessage(testClass.getAnnotations());
}
private static String getReportMessage(Annotation[] annotations) {
if (annotations != null) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().isAssignableFrom(ReportMessage.class)) {
return ((ReportMessage) annotation).value();
}
}
}
return null;
}
}
}
| [
"[email protected]"
] | |
2eb4b67737ad60f5bf67734c6be4882eb76d3801 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/106/org/apache/commons/math/analysis/UnivariateRealIntegrator_setMaximalIterationCount_40.java | ba8399c48c8d00135ce328384028244d2017ef99 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 512 | java |
org apach common math analysi
interfac univari real integr algorithm
version revis date
univari real integr univariaterealintegr
set upper limit number iter
high iter count converg problem
reason vari wide case user
advis
code converg except convergenceexcept code thrown number
exceed
param count maximum number iter
set maxim iter count setmaximaliterationcount count
| [
"[email protected]"
] | |
619a1aa89abe22bc6ffefbaf96f5852f3a467b41 | ab673fd010e3970a3cd26024244a5eb4bf43cb93 | /app/src/main/java/com/xuexiang/xuidemo/fragment/expands/MaterialDesignFragment.java | 7a820c43034632091e2337d78bb2c9b9b6ac9df5 | [
"Apache-2.0"
] | permissive | dandycheung/XUI | 9cbd03a7f28c2cdd3a05fbcfafc8e57688f5d102 | 111e6008ccd97978d892c6807be1a50f544908ee | refs/heads/master | 2023-07-11T08:00:08.614364 | 2023-06-25T17:40:30 | 2023-06-25T17:40:30 | 239,179,628 | 0 | 0 | Apache-2.0 | 2023-06-29T18:19:32 | 2020-02-08T18:08:35 | Java | UTF-8 | Java | false | false | 3,842 | java | package com.xuexiang.xuidemo.fragment.expands;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.core.PageOption;
import com.xuexiang.xuidemo.R;
import com.xuexiang.xuidemo.activity.MaterialDesignThemeActivity;
import com.xuexiang.xuidemo.activity.SettingsActivity;
import com.xuexiang.xuidemo.base.BaseSimpleListFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.BadgeDrawableFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.BehaviorFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.BottomSheetDialogFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.ConstraintLayoutFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.DrawerLayoutFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.ItemTouchHelperFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.MaterialButtonFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.ShapeableImageViewFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.TextInputLayoutFragment;
import com.xuexiang.xuidemo.fragment.expands.materialdesign.ToolBarFragment;
import com.xuexiang.xutil.app.ActivityUtils;
import java.util.List;
import static com.xuexiang.xuidemo.base.BaseActivity.KEY_SUPPORT_SLIDE_BACK;
/**
* @author xuexiang
* @since 2019-05-07 23:30
*/
@Page(name = "Material Design", extra = R.drawable.ic_expand_material_design)
public class MaterialDesignFragment extends BaseSimpleListFragment {
/**
* 初始化例子
*
* @param lists
* @return
*/
@Override
protected List<String> initSimpleData(List<String> lists) {
lists.add("ToolBar使用");
lists.add("Behavior\n手势行为");
lists.add("DrawerLayout + NavigationView\n常见主页布局");
lists.add("ConstraintLayout\n约束布局");
lists.add("ItemTouchHelper+RecyclerView\n实现列表拖拽");
lists.add("AppCompatPreferenceActivity\n设置页面");
lists.add("BottomSheetDialog");
lists.add("BadgeDrawable");
lists.add("ShapeableImageView");
lists.add("MaterialButton");
lists.add("TextInputLayout");
return lists;
}
/**
* 条目点击
*
* @param position
*/
@Override
protected void onItemClick(int position) {
switch (position) {
case 0:
openPage(ToolBarFragment.class);
break;
case 1:
openPage(BehaviorFragment.class);
break;
case 2:
openNewPage(DrawerLayoutFragment.class, KEY_SUPPORT_SLIDE_BACK, false);
break;
case 3:
openPage(ConstraintLayoutFragment.class);
break;
case 4:
openPage(ItemTouchHelperFragment.class);
break;
case 5:
ActivityUtils.startActivity(SettingsActivity.class);
break;
case 6:
openPage(BottomSheetDialogFragment.class);
break;
case 7:
PageOption.to(BadgeDrawableFragment.class)
.setNewActivity(true, MaterialDesignThemeActivity.class)
.open(this);
break;
case 8:
openPage(ShapeableImageViewFragment.class);
break;
case 9:
PageOption.to(MaterialButtonFragment.class)
.setNewActivity(true, MaterialDesignThemeActivity.class)
.open(this);
break;
case 10:
openPage(TextInputLayoutFragment.class);
break;
default:
break;
}
}
}
| [
"[email protected]"
] | |
63512ef2e8919ed7ecc3daa78e93148fe69c93f9 | 2c4cc13e6089758b6088d1aad563ae98fbc11a59 | /engine-config/src/main/java/com/datacloudsec/config/tools/DateUtil.java | 9c6828c9f909c0710c12448bd632485a8ff0ca98 | [
"MIT"
] | permissive | gumizy/flume-collector | df84cbad25255d5ffa78d3c7c9f567af8cd82c57 | d392ece035623365e2ec6c770f5cb621a0dd9ca5 | refs/heads/master | 2020-04-29T02:29:00.460976 | 2019-04-01T08:28:17 | 2019-04-01T08:28:17 | 175,769,409 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,021 | java | package com.datacloudsec.config.tools;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
public class DateUtil {
private static final Locale[] locales = {Locale.CHINA, Locale.ENGLISH};
/**
* 格式化日期
*
* @param df SimpleDateFormat
* @param dateStr dateStr
* @return Date
*/
public static Date format(SimpleDateFormat df, String dateStr) {
Calendar c = Calendar.getInstance();
String pattern = df.toPattern();
StringBuilder dateBuilder = new StringBuilder(dateStr);
StringBuilder formatBuilder = new StringBuilder(pattern);
if (!pattern.contains("yy")) {
formatBuilder.append(" yyyy");
dateBuilder.append(" ").append(c.get(Calendar.YEAR));
}
if (!pattern.contains("M")) {
formatBuilder.append(" MM");
dateBuilder.append(" ").append(c.get(Calendar.MONTH) + 1);
}
if (!pattern.contains("d")) {
formatBuilder.append(" dd");
dateBuilder.append(" ").append(c.get(Calendar.DAY_OF_MONTH));
}
//当使用hKk格式时,避免多追加HH
if (!pattern.contains("H") && !pattern.contains("h") && !pattern.contains("K") && !pattern.contains("k")) {
formatBuilder.append(" HH");
dateBuilder.append(" ").append(c.get(Calendar.HOUR_OF_DAY));
}
if (!pattern.contains("m")) {
formatBuilder.append(" mm");
dateBuilder.append(" ").append(c.get(Calendar.MINUTE));
}
Date d = null;
for (Locale locale : locales) {
try {
DateFormat sdf = new SimpleDateFormat(formatBuilder.toString(), locale);
sdf.setTimeZone(df.getTimeZone());
d = sdf.parse(dateBuilder.toString());
break;
} catch (Exception e) {
}
}
return d;
}
}
| [
"[email protected]"
] | |
d707217a55f81033dd02c0353c560780915f288b | 3854926ac8f6c69228e3a6b5a3de15322c2de946 | /Week_01/HelloClassLoader.java | 2bde36ccccf6d299fd1c5bac4dedb442b05216d1 | [] | no_license | thomas-fan/JAVA-000 | c3bca4b492f3881b5b060021342deb6d8f45eba0 | 8984bf02dff8acdb1b33a7aaff39fdc1f7a2fe9e | refs/heads/main | 2022-12-31T11:02:38.871504 | 2020-10-20T01:44:15 | 2020-10-20T01:44:15 | 303,265,212 | 0 | 0 | null | 2020-10-12T03:15:00 | 2020-10-12T03:14:59 | null | UTF-8 | Java | false | false | 1,677 | java | import java.io.*;
import java.lang.reflect.Method;
public class HelloClassLoader extends ClassLoader {
public static void main(String[] args) throws Exception {
HelloClassLoader myClassLoader = new HelloClassLoader();
final Class<?> hello = myClassLoader.findClass("Hello");
Method sayHello = hello.getMethod("hello");
Object hello1 = hello.newInstance();
System.out.println(sayHello.invoke(hello1));
}
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
Class clazz = null;
String classFilename = name + ".xlass";
File classFile = new File(classFilename);
if (classFile.exists()) {
try {
InputStream in = new FileInputStream(classFilename);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[1024 * 4];
int n = 0;
while ((n = in.read(buffer)) != -1) {
out.write(buffer, 0, n);
}
byte[] bytes = out.toByteArray();
for (int i = 0; i < bytes.length; i++) {
bytes[i] = (byte) (255 - bytes[i]);
}
clazz = defineClass(name, bytes, 0, bytes.length);
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
if (clazz == null) {
throw new ClassNotFoundException(name);
}
return clazz;
}
}
| [
"[email protected]"
] | |
72469fbde5698ca574537e1de26d4f5580d17340 | bac5385d871c037f992e6c9466c6f371d1ab3be7 | /test/java/com/donald/tests/PaymentDAOTests.java | 8f17c7e7f062d1434ebd585cf6efa03c548f8903 | [] | no_license | devwithdonald/Car_Dealership_Project | 0327646bbe80444457c836f2dcb26e5a3f376366 | cae2d39be6e64794a2c33864a6b89252ba0c7202 | refs/heads/master | 2022-09-24T14:05:08.782805 | 2019-06-18T19:13:56 | 2019-06-18T19:13:56 | 190,090,404 | 1 | 0 | null | 2022-09-08T01:00:56 | 2019-06-03T22:22:30 | Java | UTF-8 | Java | false | false | 989 | java | package com.donald.tests;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.donald.sqldao.PaymentPostgresDAOImpl;
import com.donald.users.Payment;
public class PaymentDAOTests {
private static PaymentPostgresDAOImpl paymentDAO;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
paymentDAO = new PaymentPostgresDAOImpl();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testGetAllPayments() {
List<Payment> result = paymentDAO.getAllPayments();
assertEquals(3, result.size());
}
@Test
public void testGetPaymentsByCustomerId() {
List<Payment> result = paymentDAO.getAllPayments();
assertEquals(3, result.size());
}
}
| [
"[email protected]"
] | |
6443048d407998ebd0e0eedae0e87afc74af7cf8 | c8818ae02043a41118094ede25aa5f57213752c1 | /app/src/main/java/com/amihealth/amihealth/Models/UserGeneral.java | 93479c5345fe2df9fc2dc91e4e2166d577d586aa | [] | no_license | nielsen29/AmIhealth_v2.0 | 4556b30aae43debd333626e04b3410c173075abd | 0c8d8734f16b1c9710eacab233f601936df5282e | refs/heads/master | 2021-05-13T18:04:56.381219 | 2019-06-02T13:48:25 | 2019-06-02T13:48:25 | 116,850,596 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,193 | java | package com.amihealth.amihealth.Models;
/**
* Created by amihealthmel on 08/07/17.
*/
public class UserGeneral {
public String nombre;
public String cedula;
public String apellido;
public String fecha_nacimiento;
public int sexo;
public int id_etnia;
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getCedula() {
return cedula;
}
public void setCedula(String cedula) {
this.cedula = cedula;
}
public String getApellido() {
return apellido;
}
public void setApellido(String apellido) {
this.apellido = apellido;
}
public String getFecha_nacimiento() {
return fecha_nacimiento;
}
public void setFecha_nacimiento(String fecha_nacimiento) {
this.fecha_nacimiento = fecha_nacimiento;
}
public int getSexo() {
return sexo;
}
public void setSexo(int sexo) {
this.sexo = sexo;
}
public int getId_etnia() {
return id_etnia;
}
public void setId_etnia(int id_etnia) {
this.id_etnia = id_etnia;
}
}
| [
"[email protected]"
] | |
57545f67b0a3558aadfbc9d2b75ca0ba77cbfac8 | 8b51ce5f66cbc7236faac4a9a205a58321cc7ee3 | /JavaSample/src/try_catch_sample/throws_sample.java | 3e7611319d0dc73c8f2ca78e85b15ba0bcdb0c41 | [] | no_license | ayolabboy/java-study- | 36836849d383c51506e257aa898f017fc4968a4c | 7b4b116662b098dbebb84dbbec137bf78d6146da | refs/heads/master | 2022-12-25T06:37:03.864710 | 2020-03-03T14:24:02 | 2020-03-03T14:24:02 | 235,958,304 | 1 | 0 | null | 2022-12-16T15:25:07 | 2020-01-24T07:32:00 | JavaScript | UTF-8 | Java | false | false | 367 | java | package try_catch_sample;
public class throws_sample {
public static void main(String[] args) {
int a = 10;
int b= 0;
try {
int k = divide(a,b);
System.out.println(k);
}catch(ArithmeticException e){
System.out.println(e.toString());
}
}
public static int divide(int a, int b) throws ArithmeticException{
return a/b;
}
}
| [
"[email protected]"
] | |
cd3d23cfd1cb23c157100d03f84c7d216caf5d71 | b4ba2cca922bcef1f3cd18fc033c7c7f0561f11a | /src/main/java/fi/vamk/e1900320/northwind/entity/PurchaseOrderDetails.java | cb400d4ec086116d0d0579d29595f49b4e4b2477 | [] | no_license | AlonaTsk/northwind | 10d6d1cdf46a8f211805171b4e3f7d20694fb11b | 3e96af01ef3811b0f5e707666a39d008c1a44c8a | refs/heads/main | 2023-03-17T10:27:40.291308 | 2021-02-28T13:12:12 | 2021-02-28T13:12:12 | 343,108,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package fi.vamk.e1900320.northwind.entity;
import java.sql.*;
import javax.persistence.*;
import lombok.Data;
@Data
@Entity(name = "fi.vamk.e1900320.northwind.entity.PurchaseOrderDetails")
@Table(name = "purchase_order_details")
public class PurchaseOrderDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "\"id\"", nullable = false)
private Integer id;
@Column(name = "\"purchase_order_id\"", nullable = false)
private Integer purchaseOrderId;
@Column(name = "\"product_id\"", nullable = true)
private Integer productId;
@Column(name = "\"quantity\"", nullable = false)
private java.math.BigDecimal quantity;
@Column(name = "\"unit_cost\"", nullable = false)
private java.math.BigDecimal unitCost;
@Column(name = "\"date_received\"", nullable = true)
private Timestamp dateReceived;
@Column(name = "\"posted_to_inventory\"", nullable = false)
private boolean postedToInventory;
@Column(name = "\"inventory_id\"", nullable = true)
private Integer inventoryId;
} | [
"[email protected]"
] | |
83c11d289a1955cb56af44bbea44c685f588237c | e48985fdf73f191445798e79ae2813e987cb150c | /src/ch08/_09_SpreadMain.java | 4fb98b5fc014b919d296dfee845b29e962179362 | [] | no_license | behappyleee/JavaTutorial | 755212831fb2a79f614dbac3449118ab0b326633 | 83519e877fd8f236165ae0d672a0d5cbcce99366 | refs/heads/master | 2023-03-06T08:00:41.856955 | 2021-02-17T13:28:47 | 2021-02-17T13:28:47 | 339,708,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package ch08;
public class _09_SpreadMain {
public static void main(String[] args) {
_09_SpreadArgs var = new _09_SpreadArgs();
var.callArg("샌드위치","연어스테이크" , "샐러드" , "ABC쥬스" ,"고구마"); //컴파일 시점에 배열이 생성됨(갯수는 상관x ==> 매개변수로 점3개를 줌 ...)
var.callArg2("홍길동" , 60, 50 , 40);
}
}
| [
"[email protected]"
] | |
7fbe586f9987881e4f0efda0aace05080f826eda | eef87b979d9d76465c8f026119b1c3a94268f36f | /src/main/java/com/oracle/xmlns/communications/ncc/_2009/_05/_15/pi/CCSCD1CHG.java | 7b44804e0555c92825de4d78ecef58d3ce58f6b5 | [] | no_license | amoiseyenko/crm | 57f9a383bd17b705225b27d771bcffe3d7c40abe | 85f757ba4071e462550f41ea1640eb7a1350cbb2 | refs/heads/master | 2016-09-06T19:34:44.046127 | 2015-08-06T10:45:39 | 2015-08-06T10:45:39 | 40,299,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,681 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.06.28 at 05:35:49 PM CEST
//
package com.oracle.xmlns.communications.ncc._2009._05._15.pi;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="AUTH" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="username" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="MSISDN" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="BALANCE_EXPIRY_DATE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="BALANCE_EXPIRY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="BALANCE_TYPE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="BALANCE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="BALMODE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="CREDIT_LIMIT" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="CURRENCY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="EXPMODE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="EXTRA_EDR" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="LANGUAGE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="NEW_MSISDN" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="PIN" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="PRODUCT" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="STATUS" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="WALLET_EXPIRY_DATE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="WALLET_EXPIRY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="WALLET_REFERENCE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="WALLET_TYPE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"auth",
"username",
"password",
"msisdn",
"balanceexpirydate",
"balanceexpiry",
"balancetype",
"balance",
"balmode",
"creditlimit",
"currency",
"expmode",
"extraedr",
"language",
"newmsisdn",
"pin",
"product",
"status",
"walletexpirydate",
"walletexpiry",
"walletreference",
"wallettype"
})
@XmlRootElement(name = "CCSCD1_CHG")
public class CCSCD1CHG {
@XmlElement(name = "AUTH")
protected String auth;
protected String username;
protected String password;
@XmlElement(name = "MSISDN", required = true)
protected String msisdn;
@XmlElement(name = "BALANCE_EXPIRY_DATE")
protected String balanceexpirydate;
@XmlElement(name = "BALANCE_EXPIRY")
protected String balanceexpiry;
@XmlElement(name = "BALANCE_TYPE")
protected String balancetype;
@XmlElement(name = "BALANCE")
protected String balance;
@XmlElement(name = "BALMODE")
protected String balmode;
@XmlElement(name = "CREDIT_LIMIT")
protected String creditlimit;
@XmlElement(name = "CURRENCY")
protected String currency;
@XmlElement(name = "EXPMODE")
protected String expmode;
@XmlElement(name = "EXTRA_EDR")
protected String extraedr;
@XmlElement(name = "LANGUAGE")
protected String language;
@XmlElement(name = "NEW_MSISDN")
protected String newmsisdn;
@XmlElement(name = "PIN")
protected String pin;
@XmlElement(name = "PRODUCT")
protected String product;
@XmlElement(name = "STATUS")
protected String status;
@XmlElement(name = "WALLET_EXPIRY_DATE")
protected String walletexpirydate;
@XmlElement(name = "WALLET_EXPIRY")
protected String walletexpiry;
@XmlElement(name = "WALLET_REFERENCE")
protected String walletreference;
@XmlElement(name = "WALLET_TYPE")
protected String wallettype;
/**
* Gets the value of the auth property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAUTH() {
return auth;
}
/**
* Sets the value of the auth property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAUTH(String value) {
this.auth = value;
}
/**
* Gets the value of the username property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUsername() {
return username;
}
/**
* Sets the value of the username property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUsername(String value) {
this.username = value;
}
/**
* Gets the value of the password property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPassword() {
return password;
}
/**
* Sets the value of the password property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPassword(String value) {
this.password = value;
}
/**
* Gets the value of the msisdn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMSISDN() {
return msisdn;
}
/**
* Sets the value of the msisdn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMSISDN(String value) {
this.msisdn = value;
}
/**
* Gets the value of the balanceexpirydate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBALANCEEXPIRYDATE() {
return balanceexpirydate;
}
/**
* Sets the value of the balanceexpirydate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBALANCEEXPIRYDATE(String value) {
this.balanceexpirydate = value;
}
/**
* Gets the value of the balanceexpiry property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBALANCEEXPIRY() {
return balanceexpiry;
}
/**
* Sets the value of the balanceexpiry property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBALANCEEXPIRY(String value) {
this.balanceexpiry = value;
}
/**
* Gets the value of the balancetype property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBALANCETYPE() {
return balancetype;
}
/**
* Sets the value of the balancetype property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBALANCETYPE(String value) {
this.balancetype = value;
}
/**
* Gets the value of the balance property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBALANCE() {
return balance;
}
/**
* Sets the value of the balance property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBALANCE(String value) {
this.balance = value;
}
/**
* Gets the value of the balmode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBALMODE() {
return balmode;
}
/**
* Sets the value of the balmode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBALMODE(String value) {
this.balmode = value;
}
/**
* Gets the value of the creditlimit property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCREDITLIMIT() {
return creditlimit;
}
/**
* Sets the value of the creditlimit property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCREDITLIMIT(String value) {
this.creditlimit = value;
}
/**
* Gets the value of the currency property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCURRENCY() {
return currency;
}
/**
* Sets the value of the currency property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCURRENCY(String value) {
this.currency = value;
}
/**
* Gets the value of the expmode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEXPMODE() {
return expmode;
}
/**
* Sets the value of the expmode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEXPMODE(String value) {
this.expmode = value;
}
/**
* Gets the value of the extraedr property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEXTRAEDR() {
return extraedr;
}
/**
* Sets the value of the extraedr property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEXTRAEDR(String value) {
this.extraedr = value;
}
/**
* Gets the value of the language property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLANGUAGE() {
return language;
}
/**
* Sets the value of the language property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLANGUAGE(String value) {
this.language = value;
}
/**
* Gets the value of the newmsisdn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNEWMSISDN() {
return newmsisdn;
}
/**
* Sets the value of the newmsisdn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNEWMSISDN(String value) {
this.newmsisdn = value;
}
/**
* Gets the value of the pin property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPIN() {
return pin;
}
/**
* Sets the value of the pin property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPIN(String value) {
this.pin = value;
}
/**
* Gets the value of the product property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPRODUCT() {
return product;
}
/**
* Sets the value of the product property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPRODUCT(String value) {
this.product = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSTATUS() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSTATUS(String value) {
this.status = value;
}
/**
* Gets the value of the walletexpirydate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getWALLETEXPIRYDATE() {
return walletexpirydate;
}
/**
* Sets the value of the walletexpirydate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setWALLETEXPIRYDATE(String value) {
this.walletexpirydate = value;
}
/**
* Gets the value of the walletexpiry property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getWALLETEXPIRY() {
return walletexpiry;
}
/**
* Sets the value of the walletexpiry property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setWALLETEXPIRY(String value) {
this.walletexpiry = value;
}
/**
* Gets the value of the walletreference property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getWALLETREFERENCE() {
return walletreference;
}
/**
* Sets the value of the walletreference property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setWALLETREFERENCE(String value) {
this.walletreference = value;
}
/**
* Gets the value of the wallettype property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getWALLETTYPE() {
return wallettype;
}
/**
* Sets the value of the wallettype property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setWALLETTYPE(String value) {
this.wallettype = value;
}
}
| [
"[email protected]"
] |
Subsets and Splits