query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Does expression 1 imply expression 2? | public static boolean implies(final Sentence expr1, final Sentence expr2) {
if (implies.containsKey(expr1)) {
if (implies.get(expr1).containsKey(expr2)) {
return implies.get(expr1).get(expr2);
} else {
final boolean val = SatChecker.isContradiction(andNot(expr1, expr2));
implies.get(expr1).put(expr2, val);
return val;
}
} else {
implies.put(expr1, new HashMap<>());
return implies(expr1, expr2);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BinaryExpression addAssignChecked(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression equal(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression addChecked(Expression expression0, ... | [
"0.65482867",
"0.64236724",
"0.6381345",
"0.63259953",
"0.62905395",
"0.6132957",
"0.6118896",
"0.61006117",
"0.59328115",
"0.5921786",
"0.58306074",
"0.5829696",
"0.58083487",
"0.57939297",
"0.5737576",
"0.57286394",
"0.57276267",
"0.5712751",
"0.56527793",
"0.563767",
"0.56... | 0.0 | -1 |
Does expression 1 contradict expression 2? | public static boolean contradicts(final Sentence expr1, final Sentence expr2) {
if (contradicts.containsKey(expr1)) {
if (contradicts.get(expr1).containsKey(expr2)) {
return contradicts.get(expr1).get(expr2);
} else {
final boolean val = SatChecker.isContradiction(Sentence.newConjunction(expr1, expr2));
contradicts.get(expr1).put(expr2, val);
return val;
}
} else {
contradicts.put(expr1, new HashMap<>());
return contradicts(expr1, expr2);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BinaryExpression equal(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression andAlso(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression andAssign(Expression expression0, Expression... | [
"0.6838492",
"0.63113886",
"0.6291267",
"0.6166875",
"0.6166773",
"0.61628425",
"0.6047351",
"0.5951679",
"0.58976036",
"0.5891448",
"0.58806586",
"0.5840574",
"0.57609856",
"0.57411903",
"0.57228845",
"0.5698854",
"0.5677414",
"0.5655353",
"0.56471765",
"0.56236184",
"0.5593... | 0.51286405 | 97 |
Creates a new parser and initializes a map with already parsed expressions | public PropositionalParser() {
final Sentence trueSentence = super.parse(Logic.TRUE);
this.exprToSentence = new HashMap<>();
this.exprToSentence.put(Logic.TRUE, trueSentence);
this.exprToSentence.put("", trueSentence);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Parser() {\n\t\tpopulateMaps();\n\t}",
"private TreeMap<Integer, PackratParser<Expression>> makeExpressionParsers (CtClass clazz) {\n TreeMap<Integer, PackratParser<Expression>> map = new TreeMap<>();\n\n for (Map.Entry<Integer, List<IROperator>> entry : operators.getOperators(clazz).entrySet()) {\n... | [
"0.67778426",
"0.6152029",
"0.59157056",
"0.5814987",
"0.5775659",
"0.5770634",
"0.5742542",
"0.57251865",
"0.5648265",
"0.55591094",
"0.5517616",
"0.54947263",
"0.5390534",
"0.5328595",
"0.530086",
"0.5289474",
"0.5181236",
"0.51542974",
"0.51508075",
"0.51496196",
"0.511270... | 0.5019726 | 43 |
Constructor that sets data. | public ToolImpl(Color fgColor, Integer startX, Integer startY, Integer endX, Integer endY) {
super();
this.startX = startX;
this.startY = startY;
this.endX = endX;
this.endY = endY;
this.fgColor = fgColor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}",
"public Model(DataHandler data){\n //assign the data parameter to the instance\n //level variable data. The scope of the parameter\n //is within the method an... | [
"0.7168044",
"0.7162459",
"0.7110643",
"0.70642734",
"0.7054657",
"0.7054657",
"0.7054657",
"0.7054657",
"0.7054657",
"0.7054657",
"0.7021864",
"0.7021864",
"0.70110714",
"0.7003088",
"0.7003088",
"0.7002227",
"0.6989549",
"0.69753295",
"0.69753295",
"0.6972973",
"0.69664276"... | 0.0 | -1 |
Constructor that sets only fgColor. | public ToolImpl(Color fgColor) {
this(fgColor, null, null, null, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setColor(int fg, int bg) {\n // Layout\n // Bit 7 | 6 5 4 | 3 | 2 1 0\n // Fct * | bg | * | fg\n color = Color.mix(fg, bg);\n }",
"public void init()\n {\n setBackground(Color.YELLOW);\n setForeground(Color.RED);\n }",
"@Override\r\n\tprotect... | [
"0.68572927",
"0.6806985",
"0.6734124",
"0.6629139",
"0.6603335",
"0.6574337",
"0.65036637",
"0.6408546",
"0.63120115",
"0.63094854",
"0.62637055",
"0.62370324",
"0.6222153",
"0.61828226",
"0.6169378",
"0.6157762",
"0.6153421",
"0.6136482",
"0.6135881",
"0.6019963",
"0.601099... | 0.7056934 | 0 |
Sets start or ending point. | private void setStartOrEnd(MouseEvent e) {
if (startX == null) {
startX = e.getX();
startY = e.getY();
} else if (endX == null) {
endX = e.getX();
endY = e.getY();
setData();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setStart(Point point) {\n mStart = point;\n }",
"protected void set(int start, int end) {\n \t\t\tfStart= start;\n \t\t\tfEnd= end;\n \t\t\tfText= null;\n \t\t\tfPreservedText= null;\n \t\t}",
"@Override\n\tpublic void setStartPoint(Point startPoint) {\n\t\tthis.startPoint=startPoint;\n\t... | [
"0.7236802",
"0.6898906",
"0.6864896",
"0.6787357",
"0.66383094",
"0.65815043",
"0.6527728",
"0.6486883",
"0.64659244",
"0.645933",
"0.64202285",
"0.6345382",
"0.63387346",
"0.6322741",
"0.63182575",
"0.6293108",
"0.6258788",
"0.62440807",
"0.62269485",
"0.62192214",
"0.62088... | 0.68369573 | 3 |
function to process the opcode and get the op4utput from a string array | private static void incode_output(String[] input) throws IOException {
int i = 0;
while (i<input.length){
//get the opcode and parameter modes
String opcode_parameter = input[i];
int opcode=0;
int mode_1st_parameter = 0;
int mode_2st_parameter = 0;
int mode_3st_parameter = 0;
if (opcode_parameter.length() !=1){
opcode = Integer.parseInt(opcode_parameter.substring(opcode_parameter.length()-2));
//have to check the length of the string before processing to avoid exceptions
if (opcode_parameter.length() >=3){
mode_1st_parameter = Integer.parseInt(opcode_parameter.substring(opcode_parameter.length()-3,opcode_parameter.length()-2));
}
if (opcode_parameter.length() >=4){
mode_2st_parameter = Integer.parseInt(opcode_parameter.substring(opcode_parameter.length()-4,opcode_parameter.length()-3));
}
if (opcode_parameter.length() >=5){
mode_3st_parameter = Integer.parseInt(opcode_parameter.substring(opcode_parameter.length()-5,opcode_parameter.length()-4));
}
}
else {
opcode = Integer.parseInt(opcode_parameter);
}
//if opcode is 99 the loop breaks and the processing is finished
if(opcode == 99){
break;
}
int value1=0;
int value1_location =0 ;
int value2=0;
int value2_location =0 ;
int return_location =0 ;
int return_value=0;
//getting the 1st value and the 2nd value according to the opcode and the modes
if ((opcode >= 1 && opcode <= 2) || (opcode >= 5 && opcode <=8)){
if (mode_1st_parameter == 0){
value1_location = Integer.parseInt(input[i+1]);
value1 = Integer.parseInt(input[value1_location]);
}
else{
value1_location = i+1;
value1 = Integer.parseInt(input[value1_location]);
}
}
if ((opcode >=1 && opcode <=2)|| (opcode >= 5 && opcode <=8)){
if (mode_2st_parameter == 0){
value2_location = Integer.parseInt(input[i+2]);
value2 = Integer.parseInt(input[value2_location]);
}
else{
value2_location = i+2;
value2 = Integer.parseInt(input[value2_location]);
}
}
// calculating the result value according to the opcode
if (opcode == 1){
return_value = value1+value2;
}
else if (opcode == 2){
return_value = value1*value2;
}
else if (opcode == 3){
//opcode 3 requires the user to input a system ID according to the chcallenge
print("opcode require input please enter the correct value");
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String input_value = reader.readLine();
// inserting the return value in the correct location according to the return location
if (mode_1st_parameter == 0){
return_location = Integer.parseInt(input[i+1]);
input[return_location] = input_value;
}
else{
return_location = i+1;
input[return_location] = input_value;
}
}
else if (opcode == 4){
//mode 4 outputs the result of a certain test or the result of the full opcode
if (mode_1st_parameter == 0){
return_location = Integer.parseInt(input[i+1]);
print("output: "+ input[return_location]);
}
else{
return_location = i+1;
print("output: "+ input[return_location]);
}
}
//opcode 5 and 6 has the possibility to minpulate the loop counter
//therefore it can skip the remaining code in the loop if the counter is minpulated
else if (opcode == 5){
if (value1 != 0 ){
i = value2;
continue;
}
}
else if (opcode == 6){
if (value1 ==0){
i=value2;
continue;
}
}
else if (opcode == 7){
if (value1 <value2){
return_value=1;
}
else{
return_value=0;
}
}
else if (opcode == 8){
if (value1==value2){
return_value=1;
}
else{
return_value=0;
}
}
// inserting the return value according to the return location, opcode and mode of the parameter
if ((opcode >=1 && opcode <=2)|| (opcode >=7 && opcode <=8)){
if (mode_3st_parameter == 0){
return_location = Integer.parseInt(input[i+3]);
input[return_location] = String.valueOf(return_value);
}
else{
return_location = i+3;
input[return_location] = String.valueOf(return_value);
}
}
//incrementing the loop counter according to the opcode
if ((opcode >=1 && opcode <=2)|| (opcode >=7 && opcode <=8)){
i = i+4;
}
else if (opcode == 5 || opcode == 6){
i=i+3;
}
else{
i=i+2;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String decoder(int[] Instruction) {\n\t\t\tString Information;\r\n\t\t\tInformation=\"The Instruction is:\";\r\n\t\t\tInformation=Information+\"Opcode:\";\r\n\t\t\tint[] Opcode=new int[6];\r\n\t\t\tint[] R=new int[2];\r\n\t\t\tint[] IX=new int[2];\r\n\t\t\tint[] Rx=new int[2];\r\n\t\t\tint[] Ry=new int[2];\... | [
"0.559225",
"0.55814904",
"0.55504525",
"0.5423585",
"0.53099203",
"0.5251832",
"0.5240536",
"0.5221864",
"0.51891583",
"0.51891583",
"0.51891583",
"0.51869243",
"0.5170375",
"0.5165112",
"0.515472",
"0.5138021",
"0.5116173",
"0.50898284",
"0.5008808",
"0.50013787",
"0.49976"... | 0.5924523 | 0 |
Gets the "ArrayOfValuationAggregate1" element | public com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 getArrayOfValuationAggregate1()
{
synchronized (monitor())
{
check_orphaned();
com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().find_element_user(ARRAYOFVALUATIONAGGREGATE1$0, 0);
if (target == null)
{
return null;
}
return target;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 addNewArrayOfValuationAggregate1()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;\r\n target = (com.msbinfo.expre... | [
"0.7541328",
"0.63937837",
"0.61359274",
"0.60583603",
"0.59245074",
"0.5919977",
"0.5919977",
"0.5877413",
"0.57687086",
"0.57361335",
"0.5718821",
"0.5670883",
"0.542301",
"0.542063",
"0.53438133",
"0.5340028",
"0.53154635",
"0.5313864",
"0.5313864",
"0.53011346",
"0.525562... | 0.8567574 | 0 |
Tests for nil "ArrayOfValuationAggregate1" element | public boolean isNilArrayOfValuationAggregate1()
{
synchronized (monitor())
{
check_orphaned();
com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().find_element_user(ARRAYOFVALUATIONAGGREGATE1$0, 0);
if (target == null) return false;
return target.isNil();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNilArrayOfValuationAggregate1()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;\r\n target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().... | [
"0.72397566",
"0.6071811",
"0.60588753",
"0.5907734",
"0.58818436",
"0.5745036",
"0.5702121",
"0.5649015",
"0.5628513",
"0.56217504",
"0.55950576",
"0.5590409",
"0.5555757",
"0.5545706",
"0.5523937",
"0.55046064",
"0.55010563",
"0.5495424",
"0.5487642",
"0.5484761",
"0.548238... | 0.8137087 | 0 |
Sets the "ArrayOfValuationAggregate1" element | public void setArrayOfValuationAggregate1(com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 arrayOfValuationAggregate1)
{
synchronized (monitor())
{
check_orphaned();
com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().find_element_user(ARRAYOFVALUATIONAGGREGATE1$0, 0);
if (target == null)
{
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().add_element_user(ARRAYOFVALUATIONAGGREGATE1$0);
}
target.set(arrayOfValuationAggregate1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNilArrayOfValuationAggregate1()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;\r\n target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().... | [
"0.7487786",
"0.68964416",
"0.67704666",
"0.5562656",
"0.551779",
"0.54421604",
"0.53812337",
"0.5351217",
"0.53401136",
"0.52568865",
"0.521785",
"0.5195715",
"0.5148923",
"0.51383114",
"0.50915056",
"0.508675",
"0.50832254",
"0.50784236",
"0.50784236",
"0.50675976",
"0.5028... | 0.82490516 | 0 |
Appends and returns a new empty "ArrayOfValuationAggregate1" element | public com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 addNewArrayOfValuationAggregate1()
{
synchronized (monitor())
{
check_orphaned();
com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().add_element_user(ARRAYOFVALUATIONAGGREGATE1$0);
return target;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 getArrayOfValuationAggregate1()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;\r\n target = (com.msbinfo.expressl... | [
"0.690416",
"0.67159593",
"0.6439916",
"0.561053",
"0.5603699",
"0.54714644",
"0.54714644",
"0.54714644",
"0.54589075",
"0.54589075",
"0.54589075",
"0.54589075",
"0.54589075",
"0.54589075",
"0.5243779",
"0.52270555",
"0.52143216",
"0.5126579",
"0.50767994",
"0.50600857",
"0.5... | 0.8264514 | 0 |
Nils the "ArrayOfValuationAggregate1" element | public void setNilArrayOfValuationAggregate1()
{
synchronized (monitor())
{
check_orphaned();
com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().find_element_user(ARRAYOFVALUATIONAGGREGATE1$0, 0);
if (target == null)
{
target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store().add_element_user(ARRAYOFVALUATIONAGGREGATE1$0);
}
target.setNil();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isNilArrayOfValuationAggregate1()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1 target = null;\r\n target = (com.msbinfo.expresslync.rct.ArrayOfValuationAggregate1)get_store(... | [
"0.77017355",
"0.6682627",
"0.636258",
"0.6328451",
"0.6047967",
"0.56648624",
"0.5660312",
"0.55746555",
"0.54598516",
"0.544208",
"0.544208",
"0.544208",
"0.53575975",
"0.5317392",
"0.5308819",
"0.5271215",
"0.52692705",
"0.51446986",
"0.51281404",
"0.5117022",
"0.51129055"... | 0.84036416 | 0 |
Method to calculate sieve of Eratosthenes | public static List<Integer> sieveOfEratosthenes(int n) {
// Declaring a boolean array of size n+1
// Where true denotes prime and false denotes non prime
// Initially all the values will be prime
// After calculation we will update the values
boolean isPrime[] = new boolean[n + 1];
// Initializing all the value as true
for (int i = 0; i <= n; i++) {
isPrime[i] = true;
}
// Declaring 0 and 1 as non prime
isPrime[0] = isPrime[1] = false;
// Calculating the primes
for (int i = 2; i * i <= n; i++) {
// If isPrime[i] is true then it is prime
if (isPrime[i] == true) {
// Then all of its multiples will be non prime
for (int j = i * i; j <= n; j += i) {
isPrime[j] = false;
}
}
}
// Declaring a list to store all the primes
List<Integer> primes = new ArrayList<Integer>();
// Storing all the primes in the list
for (int i = 0; i <= n; i++) {
if (isPrime[i] == true) {
primes.add(i);
}
}
// Returning the list containing all the primes
return primes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void sieve(int n) {\n boolean[] isTrue = new boolean[n-1];\n Arrays.fill(isTrue, true);\n\n\n int increment = 1;\n for (int i = 2; i < isTrue.length; i++) {\n increment = 1;\n for (int j = i * i; j < isTrue.length; j = increment*i) {\n ... | [
"0.6998064",
"0.69185746",
"0.6748709",
"0.67163306",
"0.6545238",
"0.65340364",
"0.64837134",
"0.64734966",
"0.64704835",
"0.6470477",
"0.63483393",
"0.63393104",
"0.6321103",
"0.6319192",
"0.6307685",
"0.6305284",
"0.629427",
"0.62784874",
"0.6273497",
"0.6272517",
"0.62533... | 0.65153015 | 6 |
Method to calculate segmented sieve | public static List<Long> segmentedSieve(long left, long right) {
// If left limit is less than 1, then make it 1
if (left < 1) {
left = 1;
}
// Calling the method to calculate regular sieve up to square root of right limit
int n = (int) Math.sqrt(right);
List<Integer> primes = sieveOfEratosthenes(n);
// Declaring a boolean array of size (right-left)+1
int size = (int) (right - left);
boolean isPrime[] = new boolean[size + 1];
// Initializing the array with true
for (int i = 0; i <= size; i++) {
isPrime[i] = true;
}
// Finding out the multiples of "List<integer> primes" in the range (left to right)
// And marking them as non prime
for (int i = 0; i < primes.size(); i++) {
// Currently selected prime
int currentPrime = primes.get(i);
// Base is the lowest value in left to right range, that is a multiple of currently selected prime
// We used (n/i)*i formula here
long base = (long) ((left / currentPrime) * currentPrime);
// If some how base becomes smaller number than the left limit
// We chose the next number that is a multiple of currently selected prime
if (base < left) {
base = base + currentPrime;
}
// Mark all the multiples of currently selected prime as non prime
for (long j = base; j <= right; j += currentPrime) {
int index = (int) (j - left);
isPrime[index] = false;
}
// In some exceptional cases, currently selected prime will be the base
// In those cases currently selected prime will be marked as non prime. Which is not true
// To handle this, we need to ensure that currently selected prime is marked as prime
if (base == currentPrime) {
int index = (int) (base - left);
isPrime[index] = true;
}
}
// Declaring a list to store the segmented sieve
List<Long> segSieve = new ArrayList<Long>();
// Storing the primes in between the range left to right (including left & right)
for (int i = 0; i <= size; i++) {
if (isPrime[i] == true) {
long num = i + left;
// Adding the primes to the list except 1
if (num != 1) {
segSieve.add(num);
}
}
}
// returning the list
return segSieve;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] argv) {\n BigInteger around = new BigInteger(\"1000000000000\");\n BigInteger howmany = new BigInteger(\"10000\");\n\n // print prime numbers that are found\n boolean show = false;\n\n long time = 0;\n\n time = -System.nanoTime();\n ... | [
"0.608206",
"0.6018325",
"0.5678069",
"0.560056",
"0.5599436",
"0.5535768",
"0.55241865",
"0.5493525",
"0.54672676",
"0.5413401",
"0.5380233",
"0.53686583",
"0.5360242",
"0.5356454",
"0.5343149",
"0.53309554",
"0.53047234",
"0.52958256",
"0.52547437",
"0.5234103",
"0.5231955"... | 0.6590801 | 0 |
Main method to test and run the program | public static void main(String[] args) {
// Scanner object to scan input
Scanner sc = new Scanner(System.in);
// Asking user for the range and taking inputs
long left, right;
System.out.println("Enter the range (low limit and high limit): ");
left = sc.nextLong();
right = sc.nextLong();
// Calling the method to calculated segmented sieve
List<Long> segSieve = segmentedSieve(left, right);
// Printing the segmented sieve
System.out.println("Primes between " + left + " and " + right + " :");
System.out.println(segSieve);
// Closing the scanner object
sc.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }",
"public static void main()\n\t{\n\t}",
"public static void main() {\n \n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main... | [
"0.7618606",
"0.76138824",
"0.75906575",
"0.75263953",
"0.74916935",
"0.74537766",
"0.7431213",
"0.7419159",
"0.7417307",
"0.7377032",
"0.736473",
"0.73522973",
"0.7331698",
"0.7307863",
"0.7281139",
"0.72803885",
"0.72397625",
"0.72344345",
"0.72326666",
"0.723117",
"0.72153... | 0.0 | -1 |
Called when no accounts are found in the database. | public void onNoAccountsFound(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void clearAccounts() {\n userAccountListController.getUserAccountList().setAccountOfInterest(null);\n userAccountListController.getUserAccountList().setActiveCareProvider(null);\n }",
"public final void loadAccounts() {\n DBUtil.select(\n \"select id, created, accou... | [
"0.6248264",
"0.59004635",
"0.58677435",
"0.58534855",
"0.570544",
"0.57017213",
"0.56973755",
"0.56879574",
"0.5676689",
"0.5675635",
"0.5667429",
"0.5667429",
"0.5667429",
"0.56569475",
"0.56569475",
"0.56444794",
"0.5634725",
"0.5634725",
"0.5634725",
"0.5634725",
"0.56347... | 0.8172191 | 0 |
Retrieves the hint text to be shown for when a search entry is being made. | public String getSearchHint(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String getSearchHint() {\n if (!isMessageListReady()) {\n return \"\";\n }\n Account account = getMessageListFragment().getAccount();\n Mailbox mailbox = getSearchableMailbox();\n\n if (mailbox == null) {\n return \"\";\n }\n\n if (sh... | [
"0.76535237",
"0.7149521",
"0.6695894",
"0.6639453",
"0.6548846",
"0.6542491",
"0.639154",
"0.6357307",
"0.6244289",
"0.61614543",
"0.6152153",
"0.60705864",
"0.6066908",
"0.6035386",
"0.5960474",
"0.5934844",
"0.5873038",
"0.5840924",
"0.582838",
"0.58263683",
"0.5708718",
... | 0.80674577 | 0 |
Called when the action bar initially shows the search entry field. | public void onSearchStarted(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showSearch() {\n\t\tonSearchRequested();\n\t}",
"public void onSearchStarted() {\n mActivity.invalidateOptionsMenu();\n }",
"private SearchBar() {\n controller = FilterController.getInstance();\n initComponents();\n createNewQueryPanel();\n }",
"@Override\r\n ... | [
"0.71789885",
"0.70843613",
"0.69819397",
"0.6846635",
"0.6580458",
"0.644165",
"0.64272964",
"0.62946826",
"0.62873167",
"0.6244389",
"0.62243116",
"0.62136286",
"0.6204568",
"0.61944956",
"0.61852354",
"0.61623275",
"0.61596674",
"0.61596674",
"0.61596674",
"0.61284715",
"0... | 0.611473 | 20 |
Called when a search is submitted. | public void onSearchSubmit(String queryTerm); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void performSearch() {\n History.newItem(MyWebApp.SEARCH_RESULTS);\n getMessagePanel().clear();\n if (keywordsTextBox.getValue().isEmpty()) {\n getMessagePanel().displayMessage(\"Search term is required.\");\n return;\n }\n mywebapp.getResultsPanel().... | [
"0.73275036",
"0.71617335",
"0.7149842",
"0.70268697",
"0.6977571",
"0.6965552",
"0.6948317",
"0.68482184",
"0.681624",
"0.6814568",
"0.6780522",
"0.6761692",
"0.6706812",
"0.6703126",
"0.66956407",
"0.6692698",
"0.6683026",
"0.6646767",
"0.66438186",
"0.6620827",
"0.6581613"... | 0.7823682 | 0 |
Called when the search box is closed. | public void onSearchExit(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onSearchClosed() {\n Log.v(\"SearchBox\", \"onSearchOpened()\");\n }",
"@Override\r\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tPostSearchBox.this.dispose();\r\n\t\t\t}",
"void unsetSearchWindowEnd();",
"protected void onSearchExit()... | [
"0.8053836",
"0.7704786",
"0.7429895",
"0.73960364",
"0.7262487",
"0.71880984",
"0.7132073",
"0.70564264",
"0.7053049",
"0.70050025",
"0.6898299",
"0.6663387",
"0.6580643",
"0.65732026",
"0.6458726",
"0.6426242",
"0.64013547",
"0.63714725",
"0.6350902",
"0.63345426",
"0.62815... | 0.77679294 | 1 |
Show the search box. | public void enterSearchMode(String initialQueryTerm) {
initSearchViews();
if (isInSearchMode()) {
return;
}
if (!TextUtils.isEmpty(initialQueryTerm)) {
mSearchView.setQuery(initialQueryTerm, false);
} else {
mSearchView.setQuery("", false);
}
mSearchView.setQueryHint(mCallback.getSearchHint());
mSearchMode = MODE_SEARCH;
// Focus on the search input box and throw up the IME if specified.
// TODO: HACK. this is a workaround IME not popping up.
mSearchView.setIconified(false);
refresh();
mCallback.onSearchStarted();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showSearch() {\n\t\tonSearchRequested();\n\t}",
"void searchUI();",
"protected void showSearch() {\n \t\tIntent search = new Intent(this, SearchActivity.class);\t\t\t\t\n \t\tthis.startActivity(search);\n \t}",
"private void search()\n {\n JTextField searchField = (currentSearchView... | [
"0.8259848",
"0.7691963",
"0.7528479",
"0.7447632",
"0.739121",
"0.7178816",
"0.7177297",
"0.70751595",
"0.70480955",
"0.698095",
"0.6969215",
"0.6889161",
"0.6758862",
"0.6751562",
"0.6743727",
"0.67221314",
"0.66450775",
"0.6624904",
"0.6611556",
"0.6561773",
"0.65300715",
... | 0.0 | -1 |
Performs the back action. | public boolean onBackPressed(boolean isSystemBackKey) {
if (shouldShowSearchBar()) {
exitSearchMode();
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void back() {\n\t\tstate.back();\n\t}",
"public void back() {\n Views.goBack();\n }",
"void actionBack();",
"public void back() {\n callFunction(\"back\");\n }",
"protected void handleBack(ActionEvent event) {\n\t}",
"public void back () {\r\n if (backHistory.size() > 1)... | [
"0.8538055",
"0.8373373",
"0.83631206",
"0.81771487",
"0.80520946",
"0.79587543",
"0.79494584",
"0.79439056",
"0.79068744",
"0.79019576",
"0.7886463",
"0.78517056",
"0.7746118",
"0.76907885",
"0.7596694",
"0.75954175",
"0.75573516",
"0.75469583",
"0.75408274",
"0.7538321",
"0... | 0.0 | -1 |
Refreshes the action bar display. | public void refresh() {
// The actual work is in refreshInernal(), but we don't call it directly here, because:
// 1. refresh() is called very often.
// 2. to avoid nested fragment transaction.
// refresh is often called during a fragment transaction, but updateTitle() may call
// a callback which would initiate another fragment transaction.
mDelayedOperations.removeCallbacks(mRefreshRunnable);
mDelayedOperations.post(mRefreshRunnable);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void refreshActionBar() {\n if (mActionBarController != null) {\n mActionBarController.refresh();\n }\n mActivity.invalidateOptionsMenu();\n }",
"private void refreshScreen() {\n app.getMainMenu().getTextField().clear();\n for (int key = 0; key < 96; key... | [
"0.7399161",
"0.68479055",
"0.64443094",
"0.6387243",
"0.63818526",
"0.6307162",
"0.6294893",
"0.62014544",
"0.6194222",
"0.6084154",
"0.6081401",
"0.6081401",
"0.6081401",
"0.6081401",
"0.6081401",
"0.6081401",
"0.6081401",
"0.6062984",
"0.6050236",
"0.60465825",
"0.6023651"... | 0.55300176 | 68 |
Load account/mailbox info, and account/recent mailbox list. | private void loadAccountMailboxInfo(final long accountId, final long mailboxId) {
mLoaderManager.restartLoader(LOADER_ID_ACCOUNT_LIST, null,
new LoaderCallbacks<Cursor>() {
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
return AccountSelectorAdapter.createLoader(mContext, accountId, mailboxId);
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
mCursor = (AccountSelectorAdapter.CursorWithExtras) data;
updateTitle();
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
mCursor = null;
updateTitle();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void ReadInAccounts() {\n\t\tLog.d(\"SelectAccountActivity.ReadInAccounts\", \"checking for file\" + AccountMan.CheckForFile());\n\t\taccounts = AccountMan.GetAccounts();\n\t\t//Comment out this line and uncomment the line above after purging the excess accounts\n\t\t//accounts = AccountMan.PurgeDuplicateA... | [
"0.6195543",
"0.60032094",
"0.58745986",
"0.58563423",
"0.5818089",
"0.57720745",
"0.5743824",
"0.57306606",
"0.5699177",
"0.56340516",
"0.56131417",
"0.5592606",
"0.5561941",
"0.55381376",
"0.5524191",
"0.54918015",
"0.5481965",
"0.54769623",
"0.54616255",
"0.5428489",
"0.54... | 0.71764123 | 0 |
Update the "title" part. | private void updateTitle() {
mAccountsSelectorAdapter.swapCursor(mCursor);
if (mCursor == null) {
// Initial load not finished.
mActionBarCustomView.setVisibility(View.GONE);
return;
}
mActionBarCustomView.setVisibility(View.VISIBLE);
if (mCursor.getAccountCount() == 0) {
mCallback.onNoAccountsFound();
return;
}
if ((mCursor.getAccountId() != Account.NO_ACCOUNT) && !mCursor.accountExists()) {
// Account specified, but does not exist.
if (isInSearchMode()) {
exitSearchMode();
}
// Switch to the default account.
mCallback.onAccountSelected(Account.getDefaultAccountId(mContext));
return;
}
mTitleMode = mCallback.getTitleMode();
if (shouldShowSearchBar()) {
initSearchViews();
// In search mode, the search box is a replacement of the account spinner, so ignore
// the work needed to update that. It will get updated when it goes visible again.
mAccountSpinnerContainer.setVisibility(View.GONE);
mSearchContainer.setVisibility(View.VISIBLE);
return;
}
// Account spinner visible.
mAccountSpinnerContainer.setVisibility(View.VISIBLE);
UiUtilities.setVisibilitySafe(mSearchContainer, View.GONE);
if (mTitleMode == Callback.TITLE_MODE_MESSAGE_SUBJECT) {
mAccountSpinnerLine1View.setSingleLine(false);
mAccountSpinnerLine1View.setMaxLines(2);
mAccountSpinnerLine1View.setText(mCallback.getMessageSubject());
mAccountSpinnerLine2View.setVisibility(View.GONE);
mAccountSpinnerCountView.setVisibility(View.GONE);
} else {
// Get mailbox name
final String mailboxName;
if (mTitleMode == Callback.TITLE_MODE_ACCOUNT_WITH_ALL_FOLDERS_LABEL) {
mailboxName = mAllFoldersLabel;
} else if (mTitleMode == Callback.TITLE_MODE_ACCOUNT_WITH_MAILBOX) {
mailboxName = mCursor.getMailboxDisplayName();
} else {
mailboxName = null;
}
// Note - setSingleLine is needed as well as setMaxLines since they set different
// flags on the view.
mAccountSpinnerLine1View.setSingleLine();
mAccountSpinnerLine1View.setMaxLines(1);
if (TextUtils.isEmpty(mailboxName)) {
mAccountSpinnerLine1View.setText(mCursor.getAccountDisplayName());
// Change the visibility of line 2, so line 1 will be vertically-centered.
mAccountSpinnerLine2View.setVisibility(View.GONE);
} else {
mAccountSpinnerLine1View.setText(mailboxName);
mAccountSpinnerLine2View.setVisibility(View.VISIBLE);
mAccountSpinnerLine2View.setText(mCursor.getAccountDisplayName());
}
mAccountSpinnerCountView.setVisibility(View.VISIBLE);
mAccountSpinnerCountView.setText(UiUtilities.getMessageCountForUi(
mContext, mCursor.getMailboxMessageCount(), true));
}
boolean spinnerEnabled =
((mTitleMode & TITLE_MODE_SPINNER_ENABLED) != 0) && mCursor.shouldEnableSpinner();
setSpinnerEnabled(spinnerEnabled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void SetTitle(String newTitle){ title = newTitle; }",
"public void setTitle(String title) { this.title = title; }",
"public void doSetTitle(String newTitle) \n {\n this.title = newTitle;\n }",
"public void setTitle(String newTitle)\r\n {\r\n title = newTitle;\r\n }",
"Up... | [
"0.8292976",
"0.79985845",
"0.79980487",
"0.799558",
"0.7918812",
"0.79119426",
"0.789851",
"0.7898486",
"0.7897377",
"0.7897377",
"0.7886071",
"0.7886071",
"0.7886071",
"0.7886071",
"0.7874322",
"0.78703475",
"0.78703475",
"0.7869287",
"0.786295",
"0.7856626",
"0.7856626",
... | 0.0 | -1 |
Event not handled. Let the search do the default action. | @Override
public boolean onQueryTextChange(String newText) {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic boolean onSearchRequested()\n\t{\n \tstartSearch(getCurSearch(), true, null, false);\n \treturn true;\n\t}",
"public void actionPerformed(ActionEvent InputEvent)\r\n {\r\n performSearch();\r\n }",
"@Override\r\n\tpublic void searchObjectListener(ActionEvent e) {\n\t\t\r\... | [
"0.7255027",
"0.7082913",
"0.6994418",
"0.68765724",
"0.6814985",
"0.68143976",
"0.67709166",
"0.67382586",
"0.6732623",
"0.66980356",
"0.66775256",
"0.6600446",
"0.65958333",
"0.65162796",
"0.650523",
"0.65033627",
"0.64926416",
"0.6483171",
"0.64759463",
"0.64728296",
"0.64... | 0.0 | -1 |
EntityProvider can be used for reading/writing ONLY if all fields above initialized | public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
return type == MockEntity.class && uriInfo != null && request != null && httpHeaders != null
&& providers != null && httpRequest != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void entityInit() {}",
"@Override\n\tpublic void initEntity() {\n\n\t}",
"@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }",
"public ExpertiseEntity() {\n }",
"public <T> T initialize(T entity);",
"@Override\n public void loadEntity... | [
"0.67901003",
"0.6544431",
"0.64805174",
"0.58995885",
"0.58843607",
"0.5876648",
"0.5872172",
"0.58251816",
"0.58009225",
"0.57538795",
"0.5746059",
"0.5710724",
"0.5703327",
"0.5671883",
"0.5660997",
"0.5623313",
"0.56154525",
"0.56150854",
"0.55806804",
"0.5579305",
"0.557... | 0.0 | -1 |
Creates a new instance of PlantillaController | public PlantillaController() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ControllerProtagonista() {\n\t}",
"public ControllerEnfermaria() {\n }",
"public PersonasController() {\r\n }",
"public ProduktController() {\r\n }",
"public PacienteController() {\n\t\t\n\t\tatualizarTela();\n\t\t}",
"public TipoInformazioniController() {\n\n\t}",
"public EstadoProyect... | [
"0.6755922",
"0.671648",
"0.6639555",
"0.6638301",
"0.6578451",
"0.6518218",
"0.6488639",
"0.64740807",
"0.64696896",
"0.6407344",
"0.63411963",
"0.63411963",
"0.6290134",
"0.62065655",
"0.61923057",
"0.6176509",
"0.61576045",
"0.61529666",
"0.61464906",
"0.61311895",
"0.6106... | 0.7906639 | 0 |
/ protected Letters str; protected Context context; protected LinkedList syllables; private Syntax syntax; // syntax in its clause | public int getId() { return id; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Syntax getSyntax();",
"public String getSyntax(){\n\t\treturn syntax;\n\t}",
"@NotNull\n String getSyntax();",
"public String getSyntax() {\n return syntax;\n }",
"private Syntaxes() {\r\n\t\tthis.map = new HashMap();\r\n\r\n\t\tregisterSyntax(new DirectoryStringSyntax());\r\n\t\tregisterSyntax(new Oi... | [
"0.7251104",
"0.6598996",
"0.6525209",
"0.6466405",
"0.62148315",
"0.6116236",
"0.59355146",
"0.5842255",
"0.57682616",
"0.57682616",
"0.5701661",
"0.56818074",
"0.55878323",
"0.5573983",
"0.55683166",
"0.55614614",
"0.55549616",
"0.5520412",
"0.55097055",
"0.55097055",
"0.55... | 0.0 | -1 |
Returns the datagram socket which is used for incoming datagram packets. | public synchronized DatagramSocket getDatagramSocket() {
return datagramSocket;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DatagramSocket getSocket() {\n\t\treturn socket;\n\t}",
"public org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol getSocketProtocol() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol.valueO... | [
"0.7430702",
"0.69537973",
"0.6894029",
"0.68914306",
"0.67980945",
"0.6732743",
"0.672649",
"0.66341275",
"0.6543535",
"0.6525177",
"0.64732397",
"0.63898206",
"0.6320639",
"0.6315865",
"0.63068295",
"0.6298147",
"0.62799424",
"0.62049204",
"0.6204263",
"0.6167591",
"0.61617... | 0.772453 | 0 |
Returns the datagram handler for this listener. | public synchronized UDPDatagramHandler getUDPDatagramHandler() {
return handler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public UDPConnectionHandler getUDPConnection() {\r\n\t\treturn udp;\r\n\t}",
"public Handler getHandler();",
"public Handler getHandler() {\n\t\treturn this.serverHandler;\n\t}",
"public Handler getHandler() {\n return mHandler;\n }",
"public Handler getHandler() {\n return this.mHandler;\... | [
"0.71079487",
"0.59263504",
"0.58384174",
"0.5808084",
"0.5797057",
"0.579425",
"0.5773188",
"0.5773188",
"0.57457924",
"0.56930083",
"0.56695426",
"0.56526047",
"0.5642936",
"0.56358594",
"0.5604888",
"0.5574441",
"0.5554601",
"0.5492246",
"0.5469469",
"0.5391296",
"0.536778... | 0.82033503 | 0 |
Indicates whether this listener is running or not. | public synchronized boolean isClosed() {
return closed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isRunning() {\n return (service != null) && service.isMonitoring();\n }",
"public boolean isListenerRunning(){\n\t\tsynchronized (httpServerMutex) {\n\t\t\tif( webServer == null )\n\t\t\t\treturn false;\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public final boolean isR... | [
"0.81294996",
"0.7959035",
"0.7949889",
"0.7919758",
"0.7875974",
"0.7867171",
"0.7864504",
"0.7864504",
"0.78630286",
"0.7860156",
"0.7858475",
"0.7835659",
"0.7822702",
"0.7822702",
"0.78121656",
"0.78121656",
"0.7808064",
"0.7794493",
"0.77791804",
"0.77703154",
"0.7760719... | 0.0 | -1 |
Starts the UDP listener. | public synchronized boolean open() {
if (!closed) {
return true;
}
/*
* Gets lock, and waits until the UDP listener is ready. This is
* necessary because we do not know, whether the thread pool starts this
* thread straight away or not.
*/
synchronized (lockObj) {
try {
if (JMEDSFramework.getThreadPool().executeOrAbort(this)) {
while (closed) {
lockObj.wait();
}
return true;
} else {
return false;
}
} catch (InterruptedException e) {
return false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void startUDP() {\n try {\n DatagramSocket socket = new DatagramSocket(port);\n byte[] buf = new byte[256];\n while (running) {\n DatagramPacket packet = new DatagramPacket((sbyte[])(object) buf, buf.length);\n socket.receive(packet);\n upd_count++;\n ... | [
"0.72105014",
"0.6963702",
"0.6825353",
"0.6732461",
"0.6611735",
"0.6608073",
"0.65868706",
"0.6452687",
"0.61784333",
"0.61317194",
"0.6049127",
"0.6002151",
"0.59877336",
"0.5885512",
"0.58732957",
"0.58290756",
"0.58230484",
"0.5807757",
"0.57922345",
"0.57739925",
"0.574... | 0.0 | -1 |
Stops the UDP listener. | public synchronized void close() throws IOException {
if (closed) {
return;
}
closed = true;
datagramSocket.close();
if (Log.isDebug()) {
Log.debug("UDP listener shutdown for interface " + getIface() + (getLocalAddress().isAnyLocalAddress() ? "" : " on " + getLocalAddress().toString()) + " and port " + getLocalPort() + ".", Log.DEBUG_LAYER_COMMUNICATION);
}
datagramSocket = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public synchronized void stop() {\r\n\t\t//TODO read why stop is deprecated http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\r\n\t\tif (udplistener != null) {\r\n\t\t\tudplistener.datagramSocket.close();\r\n\t\t\tudpthread.stop();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (tcplistener !=... | [
"0.72977924",
"0.6835944",
"0.66574466",
"0.6267376",
"0.6229964",
"0.61732835",
"0.61629903",
"0.6053751",
"0.6053251",
"0.59404975",
"0.59178895",
"0.5912871",
"0.589368",
"0.58885723",
"0.58672774",
"0.5828528",
"0.58275837",
"0.5819462",
"0.5780571",
"0.5709938",
"0.57073... | 0.0 | -1 |
This method is called every time the scheme is being repainted. It is possible to draw almost anything on the scheme without any restrictions. However, long computations should be avoided or the user interface will become unresponsive. To paint visual class's original graphics, call vclass.drawClassGraphics( graphics, scale ); | public abstract void paint(Graphics2D graphics, float scale); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void update(Graphics g) {\r\n\t\t// S*ystem.out.println(\"Graph.update\");\r\n\t\t// paint(g);\r\n\t\t// super.update(g);\r\n\t}",
"@Override \n\tpublic void update(Graphics g) \n\t{\n\t\tpaint(g); \n\t}",
"@Override\n public void update(Graphics g) {\n paint(g);\n }",
"pub... | [
"0.7096322",
"0.70640546",
"0.7058296",
"0.70513785",
"0.7031755",
"0.6998712",
"0.68622756",
"0.6853691",
"0.684473",
"0.683774",
"0.6835587",
"0.6817425",
"0.680343",
"0.67945397",
"0.67945397",
"0.6754822",
"0.6736052",
"0.6720424",
"0.6683616",
"0.6679963",
"0.6672438",
... | 0.62262446 | 92 |
Used internally for creating new instances from a prototype. | @Override
public ClassPainter clone() {
ClassPainter clone = null;
try {
clone = (ClassPainter) super.clone();
} catch (CloneNotSupportedException e) {
// Object does support clone()
}
return clone;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IfacePrototype createPrototype(IfaceType dt);",
"Reproducible newInstance();",
"Instance createInstance();",
"private Object setupDefaultPrototype() {\n }",
"public T newInstance();",
"public interface Prototype {\n\n Prototype clone();\n}",
"public abstract Instance duplicate();",
"private Object ... | [
"0.660457",
"0.659436",
"0.64686835",
"0.62734985",
"0.6247714",
"0.620628",
"0.6156117",
"0.60050505",
"0.5998917",
"0.593356",
"0.5888657",
"0.5851114",
"0.584227",
"0.5837958",
"0.5823957",
"0.58213574",
"0.58117497",
"0.5807481",
"0.5765866",
"0.5738791",
"0.57373446",
... | 0.0 | -1 |
Converts the supplied byte array to an UTF8 encoded string. | public static String bytesToString(byte[] bytes) {
if (bytes == null) {
return "";
}
return new String(bytes, ENCODING);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@NonNull\n public static String byteToString(byte[] byteArray) throws UnsupportedEncodingException\n {\n return new String(byteArray, \"UTF-8\");\n }",
"private static String bytes2String(byte[] bytes) {\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < bytes.l... | [
"0.7914706",
"0.7047915",
"0.686253",
"0.6829554",
"0.6739938",
"0.6723641",
"0.67070985",
"0.6695336",
"0.66451484",
"0.6575691",
"0.6569301",
"0.6521894",
"0.6518328",
"0.6422673",
"0.63260794",
"0.6310525",
"0.6286781",
"0.6281543",
"0.62564427",
"0.62268156",
"0.62248397"... | 0.6861885 | 3 |
Converts the supplied strung to a bytearray of the string, encoded in UTF8.. | public static byte[] stringToBytes(String string) {
return string.getBytes(ENCODING);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static final byte[] asUTF8(final String s) {\n return s.getBytes(StandardCharsets.UTF_8);\n }",
"public static byte[] toBytes(String s) {\n return s.getBytes(UTF8_CHARSET);\n }",
"protected static byte[] toByteArray(String str) {\n byte[] bytes = new byte[str.length()];\n ... | [
"0.75111455",
"0.7452405",
"0.7244097",
"0.72317946",
"0.7099996",
"0.7050967",
"0.7046184",
"0.7043401",
"0.70433944",
"0.7029665",
"0.6998901",
"0.6950291",
"0.68915766",
"0.68843925",
"0.68841696",
"0.68605447",
"0.6850412",
"0.67942643",
"0.6759452",
"0.67470074",
"0.6740... | 0.73059803 | 2 |
Returns a copy the supplied array with all trailing 0 characters trimmed. | public static byte[] trimBytes(byte[] bytes)
{
int i = bytes.length - 1;
while (i >= 0 && bytes[i] == 0) {
--i;
}
return Arrays.copyOf(bytes, i + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Nonnull private static byte[] trimZeroes(@Nonnull final byte[] b) {\n Constraint.isNotNull(b, \"byte[] data was null\");\n \n int i = 0;\n while (i < b.length - 1 && b[i] == 0) {\n i++;\n }\n if (i == 0) {\n return b;\n }\n return Array... | [
"0.7466413",
"0.7358202",
"0.6661338",
"0.641927",
"0.63739204",
"0.6331234",
"0.63108027",
"0.630178",
"0.62971044",
"0.62939084",
"0.6129389",
"0.6047595",
"0.5898451",
"0.5895066",
"0.5741202",
"0.5731614",
"0.5727241",
"0.5650293",
"0.56449115",
"0.5585381",
"0.5524435",
... | 0.698169 | 2 |
Metodo para listar detalle de activos de sala | public List<ActDetalleActivo> listarDetalleActivoLaboratorio(long codigoSalaLaboratorio,long codigoTipo,String amie, int estado,int anio); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Permiso> obtenerTodosActivos();",
"public List<ActDetalleActivo> listarPorSerial(String serial,String amie, int estado,Integer anio,int estadoActivo);",
"public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSy... | [
"0.6766101",
"0.62963384",
"0.62837887",
"0.6239896",
"0.61748695",
"0.61378664",
"0.61201745",
"0.6096293",
"0.6008057",
"0.59633243",
"0.59293616",
"0.5928497",
"0.5877014",
"0.5784224",
"0.5769795",
"0.57610756",
"0.57610756",
"0.57511824",
"0.5748766",
"0.5740447",
"0.573... | 0.59034324 | 12 |
Metodo para buscar el detalle de un activo por serial | public ActDetalleActivo buscarPorSerial(String serial,String amie, int estado,int anio); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<ActDetalleActivo> listarPorSerial(String serial,String amie, int estado,Integer anio,int estadoActivo);",
"String getSerial();",
"java.lang.String getSerial();",
"public String getReceivedSerialNumber() ;",
"public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sue... | [
"0.6810352",
"0.61758566",
"0.6076184",
"0.57162666",
"0.5692065",
"0.56262827",
"0.5522264",
"0.5502368",
"0.5476624",
"0.54639816",
"0.54587615",
"0.54332024",
"0.5419749",
"0.541929",
"0.5418959",
"0.5394599",
"0.53630733",
"0.5351997",
"0.53518593",
"0.5327802",
"0.532699... | 0.71693563 | 0 |
Metodo para listar el detalle de un activo por serial | public List<ActDetalleActivo> listarPorSerial(String serial,String amie, int estado,Integer anio,int estadoActivo); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ActDetalleActivo buscarPorSerial(String serial,String amie, int estado,int anio);",
"public List<Permiso> obtenerTodosActivos();",
"public List<ActDetalleActivo> listarDetalleActivoLaboratorio(long codigoSalaLaboratorio,long codigoTipo,String amie, int estado,int anio);",
"public String obtenerDetalle... | [
"0.61544424",
"0.61437595",
"0.5991982",
"0.59878176",
"0.5870801",
"0.5840595",
"0.5813992",
"0.579973",
"0.5796313",
"0.57911754",
"0.57817143",
"0.57795405",
"0.57536155",
"0.56605506",
"0.56583893",
"0.56520987",
"0.56499076",
"0.5627084",
"0.5616822",
"0.55939",
"0.55896... | 0.7260208 | 0 |
Created by kihors on 24.02.18. | public interface FrontService {
@GET("front")
Observable<ArrayList<Front>> getFrontList();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"private voi... | [
"0.57828766",
"0.5730886",
"0.5682732",
"0.5599954",
"0.5536686",
"0.5536686",
"0.54947937",
"0.5468298",
"0.54623735",
"0.54412246",
"0.54412246",
"0.54412246",
"0.54412246",
"0.54412246",
"0.5441076",
"0.543852",
"0.5429292",
"0.5424118",
"0.5421566",
"0.54177785",
"0.54088... | 0.0 | -1 |
Create a Goods from jsonString | @RequestMapping(value = MsalesConstants.MODULE.GOODS.ACTION_CREATE_GOODS, method = RequestMethod.POST)
public @ResponseBody
String createGoods(HttpServletRequest request) {
String jsonString = request.getAttribute(MsalesConstants.CONTENTS).toString();
// jsonString not null
if (jsonString != null) {
Goods goods = null;
try {
// parse jsonString to a status Object
goods = MsalesJsonUtils.getObjectFromJSON(jsonString, Goods.class);
} // jsonString syntax incorrect
catch (Exception ex) {
// check field in JSOn request not match with field in JSON.
return MsalesJsonUtils.validateFormat(ex);
}
// status from json not null
if (goods != null) {
LinkedHashMap<String, String> hashErrors = new LinkedHashMap<String, String>();
if (goods.getParentId() != null) {
Goods user = dataService.getRowById(goods.getParentId(), Goods.class);
if (user == null) {
// is not exist in DB
hashErrors.put("ParentId", MsalesValidator.MCP_GOODS_ID_NOT_EXIST + goods.getParentId());
}
}
if (goods.getGoodsCategoryId() != null) {
GoodsCategory user = dataService.getRowById(
goods.getGoodsCategoryId(), GoodsCategory.class);
if (user == null) {
// is not exist in DB
hashErrors.put("GoodsCategory", MsalesValidator.MCP_GOODS_CATEGORY_NOT_EXIST + goods.getGoodsCategoryId());
}
} else {
hashErrors.put("GoodsCategory", MsalesValidator.MCP_GOODS_CATEGORY_ID_NULL);
}
if (goods.getStatusId() != null) {
Status user = dataService.getRowById(goods.getStatusId(),
Status.class);
if (user == null) {
// is not exist in DB
hashErrors.put("Status", MsalesValidator.MCP_STATUS_NOT_EXIST + goods.getStatusId());
}
} else {
hashErrors.put("Status", MsalesValidator.MCP_STATUS_NULL);
}
if (goods.getCreatedUser() != null) {
User userRole2 = dataService.getRowById(goods.getCreatedUser(), User.class);
if (userRole2 == null) {
hashErrors.put("Goods", MsalesValidator.MCP_USER_NOT_EXIST + goods.getCreatedUser());
}
}
if (hashErrors.size() > 0) {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(MsalesStatus.NOT_EXISTS_IN_DATABASE, hashErrors));
}
String str = goods.getName();
if (str != null) {
if (str.trim().isEmpty()) {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(MsalesStatus.JSON_VALUE_INVALID, MsalesValidator.DK_GOODS_NAME_NOT_EXIST));
}
}
String str1 = goods.getGoodsCode();
if (str1 != null) {
if (str1.trim().isEmpty()) {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(MsalesStatus.JSON_VALUE_INVALID, MsalesValidator.DK_GOODS_CODE_NOT_EXIST));
}
}
int ret = 0;
try {
// insert new a user to database
ret = dataService.insertRow(goods);
} catch (Exception e) {
Exception ex = (Exception) e.getCause().getCause();
if (e.getCause().getCause() instanceof ConstraintViolationException) {
return MsalesJsonUtils.jsonValidate(ex);
}
}
if (ret > 0) {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(HttpStatus.OK, null));
} // status from DB null
else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.SQL_INSERT_FAIL));
}
// status from DB not null
} // status from json null
else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.NULL));
}
} // jsonString null
else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.JSON_CONTENTS_EMPTY));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RoyaltyEntity fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, RoyaltyEntity.class);\n }",
"<T> T fromJson(String json, Class<T> type);",
"public void fromJSON(String json) throws JSONException;",
"private void testJsonObject(String jsonString, C... | [
"0.6343581",
"0.6002258",
"0.5939287",
"0.5924384",
"0.5854572",
"0.58525294",
"0.5830013",
"0.5764684",
"0.57368225",
"0.5706328",
"0.56997806",
"0.56874824",
"0.5685677",
"0.56753343",
"0.5656615",
"0.5621009",
"0.5613456",
"0.5603109",
"0.5585829",
"0.5568408",
"0.5547544"... | 0.0 | -1 |
Get a list all goods | @RequestMapping(value = MsalesConstants.MODULE.GOODS.ACTION_GET_LIST_GOODS)
public @ResponseBody
String getListGoods(HttpServletRequest request) {
MsalesPageRequest page = (MsalesPageRequest) request.getAttribute(MsalesConstants.PAGE);
ParameterList parameterList = new ParameterList(page.getPageNo(), page.getRecordsInPage());
MsalesResults<Goods> list = dataService.getListOption(Goods.class, parameterList, true);
if (page.getPageNo() > 0 && page.getRecordsInPage() > 0) {
if (list == null) {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(MsalesStatus.NULL));
}
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(HttpStatus.OK, list));
} else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(MsalesStatus.PAGE_INVALID));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<Goods> getGoodsList();",
"@Override\n\tpublic List<Goods> getGoodsList() {\n\t\treturn goodsMapper.selectAllGoods();\n\t}",
"public void listGoods() {\n\t\tfor (String goodId : goods.keySet()) {\n\t\t\tBoolean value = goods.get(goodId).forSale();\n\t\t\tSystem.out.println(goodId + \" --> For sale: \" + va... | [
"0.824569",
"0.7670529",
"0.7456748",
"0.70975584",
"0.7057151",
"0.7057151",
"0.7057151",
"0.70188975",
"0.7005912",
"0.69979495",
"0.6994542",
"0.69735384",
"0.69635063",
"0.69635063",
"0.6906122",
"0.6895019",
"0.68808615",
"0.68175375",
"0.68138",
"0.67870206",
"0.6769069... | 0.65991724 | 29 |
get Combobox List Goods | @RequestMapping(value = MsalesConstants.MODULE.GOODS.ACTION_GET_CB_LIST_GOODS, method = RequestMethod.POST)
public @ResponseBody
String getCbListGoods(HttpServletRequest request) {
// get List Goods from DB
ParameterList parameterList = new ParameterList();
MsalesResults<Goods> list = dataService.getListOption(Goods.class, parameterList, true);
// list not null display list
String[] strings = {"parents", "goodsCode", "statuss", "goodsCategorys", "isRecover",
"price", "factor", "isFocus", "order"};
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(
HttpStatus.OK, list), strings);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initCombobox() {\n comboConstructeur = new ComboBox<>();\n comboConstructeur.setLayoutX(100);\n comboConstructeur.setLayoutY(250);\n\n\n BDDManager2 bddManager2 = new BDDManager2();\n bddManager2.start(\"jdbc:mysql://localhost:3306/concession?characterEncoding=utf8\"... | [
"0.68475986",
"0.6837794",
"0.6563478",
"0.64932585",
"0.6488604",
"0.6485657",
"0.6463956",
"0.64570034",
"0.64558303",
"0.64053524",
"0.63973814",
"0.63793373",
"0.63570195",
"0.63545465",
"0.6305436",
"0.63044703",
"0.62921244",
"0.62826866",
"0.62799144",
"0.62781256",
"0... | 0.0 | -1 |
get combobox List Goods By GoodsCategory | @RequestMapping(value = MsalesConstants.MODULE.GOODS.ACTION_GET_CB_LIST_GOODS_BY_GOODS_CATEGORY_ID, method = RequestMethod.POST)
public @ResponseBody
String getCbListGoodsByGoodsCategoryId(HttpServletRequest request) {
String jsonString = request.getAttribute(MsalesConstants.CONTENTS).toString();
MsalesPageRequest page = (MsalesPageRequest) request.getAttribute(MsalesConstants.PAGE);
// jsonString not null
if (jsonString != null) {
Goods goods = null;
try {
// parse jsonString to a Goods Object
goods = MsalesJsonUtils.getObjectFromJSON(jsonString,
Goods.class);
} // jsonString syntax incorrect
catch (Exception ex) {
// check field in JSOn request not match with field in JSON.
return MsalesJsonUtils.validateFormat(ex);
}// location from json not null
if (goods != null) {
LinkedHashMap<String, String> hashErrors = new LinkedHashMap<String, String>();
// Location with correct parentId
if (goods.getGoodsCategoryId() != null) {
// get List Location by parentId
ParameterList parameterList = new ParameterList("goodsCategorys.id", goods.getGoodsCategoryId(), page.getPageNo(), page.getRecordsInPage());
MsalesResults<Goods> lists = dataService.getListOption(Goods.class, parameterList, true);
String[] strings = {"parents", "goodsCode", "statuss", "goodsCategorys", "isRecover", "factor", "price", "isFocus", "order"};
return MsalesJsonUtils.getJSONFromOject(MsalesResponse.create(HttpStatus.OK, lists), strings);
} // location from json with incorrect parentId
else {
hashErrors.put("Goods", MsalesValidator.MCP_GOODS_CATEGORY_ID_NULL);
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.JSON_FIELD_REQUIRED, hashErrors));
}
} // location from json null
else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.NULL));
}
} // jsonString null
else {
return MsalesJsonUtils.getJSONFromOject(MsalesResponse
.create(MsalesStatus.NULL));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void listCategory() {\r\n \r\n cmbCategoryFilter.removeAllItems();\r\n cmbCategory.removeAllItems();\r\n \r\n cmbCategoryFilter.addItem(\"All\");\r\n for (Category cat : Category.listCategory()) {\r\n cmbCategoryFilter.addItem(cat.getName());\r\n ... | [
"0.66748905",
"0.66251767",
"0.64553493",
"0.6446018",
"0.62144446",
"0.6213711",
"0.6194442",
"0.618613",
"0.6179217",
"0.6171606",
"0.61677134",
"0.6161758",
"0.6149861",
"0.61462206",
"0.61362964",
"0.6119051",
"0.6117903",
"0.60997367",
"0.60892904",
"0.6073458",
"0.60448... | 0.56230885 | 71 |
Results in a boolean value (isUpToDate) indicating whether or not there are updates available to be installed. This will also produce the installed and current ChannelXmlBeans and if used asynchronously (callback is not null), then this will invoke the appropriate callback method. One side effect is that the last update check time is stored in update settings so that the update check timer knows when to schedule another check at startup. The sequence of steps involved is : 1. Find the local release.xml file 2. Load the local release.xml file as a ChannelXmlBean. 3. Get the release.xml file as a ChannelXmlBean from the server or local filesystem 3a. For server, Determine the channel that the user has (stable or snapshot) 5. Determine if it is the same as the local copy, which was placed either by the installer or the last update? | public void run()
{
String releaseFilename = null;
// 1. Find the local release.xml file. Bail with exception if we cannot find it.
try
{
releaseFilename = _util.getLocalReleaseFile().getAbsolutePath();
}
catch (Exception e)
{
s_log.error("Unexpected exception while attempting to find local release file: "+e.getMessage(), e);
if (_callback != null) {
_callback.updateCheckFailed(e);
}
return;
}
// 2. Load the local release.xml file as a ChannelXmlBean.
ChannelXmlBean installedChannelBean = _util.getLocalReleaseInfo(releaseFilename);
// 3. & 3a. Get the release.xml file as a ChannelXmlBean from the server or
// filesystem.
ChannelXmlBean currentChannelBean = getCurrentChannelXmlBean(installedChannelBean);
// Record now as the last time we checked for updates.
_settings.setLastUpdateCheckTimeMillis("" + currentTimeMillis());
_app.getSquirrelPreferences().setUpdateSettings(_settings);
// 5. Is it the same as the local copy, which was placed either by the
// installer or the last update?
if (currentChannelBean == null)
{
s_log.warn("run: currentChannelBean was null - it is inconclusive whether or not the software "
+ "is current : assuming that it is for now");
if (_callback != null) {
_callback.updateCheckFailed(null);
}
}
else
{
isUpToDate = currentChannelBean.equals(installedChannelBean);
if (_callback != null)
{
_callback.updateCheckComplete(isUpToDate, installedChannelBean, currentChannelBean);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void checkForUpdate(String currentVersion);",
"private ChannelXmlBean getCurrentChannelXmlBean(ChannelXmlBean installedChannelBean)\n\t{\n\t\tChannelXmlBean currentChannelBean = null;\n\t\tif (_settings.isRemoteUpdateSite())\n\t\t{\n\t\t\t// 3a. For server, Determine the channel that the user has (stable ... | [
"0.62426186",
"0.61780304",
"0.6100677",
"0.5922629",
"0.58418816",
"0.57395804",
"0.5631742",
"0.55879366",
"0.54821324",
"0.5453017",
"0.5429803",
"0.5428341",
"0.5406129",
"0.5399418",
"0.53674006",
"0.5356104",
"0.5349353",
"0.53366166",
"0.5331015",
"0.53214824",
"0.5298... | 0.72549105 | 0 |
Uses settings to determine where to get the current release.xml that is available and retrieves it as an XML bean. This will return null (and log a warning) if it couldn't be retrieved. | private ChannelXmlBean getCurrentChannelXmlBean(ChannelXmlBean installedChannelBean)
{
ChannelXmlBean currentChannelBean = null;
if (_settings.isRemoteUpdateSite())
{
// 3a. For server, Determine the channel that the user has (stable or snapshot)
String channelName = getDesiredChannel(_settings, installedChannelBean);
try
{
StringBuilder releasePath = new StringBuilder("/");
releasePath.append(_settings.getUpdateServerPath());
releasePath.append("/");
releasePath.append(channelName);
releasePath.append("/");
currentChannelBean =
_util.downloadCurrentRelease(_settings.getUpdateServer(),
Integer.parseInt(_settings.getUpdateServerPort()), releasePath.toString(),
RELEASE_XML_FILENAME, _app.getSquirrelPreferences().getProxySettings());
}
catch (Exception e)
{
s_log.error("Unexpected exception: " + e.getMessage(), e);
}
}
else
{
currentChannelBean = _util.loadUpdateFromFileSystem(_settings.getFileSystemUpdatePath());
}
return currentChannelBean;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getXMLConfiguration()\n {\n return this.XMLConfiguration;\n }",
"public static XML getDefaultXML() {\r\n try {\r\n return (XML) Class.forName(defaultXMLName).newInstance();\r\n }\r\n catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {\r\n ... | [
"0.5593696",
"0.5587604",
"0.5534912",
"0.55313927",
"0.55096924",
"0.5310588",
"0.52576286",
"0.51749724",
"0.5148838",
"0.5117059",
"0.51168644",
"0.5078544",
"0.50475436",
"0.5042122",
"0.50317156",
"0.501615",
"0.5010602",
"0.49920404",
"0.49902487",
"0.49882683",
"0.4968... | 0.6153287 | 0 |
This method takes a look at preference for channel and the channel that the user currently has installed and logs an info if switching from one to channel to another. | private String getDesiredChannel(final IUpdateSettings settings, final ChannelXmlBean _installedChannelBean)
{
String desiredChannel = settings.getUpdateServerChannel().toLowerCase();
String currentChannelName = _installedChannelBean.getName();
if (!currentChannelName.equals(desiredChannel))
{
if (s_log.isInfoEnabled())
{
s_log.info("getDesiredChannel: User is switching distribution channel from "
+ "installed channel (" + currentChannelName + ") to new channel (" + desiredChannel + ")");
}
}
return desiredChannel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void changeChannel(int channel) {\n\t\tSystem.out.println(\"채널을 바꾸다\");\r\n\t}",
"@Override\n\tpublic void changeChannel() {\n\t\tSystem.out.println(\"Listening to Radio...\\n channel 1 2 3 4....\");\n\t}",
"private synchronized void setCurrentChannel(String currentChannel) {\n\n t... | [
"0.6024867",
"0.601213",
"0.5905379",
"0.5843644",
"0.5792727",
"0.5580718",
"0.5510211",
"0.54626864",
"0.539642",
"0.53782535",
"0.5359666",
"0.5318308",
"0.53127295",
"0.5289008",
"0.5284885",
"0.5284885",
"0.52820295",
"0.5267324",
"0.5245604",
"0.5244718",
"0.52217937",
... | 0.6286979 | 0 |
fail("Not yet implemented"); Intern expectedIntern = new Intern(); | @Test
public final void testIntern() {
HR hr = new HR();
Object result;
result = hr.recruit("I");
assertTrue(result instanceof Intern);
//assertEquals(expectedIntern, result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public FuncionInternaTest(String name) {\n\t\tsuper(name);\n\t}",
"@Test\n public void testAtomString_6() {\n LOGGER.info(\"testAtomString_6\");\n AtomString actual = null;\n final AtomString expected = null;\n boolean caught = false;\n try {\n actual = new AtomSt... | [
"0.61749166",
"0.56927514",
"0.56486225",
"0.5617892",
"0.54403234",
"0.53940225",
"0.53644663",
"0.53467584",
"0.5332385",
"0.5309507",
"0.52985096",
"0.52915615",
"0.52792394",
"0.5279236",
"0.52673143",
"0.5256353",
"0.52414596",
"0.52318615",
"0.52260906",
"0.5209154",
"0... | 0.7915738 | 0 |
Lock for synchronization Begins simulation of the traffic light system | public static void run_simulation(JTable vehicleTable, JTable lightTable, Queue <Car> new_cars, ReentrantLock lock){
Timer timer = new Timer();
// Creating an instance of task to be scheduled
TimerTask task = new Worker(lightSE, lightWS, lightEW, vehicleTable, lightTable, Cars, new_cars, lock);
// Scheduling the timer instance
timer.schedule(task, 100, 1000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void lock() {\n islandLocked = true;\n }",
"public void lock() {\n\t\tlocked = true;\n\t}",
"public void lock() {\r\n super.lock();\r\n }",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n ... | [
"0.71494627",
"0.67783266",
"0.6720755",
"0.66864294",
"0.66864294",
"0.66864294",
"0.6671914",
"0.6606519",
"0.6503867",
"0.64910597",
"0.64638656",
"0.63017684",
"0.62702495",
"0.61625385",
"0.6146728",
"0.6113539",
"0.6081437",
"0.60247236",
"0.6020596",
"0.6009415",
"0.59... | 0.5766024 | 35 |
Initialize queue to store newly arriving cars after simulation has begun | public static void main(String[] args) {
Queue <Car> new_cars = new LinkedList <Car>();
// Set the South-East traffic light as Green initially
int activeLight = 1;
lightSE.isGreen = true;
// Create main UI frame
JFrame frame = new JFrame("Automatic Traffic Light System");
// Create and set positions for user input labels
JLabel sourceLabel = new JLabel();
JLabel destinationLabel = new JLabel();
JLabel arrivalLabel = new JLabel();
sourceLabel.setText("Source: ");
destinationLabel.setText("Destination: ");
arrivalLabel.setText("Arrival Time: ");
sourceLabel.setBounds(250, 50, 100, 30);
destinationLabel.setBounds(250, 90, 100, 30);
arrivalLabel.setBounds(250, 130, 100, 30);
// Create and set positions for user input textboxes
JTextField sourceText = new JTextField(15);
JTextField destText = new JTextField(15);
JTextField arrivalTime = new JTextField(15);
sourceText.setBounds(350, 50, 200, 30);
destText.setBounds(350, 90, 200, 30);
arrivalTime.setBounds(350, 130, 200, 30);
// Add buttons to add cars and run simulation
JButton addCarButton = new JButton("Add car");
JButton runSimulationButton = new JButton("Run Simulation");
addCarButton.setBounds(350, 180, 100, 40);
runSimulationButton.setBounds(300, 230, 200, 40);
// Create panels to display vehicle and traffic light status tables
JPanel vehiclePanel = new JPanel();
JPanel lightPanel = new JPanel();
// Create vehicle status table
String[] vehicleTableColumns = {"Vehicle ID", "Source", "Destination", "Status", "Time Left"};
vehicleTable = new JTable(new DefaultTableModel(vehicleTableColumns, 0));
// Create light status table
String[] lightTableColumns = {"Light", "State", "Time"};
lightTable = new JTable(new DefaultTableModel(lightTableColumns, 0));
DefaultTableModel lightModel = (DefaultTableModel) lightTable.getModel();
// Initialize traffic lights' status table
lightModel.addRow(new String[]{"Light 1", "Green", "60"});
lightModel.addRow(new String[]{"Light 2", "Red", "-"});
lightModel.addRow(new String[]{"Light 3", "Red", "-"});
// Add callback function for when the "Add car" button is clicked
addCarButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
// Get user input for directions and arrival time
String sourceDirection = sourceText.getText();
String destDirection = destText.getText();
// If input is invalid, return
if(!sourceDirection.equals("N") && !sourceDirection.equals("E") && !sourceDirection.equals("W") && !sourceDirection.equals("S")){
return;
}
if(!destDirection.equals("N") && !destDirection.equals("E") && !destDirection.equals("W") && !destDirection.equals("S")){
return;
}
// Clear input fields
// sourceText.setText("");
// destText.setText("");
int currentTime = 0;
// If simulation not running currently
if(!isClicked) {
currentTime = Integer.parseInt(arrivalTime.getText());
if(currentTime < 0) System.out.println("Invalid Input! Arrival time should be greater than zero.");
// arrivalTime.setText("");
}
//Initialize new Car object
Car car = null;
// If simulation has not begun yet
if(!isClicked){
// Create a car object and associate traffic light with its travel directions
if(sourceDirection.equals("S") && destDirection.equals("E")){
car = new Car(lightSE, sourceDirection, destDirection, currentTime);
}
else if(sourceDirection.equals("W") && destDirection.equals("S")){
car = new Car(lightWS, sourceDirection, destDirection, currentTime);
}
else if(sourceDirection.equals("E") && destDirection.equals("W")){
car = new Car(lightEW, sourceDirection, destDirection, currentTime);
}
else{
car = new Car(null, sourceDirection, destDirection, currentTime);
car.departureTime = 0;
}
// Update array of all cars arrived till now
Cars.add(car);
}
// If simulation is running
else{
// Create a car object and associate traffic light with its travel directions
if(sourceDirection.equals("S") && destDirection.equals("E")){
car = new Car(lightSE, sourceDirection, destDirection, 0);
}
else if(sourceDirection.equals("W") && destDirection.equals("S")){
car = new Car(lightWS, sourceDirection, destDirection, 0);
}
else if(sourceDirection.equals("E") && destDirection.equals("W")){
car = new Car(lightEW, sourceDirection, destDirection, 0);
}
else{
car = new Car(null, sourceDirection, destDirection, 0);
car.departureTime = 0;
}
// Acquire lock to ensure synchronization while updating the queue shared by the Main thread and the TimerThread
lock.lock();
try{
// Add new car to queue
new_cars.add(car);
}
catch(Exception e){
e.printStackTrace();
}
finally{
// Release lock
lock.unlock();
}
}
}
});
// Add callback function to "Run Simulation" button
runSimulationButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
// Begin traffic light system simulation
run_simulation(vehicleTable, lightTable, new_cars, lock);
isClicked = true;
// Disable appropriate UI components
arrivalTime.setEnabled(false);
runSimulationButton.setEnabled(false);
}
});
// Set position of UI tables
vehiclePanel.add(new JScrollPane(vehicleTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
vehiclePanel.setBounds(100, 300, 600, 500);
lightPanel.setBounds(100, 825, 600, 75);
lightPanel.add(new JScrollPane(lightTable), BorderLayout.CENTER);
// Add UI components to parent frame
frame.add(sourceLabel);
frame.add(destinationLabel);
frame.add(arrivalLabel);
frame.add(sourceText);
frame.add(destText);
frame.add(arrivalTime);
frame.add(addCarButton);
frame.add(runSimulationButton);
frame.add(vehiclePanel);
frame.add(lightPanel);
// Set frame layout
frame.setSize(800,1000);
frame.setLayout(null);
frame.setVisible(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void init(){\n\n carQueue = new CarQueue();\n gasStation = new GasStation(30,8, carQueue);\n\n gasStation.initialize();\n\n cars = new AddCarThread(carQueue);\n addCars = new Thread(cars);\n }",
"public CarWashSimulation ()\n {\n bay = new Bay(CarWashApplica... | [
"0.7240731",
"0.66167426",
"0.64736",
"0.6427982",
"0.63564515",
"0.63108826",
"0.6299358",
"0.62772006",
"0.616208",
"0.6131598",
"0.6125944",
"0.6060642",
"0.603985",
"0.5938249",
"0.5929866",
"0.5920401",
"0.59132576",
"0.5877175",
"0.5854712",
"0.58450043",
"0.58395207",
... | 0.0 | -1 |
Get user input for directions and arrival time | public void actionPerformed(ActionEvent event){
String sourceDirection = sourceText.getText();
String destDirection = destText.getText();
// If input is invalid, return
if(!sourceDirection.equals("N") && !sourceDirection.equals("E") && !sourceDirection.equals("W") && !sourceDirection.equals("S")){
return;
}
if(!destDirection.equals("N") && !destDirection.equals("E") && !destDirection.equals("W") && !destDirection.equals("S")){
return;
}
// Clear input fields
// sourceText.setText("");
// destText.setText("");
int currentTime = 0;
// If simulation not running currently
if(!isClicked) {
currentTime = Integer.parseInt(arrivalTime.getText());
if(currentTime < 0) System.out.println("Invalid Input! Arrival time should be greater than zero.");
// arrivalTime.setText("");
}
//Initialize new Car object
Car car = null;
// If simulation has not begun yet
if(!isClicked){
// Create a car object and associate traffic light with its travel directions
if(sourceDirection.equals("S") && destDirection.equals("E")){
car = new Car(lightSE, sourceDirection, destDirection, currentTime);
}
else if(sourceDirection.equals("W") && destDirection.equals("S")){
car = new Car(lightWS, sourceDirection, destDirection, currentTime);
}
else if(sourceDirection.equals("E") && destDirection.equals("W")){
car = new Car(lightEW, sourceDirection, destDirection, currentTime);
}
else{
car = new Car(null, sourceDirection, destDirection, currentTime);
car.departureTime = 0;
}
// Update array of all cars arrived till now
Cars.add(car);
}
// If simulation is running
else{
// Create a car object and associate traffic light with its travel directions
if(sourceDirection.equals("S") && destDirection.equals("E")){
car = new Car(lightSE, sourceDirection, destDirection, 0);
}
else if(sourceDirection.equals("W") && destDirection.equals("S")){
car = new Car(lightWS, sourceDirection, destDirection, 0);
}
else if(sourceDirection.equals("E") && destDirection.equals("W")){
car = new Car(lightEW, sourceDirection, destDirection, 0);
}
else{
car = new Car(null, sourceDirection, destDirection, 0);
car.departureTime = 0;
}
// Acquire lock to ensure synchronization while updating the queue shared by the Main thread and the TimerThread
lock.lock();
try{
// Add new car to queue
new_cars.add(car);
}
catch(Exception e){
e.printStackTrace();
}
finally{
// Release lock
lock.unlock();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculateDirections(){\n \t\n \tAddress start = parseAddress(jTextFieldStart);\n \tAddress end = parseAddress(jTextFieldEnd);\n \tif(DEBUG_SETDB){ start = DEBUG_START; end = DEBUG_END; }\n \t\n \t\n \tif(textFieldDefaults.get(jTextFieldStart).equals(jTextFieldStart.getText()) ... | [
"0.6039217",
"0.6020401",
"0.5961242",
"0.59116733",
"0.58730996",
"0.5852793",
"0.5852793",
"0.5804178",
"0.5717015",
"0.56911755",
"0.5680249",
"0.5676732",
"0.5593043",
"0.5502387",
"0.5500207",
"0.543282",
"0.5421643",
"0.54179233",
"0.54107225",
"0.54082024",
"0.5397692"... | 0.0 | -1 |
Begin traffic light system simulation | public void actionPerformed(ActionEvent event){
run_simulation(vehicleTable, lightTable, new_cars, lock);
isClicked = true;
// Disable appropriate UI components
arrivalTime.setEnabled(false);
runSimulationButton.setEnabled(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start() {\n notifyStart();\n simloop();\n notifyStop();\n }",
"public void startSimulation();",
"public static void start(){\n new Light(new Vector3f(getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2,getSIZE()*Chunk.getCHUNKSIZE()/2));\n Keyboar... | [
"0.6896163",
"0.685868",
"0.6726649",
"0.6722229",
"0.6718505",
"0.6690907",
"0.66602415",
"0.6551541",
"0.6451232",
"0.6420909",
"0.64112145",
"0.6391973",
"0.63412875",
"0.6312529",
"0.6309927",
"0.6308072",
"0.6302209",
"0.62934184",
"0.62828034",
"0.62758243",
"0.6267698"... | 0.0 | -1 |
TODO Autogenerated method stub | public List<Teacher> find(String permission_id) {
if(permission_id!=null){
this.session=getSession();
hql="from Teacher";
return (List<Teacher>)teacherDao.findAll(hql, session);
}else
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Get the car size. | public int size() {
return this.size;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getSize() {\n return this.numberOfVehicle;\n }",
"public static int getSIZE() {\n return SIZE;\n }",
"public double getSize()\n\t{\n\t\treturn size;\n\t}",
"public int getSize() {\n return this.radius;\n }",
"public int getSize() {\r\n return this.radius;\r\n... | [
"0.771",
"0.71160984",
"0.70980924",
"0.7086317",
"0.70469064",
"0.6983589",
"0.6974016",
"0.6972017",
"0.69674915",
"0.6939748",
"0.69159865",
"0.69090915",
"0.6896066",
"0.68631554",
"0.68577963",
"0.67650354",
"0.6729484",
"0.67206085",
"0.670437",
"0.66977394",
"0.6688243... | 0.0 | -1 |
Get the car orientation. | public Orientation orientation() {
return this.orientation;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract double getOrientation();",
"public IOrientation getOrientation();",
"public int getOrientation()\n\t{\n\t\treturn orientation;\n\t}",
"public char getOrientation() {\n return orientation;\n }",
"public java.lang.Integer getOrientation () {\n\t\treturn orientation;\n\t}",
"public... | [
"0.7745534",
"0.7722723",
"0.75162023",
"0.75046724",
"0.74810565",
"0.7458451",
"0.7414736",
"0.74028146",
"0.7359955",
"0.7232727",
"0.7200579",
"0.72005045",
"0.7177487",
"0.71766406",
"0.71461445",
"0.706785",
"0.7067651",
"0.70228416",
"0.70063746",
"0.6991919",
"0.69820... | 0.7042179 | 17 |
Get the color of car. | public Color color() {
return this.color;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getCarColor() {\n\t\treturn carColor;\n\t}",
"public CityColor getColor() {\r\n\t\treturn this.color;\r\n\t}",
"public int getColor() {\n return color;\n }",
"public String obtenColor() {\r\n return color;\r\n }",
"public String getVehicleColor() {\n return vehicleC... | [
"0.8369885",
"0.7690777",
"0.7652244",
"0.76111746",
"0.76006764",
"0.75974345",
"0.758595",
"0.758595",
"0.7563534",
"0.754913",
"0.75370824",
"0.75348616",
"0.75271994",
"0.75113326",
"0.7509652",
"0.7509137",
"0.7497646",
"0.7497646",
"0.7490867",
"0.7487805",
"0.7484166",... | 0.71323496 | 100 |
Get the car coordinate. | public Coordinate coordinate() {
return coordinate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Point getCarLocation() {\r\n\r\n SQLiteQueryBuilder builder = new SQLiteQueryBuilder();\r\n builder.setTables(FTS_VIRTUAL_TABLE_CAR);\r\n builder.setProjectionMap(mColumnMapCar);\r\n\r\n Cursor cursor = builder.query(mDatabaseOpenHelper.getReadableDatabase(),\r\n n... | [
"0.77308655",
"0.69350696",
"0.6913295",
"0.6717267",
"0.6712009",
"0.6702665",
"0.6662659",
"0.66587913",
"0.661294",
"0.6532018",
"0.65303606",
"0.6483313",
"0.64832526",
"0.6460175",
"0.6425863",
"0.6382872",
"0.6317428",
"0.6302813",
"0.62974596",
"0.6294089",
"0.6289459"... | 0.67860985 | 3 |
Set the car position | public void setPosition(Coordinate coord) {
this.coordinate = coord;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void carPosition(Car car) {\n if (car.getLocation() == 1) {\n AnchorPane.setTopAnchor(car, 180.0);\n AnchorPane.setLeftAnchor(car, 160.0);\n car.setRotate(180);\n } else if (car.getLocation() == 2) {\n AnchorPane.setTopAnchor(car, 180.0);\n ... | [
"0.77519035",
"0.7306294",
"0.72114",
"0.72114",
"0.7193541",
"0.7087873",
"0.7047187",
"0.7025954",
"0.7023803",
"0.701122",
"0.69901824",
"0.69586796",
"0.6884471",
"0.6881938",
"0.68545336",
"0.682763",
"0.68152714",
"0.6793527",
"0.67544067",
"0.67486346",
"0.67457193",
... | 0.0 | -1 |
DATA ::= RECDATA or POLYDATA or MONODATA | private @Nullable Data readData(
@NotNull Type typeBound,
@NotNull List<P> projections // non-empty, polymorphic tails respected
) throws IOException, JsonFormatException {
if (nextToken() == null) return null;
return finishReadingData(typeBound, projections);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isData() {\n return \"data\".equalsIgnoreCase(data.substring(tokenStart, tokenStart + 4));\n }",
"java.lang.String getData();",
"public void cdata(Object parser, String data) {\n if (!empty(this.in_content)) {\r\n\t\t\t// handle self-closing tags (case: text node found, need to... | [
"0.63183975",
"0.61219406",
"0.61055166",
"0.6080041",
"0.60440856",
"0.59702104",
"0.5905162",
"0.5893207",
"0.5883205",
"0.5875592",
"0.5875592",
"0.5813641",
"0.5800341",
"0.57575345",
"0.5699673",
"0.567539",
"0.56720376",
"0.5659035",
"0.5652483",
"0.5652483",
"0.5646723... | 0.0 | -1 |
VALUE ::= POLYVALUE | MONOVALUE | private @NotNull Val readValue(
@NotNull DatumType typeBound,
@NotNull List<MP> projections // non-empty
) throws IOException, JsonFormatException {
nextNonEof();
return finishReadingValue(typeBound, projections);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@VTID(14)\r\n double getValue();",
"double getValue();",
"double getValue();",
"double getValue();",
"@Override\n public Double value(TypeOfValue value);",
"V getValue();",
"V getValue();",
"V getValue();",
"ValueType getValue();",
"public double getValue();",
"Double getValue();",
"gov.n... | [
"0.5954287",
"0.5842774",
"0.5842774",
"0.5842774",
"0.5808268",
"0.5801042",
"0.5801042",
"0.5801042",
"0.5773355",
"0.5748904",
"0.5741117",
"0.55828226",
"0.5582221",
"0.55581605",
"0.5555003",
"0.55071473",
"0.54853314",
"0.5478392",
"0.54525334",
"0.5448404",
"0.54290634... | 0.0 | -1 |
VALUE ::= POLYVALUE | MONOVALUE | private @NotNull Val finishReadingValue(
@NotNull DatumType typeBound,
@NotNull List<MP> projections // non-empty
) throws IOException, JsonFormatException {
assert !projections.isEmpty();
boolean readPoly = WireUtil.needPoly(typeBound, projections);
JsonToken token = currentToken();
final DatumType type;
if (readPoly) {
ensure(token, JsonToken.START_OBJECT);
type = readModelType(projections);
stepOver(JsonFormat.POLYMORPHIC_VALUE_FIELD); // "data"
nextNonEof(); // position parser on first MONODATA token
} else {
DatumType projectionType = (DatumType) projections.get(projections.size() - 1)
.type(); // effectiveType; // mostSpecificType(projections);
type = projectionType.isAssignableFrom(typeBound) ? typeBound : projectionType; // pick most specific
}
Val result = finishReadingMonoValue(type, projections);
if (readPoly) stepOver(JsonToken.END_OBJECT);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@VTID(14)\r\n double getValue();",
"double getValue();",
"double getValue();",
"double getValue();",
"@Override\n public Double value(TypeOfValue value);",
"V getValue();",
"V getValue();",
"V getValue();",
"ValueType getValue();",
"public double getValue();",
"Double getValue();",
"gov.n... | [
"0.5954287",
"0.5842774",
"0.5842774",
"0.5842774",
"0.5808268",
"0.5801042",
"0.5801042",
"0.5801042",
"0.5773355",
"0.5748904",
"0.5741117",
"0.55828226",
"0.5582221",
"0.55581605",
"0.5555003",
"0.55071473",
"0.54853314",
"0.5478392",
"0.54525334",
"0.5448404",
"0.54290634... | 0.0 | -1 |
VALUE ::= ERROR or DATUM or null | private @NotNull Val finishReadingMonoValue(
@NotNull DatumType type,
@NotNull Collection<MP> tagModelProjections // non-empty
) throws IOException, JsonFormatException {
JsonToken token = currentToken();
assert !tagModelProjections.isEmpty();
// null?
if (token == JsonToken.VALUE_NULL) return type.createValue(null);
// error?
final @Nullable String firstFieldName;
if (token == JsonToken.START_OBJECT) { // can be a record or an error
firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)
if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());
} else firstFieldName = null;
// datum
final @NotNull Datum datum = finishReadingDatum(type, firstFieldName, tagModelProjections);
return datum.asValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Value validateValue(Value value);",
"abstract Object getValue (String str, ValidationContext vc) throws DatatypeException;",
"public abstract void validate(String value) throws DatatypeException;",
"ValueType getValue();",
"gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value xgetVal... | [
"0.62622786",
"0.59421915",
"0.5690968",
"0.5676315",
"0.565348",
"0.5643239",
"0.5506099",
"0.55033535",
"0.55033535",
"0.5496391",
"0.5491862",
"0.5480177",
"0.54533666",
"0.54327345",
"0.540306",
"0.54028165",
"0.54001683",
"0.5368207",
"0.5361335",
"0.53286964",
"0.532846... | 0.0 | -1 |
`: 404, "message": "blah" }` | private @NotNull ErrorValue finishReadingError()
throws IOException, JsonFormatException {
stepOver(JsonToken.VALUE_NUMBER_INT, "integer value");
int errorCode;
try { errorCode = currentValueAsInt(); } catch (JsonParseException ignored) {
throw expected("integer error code");
}
stepOver(JsonFormat.ERROR_MESSAGE_FIELD);
stepOver(JsonToken.VALUE_STRING, "string value");
String message = currentText();
// TODO read custom error properties here (if we decide to support these)
stepOver(JsonToken.END_OBJECT);
return new ErrorValue(errorCode, message, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public NotFoundException(final String message) {\r\n super(Response.status(Responses.NOT_FOUND).\r\n entity(message).type(\"text/plain\").build());\r\n myDetailMessage = message;\r\n }",
"@GetMapping(\"notfound\")\n public void notFound()\n {\n throw new NotFoundExcep... | [
"0.6933721",
"0.6754707",
"0.66461134",
"0.6514815",
"0.6447914",
"0.64335215",
"0.62738085",
"0.62248313",
"0.6153331",
"0.6039648",
"0.6019155",
"0.5991903",
"0.5954633",
"0.5952427",
"0.59193486",
"0.5877563",
"0.5871052",
"0.586532",
"0.58534783",
"0.58529925",
"0.5816621... | 0.0 | -1 |
`}` or `: DATA, "field": DATA, ... }` | private @NotNull RecordDatum.Builder finishReadingRecord(
@Nullable String fieldName,
@NotNull RecordType type,
@NotNull Collection<RMP> projections // non-empty
) throws IOException, JsonFormatException {
RecordDatum.Builder datum = type.createBuilder();
if (fieldName == null) { // empty record?
ensureCurr(JsonToken.END_OBJECT, "field name or '}'");
return datum;
} else {
while (true) {
Field field = type.fieldsMap().get(fieldName);
if (field == null) throw error(
"Unknown field '" + fieldName + "' in record type '" + type.name().toString() + "'"
);
List<P> fieldProjections =
fieldProjections(projections, field, () -> new ArrayList<>(projections.size()));
if (fieldProjections == null) throw error("Unexpected field '" + fieldName + "'");
Data fieldData = readData(field.dataType().type(), fieldProjections);
datum._raw().setData(field, fieldData);
JsonToken token = nextNonEof();
if (token == JsonToken.END_OBJECT) break;
if (token == JsonToken.FIELD_NAME) fieldName = currentName();
else throw expected("field name or '}'");
}
}
for (RMP projection : projections)
for (final Map.Entry<String, FPE> entry : projection.fieldProjections().entrySet())
if (fieldRequired(entry.getValue())) {
final Data data = datum._raw().getData((Field) entry.getValue().field());
if (data == null)
throw error("Required field '" + entry.getKey() + "' is missing");
else if (data.type().kind() != TypeKind.ENTITY) {
final Val val = data._raw().tagValues().get(DatumType.MONO_TAG_NAME);
if (val == null || val.getDatum() == null)
throw error("Required field '" + entry.getKey() + "' is missing");
}
}
return datum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected String getParameterizedFields()\n\t{\n\t\tString fields = \" GAZOID=?, GAZFLD=?, GAZPVN=?, GAZTYP=?, GAZCLN=?, GAZCLS=? \";\n\t\treturn fields;\n\t}",
"@Test\n public void fieldData() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new Docum... | [
"0.52792245",
"0.52541655",
"0.5228009",
"0.5217415",
"0.5135465",
"0.5121056",
"0.5103405",
"0.50698406",
"0.5060654",
"0.5054822",
"0.5046232",
"0.5035389",
"0.50228506",
"0.49995774",
"0.48952162",
"0.48785895",
"0.48280364",
"0.48274073",
"0.48220077",
"0.47990623",
"0.47... | 0.0 | -1 |
we don't support anything but qualified type names here | private @Nullable Type resolveType(@NotNull String typeName) {
QnTypeRef typeRef = new QnTypeRef(Qn.fromDotSeparated(typeName));
return (Type) typesResolver.resolve(typeRef);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"QName getType();",
"public Type type(String name);",
"String typeName();",
"public abstract QName getType();",
"public abstract jq_Type getDeclaredType();",
"public String getQualifiedName()\n {\n return name + \".\" + type;\n }",
"NamedType createNamedType();",
"protected abstract Strin... | [
"0.61871386",
"0.6163918",
"0.6156917",
"0.60895157",
"0.6048877",
"0.60107243",
"0.6005734",
"0.5967094",
"0.5961561",
"0.59453654",
"0.59270644",
"0.5905805",
"0.5868803",
"0.58585817",
"0.5849607",
"0.5849607",
"0.5849607",
"0.5849607",
"0.5849607",
"0.5849607",
"0.5849607... | 0.6049308 | 4 |
VALUE ::= ERROR or DATUM or null | private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {
DatumType type = tag.type;
@NotNull JsonToken token = currentToken();
// null?
if (token == JsonToken.VALUE_NULL) return type.createValue(null);
// error?
final @Nullable String firstFieldName;
if (token == JsonToken.START_OBJECT) { // can be a record or an error
firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)
if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());
} else firstFieldName = null;
// datum
final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);
return datum.asValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Value validateValue(Value value);",
"abstract Object getValue (String str, ValidationContext vc) throws DatatypeException;",
"public abstract void validate(String value) throws DatatypeException;",
"ValueType getValue();",
"gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value xgetVal... | [
"0.62622786",
"0.59421915",
"0.5690968",
"0.5676315",
"0.565348",
"0.5643239",
"0.5506099",
"0.55033535",
"0.55033535",
"0.5496391",
"0.5491862",
"0.5480177",
"0.54533666",
"0.54327345",
"0.540306",
"0.54028165",
"0.54001683",
"0.5368207",
"0.5361335",
"0.53286964",
"0.532846... | 0.0 | -1 |
`}` or `: DATA, "field": DATA, ... }` | private @NotNull RecordDatum finishReadingRecord(
@NotNull JsonToken token,
@Nullable String fieldName,
@NotNull RecordType type
) throws IOException, JsonFormatException {
ensure(token, JsonToken.START_OBJECT);
RecordDatum.Builder datum = type.createBuilder();
if (fieldName == null) { // empty record?
ensureCurr(JsonToken.END_OBJECT, "field name or '}'");
return datum;
} else {
while (true) {
Field field = type.fieldsMap().get(fieldName);
if (field == null) throw error(
"Unknown field '" + fieldName + "' in record type '" + type.name().toString() + "'"
);
Data fieldData = readData(field.dataType());
datum._raw().setData(field, fieldData);
token = nextNonEof();
if (token == JsonToken.END_OBJECT) break;
if (token == JsonToken.FIELD_NAME) fieldName = currentName();
else throw expected("field name or '}'");
}
}
return datum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected String getParameterizedFields()\n\t{\n\t\tString fields = \" GAZOID=?, GAZFLD=?, GAZPVN=?, GAZTYP=?, GAZCLN=?, GAZCLS=? \";\n\t\treturn fields;\n\t}",
"@Test\n public void fieldData() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new Docum... | [
"0.52792245",
"0.52541655",
"0.5228009",
"0.5217415",
"0.5135465",
"0.5121056",
"0.5103405",
"0.50698406",
"0.5060654",
"0.5054822",
"0.5046232",
"0.5035389",
"0.50228506",
"0.49995774",
"0.48952162",
"0.48785895",
"0.48280364",
"0.48274073",
"0.48220077",
"0.47990623",
"0.47... | 0.4731634 | 26 |
FIXME use `stepOver(JsonToken, String)` | private void stepOver(@NotNull JsonToken expected)
throws IOException, JsonFormatException {
stepOver(expected, "'" + expected.toString() + "'");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void next(JSONTokener tokener) {\n char result = tokener.nextClean();\n // step back one if we haven't reached the end of the input\n if (result != 0) tokener.back();\n }",
"abstract protected void parseNextToken();",
"java.lang.String getNextStep();",
"private Token readNext(... | [
"0.61839575",
"0.56983775",
"0.55314445",
"0.5376124",
"0.5289786",
"0.5240467",
"0.51393783",
"0.5099694",
"0.5096944",
"0.5076172",
"0.5066562",
"0.5053063",
"0.50328934",
"0.4974055",
"0.49712676",
"0.49576113",
"0.49338558",
"0.4925749",
"0.48920995",
"0.48832792",
"0.487... | 0.73598355 | 0 |
TODO Autogenerated method stub | @Override
public View getView(int position, View convertView, ViewGroup parent) {
View layout= getLayoutInflater().inflate(R.layout.item_listview_age, null);
TextView textView= (TextView) layout.findViewById(R.id.tv_listview_age);
textView.setText(mAgeLists[position]);
return layout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int getCount() {
return mAgeLists.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Object getItem(int position) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public long getItemId(int position) {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.age, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7247427",
"0.720267",
"0.7196145",
"0.7178052",
"0.71080035",
"0.7040695",
"0.7039065",
"0.7012457",
"0.7011027",
"0.6980861",
"0.69456106",
"0.69392735",
"0.6934666",
"0.691844",
"0.691844",
"0.6891824",
"0.6884514",
"0.6875728",
"0.6875644",
"0.6862535",
"0.6862535",
"... | 0.0 | -1 |
/ String userCode = SPUtils.getInstance().getString(CacheConsts.userCode, ""); String reservoirId = SPUtils.getInstance().getString(CacheConsts.reservoirId, ""); List routePositionsNew = DataSupport.where("usercode=? and reservoirid=?", userCode, reservoirId).find(RoutePosition.class); | public List<RoutePosition> getRoutePositions() {
return routePositions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List getRoutes(int fromId, int toId) {\n String queryString = \"FROM Route R WHERE R.fromId =\\\"\" + fromId + \"\\\" AND R.toId = \\\"\"+ toId +\"\\\" ORDER BY R.price ASC\";\n// String queryString = \"SELECT R.airline, R.price FROM Route R WHERE R.fromId =\\\"\" + fromId + \"\\\" AND R.toId = \\... | [
"0.60740155",
"0.56123614",
"0.56069195",
"0.559576",
"0.5594326",
"0.5593688",
"0.54575616",
"0.54388916",
"0.54253787",
"0.53680027",
"0.53340024",
"0.53230125",
"0.53195065",
"0.5306953",
"0.52715665",
"0.52535367",
"0.52529234",
"0.5246269",
"0.5239845",
"0.52368367",
"0.... | 0.0 | -1 |
/ String userCode = SPUtils.getInstance().getString(CacheConsts.userCode, ""); String reservoirId = SPUtils.getInstance().getString(CacheConsts.reservoirId, ""); itemList = DataSupport.where("userCode=? and reservoirId=?", userCode,reservoirId).find(TaskItemBean.class); | public List<TaskItemBean> getItemList(){
return itemList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static List<Task> getTaskFromDb() {\n List<Task> taskList = new ArrayList<>();\n try {\n // taskList = Task.listAll(Task.class);\n taskList= Select.from(Task.class).orderBy(\"due_date Desc\").where(\"status=?\", new String[] {\"0\"}).list();\n } catch (Exception e) ... | [
"0.60628897",
"0.60339737",
"0.595969",
"0.5924863",
"0.5916187",
"0.58851904",
"0.5835518",
"0.5827198",
"0.57872486",
"0.57775897",
"0.5704225",
"0.57015085",
"0.56826067",
"0.56687176",
"0.56540304",
"0.56365466",
"0.56234145",
"0.5602231",
"0.559516",
"0.55807996",
"0.556... | 0.5390653 | 41 |
A default pager model implementation | public DefaultPagerModel(int minEndPages, int currentBuffer, int nextPrevThreshold) {
this(minEndPages, minEndPages, currentBuffer, nextPrevThreshold, nextPrevThreshold);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IPager createPager(PagedList.Config config);",
"public void paging(ModelAndView mav);",
"@Override\n\tpublic Pager<Object> getPager() {\n\t\treturn null;\n\t}",
"@RequestMapping(\"/initPage\")\n @ResponseBody\n public Pager initPage(Pager<Data_sets> pager, Model model) {\n if (pager.getSearch_st... | [
"0.72932583",
"0.66936475",
"0.65018487",
"0.6386517",
"0.6370222",
"0.6314423",
"0.628325",
"0.6236676",
"0.6140779",
"0.6111954",
"0.6055109",
"0.59822685",
"0.5981918",
"0.5981918",
"0.59779155",
"0.59737676",
"0.59693956",
"0.59352005",
"0.58202565",
"0.5816156",
"0.58035... | 0.620763 | 8 |
A default pager model implementation | public DefaultPagerModel(int minStartPages, int minEndPages, int currentBuffer, int prevThreshold, int nextThreshold) {
super();
this.minStartPages = minStartPages;
this.minEndPages = minEndPages;
this.currentBuffer = currentBuffer;
this.prevThreshold = prevThreshold;
this.nextThreshold = nextThreshold;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IPager createPager(PagedList.Config config);",
"public void paging(ModelAndView mav);",
"@Override\n\tpublic Pager<Object> getPager() {\n\t\treturn null;\n\t}",
"@RequestMapping(\"/initPage\")\n @ResponseBody\n public Pager initPage(Pager<Data_sets> pager, Model model) {\n if (pager.getSearch_st... | [
"0.72932583",
"0.66936475",
"0.65018487",
"0.6386517",
"0.6370222",
"0.628325",
"0.6236676",
"0.620763",
"0.6140779",
"0.6111954",
"0.6055109",
"0.59822685",
"0.5981918",
"0.5981918",
"0.59779155",
"0.59737676",
"0.59693956",
"0.59352005",
"0.58202565",
"0.5816156",
"0.580351... | 0.6314423 | 5 |
Persist project via its DTO. Checks name to not be empty and name of the project does not exists | @Transactional
public Long persist(ProjectDto project) {
Objects.requireNonNull(project);
Objects.requireNonNull(project.getName());
if(project.getOrganizationId() == null) throw new EarException("Organization ID must be specified");
User user = userService.getSecurityUser();
// name must not be empty
if (project.getName().isEmpty()) throw new ValidationException("Name of the project can not be empty");
// project must not exist
Project foundProject = dao.findByName(project.getName());
if (foundProject != null) throw new AlreadyExistsException("Project with this name already exists");
Organization foundOrganization = organizationDao.find(project.getOrganizationId());
if (foundOrganization == null) throw new AlreadyExistsException("Organization with this id doesnt exist");
if (!foundOrganization.isUserPM(user.getId())) {
throw new ValidationException("Not enough rights");
}
Project newProject = project.buildNewProject();
newProject.setOrganization(foundOrganization);
dao.persist(newProject);
// Add user to project
ProjectUser projectUser = new ProjectUser(user, newProject);
projectUserDao.persist(projectUser);
return newProject.getId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@PostMapping(\"/projects\")\n @Timed\n public ResponseEntity<ProjectDTO> createProject(@Valid @RequestBody ProjectDTO projectDto)\n throws URISyntaxException, NotAuthorizedException {\n log.debug(\"REST request to save Project : {}\", projectDto);\n var org = projectDto.getOrganizati... | [
"0.732588",
"0.6924365",
"0.6361648",
"0.6352319",
"0.6338412",
"0.6320223",
"0.62931347",
"0.6278102",
"0.6201968",
"0.6188176",
"0.6140468",
"0.60846746",
"0.604349",
"0.6003478",
"0.6003452",
"0.6003452",
"0.6003452",
"0.59939384",
"0.59923047",
"0.5963465",
"0.59489125",
... | 0.64391994 | 2 |
calculate all data when button of "process sale" | public void saleAct() {
if(createWine() != null) {
text_amount =String.valueOf( cus.saleTransaction(createWine()));
wine_name.setText(name.getText());
amount.setText(" £ " + text_amount + " " );
balance.setText(" £ " + isCredit((double)cus.getAccount() / 100.00) + " ");
//reset all textfield
name.setText(null);
quantity.setText(null);
price.setText(null);
}
else {
name.setText(null);
quantity.setText(null);
price.setText(null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void act()\n {\n if(onSales == true)\n {\n calculateSale();\n }\n }",
"public void calculateSale()\n {\n double total = 0.00;\n int numTimbits = 0;\n int numDoughnuts = 0;\n int smallCoffee = 0;\n int mediumCoffee = 0;\n in... | [
"0.69409764",
"0.6423472",
"0.63322455",
"0.62398094",
"0.6110371",
"0.60997087",
"0.59705174",
"0.5966577",
"0.59416574",
"0.592146",
"0.5893026",
"0.58909035",
"0.58888346",
"0.5816039",
"0.57940346",
"0.57867676",
"0.5777556",
"0.5766959",
"0.57526004",
"0.5751263",
"0.574... | 0.6174886 | 4 |
calculate all data when button of "process return" | public void returnAct() {
if(createWine() != null) {
text_amount =String.valueOf( cus.returnTransaction(createWine()));
wine_name.setText(name.getText());
amount.setText(" £ " + text_amount + " " );
balance.setText(" £ " + isCredit((double)cus.getAccount() / 100.00) + " ");
//reset all textfield
name.setText(null);
quantity.setText(null);
price.setText(null);
}
else {
name.setText(null);
quantity.setText(null);
price.setText(null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculate();",
"public void calculateMethod() {\n\n if (counter != 16) {\n ifElseCalculation();\n } else {\n ifElseCalculation();\n\n //saves final Points for 2nd Activity\n shareData();\n //opens 2nd Activity for Result\n ... | [
"0.6293098",
"0.6127761",
"0.6107697",
"0.60103154",
"0.598053",
"0.5924595",
"0.5922857",
"0.58818924",
"0.5872368",
"0.5849537",
"0.58484924",
"0.58418214",
"0.5838644",
"0.58112484",
"0.57965565",
"0.5789687",
"0.5750822",
"0.5716917",
"0.5709857",
"0.5703717",
"0.56330705... | 0.5591477 | 25 |
determine balance whether positive or negative | public String isCredit(double balance) {
if(balance < 0) {
return String.valueOf(Math.abs(balance)) + "CR"; //CR value
}
else
return String.valueOf(balance);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"double getBalance();",
"double getBalance();",
"private static boolean isValidBalance(float balance) {\n\t\tif(balance < 0) {\r\n\t\t\tSystem.out.println(\"Not a valid balance\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse return true;\r\n\t}",
"BigDecimal getClosingDebitBalance();",
"public boolean isBal... | [
"0.7121001",
"0.7121001",
"0.6911847",
"0.67261714",
"0.66688854",
"0.66085666",
"0.6589563",
"0.6589563",
"0.6556789",
"0.65247715",
"0.6510597",
"0.65068763",
"0.6499554",
"0.64992374",
"0.64782935",
"0.6470289",
"0.642113",
"0.6403054",
"0.63731146",
"0.6328985",
"0.630510... | 0.6142965 | 49 |
check the input data is validate or not | public String checkFormat() {
String msg = null;
try { //input is not a number
Double.parseDouble(price.getText());
Integer.parseInt(quantity.getText());
}
catch(Exception e) {
return msg = "Data format is invalid";
}
if(name.getText().isEmpty() //wine name is empty
|| name.getText().length() > 30 //wine name is more than 30 letters
|| quantity.getText().isEmpty() //quantity is empty
||price.getText().isEmpty() //price is empty
||((!(price.getText().length() - price.getText().indexOf('.') == 3)) //price is not two decimal spaces
&& price.getText().indexOf('.') != -1))
{
msg = "Data format is invalid";
}
else {
msg = null;
}
return msg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void validateData() {\n }",
"protected boolean isValidData() {\n return true;\n }",
"private boolean isInputValid() {\n return true;\n }",
"protected abstract boolean isInputValid();",
"private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n ... | [
"0.84501356",
"0.77126855",
"0.7578367",
"0.75369567",
"0.74555796",
"0.74090225",
"0.7401893",
"0.7389382",
"0.7352748",
"0.73146737",
"0.72685885",
"0.7224732",
"0.71274626",
"0.70843375",
"0.7074103",
"0.7074103",
"0.706048",
"0.70477974",
"0.7019777",
"0.70183545",
"0.701... | 0.0 | -1 |
Created by Martin Petzold on 04.12.2016. | public interface OrderConceptRepository<O extends OrderConcept> extends JpaRepository<O, Long> {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"@Override\n public int describeContents() { return 0; }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\... | [
"0.5761576",
"0.56085277",
"0.56064886",
"0.5597284",
"0.551865",
"0.5500112",
"0.5492896",
"0.5474663",
"0.54335946",
"0.5433009",
"0.5419241",
"0.5414535",
"0.5414535",
"0.5413277",
"0.53593385",
"0.5354854",
"0.53309894",
"0.52971894",
"0.52929586",
"0.5291843",
"0.5287702... | 0.0 | -1 |
Build a list with all the resident nodes of the MEBN ordered by name. | public static List<ResidentNode> createOrderedResidentNodeList(MultiEntityBayesianNetwork mebn){
List<ResidentNode> listResident = new ArrayList<ResidentNode>();
for(MFrag mfrag: mebn.getMFragList()){
for(ResidentNode node: mfrag.getResidentNodeList()){
listResident.add(node);
}
}
Collections.sort(listResident);
return listResident;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.util.List<io.netifi.proteus.admin.om.Node> \n getNodesList();",
"java.util.List<entities.Torrent.NodeId>\n getNodesList();",
"List<String> getNodeNames()\n {\n return allNodes.values().stream().map(CommunicationLink::getName).collect(Collectors.toList());\n }",
"List<Node> getNo... | [
"0.63908404",
"0.62612903",
"0.6222534",
"0.61024487",
"0.6025049",
"0.5923041",
"0.588003",
"0.58561444",
"0.5847878",
"0.58108574",
"0.57912195",
"0.5771521",
"0.5762948",
"0.5755495",
"0.57473075",
"0.5712284",
"0.57061905",
"0.56744695",
"0.5660583",
"0.5657728",
"0.56515... | 0.7528862 | 0 |
Constructor for an Action. | public Action(long id) {
this(id, "");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ActionManager() {\n\t\tsuper();\n\t}",
"public Action(String name) {\n this.name = name;\n }",
"public ScheduledActionAction() {\n\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"public... | [
"0.7443472",
"0.740604",
"0.73790044",
"0.7314408",
"0.72342914",
"0.72342914",
"0.72342914",
"0.72062093",
"0.71207124",
"0.71137273",
"0.70835066",
"0.70617306",
"0.7028072",
"0.70132303",
"0.6994445",
"0.6950341",
"0.6921869",
"0.68726045",
"0.68390507",
"0.6682701",
"0.66... | 0.7757959 | 0 |
Constructor for an Action. | public Action(long id, @Nullable CharSequence label) {
this(id, label, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Action(long id) {\n this(id, \"\");\n }",
"public ActionManager() {\n\t\tsuper();\n\t}",
"public Action(String name) {\n this.name = name;\n }",
"public ScheduledActionAction() {\n\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"Action createAction();",
"... | [
"0.7757959",
"0.7443472",
"0.740604",
"0.73790044",
"0.7314408",
"0.72342914",
"0.72342914",
"0.72342914",
"0.72062093",
"0.71207124",
"0.71137273",
"0.70835066",
"0.70617306",
"0.7028072",
"0.70132303",
"0.6994445",
"0.6950341",
"0.6921869",
"0.68726045",
"0.68390507",
"0.66... | 0.64266235 | 61 |
Constructor for an Action. | public Action(long id, @Nullable CharSequence label1, @Nullable CharSequence label2) {
this(id, label1, label2, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Action(long id) {\n this(id, \"\");\n }",
"public ActionManager() {\n\t\tsuper();\n\t}",
"public Action(String name) {\n this.name = name;\n }",
"public ScheduledActionAction() {\n\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"Action createAction();",
"... | [
"0.7757959",
"0.7443472",
"0.740604",
"0.73790044",
"0.7314408",
"0.72342914",
"0.72342914",
"0.72342914",
"0.72062093",
"0.71207124",
"0.71137273",
"0.70835066",
"0.70617306",
"0.7028072",
"0.70132303",
"0.6994445",
"0.6950341",
"0.6921869",
"0.68726045",
"0.68390507",
"0.66... | 0.0 | -1 |
Constructor for an Action. | public Action(
long id,
@Nullable CharSequence label1,
@Nullable CharSequence label2,
@Nullable Drawable icon
) {
setId(id);
setLabel1(label1);
setLabel2(label2);
setIcon(icon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Action(long id) {\n this(id, \"\");\n }",
"public ActionManager() {\n\t\tsuper();\n\t}",
"public Action(String name) {\n this.name = name;\n }",
"public ScheduledActionAction() {\n\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"Action createAction();",
"... | [
"0.7757959",
"0.7443472",
"0.740604",
"0.73790044",
"0.7314408",
"0.72342914",
"0.72342914",
"0.72342914",
"0.72062093",
"0.71207124",
"0.71137273",
"0.70835066",
"0.70617306",
"0.7028072",
"0.70132303",
"0.6994445",
"0.6950341",
"0.6921869",
"0.68726045",
"0.68390507",
"0.66... | 0.0 | -1 |
Sets the id for this Action. | public final void setId(long id) {
mId = id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setId(int id) {\n this.id = String.valueOf(this.hashCode());\n }",
"public void setId(int id_)\n\t{\n\t\tthis.id=id_;\n\t}",
"public void setId(Object id) {\n this.id = id;\n }",
"public void setId(Object id) {\n this.id = id;\n }",
"public void setId(final int id)... | [
"0.7497568",
"0.740553",
"0.73879874",
"0.73879874",
"0.73403645",
"0.7328074",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7282983",
"0.7243487",
"0.7243487",
"0.72318053",
"0.72318053",... | 0.0 | -1 |
Returns the id for this Action. | public final long getId() {
return mId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getId() {\n return (String) getValue(ACTION_ID);\n }",
"public String getActionId() {\n\t\treturn actionId;\n\t}",
"public Long getActionId() {\n return actionId;\n }",
"@Override\n\tpublic int getActionId() {\n\t\treturn actionId;\n\t}",
"public String getActionId() {\n ... | [
"0.8235456",
"0.7835912",
"0.7775717",
"0.75553626",
"0.7391336",
"0.68487597",
"0.66610754",
"0.65957254",
"0.6584102",
"0.6559914",
"0.6539016",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",
"0.6523696",... | 0.0 | -1 |
Sets the first line label for this Action. | public final void setLabel1(@Nullable CharSequence label) {
mLabel1 = label;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createStartingLabel() {\n \tcreateLabel(myResources.getString(\"title\"), 1, 0, TITLE_FONT);\n }",
"public void setFirstLineNumberIfNeeded(int firstLineNumber) {\n\t\tcodeItem.setFirstLineNumber(firstLineNumber);\n\t}",
"public void setBeginText(String msg) {\n\t\tbegin.setLabel(msg);\n\t}",... | [
"0.59754485",
"0.5868683",
"0.579131",
"0.5737742",
"0.57241774",
"0.56734496",
"0.5646457",
"0.56342",
"0.55805194",
"0.55494666",
"0.5544503",
"0.55303776",
"0.5516814",
"0.55060834",
"0.55017245",
"0.5461394",
"0.5450035",
"0.54450995",
"0.54305136",
"0.54297054",
"0.54262... | 0.5658004 | 6 |
Returns the first line label for this Action. | @Nullable
public final CharSequence getLabel1() {
return mLabel1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFirstLine() {\n return this.firstLine;\n }",
"public String getFirstLine() {\r\n return this.firstLine;\r\n }",
"public String label() {\n\t\treturn \"LABEL_\" + (labelCount++);\n\t}",
"@Nullable\n public CharSequence getLabel() {\n return mPrimaryLabel;\n }",
... | [
"0.65114534",
"0.650151",
"0.62191397",
"0.60383755",
"0.60279363",
"0.59657216",
"0.5962464",
"0.5948123",
"0.5917651",
"0.5868487",
"0.5836616",
"0.58317065",
"0.58317065",
"0.58317065",
"0.5830435",
"0.5826013",
"0.5826013",
"0.58245087",
"0.5819391",
"0.58164513",
"0.5812... | 0.62888956 | 2 |
Sets the second line label for this Action. | public final void setLabel2(@Nullable CharSequence label) {
mLabel2 = label;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateProgressLabel2 (String label2)\n\t{\n\t\t\n\t\tmProgressLabel2.setText(label2);\n\t\n\t}",
"public void setLabel(T2 eLabel) {\r\n\t\tthis.label = eLabel;\r\n\t\tcheckRep();\r\n\t}",
"public void setYLabel(String _label);",
"public void setLine2(java.lang.String line2) {\r\n this.line... | [
"0.58566487",
"0.5852446",
"0.5726386",
"0.57085556",
"0.5703961",
"0.5588942",
"0.5577799",
"0.5488293",
"0.5466242",
"0.54212654",
"0.5376064",
"0.5354779",
"0.5340479",
"0.5335228",
"0.52844447",
"0.52819085",
"0.5237249",
"0.5236114",
"0.5219832",
"0.51907414",
"0.5176239... | 0.6318255 | 0 |
Returns the second line label for this Action. | @Nullable
public final CharSequence getLabel2() {
return mLabel2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public T2 getLabel() {\r\n\t\treturn label;\r\n\t}",
"public String getSecondLine() {\n return this.secondLine;\n }",
"@Nullable\n public CharSequence getSecondaryLabel(int index) {\n return mSecondaryLabels.get(index);\n }",
"public String getMode2Label()\n\t\t{\n\t\t\treturn mMode2Label;\n... | [
"0.63527143",
"0.62438834",
"0.60754955",
"0.596255",
"0.5941328",
"0.58797354",
"0.5822257",
"0.5798513",
"0.57260555",
"0.57041895",
"0.5692102",
"0.568849",
"0.5653437",
"0.5645634",
"0.56021786",
"0.5561949",
"0.5561949",
"0.55456865",
"0.55077285",
"0.54941994",
"0.54882... | 0.69487303 | 0 |
Sets the icon drawable for this Action. | public final void setIcon(@Nullable Drawable icon) {
mIcon = icon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void setIcon(Drawable icon) {\n\t\t\n\t}",
"public void setIcon(@DrawableRes final int icon) {\n post(() -> {\n Drawable drawable = ResourcesCompat.getDrawable(getResources(),icon,null);\n int padding = (getWidth() / 2) - (drawable.getIntrinsicWidth() / 2);\n ... | [
"0.7303263",
"0.6818429",
"0.66932064",
"0.66027504",
"0.65172327",
"0.65038234",
"0.65038234",
"0.6398249",
"0.6385386",
"0.6369848",
"0.63322514",
"0.6295519",
"0.6268403",
"0.6262499",
"0.62558144",
"0.61618626",
"0.6150356",
"0.61456233",
"0.6114372",
"0.6072786",
"0.6046... | 0.6888214 | 1 |
Returns the icon drawable for this Action. | @Nullable
public final Drawable getIcon() {
return mIcon;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getIcon()\n\t{\n\t\treturn getClass().getAnnotation(AccuAction.class).icon();\n\t}",
"public abstract Drawable getIcon();",
"public String getIcon() {\n\t\treturn \"icon\";\n\t}",
"@Nullable\n public Drawable getIcon() {\n return mPrimaryIcon;\n }",
"public String getIcon() {\n ... | [
"0.7377068",
"0.7371111",
"0.73004526",
"0.7233667",
"0.7221275",
"0.7221275",
"0.7221275",
"0.7221275",
"0.7197492",
"0.7190238",
"0.7096817",
"0.7023255",
"0.7023255",
"0.7021006",
"0.6985685",
"0.6985685",
"0.6977374",
"0.69605553",
"0.6946847",
"0.6946847",
"0.6946294",
... | 0.7719486 | 0 |
Adds a keycode used to invoke this Action. | public final void addKeyCode(int keyCode) {
mKeyCodes.add(keyCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void nativeKeyAction(int keyCode) {\n getProgramController().nativeKeyAction(keyCode);\n }",
"@Override\n\tpublic void keyPressed(KeyEvent arg0) {\n\t\tswitch(arg0.getExtendedKeyCode()){\n\t\t\tcase KeyEvent.VK_DOWN:\n\t\t\t\tlast = new AgentAction(Maze.SOUTH);\n\t\t\t\tbreak;\n\t... | [
"0.6954937",
"0.66180015",
"0.6553024",
"0.63533777",
"0.6325556",
"0.6263949",
"0.620236",
"0.617089",
"0.6045824",
"0.6007741",
"0.599172",
"0.5979975",
"0.596882",
"0.5966723",
"0.59589887",
"0.59449816",
"0.5943335",
"0.59416395",
"0.5940166",
"0.59198016",
"0.59082204",
... | 0.6124767 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.