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 |
|---|---|---|---|---|---|---|
DO NOT MODIFY THIS METHOD Prints the total number of requests and the number of requests that resulted in a cache hit. | public void reportStats() {
System.out.println("Number of requests: " + (requestCount - warmUpRequests));
System.out.println("Number of hits: " + hitCount);
System.out.println("hit ratio: " + (double) hitCount / (requestCount - warmUpRequests));
System.out.println("Average hit cost: " + (double) hitCost / hitCount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getCacheHits();",
"public Long get_cachetotrequests() throws Exception {\n\t\treturn this.cachetotrequests;\n\t}",
"public int getNumCacheHit() {\n return cacheHandler.getCountCacheHit();\n }",
"int getCachedCount();",
"long getRequestsCount();",
"public Long get_cachetotpetrequests() thro... | [
"0.7077922",
"0.70141554",
"0.6890434",
"0.6886961",
"0.68494445",
"0.6743316",
"0.6612681",
"0.6612681",
"0.64935076",
"0.64545107",
"0.6434418",
"0.6341745",
"0.62825596",
"0.62542623",
"0.62269527",
"0.6220494",
"0.6196726",
"0.61812",
"0.617868",
"0.61730534",
"0.61344236... | 0.6761465 | 5 |
DO NOT MODIFY THIS METHOD Returns the word that begins at the specified memory address. This is the public version of readWord. It calls the private version of readWord with the recordStats parameter set to true so that the cache statistics information will be recorded. | public boolean[] readWord(boolean[] address) {
return readWord(address, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean[] readWord(boolean[] address, boolean recordStats) {\n if (address.length > 32) {\n throw new IllegalArgumentException(\"address parameter must be 32 bits\");\n }\n // Programming Assignment 5: Complete this method\n // The comments provide a guide for this method.\n\n\n /*\n ... | [
"0.6172908",
"0.5878186",
"0.56578225",
"0.5647184",
"0.5564177",
"0.5448923",
"0.5439259",
"0.54272",
"0.540661",
"0.5389773",
"0.5369616",
"0.528764",
"0.5266021",
"0.51500016",
"0.5149517",
"0.51347613",
"0.5077663",
"0.50666386",
"0.5061828",
"0.5052653",
"0.5042333",
"... | 0.5325232 | 11 |
STUDENT MUST COMPLETE THIS METHOD Returns the word that begins at the specified memory address. This is the private version of readWord that includes the cache statistic tracking parameter. When recordStats is false, this method should not update the cache statistics data members (hitCount and hitCost). | private boolean[] readWord(boolean[] address, boolean recordStats) {
if (address.length > 32) {
throw new IllegalArgumentException("address parameter must be 32 bits");
}
// Programming Assignment 5: Complete this method
// The comments provide a guide for this method.
/*
* Where does the address map in the cache? --> Determine the cache set that corresponds with
* the requested memory address
*/
// Get set bits from the address that was passed in
boolean[] setBits = new boolean[numSetBits];
for (int i = numByteBits; i < numByteBits + numSetBits; i++) {
setBits[i - numByteBits] = address[i];
System.out.println("setBits[" + Integer.toString(i - numByteBits) + "] is "
+ String.valueOf(setBits[i - numByteBits]));
}
long cacheSet = Binary.binToUDec(setBits);
System.out.println("Cache set is " + Long.toString(cacheSet));
boolean[] tagBits = new boolean[numTagBits];
// Get tag from the address that was passed in
for (int i = numByteBits + numSetBits; i < numByteBits + numSetBits + numTagBits; i++) {
tagBits[i - numByteBits - numSetBits] = address[i];
System.out.println("tagbits[" + Integer.toString(i - numByteBits - numSetBits) + "] is "
+ String.valueOf(tagBits[i - numByteBits - numSetBits]));
}
/*
* Determine whether or not the line that corresponds with the requested memory address is
* currently in the cache
*/
int lineCount=0;
boolean inCache = false;
// Iterate through the correct Cache Set
for (int i = 0; i < cache[toIntExact(cacheSet)].size(); i++) {
System.out.println("\n Line " + Integer.toString(i) + ":");
lineCount++;
// Get the tag the line
boolean[] lineTag = cache[toIntExact(cacheSet)].getLine(i).getTag();
// If the tag from the line equals the tag from the parameter, then the line that corresponds
// to the memory address is currently in the cache
if (Arrays.equals(lineTag, tagBits)) {
System.out.println("Line sorresponding to the memory address is currently in the cache");
inCache = true;
// System.exit(0);
}
}
//if it is in the cache the hit count increases
// If the line corresponding to the memory address is not in the cache, call readLineFromMemory
if (inCache==false) {
readLineFromMemory(address, toIntExact(cacheSet), tagBits);
}
//System.out.println(Binary.toString(toIntExact(cacheSet)));
System.exit(0);
// TODO:
// Update CacheMemory data members (requestCount, hitCount, hitCost)
// and CacheLine data members (using the various set methods)
// as needed for tracking cache hit rate and implementing the
// least recently used replacement algorithm in the cache set.
if(inCache==false) {
hitCount++;
hitCost=lineCount-1;
}
requestCount++;
// replace this placeholder return with the data copied from the cache line
return new boolean[32];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String read(int address)\n {\n return MMU.read(VMA.get( address/RAM.getPageSize()) * RAM.getPageSize() + (address % RAM.getPageSize()));\n }",
"public String getLexEntry(String word)\n {\n boolean found = false;\n String buff = \"\";\n String rtn = \"\";\n\n las... | [
"0.548021",
"0.5315231",
"0.52091146",
"0.5205988",
"0.51705873",
"0.51574206",
"0.5112618",
"0.5082624",
"0.50620013",
"0.5030367",
"0.49533403",
"0.48454723",
"0.4831646",
"0.482565",
"0.4811732",
"0.4803879",
"0.47768116",
"0.47764447",
"0.4764033",
"0.47536018",
"0.473142... | 0.6384056 | 0 |
STUDENT MUST COMPLETE THIS METHOD Copies a line of data from memory into cache. Selects the cache line to replace. Uses the Least Recently Used (LRU) algorithm when a choice must be made between multiple cache lines that could be replaced. | private CacheLine readLineFromMemory(boolean[] address, int setNum, boolean[] tagBits) {
// Use the LRU (least recently used) replacement scheme to select a line
// within the set.
// Read the line from memory. The memory address to read is the
// first memory address of the line that contains the requested address.
// The MainMemory read method should be called.
// Copy the line read from memory into the cache
// replace this placeholder return with the correct line to return
/*COMMENT FOR NICK: The least recently used I don't now how to change. The code below
* sets the first line in the cache set to the LRU but I don't know how to update it
* to the next line over once address is put into the LRU line
*/
int lastUsed=0;
int isFullCheck=0;
int count=0;
int addressToInt []=new int[address.length];
System.out.println("Cache Set: "+setNum);
//loops through the cache set to see if there is a open line if so the address is set into the data
for(int i=0;i<cache[setNum].size();i++) {
if (cache[setNum].getLine(i).getData()==null) {
cache[setNum].getLine(i).setData(mainMemory.read(address,address.length));
if(count==0) {
cache[setNum].getLine(i).setLastUsed(i);
isFullCheck++;
}
count++;
System.out.println("Line read into "+ i +" line: "+ Binary.toString(address));
}
isFullCheck++;
//if the cache set is full the new data takes the place of the LRU line
if(isFullCheck==cache[setNum].size()) {
cache[setNum].getLine(lastUsed).setData(mainMemory.read(address,address.length));
lastUsed++;
System.out.println("Line read into "+lastUsed);
}
}
return new cacheSet.getLine();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void whenReadFileAndAddNewLineToFileThenSecondReadFromHashWithoutLine() {\n Cache cache = new Cache(\"c:/temp\");\n String before = cache.readFile(\"names2.txt\");\n String result = cache.select(\"names2.txt\");\n String path = \"c:/temp/names2.txt\";\n try (Fil... | [
"0.59968776",
"0.5948639",
"0.5696248",
"0.544144",
"0.54345304",
"0.5351481",
"0.53237474",
"0.5285688",
"0.52813447",
"0.5260669",
"0.5259765",
"0.52011716",
"0.5183098",
"0.5163565",
"0.515046",
"0.51498294",
"0.51378936",
"0.5119262",
"0.5108102",
"0.50759655",
"0.5072160... | 0.73539954 | 0 |
constructors Takes no arguments and initializes an empty array of size zero | Array() {
array = new int[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Array()\n {\n assert DEFAULT_CAPACITY > 0;\n\n array = new Object[DEFAULT_CAPACITY];\n }",
"public CircularArray() {\n\t\tthis(DEFAULT_SIZE);\n\t}",
"public MyArray() {\n\t\tcapacity = DEFAULT_CAPACITY;\n\t\tnumElements = 0;\n\t\telements = (E[]) new Object[capacity];\n\t}",
"publi... | [
"0.7792133",
"0.7171616",
"0.7169117",
"0.7062475",
"0.7007616",
"0.68906355",
"0.68631744",
"0.6837055",
"0.67551225",
"0.6740826",
"0.6648976",
"0.66141737",
"0.6596602",
"0.65797824",
"0.6561889",
"0.6543405",
"0.65428084",
"0.6538317",
"0.6531684",
"0.6531581",
"0.6522489... | 0.79130286 | 0 |
Takes an array of integers as the arg | Array(int[] n) {
array = n;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public IntArrayProcessor(int[] array)\n {\n integers = array;\n }",
"void mo12207a(int[] iArr);",
"private List<Integer> toList(int[] array) {\n List<Integer> list = new LinkedList<Integer>();\n for (int item : array) {\n list.add(item);\n }\n return list;\n ... | [
"0.7279242",
"0.69186807",
"0.6890119",
"0.68697953",
"0.67417306",
"0.67296124",
"0.66770285",
"0.66673344",
"0.6637993",
"0.6625925",
"0.6539273",
"0.6530669",
"0.6513836",
"0.64766675",
"0.64761955",
"0.6435487",
"0.6412524",
"0.63812304",
"0.63427055",
"0.6305965",
"0.628... | 0.67200506 | 6 |
Takes an int and creates an array of that size with all values set to zero | Array(int x) {
array = new int[x];
for (int i = 0; i < array.length; i++) {
array[i] = 0; // make each index 0
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void zero(int[] x)\n {\n for (int i = 0; i != x.length; i++)\n {\n x[i] = 0;\n }\n }",
"public int[] ZeroOutNegs(int[] arr) {\r\n for (int x = 0; x < arr.length; x++) {\r\n if (arr[x] < 0) {\r\n arr[x] = 0;\r\n }\r\n... | [
"0.74063826",
"0.6871385",
"0.6866691",
"0.68285865",
"0.6790089",
"0.6769735",
"0.6743497",
"0.6707091",
"0.6690591",
"0.6626388",
"0.65777886",
"0.6529333",
"0.64746577",
"0.6452671",
"0.64510065",
"0.641133",
"0.63932604",
"0.6381851",
"0.63585",
"0.6296867",
"0.6294426",
... | 0.72315305 | 1 |
returns the value at "index" in the array get() method tailored to Concert Population context | int getConcertPopulation(int index) {
return array[index];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int get(int index) {\n return array[index];\n }",
"int get(int index)\n\t{\n\t\treturn inputArray[index];\n\t}",
"public Occ get( int index )\n {\n if ( index < 0 || index >= size ) throw new IndexOutOfBoundsException( \"\"+index+\" >= \"+size );\n return data[index];\n }",
"@Override... | [
"0.76855075",
"0.76004404",
"0.7343242",
"0.72840244",
"0.72836524",
"0.7240621",
"0.721842",
"0.71805793",
"0.7080758",
"0.70684123",
"0.7059557",
"0.70078444",
"0.70078444",
"0.7007419",
"0.6990394",
"0.69600487",
"0.69424075",
"0.69390726",
"0.6922515",
"0.69127643",
"0.69... | 0.7512753 | 2 |
adds a number at the end of the array and increases its size by 1 | void push(int val) {
int[] temp = new int[array.length + 1]; // temporary place holder
for (int i = 0; i < array.length; i++) {
temp[i] = array[i];
}
temp[array.length] = val;
// the next statement is not really an assignment, it is having array
// point to a different memory location
array = temp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void addLast(T item) {\n if (size >= array.length) {\n resize(size * 2);\n array[nextLast] = item;\n nextLast = plusOne(nextLast);\n } else {\n array[nextLast] = item;\n nextLast = plusOne(nextLast);\n }\n size... | [
"0.6884718",
"0.6857309",
"0.67910004",
"0.67241096",
"0.67225385",
"0.6662752",
"0.6631659",
"0.65719223",
"0.65082365",
"0.64899594",
"0.6487361",
"0.6487037",
"0.64779085",
"0.6476168",
"0.6470515",
"0.64219916",
"0.6397185",
"0.6377971",
"0.6358615",
"0.6350054",
"0.63459... | 0.0 | -1 |
returns the last item from the array and decreases the size of the array | int pop() {
int[] temp = new int[array.length - 1]; // temporary place holder
for (int i = 0; i < array.length - 1; i++) {
temp[i] = array[i];
}
// returning last value in array
int lastValue = array[array.length - 1];// array.length - 1 bc its the
// last term
array = temp;
return lastValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public U getLast(){\r\n\t \tif (getArraySize()==0)\r\n\t \t\tthrow new IndexOutOfBoundsException();\r\n\t \t//calls get\r\n\t \treturn get(numElems-1);\r\n\t }",
"@Override\n public T removeLast() {\n if (size == 0) {\n return null;\n }\n\n int position = minusOn... | [
"0.7831604",
"0.7806745",
"0.7652871",
"0.7545919",
"0.7501373",
"0.74568063",
"0.7057955",
"0.70463884",
"0.7023531",
"0.7017226",
"0.7015563",
"0.6988774",
"0.69718057",
"0.69316345",
"0.6882871",
"0.68722415",
"0.6870081",
"0.68674356",
"0.68559116",
"0.68448335",
"0.68156... | 0.7045956 | 8 |
deletes the value from the array and to location specified in 'index' and shrinks the array | void remove(int index) {
for (int i = index; i < array.length - 1; i++) {
array[i] = array[i + 1];
}
int[] temp = new int[array.length - 1];
for (int i = 0; i < array.length - 1; i++) {
temp[i] = array[i];
}
int lastValue = array[array.length - 1];// index starts @ 0, so its the
// array.length - 1 to account
// for the 0
array = temp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteIndex(int index) {\n if (index < arraySize) {\n for (int i = index; i < arraySize - 1; i++) {\n theArray[i] = theArray[i + 1];\n }\n arraySize--;\n }\n }",
"public void removeAt(int index){\n E[] array2 = (E[]) new Object[c... | [
"0.79180956",
"0.7889438",
"0.77380717",
"0.7628673",
"0.7626209",
"0.75745386",
"0.7564171",
"0.74682933",
"0.74201953",
"0.7407433",
"0.7391601",
"0.7286278",
"0.72751826",
"0.7273055",
"0.7262227",
"0.7229586",
"0.72074586",
"0.71867585",
"0.7146469",
"0.71149623",
"0.7107... | 0.7659622 | 3 |
returns the length of the array | int size() {
return array.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getArrayLength();",
"int getArrayLength();",
"long arrayLength();",
"public int arraySize();",
"public int size() {\n\t\treturn array.length();\n\t}",
"public int size() {\n //encapsulate\n int size = this.array.length;\n return size;\n }",
"int size()\n\t{\n\t\t//If array i... | [
"0.89788306",
"0.89788306",
"0.8844196",
"0.85596704",
"0.84507793",
"0.83279335",
"0.81958014",
"0.81841874",
"0.8173373",
"0.80879647",
"0.79878294",
"0.78640234",
"0.7848461",
"0.75746554",
"0.755585",
"0.74939454",
"0.74722475",
"0.74561286",
"0.74288934",
"0.7397014",
"0... | 0.83005846 | 6 |
changes the value in the array at position 'index' to 'val' | void update(int index, int val) {
array[index] = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void set(int index, Object value) {\n\n\t\t// the right portion of values of the array -> room is not available\n\t\tif(index >= arr.length) {\n\t\t\tObject[] tmpArr = new Object[index+1]; // keep all values of the variable arr\n\t\t\t\n\t\t\t// keep all items of arr\n\t\t\tfor(int i=0; i<arr.length; i++) {... | [
"0.7644638",
"0.7605554",
"0.7502879",
"0.74870896",
"0.74811447",
"0.74811447",
"0.71277034",
"0.7068088",
"0.70382214",
"0.70105475",
"0.6983889",
"0.69744503",
"0.69024646",
"0.68636334",
"0.680043",
"0.6772033",
"0.66875035",
"0.66815645",
"0.6671623",
"0.6643939",
"0.663... | 0.81832105 | 0 |
swaps the values in positions 'index1' and 'index2' in the array | void swap(int index1, int index2) {
int temp = array[index1]; // created a temporary variable to store first
// index
array[index1] = array[index2]; // swapped the int in first index for the
// int in second index
array[index2] = temp; // made int in 2nd index into temp variable, which
// holds the previous int in first index
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void swap(int index_1,int index_2){\n int temp=arr[index_1];\n arr[index_1]=arr[index_2];\n arr[index_2]=temp;\n }",
"private static void swap(int[] array, int index1, int index2) {\n int x = array[index1];\n array[index1] = array[index2];\n array[index2] = x;\n }"... | [
"0.8309734",
"0.83030576",
"0.8243031",
"0.8098988",
"0.7964072",
"0.7927888",
"0.7916318",
"0.7860293",
"0.77891475",
"0.7728848",
"0.76787645",
"0.761901",
"0.7508387",
"0.7458529",
"0.7355545",
"0.7331181",
"0.7318094",
"0.7301634",
"0.7262635",
"0.72366464",
"0.72340137",... | 0.7975654 | 4 |
sorts the values in the array from least to greatest | void sort() {
int n = array.length;
int temp = 0;
for (int i = 0; i < n; i++) {
for (int j = 1; j < (n - i); j++) {
if (array[j - 1] > array[j]) { // if the first term is larger
// than the last term, then the
// temp holds the previous term
temp = array[j - 1];
array[j - 1] = array[j];// swaps places within the array
array[j] = temp;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sorter(int[] array){\r\n\r\n for (int i = 0; i < array.length-1; i++)\r\n for (int j = 0; j < array.length-i-1; j++)\r\n if (array[j] > array[j+1])\r\n {\r\n int temp = array[j];\r\n array[j] = array[j+1];\r\n ... | [
"0.73147416",
"0.7239536",
"0.71738887",
"0.7165909",
"0.71401626",
"0.71135074",
"0.7113247",
"0.70778924",
"0.70570105",
"0.7052694",
"0.70335054",
"0.70237803",
"0.7019866",
"0.70191246",
"0.69994813",
"0.69969785",
"0.6981612",
"0.6969295",
"0.69640994",
"0.6937186",
"0.6... | 0.7516186 | 0 |
returns the minimum value in the array | int min() {
// added my sort method in the beginning to sort our array
int n = array.length;
int temp = 0;
for (int i = 0; i < n; i++) {
for (int j = 1; j < (n - i); j++) {
if (array[j - 1] > array[j]) {
temp = array[j - 1];
array[j - 1] = array[j];
array[j] = temp;
}
}
}
// finds the first term in the array --> first term should be min if
// sorted
int x = array[0];
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public T findLowest(){\n T lowest = array[0]; \n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()<lowest.doubleValue())\n {\n lowest = array[i]; \n } \n }\n return lowest;\n }... | [
"0.8413232",
"0.82534015",
"0.82491153",
"0.823157",
"0.8182065",
"0.8167441",
"0.8162496",
"0.81363183",
"0.8114157",
"0.80814457",
"0.8080127",
"0.8071568",
"0.7979959",
"0.79709196",
"0.7846693",
"0.783978",
"0.78031874",
"0.7788984",
"0.7723619",
"0.77203965",
"0.7708267"... | 0.83561707 | 1 |
returns the maximum value in the array | int max() {
// added my sort method in the beginning to sort out array
int n = array.length;
int temp = 0;
for (int i = 0; i < n; i++) {
for (int j = 1; j < (n - i); j++) {
if (array[j - 1] > array[j]) {
temp = array[j - 1];
array[j - 1] = array[j];
array[j] = temp;
}
}
}
// finds the last term in the array --> if array is sorted then the last
// term should be max
int x = array[array.length - 1];
return x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n... | [
"0.8512293",
"0.83294886",
"0.82736",
"0.8086462",
"0.8042134",
"0.8026647",
"0.80231476",
"0.80198115",
"0.80060846",
"0.7922985",
"0.7875871",
"0.7857806",
"0.7853968",
"0.7839493",
"0.78325975",
"0.7822",
"0.78173995",
"0.78100723",
"0.78094554",
"0.77722293",
"0.7756908",... | 0.8237814 | 3 |
returns the average of the array | double average() { // used double b/c I want decimal places
int sum = 0;
for (int i = 0; i < array.length; i++) {
sum = sum + array[i];
}
double average = (double) sum / array.length;
return average;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }",
"double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\tretu... | [
"0.8670593",
"0.8656264",
"0.85522115",
"0.849494",
"0.83986765",
"0.83810925",
"0.8337846",
"0.8324621",
"0.83157426",
"0.8265099",
"0.81665564",
"0.8039262",
"0.8009727",
"0.8001502",
"0.79827726",
"0.7976243",
"0.79532844",
"0.793831",
"0.79031634",
"0.7902775",
"0.7887105... | 0.85904074 | 2 |
/ Optional for implementation | @Override
public Set<Event> getNextEvents(LocalDateTime to) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Optional<A> val();",
"protected abstract Optional<T> getSingleSelection();",
"@Override\n\tpublic Optional<T> get() {\n\t\treturn null;\n\t}",
"default T handleNull() {\n throw new UnsupportedOperationException();\n }",
"public T caseImplementation(Implementation object)\n {\n ... | [
"0.6203069",
"0.62020016",
"0.6031969",
"0.5976546",
"0.59745395",
"0.58462363",
"0.5819129",
"0.57336605",
"0.57300156",
"0.57300156",
"0.5704383",
"0.569989",
"0.5691493",
"0.5666637",
"0.5658484",
"0.56425685",
"0.5633854",
"0.56332445",
"0.5619469",
"0.5607738",
"0.560460... | 0.0 | -1 |
TODO Autogenerated method stub | public Object executeCommand() {
if( this.newUser == null ) {
System.out.println("this.newUser == null");
return NewUserActor.NULL_USER;
}
//User currentUser = new User();
// 要求Utility增加createNewUser(User userToBeAdded),Utility的数据都在DataPool里面
System.out.println(this.newUser.getUserName());
int result=DataPool.getInstance().createNewUser(this.newUser);
// 由于底层没有实现,样例到此为止
// 剩下的事情就是Utility向数据库检查合法性checkExistUser(),和更新数据库 createNewUserData()
// 最后Utility更新DataPool并返回结果即可
if(result==-2)
{
System.out.println("USer Already Exist!!!");
return NewUserActor.USER_EXIST;
}
return NewUserActor.SUCCEED;
} | {
"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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0... | 0.0 | -1 |
Removes selected node by calling Children.Array.remove | public void testRemoveAndAddNodes() {
final Children c = new Array();
Node n = new AbstractNode (c);
final PListView lv = new PListView();
final ExplorerPanel p = new ExplorerPanel();
p.add(lv, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(n);
p.open();
Node[] children = new Node[NO_OF_NODES];
for (int i = 0; i < NO_OF_NODES; i++) {
children[i] = new AbstractNode(Children.LEAF);
children[i].setDisplayName(Integer.toString(i));
children[i].setName(Integer.toString(i));
c.add(new Node[] { children[i] } );
}
//Thread.sleep(2000);
try {
// Waiting for until the view is updated.
// This should not be necessary
try {
SwingUtilities.invokeAndWait( new EmptyRunnable() );
} catch (InterruptedException ie) {
fail ("Caught InterruptedException:" + ie.getMessage ());
} catch (InvocationTargetException ite) {
fail ("Caught InvocationTargetException: " + ite.getMessage ());
}
p.getExplorerManager().setSelectedNodes(new Node[] {children[0]} );
} catch (PropertyVetoException pve) {
fail ("Caught the PropertyVetoException when set selected node " + children[0].getName ()+ ".");
}
for (int i = 0; i < NO_OF_NODES; i++) {
c.remove(new Node [] { children[i] } );
children[i] = new AbstractNode(Children.LEAF);
children[i].setDisplayName(Integer.toString(i));
children[i].setName(Integer.toString(i));
c.add(new Node[] { children[i] } );
//Thread.sleep(350);
}
assertEquals(NO_OF_NODES, c.getNodesCount());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeChildAt(int index) {children.removeElementAt(index);}",
"public void remove() {\n removeNode(this);\n }",
"@Override\n public void removeChildren()\n {\n children.clear();\n }",
"public void removeChildren() {\r\n this.children.clear();\r\n ch... | [
"0.72711575",
"0.72448546",
"0.7150731",
"0.71377856",
"0.7011218",
"0.7006864",
"0.7006234",
"0.69475406",
"0.6932894",
"0.6819907",
"0.67705804",
"0.67426264",
"0.6739461",
"0.6690507",
"0.6677841",
"0.66379416",
"0.66002196",
"0.65416574",
"0.6524875",
"0.6524694",
"0.6519... | 0.0 | -1 |
Creates two nodes. Selects one and tries to remove it and replace with the other one (several times). | public void testNodeAddingAndRemoving() {
final Children c = new Array();
Node n = new AbstractNode (c);
final PListView lv = new PListView();
final ExplorerPanel p = new ExplorerPanel();
p.add(lv, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(n);
p.open();
final Node c1 = new AbstractNode(Children.LEAF);
c1.setDisplayName("First");
c1.setName("First");
c.add(new Node[] { c1 });
Node c2 = new AbstractNode(Children.LEAF);
c2.setDisplayName("Second");
c2.setName("Second");
//Thread.sleep(500);
for (int i = 0; i < 5; i++) {
c.remove(new Node[] { c1 });
c.add(new Node[] { c2 });
// Waiting for until the view is updated.
// This should not be necessary
try {
SwingUtilities.invokeAndWait( new EmptyRunnable() );
} catch (InterruptedException ie) {
fail ("Caught InterruptedException:" + ie.getMessage ());
} catch (InvocationTargetException ite) {
fail ("Caught InvocationTargetException: " + ite.getMessage ());
}
try {
p.getExplorerManager().setSelectedNodes(new Node[] {c2} );
} catch (PropertyVetoException pve) {
fail ("Caught the PropertyVetoException when set selected node " + c2.getName ()+ ".");
}
c.remove(new Node[] { c2 });
c.add(new Node[] { c1 });
//Thread.sleep(350);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Node replaceChild(Node newChild, Node oldChild);",
"private Node delete(Order ord2) {\n\t\treturn null;\n\t}",
"public void union(Node a, Node b) {\n Node set1 = find(a);\n Node set2 = find(b);\n\n if (set1 != set2) {\n // Limits the worst case runtime of a find to O(log N)\n if (set1.getSiz... | [
"0.59648097",
"0.5605231",
"0.5592731",
"0.5592185",
"0.55731785",
"0.55109686",
"0.55034345",
"0.5496515",
"0.54637545",
"0.54002404",
"0.5372137",
"0.5367049",
"0.5364076",
"0.5334419",
"0.5320158",
"0.5291383",
"0.5276633",
"0.5271921",
"0.526746",
"0.52620524",
"0.5222671... | 0.5244745 | 20 |
solution 2: using two hashset | public List<String> findRepeatedDnaSequences2(String s) {
if(s == null || s.length() <= 10){
return new ArrayList<String>();
}
int n = s.length();
Set<String> visited = new HashSet<String>();
Set<String> duplicated = new HashSet<String>();
for(int i = 0; i <= n - 10; ++i){
String subStr = s.substring(i, i + 10);
if(!visited.add(subStr)) {
duplicated.add(subStr);
}
}
return new ArrayList<String>(duplicated);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static Set<String> m23474a(Set<String> set, Set<String> set2) {\n if (set.isEmpty()) {\n return set2;\n }\n if (set2.isEmpty()) {\n return set;\n }\n HashSet hashSet = new HashSet(set.size() + set2.size());\n ha... | [
"0.78988475",
"0.73468",
"0.7228724",
"0.6613326",
"0.6610609",
"0.656806",
"0.6546545",
"0.650999",
"0.6410643",
"0.6357261",
"0.6263221",
"0.6251809",
"0.6245846",
"0.6242093",
"0.6221799",
"0.61981004",
"0.6172208",
"0.61542207",
"0.6107193",
"0.6053878",
"0.60483223",
"... | 0.0 | -1 |
Created by TangBin on 9/6/16. | public interface GeneratorInterface<T> {
T next();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"public final void mo51373a() {\n }",
"@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\n\t}",
"protected boolean func_70814_o() { ret... | [
"0.5949545",
"0.59431374",
"0.58525574",
"0.5818002",
"0.58163434",
"0.5807098",
"0.5782478",
"0.57433724",
"0.57433724",
"0.5732123",
"0.57246697",
"0.57085156",
"0.5705336",
"0.5703302",
"0.56999207",
"0.56883675",
"0.56883675",
"0.56883675",
"0.56883675",
"0.56883675",
"0.... | 0.0 | -1 |
selectUrlType gets the URL as a string and sets the correspondent URL as a new value. This value is split at each dot, and the last index contains the type. theUrlType is updated with the correct type value, and if it is RLE, the RLEDecoder is instantiated. | public void selectUrlType(String inURL) {
try {
URL url = new URL(inURL);
String[] fileType = url.getFile().split("[.]");
int itemCount = fileType.length;
if (fileType[itemCount - 1].contains("txt") || fileType[itemCount - 1].contains("cells")) {
theUrlType = "Text Url";
} else if (fileType[itemCount - 1].contains("rle")) {
theUrlType = "RLE Url";
Decoder RLE = new Decoder();
RLE.readAndDecodeURL(inURL);
}
} catch (Exception e) {
dialog.urlError();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setType(URI type) {\n this.type = type;\n }",
"public String getUrlType() {\n return theUrlType;\n }",
"private void setUrl(\n java.lang.String value) {\n value.getClass();\n bitField0_ |= 0x00000002;\n url_ = value;\n }",
"private void setUrl(\n java.l... | [
"0.57176596",
"0.5695864",
"0.5456674",
"0.54372215",
"0.5423494",
"0.5149134",
"0.5117464",
"0.5099809",
"0.49950755",
"0.49803865",
"0.49764457",
"0.4958101",
"0.4947342",
"0.49138418",
"0.48870277",
"0.48800966",
"0.48713458",
"0.4850312",
"0.48354065",
"0.48259625",
"0.48... | 0.76323026 | 0 |
Getter for the URL type. | public String getUrlType() {
return theUrlType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public URIType getURIType();",
"@ApiModelProperty(value = \"A URI reference according to IETF RFC 3986 that identifies the problem type\")\n \n public String getType() {\n return type;\n }",
"@XmlTransient\r\n @JsonIgnore\r\n public URI getType() {\r\n return this.type == null ? null : th... | [
"0.73120445",
"0.7013343",
"0.68820727",
"0.67706954",
"0.66741395",
"0.65998614",
"0.6534417",
"0.6477575",
"0.64310527",
"0.6385634",
"0.6378224",
"0.6332816",
"0.633177",
"0.63172114",
"0.63172114",
"0.63172114",
"0.63172114",
"0.63172114",
"0.63003397",
"0.62988764",
"0.6... | 0.8717747 | 0 |
Opinionated methods allow for synchronization where it matters | @SneakyThrows
public void loginSuccessfully(UserData userData) {
login(userData);
try {
synchWait().until((page) -> !isOnPage());
} catch (TimeoutException e) {
throw new TimeoutException("login was unsuccessful; found error message: " + error.getText());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void synchronize(){ \r\n }",
"void contentsSynchronized();",
"@Override\n public void sync(){\n }",
"@Override\n public void callSync() {\n\n }",
"void lock();",
"public void requestExtraSync()\n {\n executor.requestExtraSync();\n }",
"@Override\r\n\tpublic boolean... | [
"0.73348236",
"0.66712105",
"0.6669638",
"0.6626886",
"0.66207343",
"0.64886725",
"0.6473023",
"0.6452982",
"0.64517355",
"0.6420355",
"0.6415937",
"0.62798256",
"0.626004",
"0.62571335",
"0.6246975",
"0.61954445",
"0.6180868",
"0.6175237",
"0.60149556",
"0.59951705",
"0.5961... | 0.0 | -1 |
Test the methods in the square entity class. | public void testSquare(){
Square s = new Square(false);
s.toggleSquare();
assertTrue(s.isToggle());
s.setToggle(false);
assertFalse(s.isToggle());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetSquare() {\n \n }",
"@Test\r\n public void testIsValidSquare()\r\n {\r\n for(int y = 0; y < 8; y++)\r\n for(int x = 0; x < 8; x++)\r\n assertTrue(board.isValidSqr(x, y));\r\n }",
"@Test\n public void testGetTile()\n {\n ... | [
"0.73239833",
"0.6546336",
"0.6542303",
"0.63555026",
"0.62573284",
"0.62056834",
"0.62026477",
"0.6144857",
"0.61333364",
"0.6126531",
"0.61243266",
"0.61000603",
"0.6087755",
"0.6083503",
"0.60760105",
"0.60610414",
"0.603814",
"0.60347646",
"0.59852964",
"0.5944171",
"0.59... | 0.67488885 | 1 |
Test the shared methods in the level superclass. | public void testLevelShared() {
Level lvl = new Level();
assertEquals("", lvl.getLevelType());
Board brd = new Board();
lvl.setBoard(brd);
assertEquals(brd, lvl.getBoard());
int[] stars = new int[3];
stars[0] = 0;
stars[1] = 1;
stars[2] = 2;
lvl.setStars(stars);
assertEquals(stars, lvl.getStars());
lvl.setStarAt(5, 1);
assertEquals(5, lvl.getStarAt(1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testInheritance() throws Exception {\n\t\ttestWith(TestClassSubClass.getInstance());\n\t}",
"@Test\n public void atBaseTypeTest() {\n // TODO: test atBaseType\n }",
"@Override\n void performTest() {\n new Base();\n new Child();\n }",
"@Override\n void perf... | [
"0.6770369",
"0.65348274",
"0.6448768",
"0.6448768",
"0.6448768",
"0.62627125",
"0.6245224",
"0.62087864",
"0.62008077",
"0.62008077",
"0.61739737",
"0.61149436",
"0.61115116",
"0.60909605",
"0.6082128",
"0.6075678",
"0.6075678",
"0.6075678",
"0.60751563",
"0.60123134",
"0.60... | 0.6208093 | 8 |
Test the PuzzleLevel subclass. | public void testPuzzleLevel() {
Board brd = new Board();
PuzzleLevel lvl = new PuzzleLevel(brd);
assertEquals("Puzzle", lvl.getLevelType());
lvl.assignMaxWords(42);
assertEquals(42, lvl.getMaxWords());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void levelsTest() {\n // TODO: test levels\n }",
"@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}",
"@Test\r\n\tpublic void testIntialation()\r\n\t{\r\n\t\tPokemon pk = new Vulpix(\"Vulpix\", 100);\r\n\t\r\n\t\tassertEquals(\"Vulpix\", pk.getName());\r\n\t\tassertEquals(100... | [
"0.6891675",
"0.630312",
"0.62535405",
"0.61690575",
"0.6163853",
"0.6152795",
"0.6046684",
"0.59784836",
"0.5951269",
"0.59298337",
"0.5929439",
"0.5921286",
"0.5892955",
"0.58843285",
"0.5836635",
"0.5836034",
"0.5831585",
"0.58190155",
"0.58106595",
"0.58097386",
"0.579577... | 0.7732315 | 0 |
Test the LightningLevel subclass. | public void testLightningLevel() {
Board brd = new Board();
LightningLevel lvl = new LightningLevel(brd);
assertEquals("Lightning", lvl.getLevelType());
lvl.assignTime(42);
assertEquals(42, lvl.getTime());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void levelsTest() {\n // TODO: test levels\n }",
"public void testLevelShared() {\n\t\tLevel lvl = new Level();\n\t\tassertEquals(\"\", lvl.getLevelType());\n\t\tBoard brd = new Board();\n\t\tlvl.setBoard(brd);\n\t\tassertEquals(brd, lvl.getBoard());\n\n\t\tint[] stars = new int[3];\n... | [
"0.6424143",
"0.6148043",
"0.60512835",
"0.59355766",
"0.59307563",
"0.5852701",
"0.5802936",
"0.5795645",
"0.5784444",
"0.57479876",
"0.574767",
"0.57393473",
"0.5703045",
"0.56827724",
"0.56778765",
"0.56676203",
"0.56541544",
"0.5627433",
"0.56156117",
"0.5605909",
"0.5605... | 0.80435747 | 0 |
Test the ThemeLevel subclass. | public void testThemeLevel() {
Board brd = new Board();
ThemeLevel lvl = new ThemeLevel(brd);
assertEquals("Theme", lvl.getLevelType());
String name = "BestTheme";
lvl.setThemeName(name);
assertEquals(name, lvl.getThemeName());
Dictionary dictionary = new Dictionary();
lvl.setDictionary(dictionary);
assertEquals(dictionary, lvl.getDictionary());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void levelsTest() {\n // TODO: test levels\n }",
"public void testLightningLevel() {\n\t\tBoard brd = new Board();\n\t\tLightningLevel lvl = new LightningLevel(brd);\n\n\t\tassertEquals(\"Lightning\", lvl.getLevelType());\n\n\t\tlvl.assignTime(42);\n\t\tassertEquals(42, lvl.getTime())... | [
"0.5948332",
"0.58709085",
"0.5799992",
"0.5731315",
"0.5731315",
"0.5731315",
"0.5731315",
"0.55989903",
"0.5574725",
"0.5547378",
"0.55462044",
"0.55462044",
"0.55462044",
"0.55462044",
"0.55462044",
"0.5526788",
"0.5425427",
"0.539329",
"0.5387995",
"0.537464",
"0.5366619"... | 0.8094936 | 0 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
dateLbl = new javax.swing.JLabel();
date = new javax.swing.JTextField();
pleaseLbl = new javax.swing.JLabel();
hoursLb = new javax.swing.JLabel();
hours = new javax.swing.JTextField();
describeLb = new javax.swing.JLabel();
submitBtn = new javax.swing.JButton();
logoutBtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
description = new javax.swing.JTextArea();
setBackground(new java.awt.Color(170, 212, 212));
dateLbl.setFont(new java.awt.Font("Franklin Gothic Demi", 0, 18)); // NOI18N
dateLbl.setText("Date: ");
pleaseLbl.setFont(new java.awt.Font("Franklin Gothic Demi", 2, 18)); // NOI18N
pleaseLbl.setText("Please Describe Your Meeting with Your Buddy:");
hoursLb.setFont(new java.awt.Font("Franklin Gothic Demi", 0, 18)); // NOI18N
hoursLb.setText("Hours: ");
describeLb.setFont(new java.awt.Font("Franklin Gothic Demi", 0, 18)); // NOI18N
describeLb.setText("Description of Activity: ");
submitBtn.setBackground(new java.awt.Color(255, 255, 255));
submitBtn.setFont(new java.awt.Font("Franklin Gothic Demi", 0, 18)); // NOI18N
submitBtn.setText("Submit");
submitBtn.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
submitBtnMouseClicked(evt);
}
});
logoutBtn.setBackground(new java.awt.Color(255, 255, 255));
logoutBtn.setFont(new java.awt.Font("Franklin Gothic Demi", 0, 18)); // NOI18N
logoutBtn.setText("Log Out");
logoutBtn.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
logoutBtnMouseClicked(evt);
}
});
logoutBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
logoutBtnActionPerformed(evt);
}
});
description.setColumns(20);
description.setRows(5);
jScrollPane1.setViewportView(description);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(pleaseLbl)
.addContainerGap(385, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(dateLbl)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(date, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(logoutBtn))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(hoursLb)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hours, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(describeLb)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 526, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(0, 0, Short.MAX_VALUE))))
.addGroup(layout.createSequentialGroup()
.addGap(327, 327, 327)
.addComponent(submitBtn)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(logoutBtn))
.addGroup(layout.createSequentialGroup()
.addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(dateLbl)
.addComponent(date, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(69, 69, 69)
.addComponent(pleaseLbl)
.addGap(57, 57, 57)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(hoursLb)
.addComponent(hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(describeLb, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(submitBtn)
.addGap(90, 90, 90))
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73199165",
"0.7291065",
"0.7291065",
"0.7291065",
"0.72868747",
"0.72488254",
"0.7214099",
"0.7209363",
"0.7196111",
"0.7190702",
"0.7184576",
"0.71590984",
"0.71483636",
"0.7093415",
"0.70814407",
"0.70579475",
"0.69872457",
"0.69773155",
"0.6955104",
"0.69544697",
"0.694... | 0.0 | -1 |
when mentor clicks submit, save their inputted data as a new column in EVENTS SQL table | private void submitBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_submitBtnMouseClicked
Scanner check = new Scanner(hours.getText());
if (check.hasNextDouble() || check.hasNextInt()) {
Meeting m = new Meeting(date.getText(), hours.getText(), description.getText(), currentID);
database.setInfo(m.getDate(), m.getHours(), m.getDescription(), m.getMentorID());
//input meeting info to EVENTS table under the correct column
Component frame = null;
JOptionPane.showMessageDialog(frame, "Event successfully submitted!");
} else {
Component frame = null;
JOptionPane.showMessageDialog(frame, "Error: Please enter a valid number of hours");
//if bad user input, show error message
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void saveEvent(){\n String event_name = eventName.getText().toString();\r\n String coach = coach_string;\r\n String time = class_time_string;\r\n int nfcID= 4;\r\n\r\n Map<String, Object> data = new HashMap<>();\r\n\r\n data.put(\"event_name\", event_name);\r\n ... | [
"0.6095981",
"0.5727747",
"0.5712296",
"0.5660623",
"0.56130403",
"0.5506665",
"0.54590005",
"0.54536426",
"0.5436332",
"0.5426217",
"0.54245806",
"0.5416146",
"0.5411977",
"0.5403784",
"0.53960633",
"0.5359805",
"0.5348685",
"0.5345566",
"0.533146",
"0.5330672",
"0.5312",
... | 0.5874722 | 1 |
GENLAST:event_submitBtnMouseClicked when logout, show login screen and clear all saved variables | private void logoutBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_logoutBtnMouseClicked
((AppDraftGUI) this.getRootPane().getParent()).showPanel(0);
frameInstance.p0.username.setText("");
frameInstance.p0.password.setText("");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n /*\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n ... | [
"0.7645315",
"0.76439464",
"0.7546413",
"0.748836",
"0.7411636",
"0.73215187",
"0.73212475",
"0.7318632",
"0.73167306",
"0.73132074",
"0.7238707",
"0.72367704",
"0.72072566",
"0.71875685",
"0.71123314",
"0.71123314",
"0.7110835",
"0.71066046",
"0.70779043",
"0.7074853",
"0.70... | 0.7767499 | 0 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof Etablissement)) {
return false;
}
Etablissement other = (Etablissement) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.6896072",
"0.6839122",
"0.6705258",
"0.66412854",
"0.66412854",
"0.65923095",
"0.65785074",
"0.65785074",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.6561566",
"0.6561566",
"0.6545169",
"0.6525343",
"0.65168375",
"0.64885366",
"0.... | 0.0 | -1 |
exceptionHandler is take care of exception thrown by services or controller. | @ExceptionHandler(RecipeNotFoundException.class)
public ResponseEntity<ErrorResponse> exceptionHandler(RecipeNotFoundException ex) {
ErrorResponse response =
new ErrorResponse("Error_CODE-0001",
"No recipe found with Id " + ex.getId());
return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void exceptionHandler(Handler<Exception> handler) {\n\t\t\n\t}",
"@ExceptionHandler(Exception.class)\n public String handleAllException(Exception ex) {\n logger.info(\"Error in dashboard.\");\n return \"error\";\n }",
"@ExceptionHandler(Exception.class)\r\n\tpublic ResponseEntity<Er... | [
"0.6883083",
"0.6830526",
"0.64892614",
"0.6318724",
"0.61728543",
"0.61191356",
"0.61134034",
"0.60756654",
"0.6053579",
"0.6041973",
"0.60293627",
"0.6021848",
"0.5964343",
"0.59445316",
"0.59413356",
"0.5928739",
"0.5928462",
"0.59271884",
"0.591436",
"0.5912305",
"0.58935... | 0.5957413 | 13 |
Make this a wrapping function Max f360.0 | min f0.0 | public void setDirection(double direction) {
if (direction <= MAX_DIRECTION && direction >= MIN_DIRECTION) {
this.direction = direction;
} else if (direction > MAX_DIRECTION) {
//this.direction = MIN_DIRECTION + (MAX_DIRECTION - direction);
this.direction %= MIN_DIRECTION ;
if (Double.isNaN(this.direction)) {
this.direction = MIN_DIRECTION;
}
} else if (direction < MIN_DIRECTION) {
//this.direction = MAX_DIRECTION - (MIN_DIRECTION + direction);
this.direction %= MAX_DIRECTION;
if (Double.isNaN(this.direction)) {
this.direction = MAX_DIRECTION;
}
} //else if (direction)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float maxSpeed();",
"public abstract float getMaxValue();",
"public float getMaximumFloat() {\n/* 266 */ return (float)this.max;\n/* */ }",
"public float getMaxValue();",
"float yMax();",
"float xMax();",
"int getMaxRotation();",
"public float maxTorque();",
"public float getMaxCY5... | [
"0.59487325",
"0.58498496",
"0.58296716",
"0.57771164",
"0.55537283",
"0.5551983",
"0.55275095",
"0.5501941",
"0.5466339",
"0.5441588",
"0.54292846",
"0.5404494",
"0.5376246",
"0.5333804",
"0.53057724",
"0.525963",
"0.52530676",
"0.52474874",
"0.5233472",
"0.52286804",
"0.517... | 0.0 | -1 |
metoda za dohvacanje poruke i spremanje u listu | public void dohvatiJMSPorukuISpremiUListu(JMSPoruka poruka){
listaJMSPoruka.add(poruka);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n ... | [
"0.74063414",
"0.716235",
"0.70920783",
"0.70532376",
"0.697592",
"0.69475067",
"0.69038594",
"0.68955034",
"0.6872977",
"0.6717648",
"0.6607841",
"0.66000426",
"0.6577121",
"0.65440845",
"0.6529056",
"0.65249014",
"0.6500293",
"0.64697593",
"0.6463904",
"0.64504105",
"0.6446... | 0.0 | -1 |
registrazione completata. mostra schermata con informazioni sulla conferma account | private void subscriptionComplete(String username, String email){
//preparo la schermata da mostrare
TextView name = (TextView) findViewById(R.id.user_name_confirm);
if(name!=null) name.setText(username);
TextView description = (TextView) findViewById(R.id.new_user_description);
String desc = getString(R.string.registration_confirmed_description);
desc = desc.replace("FUCKINGMAIL",email);
if(description!=null) description.setText(desc);
//eseguo lo scambio dei layout mostrati
View first = findViewById(R.id.subscribe_first);
View second = findViewById(R.id.subscribe_second);
if(first!=null && second != null) {
first.setVisibility(View.INVISIBLE);
second.setVisibility(View.VISIBLE);
}
//nascondo pulsanti da toolbar
menu.findItem(R.id.next).setVisible(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void registrar() {\n try {\r\n do {\r\n //totalUsuarios = this.registraUnUsuario(totalUsuarios);\r\n this.registraUnUsuario();\r\n } while (!this.salir());\r\n } catch (IOException e) {\r\n flujoSalida.println(\"Error de entrada/sa... | [
"0.73508435",
"0.73093593",
"0.70756966",
"0.705261",
"0.70510674",
"0.70510674",
"0.69955117",
"0.6841777",
"0.68332076",
"0.67439395",
"0.6700139",
"0.6690932",
"0.6546939",
"0.65378135",
"0.65325564",
"0.64860046",
"0.6477317",
"0.6470195",
"0.6467129",
"0.6447834",
"0.642... | 0.0 | -1 |
ottiene i dati da un campo della form | private String getFormValue(EditText edit){
if(edit!=null) return edit.getText().toString();
else return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void limpiarCamposFormBusqueda() {\n\t}",
"protected RespostaFormularioPreenchido() {\n // for ORM\n }",
"public void setar_campos() {\n int setar = tblEmpresas.getSelectedRow();\n txtEmpId.setText(tblEmpresas.getModel().getValueAt(setar, 0).toString());\n txtEmpNome.setTe... | [
"0.70058686",
"0.6358181",
"0.6191259",
"0.6135596",
"0.6124709",
"0.6118707",
"0.6102391",
"0.6095444",
"0.6090672",
"0.6075624",
"0.60573685",
"0.6043742",
"0.60417175",
"0.60409766",
"0.5969874",
"0.59688365",
"0.59648645",
"0.59462714",
"0.59462714",
"0.59462714",
"0.5946... | 0.0 | -1 |
Starts this service to perform action Baz with the given parameters. If the service is already performing a task this action will be queued. | public static void startUpdate(Context context, String url, String fileName, OnProgressListener progressListener) {
mProgressListener = progressListener;
Intent intent = new Intent(context, AppUpdateService.class);
intent.setAction(ACTION_UPDATE);
intent.putExtra(EXTRA_URL, url);
intent.putExtra(EXTRA_FILE_NAME, fileName);
context.startService(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doStart() {\n if (this.mActive == null) {\n a();\n } else {\n com.alipay.mobile.common.task.Log.v(TAG, \"StandardPipeline.start(a task is running, so don't call scheduleNext())\");\n }\n }",
"public void startTask() {\n\t}",
"public static void startAct... | [
"0.6057723",
"0.5958753",
"0.5890844",
"0.5878268",
"0.58370185",
"0.581168",
"0.57984596",
"0.5721728",
"0.57189745",
"0.56157047",
"0.55744123",
"0.5502057",
"0.54835826",
"0.54614526",
"0.54060847",
"0.5400008",
"0.5205406",
"0.51963204",
"0.519342",
"0.51924205",
"0.51877... | 0.0 | -1 |
/ Following methods deal with topic related queries Stores a topic, and associated keywords. | public static final String getTopicTableCreationSQL(String shortname) {
String crTopicTableSQL = "CREATE TABLE IF NOT EXISTS dblp_topic_" +shortname +
"(tid varchar(50) NOT NULL, " +
" keyword varchar(255) NOT NULL, " +
" istop tinyint UNSIGNED ZEROFILL, " + // Is this keyword a top keyword for this topic
" PRIMARY KEY (tid,keyword)) ";
return crTopicTableSQL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void updateTopic(String topic);",
"public interface TopicService {\n\nboolean topicsave(Topic topic, HttpServletRequest request);\n List<Topic> getTopicList(String query);\n Topic findByname(String name);\n}",
"private void convertTopics() throws Exception {\r\n final File file = new ... | [
"0.5936286",
"0.58774793",
"0.5849406",
"0.57866657",
"0.57691735",
"0.57612085",
"0.5754397",
"0.57253265",
"0.57253265",
"0.5690541",
"0.5602298",
"0.5601407",
"0.5578064",
"0.5556182",
"0.55047995",
"0.54718536",
"0.5468277",
"0.54523",
"0.542335",
"0.542335",
"0.5420108",... | 0.0 | -1 |
/ Stores a grouping between a keyword and an author. If a topic contains a keyword w, and if this topic is linked to a paper p, written by a coauthor a, we insert a record . Keywords are finegrained, one can do the same with topic also. | public static final String getAuthKWRelTableCreationSQL(String shortname) {
String crTopicTableSQL = "CREATE TABLE IF NOT EXISTS dblp_authkw_" +shortname +
"(author varchar(70) NOT NULL, " +
" keyword varchar(255) NOT NULL, " +
" PRIMARY KEY (keyword,author)) ";
return crTopicTableSQL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int insert(GrpTagKey record);",
"int insert(UserTopic record);",
"int insert(UserTopic record);",
"public ContentModelInsertion(String name, KeyStroke keyStroke, String group)\n {\n super(name,name,keyStroke,group);\n \n }",
"private void insertKeyword(String keyword, String adId) {\n\n... | [
"0.5637315",
"0.55528677",
"0.55528677",
"0.5485346",
"0.5445385",
"0.5438342",
"0.5438342",
"0.5438311",
"0.5400132",
"0.5388424",
"0.53398526",
"0.52980494",
"0.52664757",
"0.52636224",
"0.5158123",
"0.5127883",
"0.5121449",
"0.51107043",
"0.50797576",
"0.5066378",
"0.50497... | 0.0 | -1 |
/ In the previous table, you can get a set of authors Aw who have written papers that contain a keyword w. But how many of them have really collaborated? This is captured in this table. A record means that for a keyword w, there exists a paper which is coauthored by a and coa. This table is created by joining dblp_collab table with dblp_authkw table. | public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {
String crTopicTableSQL = "CREATE TABLE IF NOT EXISTS dblp_authcollabkw_" +shortname +
"(keyword varchar(255) NOT NULL, " +
"author varchar(70) NOT NULL, " +
" collabauth varchar(70) NOT NULL, " +
"collabcnt int NOT NULL" +
" ) ";
return crTopicTableSQL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getAuthorsQuery(String wkhuskagraph, String num, Boolean mode);",
"private void extractNumberOfCoauthors() {\r\n try {\r\n List<String> coAuthor = new ArrayList<String>();\r\n // gets all matched objects for extracting coauthor names.\r\n Matcher matcherObject = matcher.patternMatcher(\"... | [
"0.51980937",
"0.49987164",
"0.49797308",
"0.4963504",
"0.49596944",
"0.48843208",
"0.48680657",
"0.48390236",
"0.4781578",
"0.47685254",
"0.47311854",
"0.47225037",
"0.467512",
"0.46730292",
"0.46519548",
"0.46477216",
"0.45855433",
"0.45727384",
"0.4552139",
"0.45465764",
"... | 0.49083528 | 5 |
Creates new form FrameForm | public FrameForm() {
initComponents();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"FORM createFORM();",
"private void buildFrame() {\n String title = \"\";\n switch (formType) {\n case \"Add\":\n title = \"Add a new event\";\n break;\n case \"Edit\":\n title = \"Edit an existing event\";\n break;\n ... | [
"0.74792886",
"0.711587",
"0.70565695",
"0.66592795",
"0.6638166",
"0.66352046",
"0.65881175",
"0.65822816",
"0.6575019",
"0.653866",
"0.653866",
"0.653866",
"0.653866",
"0.653866",
"0.653866",
"0.653866",
"0.64747995",
"0.64592814",
"0.6390889",
"0.6375957",
"0.635798",
"0... | 0.76138604 | 0 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
allCheck = new javax.swing.JCheckBox();
blueCheck = new javax.swing.JCheckBox();
redCheck = new javax.swing.JCheckBox();
greenCheck = new javax.swing.JCheckBox();
jLabel1 = new javax.swing.JLabel();
supIzqRadio = new javax.swing.JRadioButton();
supDchaRadio = new javax.swing.JRadioButton();
infIzqRadio = new javax.swing.JRadioButton();
infDchaRadio = new javax.swing.JRadioButton();
jLabel2 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
try {
lienzo = new filtrarimagen.Lienzo();
} catch (java.net.MalformedURLException e1) {
e1.printStackTrace();
}
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, new java.awt.Color(0, 0, 0), new java.awt.Color(0, 0, 0)), "Configuración", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 10))); // NOI18N
allCheck.setSelected(true);
allCheck.setText("Todos");
allCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
allCheckActionPerformed(evt);
}
});
blueCheck.setSelected(true);
blueCheck.setText("Azul");
blueCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
blueCheckActionPerformed(evt);
}
});
redCheck.setSelected(true);
redCheck.setText("Rojo");
redCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
redCheckActionPerformed(evt);
}
});
greenCheck.setSelected(true);
greenCheck.setText("Verde");
greenCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
greenCheckActionPerformed(evt);
}
});
jLabel1.setText("Canales de color:");
buttonGroup.add(supIzqRadio);
supIzqRadio.setText("Superior izquierda");
supIzqRadio.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
supIzqRadioItemStateChanged(evt);
}
});
buttonGroup.add(supDchaRadio);
supDchaRadio.setSelected(true);
supDchaRadio.setText("Superior derecha");
supDchaRadio.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
supDchaRadioItemStateChanged(evt);
}
});
buttonGroup.add(infIzqRadio);
infIzqRadio.setText("Inferior izquierda");
infIzqRadio.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
infIzqRadioItemStateChanged(evt);
}
});
buttonGroup.add(infDchaRadio);
infDchaRadio.setText("Inferior derecha");
infDchaRadio.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
infDchaRadioItemStateChanged(evt);
}
});
jLabel2.setText("Posición del logo (Esquina):");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(45, 45, 45)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(supIzqRadio)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(supDchaRadio))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(infIzqRadio)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(infDchaRadio))
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(blueCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(greenCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(allCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(redCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(81, 81, 81)))
.addGap(31, 31, 31))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addGap(8, 8, 8)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(allCheck)
.addComponent(redCheck)
.addComponent(supIzqRadio)
.addComponent(supDchaRadio))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(blueCheck)
.addComponent(greenCheck)
.addComponent(infIzqRadio)
.addComponent(infDchaRadio))
.addContainerGap(44, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1200, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(lienzo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 652, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(lienzo, javax.swing.GroupLayout.PREFERRED_SIZE, 652, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
jLabel3.setText("Jorge Santana Lorenzo");
jLabel4.setText("Francisco Javier Sánchez González");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)))
.addContainerGap(52, Short.MAX_VALUE))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73191476",
"0.72906625",
"0.72906625",
"0.72906625",
"0.72860986",
"0.7248112",
"0.7213479",
"0.72078276",
"0.7195841",
"0.71899796",
"0.71840525",
"0.7158498",
"0.71477973",
"0.7092748",
"0.70800966",
"0.70558053",
"0.69871384",
"0.69773406",
"0.69548076",
"0.69533914",
"... | 0.0 | -1 |
Close the socket first to prevent new messages. | @Override
public void stop() {
try {
serverSocket.close();
}
catch (IOException e) {
getExceptionHandler().receivedException(e);
}
// Close all open connections.
synchronized (listConnections) {
for (TcpConnectionHandler tch : listConnections)
tch.kill();
listConnections.clear();
}
// Now close the executor service.
executorService.shutdown();
try {
executorService.awaitTermination(3, TimeUnit.SECONDS);
}
catch (InterruptedException e) {
getExceptionHandler().receivedException(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void closeSocket() { //gracefully close the socket connection\n\t\ttry {\n\t\t\tthis.os.close();\n\t\t\tthis.is.close();\n\t\t\tthis.clientSocket.close();\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"XX. \" + e.getStackTrace());\n\t\t}\n\t}",
"public void closeSocket() { //gracefully clo... | [
"0.8066156",
"0.8031883",
"0.797965",
"0.79319096",
"0.7868047",
"0.7801767",
"0.7729246",
"0.7713242",
"0.7684017",
"0.76756805",
"0.76739955",
"0.76644987",
"0.75914353",
"0.757805",
"0.7562244",
"0.75353134",
"0.7489918",
"0.74020296",
"0.73753524",
"0.7357996",
"0.7353639... | 0.0 | -1 |
A debugging utility that prints to stdout the component's minimum, preferred, and maximum sizes. | public static void printSizes(Component c) {
System.out.println("minimumSize = " + c.getMinimumSize());
System.out.println("preferredSize = " + c.getPreferredSize());
System.out.println("maximumSize = " + c.getMaximumSize());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printMetrics() {\n System.out.println(\"\\nPROG_SIZE = \" + Metrics.getProgSize() + '\\n' + \"EXEC_TIME = \" + Metrics.getExecTime() + \" ms\" + '\\n' + \"EXEC_MOVE = \" + Metrics.getExecMove() + '\\n' + \"DATA_MOVE = \" + Metrics.getDataMove() + '\\n' + \"DATA_READ = \" + Metrics.getDataRead() ... | [
"0.5628652",
"0.55489373",
"0.54363704",
"0.54323924",
"0.5414512",
"0.53303695",
"0.5319632",
"0.5313559",
"0.52183354",
"0.518164",
"0.51494336",
"0.50975496",
"0.50945",
"0.5086579",
"0.50858957",
"0.50790006",
"0.50718635",
"0.50635374",
"0.5059955",
"0.50570863",
"0.5007... | 0.6649683 | 0 |
/ Used by makeCompactGrid. | private static SpringLayout.Constraints getConstraintsForCell(
int row, int col,
Container parent,
int cols) {
final SpringLayout layout = (SpringLayout) parent.getLayout();
final Component c = parent.getComponent(row * cols + col);
return layout.getConstraints(c);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void buildGrid(){\n for(int column=0; column<columns; column++){\n for(int row=0; row<rows; row++){\n grid[column][row] = \"[ ]\";\n }\n }\n }",
"public void updateGridX();",
"private void clearGrid() {\n\n }",
"public RegularGrid... | [
"0.650509",
"0.6425575",
"0.6379256",
"0.63644356",
"0.6331686",
"0.6255327",
"0.61998755",
"0.6182439",
"0.61661917",
"0.614702",
"0.6140818",
"0.61195433",
"0.60999346",
"0.6080223",
"0.60652894",
"0.6038573",
"0.60369956",
"0.6035592",
"0.6026788",
"0.6023034",
"0.60037094... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
HashMap<Character, Character> map = new HashMap<>();
map.put('(', ')');
map.put('{','}');
map.put('[', ']');
while(scanner.hasNext()) {
String s = scanner.next();
System.out.println(isBalanced(s,map) ? "true":"false");
}
} | {
"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 |
set ore rates to whatever input was | public void generate() {
currentlyGenerating = true;
Bukkit.broadcastMessage(ChatColor.GREEN + "The world generation process has been started!");
createUhcWorld();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setRate();",
"public void setRate(int rate) { this.rate = rate; }",
"public abstract void setRate();",
"public void setRate(double annualRate) {\nmonthlyInterestRate = annualRate / 100.0 / MONTHS;\n}",
"public void setRate(Integer rate) {\r\n this.rate = rate;\r\n }",
"private void ... | [
"0.7051423",
"0.70009655",
"0.67732716",
"0.6687138",
"0.6536129",
"0.6504882",
"0.6493726",
"0.61576474",
"0.6152453",
"0.61520255",
"0.61244684",
"0.6117133",
"0.6093482",
"0.60790575",
"0.60706854",
"0.6027949",
"0.60274523",
"0.5998585",
"0.59922373",
"0.59879583",
"0.597... | 0.0 | -1 |
Create an extent report instance | public static ExtentReports createInstance() {
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(Constants.EXTENTREPORT_PATH+"---"+ScreenShot.timeStamp()+".html");
htmlReporter.config().setTestViewChartLocation(ChartLocation.BOTTOM);
htmlReporter.config().setChartVisibilityOnOpen(true);
htmlReporter.config().setTheme(Theme.DARK);
htmlReporter.config().setReportName("Functional Report");
htmlReporter.config().setEncoding("utf-8");
htmlReporter.config().setDocumentTitle("AutoMation Report");
htmlReporter.config().setTimeStampFormat("EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setSystemInfo("OS", "Windows");
extent.setSystemInfo("AUT", "QA");
return extent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ExtentReports extentReportGenerator() \n\t{\n\tString path=System.getProperty(\"user.dir\")+\"\\\\reports\\\\index.html\";\n//\tExtentSparkReporter reporter=new ExtentSparkReporter(path);\n//\t\treporter.config().setEncoding(\"utf-8\");\n//\t\treporter.config().setReportName(\"Automation Test Results... | [
"0.747967",
"0.7038648",
"0.6919",
"0.67445123",
"0.6703984",
"0.6696888",
"0.65175617",
"0.64860135",
"0.6465534",
"0.64432514",
"0.6387093",
"0.6333037",
"0.63274693",
"0.631654",
"0.6286335",
"0.6285572",
"0.6091306",
"0.6026994",
"0.59093",
"0.59007335",
"0.58968806",
"... | 0.7867286 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
TreeSet<String> treeset = new TreeSet<String>();
treeset.add("Good");
treeset.add("For");
treeset.add("Health");
//Add Duplicate Element
treeset.add("Good");
System.out.println("TreeSet : ");
for (String temp : treeset) {
System.out.println(temp);
}
} | {
"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 |
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); | @Override
public void onClick(View view) {
isFromResultActivity=false;
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View v) {\n Snackbar.make(v, \"I'm dead! =(\", Snackbar.LENGTH_LONG)\n .setAction(\"Action\", null).show();\n }",
"private void showSnackbarMessage(String message){\n if(view != null){\n Snackbar.make(view, message, Sna... | [
"0.77849233",
"0.73431313",
"0.7312924",
"0.7308021",
"0.71119523",
"0.70179576",
"0.6977823",
"0.693279",
"0.6817242",
"0.67794555",
"0.6773066",
"0.6769153",
"0.66969097",
"0.66901416",
"0.6535203",
"0.6526453",
"0.6526107",
"0.64990896",
"0.64981586",
"0.64537144",
"0.6414... | 0.0 | -1 |
Returns the enum value for a string, or null if none. | public static Enum forString(java.lang.String s)
{ return (Enum)table.forString(s); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RecordStatusEnum get(String string) {\n if (string == null) {\n return null;\n }\n try {\n Integer id = Integer.valueOf(string);\n RecordStatusEnum enumeration = getById(id);\n if (enumeration != null) {\n return enumerat... | [
"0.7287693",
"0.6751677",
"0.65314513",
"0.6493583",
"0.64313394",
"0.6422369",
"0.6397381",
"0.63267887",
"0.62091017",
"0.61424094",
"0.6082569",
"0.607042",
"0.60694385",
"0.601767",
"0.6001843",
"0.5966389",
"0.5958356",
"0.5955963",
"0.5934569",
"0.59279925",
"0.58848006... | 0.64256704 | 7 |
Returns the enum value corresponding to an int, or null if none. | public static Enum forInt(int i)
{ return (Enum)table.forInt(i); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BendType toEnum(int val) {\r\n\t\t\ttry {\r\n\t\t\t\treturn values()[val - 1];\r\n\t\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}",
"public T caseIntEnum(IntEnum object)\n {\n return null;\n }",
"public static Resource_kind get(int value) {\n\t\tswit... | [
"0.65354",
"0.64121985",
"0.6008517",
"0.5999116",
"0.5954221",
"0.5938351",
"0.5918922",
"0.58807987",
"0.58773386",
"0.587598",
"0.5873916",
"0.58688426",
"0.58688426",
"0.5838283",
"0.58377904",
"0.58305204",
"0.5823383",
"0.5821554",
"0.57482404",
"0.5741277",
"0.57199764... | 0.5595413 | 49 |
DENTRO DO EU COLOCO PRIMEIRO O NOME DA CLASSE E DEPOIS O TIPO DO ID | public interface ManutencaoRepository extends JpaRepository<ManutencaoTable, Long> {
Optional<ManutencaoTable> findByNome(String nome);
Optional<ManutencaoTable> findByNomeAndCategoria(String nome, String categoria);
@Query(value = "SELECT * FROM tb_manutencao_crud where id >= 3", nativeQuery = true)
List<ManutencaoTable> anosIntervalos();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.Long getId_tecnico();",
"public abstract java.lang.Long getId_causal_peticion();",
"public long getIdCargaTienda();",
"public int getId()\r\n/* 53: */ {\r\n/* 54: 79 */ return this.idDetalleComponenteCosto;\r\n/* 55: */ }",
"public BigDecimal getIdContrato() {\r\n r... | [
"0.73384345",
"0.72565615",
"0.7106608",
"0.6951749",
"0.6938851",
"0.6916787",
"0.6886402",
"0.6840408",
"0.6744098",
"0.6711602",
"0.66703165",
"0.6602814",
"0.6589229",
"0.65864646",
"0.65854675",
"0.65604943",
"0.6551629",
"0.6551418",
"0.6531057",
"0.6513691",
"0.6513531... | 0.0 | -1 |
Get the list of option values in the variant E.g product variant is a 60ml bottle of 6mg strength eliquid > option values are 60ml & 6mg | public ArrayList<String> getOptionValues() {
return optionValues;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<String> getValues(String opt) {\n //noinspection unchecked\n return m_commandLine.getValues(opt);\n }",
"@Override\n public Enumeration<Option> listOptions() {\n\n Vector<Option> result = new Vector<Option>();\n\n result.addElement(new Option(\"\\tThe method used to determine best split... | [
"0.61064845",
"0.5911697",
"0.584696",
"0.5752894",
"0.57143056",
"0.56954247",
"0.56687945",
"0.5611132",
"0.5609258",
"0.56090415",
"0.55957216",
"0.5561844",
"0.55267",
"0.5524711",
"0.5512507",
"0.5507065",
"0.54848087",
"0.5461166",
"0.5452004",
"0.5444821",
"0.5434461",... | 0.65168035 | 0 |
Add an option value to the set | public void addOptionValue(String optionValue) {
optionValue = optionValue.toLowerCase();
if(optionValueSet.contains(optionValue)){
return;
}
this.optionValueSet.add(optionValue);
this.optionValues.add(optionValue);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setOption(String name, Object value);",
"private static void addValue(ISet set, Scanner in)\n {\n boolean contained;\n int val;\n if (set.getSize() == ISet.MAX_SIZE)\n {\n System.out.println(\"Set is already full!\");\n return;\n }\n do {\n ... | [
"0.6485531",
"0.6208906",
"0.6208554",
"0.59912586",
"0.5977987",
"0.5963509",
"0.594499",
"0.5864735",
"0.5758042",
"0.5700702",
"0.5699024",
"0.5669565",
"0.56674373",
"0.5628316",
"0.56085336",
"0.5607341",
"0.5575943",
"0.557142",
"0.5571164",
"0.55432963",
"0.551735",
... | 0.6447235 | 1 |
Get the price of the variant | public double getPrice() {
return price;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Double getPrice();",
"double getPrice();",
"double getPrice();",
"double getPrice();",
"public double getPrice();",
"public double getPrice() {\n return price_;\n }",
"public double price() {\n return price;\n }",
"public double getPrice() {\n return price_;\n }",... | [
"0.74129224",
"0.73763853",
"0.73763853",
"0.73763853",
"0.7367344",
"0.73234403",
"0.7304251",
"0.72854304",
"0.725964",
"0.7237044",
"0.7237044",
"0.7237044",
"0.7237044",
"0.7236023",
"0.7233612",
"0.72215563",
"0.722009",
"0.7206072",
"0.7205577",
"0.72006786",
"0.7195761... | 0.72028875 | 25 |
Check if the variant is in stock | public boolean inStock() {
return inStock;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkStock(){\n int i;\n int inventorySize = inventory.size();\n int count = 0;\n for(i = 0; i < inventorySize; i++){\n count = count + inventory.get(i).getStock();\n\n }\n //System.out.println(\"Count was: \" + count);\n if(count < 1){\n ... | [
"0.726514",
"0.6949389",
"0.6706022",
"0.67051554",
"0.65851927",
"0.65094256",
"0.6474859",
"0.6472044",
"0.6393402",
"0.63223994",
"0.6308892",
"0.6226986",
"0.61548513",
"0.61326575",
"0.6132483",
"0.61159945",
"0.61006474",
"0.60539377",
"0.59802216",
"0.59483546",
"0.594... | 0.7419601 | 0 |
create pristine level instance | public static final void initLevel()
{
current = new JARLevel();
//assign blocks, enemies, the player and all items
current.iWalls = new JARWall[]
{
new JARWall( 30 + 256, current.iLevelBoundY - 310 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 384, current.iLevelBoundY - 320 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 512, current.iLevelBoundY - 300 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 640, current.iLevelBoundY - 290 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 768, current.iLevelBoundY - 280 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 896, current.iLevelBoundY - 270 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1152, current.iLevelBoundY - 260 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1408, current.iLevelBoundY - 250 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 - 32, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 + 0, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 + 32, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 - 2 * 32, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 - 3 * 32, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1664, current.iLevelBoundY - 240 - 4 * 32, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 1920, current.iLevelBoundY - 230 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 30 + 2100, current.iLevelBoundY - 230 + 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.EYes ),
new JARWall( 66, current.iLevelBoundY - 324, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 0, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 128, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 256, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 384, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 512, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 640, current.iLevelBoundY - 64, JARWall.WALL_STONE_1, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 768, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 896, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1024, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1152, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1280, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1408, current.iLevelBoundY - 64, JARWall.WALL_STONE_2, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1536, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1664, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1792, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 1920, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 2048, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
new JARWall( 2176, current.iLevelBoundY - 64, JARWall.WALL_STONE_3, LibRect2D.Elevation.ENone, PassThrough.ENo ),
};
current.iEnemies = new JARPlayer[]
{
/*
new JARPlayer( 500, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_WEAK ),
new JARPlayer( 1000, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_WEAK ),
new JARPlayer( 1500, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_WEAK ),
new JARPlayer( 2000, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_WEAK ),
new JARPlayer( 2500, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_STRONG ),
new JARPlayer( 3000, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_STRONG ),
new JARPlayer( 3500, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_STRONG ),
new JARPlayer( 4000, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_STRONG ),
new JARPlayer( 4500, GameObjectType.EEnemy, JARPlayerTemplate.ENEMY_STRONG )
*/
};
current.iPlayer = new JARPlayer( 0, GameObjectType.EPlayer, JARPlayerTemplate.USER );
current.iItems = new JARItem[]
{
//new JARItem( 50, 700, JARItemType.ITEM_TYPE_COIN ),
//new JARItem( 150, 700, JARItemType.ITEM_TYPE_COIN ),
//new JARItem( 250, 700, JARItemType.ITEM_TYPE_COIN ),
new JARItem( 550, 700, JARItemType.ITEM_TYPE_CHERRY ),
new JARItem( 650, 700, JARItemType.ITEM_TYPE_CHERRY ),
new JARItem( 750, 700, JARItemType.ITEM_TYPE_CHERRY ),
new JARItem( 1050, 700, JARItemType.ITEM_TYPE_APPLE ),
new JARItem( 1150, 700, JARItemType.ITEM_TYPE_APPLE ),
new JARItem( 1250, 700, JARItemType.ITEM_TYPE_APPLE ),
new JARItem( 1550, 700, JARItemType.ITEM_TYPE_ORANGE ),
new JARItem( 1650, 700, JARItemType.ITEM_TYPE_ORANGE ),
new JARItem( 1750, 700, JARItemType.ITEM_TYPE_ORANGE ),
new JARItem( 2050, 700, JARItemType.ITEM_TYPE_PEAR ),
new JARItem( 2150, 700, JARItemType.ITEM_TYPE_PEAR ),
new JARItem( 2250, 700, JARItemType.ITEM_TYPE_PEAR ),
new JARItem( 2550, 700, JARItemType.ITEM_TYPE_STRAWBERRY ),
new JARItem( 2650, 700, JARItemType.ITEM_TYPE_STRAWBERRY ),
new JARItem( 2750, 700, JARItemType.ITEM_TYPE_STRAWBERRY ),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void createNewLevel(int level);",
"public void createLevel() {\n room = 1;\n currentLevelFinish = false;\n createRoom();\n }",
"public void create(){}",
"public void create() {\n\t\t\n\t}",
"Reproducible newInstance();",
"WithCreate withLevel(LockLevel level);",
"private void in... | [
"0.63569164",
"0.62475276",
"0.61970013",
"0.6103494",
"0.6085479",
"0.59703505",
"0.59677505",
"0.5943273",
"0.5834053",
"0.5825372",
"0.5814432",
"0.5806399",
"0.58032596",
"0.5790231",
"0.5759044",
"0.5702422",
"0.5696098",
"0.56821376",
"0.5648802",
"0.56042755",
"0.55740... | 0.0 | -1 |
Draws the bg using parallax scrolling. | public void drawLevelBg( SpriteBatch batch, JARCamera camera )
{
//draw bg image
if ( JARSettings.scrollBgImageParallax )
{
int imgWidth = (int)JARImage.GAME_BG_HILL.getWidth();
int imgHeight = (int)JARImage.GAME_BG_HILL.getHeight();
LibDrawing.drawImage
(
batch,
JARImage.GAME_BG_HILL.getTextureRegion(),
0 - ( imgWidth - JARScreen.width() ) * camera.x / ( iLevelBoundX - JARScreen.width() ),
0 - ( imgHeight - JARScreen.height() ) * camera.y / ( iLevelBoundY - JARScreen.height() ),
LibAnchor.LEFT_TOP
);
}
else
{
//draw image static on center bottom of the canvas
LibDrawing.drawImage( batch, JARImage.GAME_BG_HILL.getTextureRegion(), JARScreen.width() / 2, JARScreen.height(), LibAnchor.CENTER_BOTTOM );
}
//blend the image to make the fg more visible
//Drawing.fillCanvas( "rgba( 255, 255, 255, " + Settings.BG_BLENDING + " )" );
//draw middle layer
if ( JARSettings.scrollBgImageParallax )
{
float imgWidth = JARImage.GAME_BG_TREES.getWidth();
float imgHeight = JARImage.GAME_BG_TREES.getHeight();
float MAGIC_OFF_Y = 100;
LibDrawing.drawImage
(
batch,
JARImage.GAME_BG_TREES.getTextureRegion(),
0 - ( imgWidth - JARScreen.width() ) * camera.x / ( iLevelBoundX - JARScreen.width() ),
0 - 4 * ( imgHeight - JARScreen.height() ) * camera.y / ( iLevelBoundY - JARScreen.height() ) + MAGIC_OFF_Y,
LibAnchor.LEFT_TOP
);
/*
float offsetX = 0;
float offsetY = 3 * imgHeight;
float targetWidth = imgWidth;
float targetHeight = 4 * imgHeight;
LibDrawing.drawImage
(
batch,
JARImage.GAME_BG_TREES,
0 - ( targetWidth - Canvas.WIDTH ) * camera.x / ( iLevelBoundX - Canvas.WIDTH ) + offsetX,
0 - ( targetHeight - Canvas.HEIGHT ) * camera.y / ( iLevelBoundY - Canvas.HEIGHT ) + offsetY,
Anchor.LEFT_TOP
);
*/
}
else
{
//draw image static on center bottom of the canvas
LibDrawing.drawImage( batch, JARImage.GAME_BG_TREES.getTextureRegion(), JARScreen.width() / 2, JARScreen.height(), LibAnchor.CENTER_BOTTOM );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(0.8f, 0.3f, 0.3f, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n bgViewPort.apply();\n batch.setProjectionMatrix(bgViewPort.getCamera().combined);\n batch.begin();\n batch.draw(background,0,0);\n ... | [
"0.6602016",
"0.6548302",
"0.65348303",
"0.6249422",
"0.61358213",
"0.61093956",
"0.60954905",
"0.60636777",
"0.60508114",
"0.59149677",
"0.580171",
"0.57879716",
"0.5760771",
"0.5753868",
"0.57412964",
"0.56920564",
"0.56874865",
"0.56604964",
"0.56308687",
"0.55895376",
"0.... | 0.6948691 | 0 |
draw blocks in foreground | public void drawLevelFg( SpriteBatch batch, JARCamera camera )
{
for ( int i = 0; i < iWalls.length; ++i )
{
//draw block with isometric offset
iWalls[ i ].iBlock.draw( batch, camera );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void paintComponent(Graphics g){\n \t\t\t g.setColor(Color.white);\n \t\t\t g.fillRect(0,0,getWidth(),getHeight());\n for(Block z : blocks){\n z.draw(g);\n }\n \t\t }",
"private void drawBlockLines(Canvas canvas,float offsetX) {\n List<BlockLine> blocks = mSpanner == nu... | [
"0.7398599",
"0.68172693",
"0.67863667",
"0.6645419",
"0.66409814",
"0.6636568",
"0.6623991",
"0.66051507",
"0.6550848",
"0.65179586",
"0.6512762",
"0.6507867",
"0.64817363",
"0.6471543",
"0.639275",
"0.63782007",
"0.6364532",
"0.6340708",
"0.6317989",
"0.6315345",
"0.630427"... | 0.6584712 | 8 |
check collisions on player | public boolean checkHorizontalCollisions( LibRect2D rect )
{
if ( iPlayer.iBlock.checkBlockCollision( rect ) )
{
return true;
}
//check collision on blocks
for ( int i = 0; i < iWalls.length; ++i )
{
//only collide on non-passable blocks
if ( iWalls[ i ].iBlock.iPassThrough == PassThrough.ENo )
{
if ( iWalls[ i ].iBlock.checkBlockCollision( rect ) )
{
return true;
}
}
}
//check collisions on enemies
for ( int i = 0; i < iEnemies.length; ++i )
{
if ( iEnemies[ i ].isAlive() )
{
if ( iEnemies[ i ].iBlock.checkBlockCollision( rect ) )
{
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkPlayerCollisions() {\r\n\t\tGObject left = getElementAt(player.getX() - 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tGObject right = getElementAt(player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tif(dragon1 != null && (left == dragon1 || right == dra... | [
"0.8160248",
"0.762636",
"0.76015884",
"0.7576864",
"0.7506796",
"0.74566835",
"0.7424482",
"0.7299193",
"0.72677505",
"0.7246881",
"0.72022504",
"0.7185579",
"0.7155843",
"0.71303546",
"0.71261644",
"0.70994556",
"0.7091946",
"0.70677495",
"0.706611",
"0.7065951",
"0.7050699... | 0.0 | -1 |
Picks the nearest collision BELOW the given rect and all available level components. | public final JARCollisionInfo getNearestYBelowRect( LibRect2D rect )
{
float nearestY = iLevelBoundY;
JARPlayer nearestPlayer = null;
JARBlock nearestBlock = null;
//consider player
if ( iPlayer != null )
{
Float blockY = iPlayer.iBlock.getRect().getYonCollisionXrect( rect, LibRect2D.Elevation.ENone );
if ( blockY != null )
{
//check if the block is UNDER the rect
if ( blockY.floatValue() < nearestY && blockY.floatValue() >= rect.iTop + rect.iHeight )
{
nearestY = blockY.floatValue();
nearestPlayer = iPlayer;
nearestBlock = iPlayer.iBlock;
}
}
}
//consider blocks
if ( iWalls != null )
{
for ( int i = 0; i < iWalls.length; ++i )
{
//if ( iWalls[ i ].block.iPassThrough == PassThrough.ENo )
{
//check elevation below player
Float blockY = iWalls[ i ].iBlock.getRect().getYonCollisionXrect( rect, iWalls[ i ].iBlock.getElevation() );
if ( blockY != null )
{
//check if the block is UNDER the rect
if ( blockY.floatValue() < nearestY && ( blockY.floatValue() >= rect.iTop + rect.iHeight ) )
{
nearestY = blockY.floatValue();
nearestPlayer = null;
nearestBlock = iWalls[ i ].iBlock;
}
}
}
}
}
//consider enemies
if ( iEnemies != null )
{
for ( int i = 0; i < iEnemies.length; ++i )
{
if ( iEnemies[ i ].isAlive() )
{
Float blockY = iEnemies[ i ].iBlock.getRect().getYonCollisionXrect( rect, LibRect2D.Elevation.ENone );
if ( blockY != null )
{
//check if the block is UNDER the rect
if ( blockY.floatValue() < nearestY && blockY.floatValue() >= rect.iTop + rect.iHeight )
{
nearestY = blockY.floatValue();
nearestPlayer = iEnemies[ i ];
nearestBlock = iEnemies[ i ].iBlock;
}
}
}
}
}
//JARDebug.bugfix.info( "Get Y below: [" + rect.iTop + "][" + ( nearestBlock != null ? nearestBlock.iRect.iTop : "null" ) + "]" );
JARCollisionInfo ret = new JARCollisionInfo( nearestY, nearestPlayer, nearestBlock );
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Rectangle getCollisionBox();",
"Rectangle getCollisionRectangle();",
"Rectangle getCollisionRectangle();",
"public Iterable<Point2D> range(RectHV rect) {\n\t\tif (rect == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tQueue<Point2D> queue = new Queue<Point2D>();\n\t\tStack<Node> stack = new Sta... | [
"0.61396724",
"0.56905127",
"0.56905127",
"0.5603947",
"0.5537961",
"0.536616",
"0.53059006",
"0.52827346",
"0.5278598",
"0.5227975",
"0.5124807",
"0.51228595",
"0.50995225",
"0.50934714",
"0.50835043",
"0.50797844",
"0.5037316",
"0.49814242",
"0.49547142",
"0.49522167",
"0.4... | 0.6915927 | 0 |
/ Bridge Routing Methods | public static boolean isOnlineAnywhere(String playerName)
{
if (haveBridge)
{
return bridge.isOnlineServerPlusClients(playerName);
}
else
{
return server.getOfflinePlayer(playerName).isOnline();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Router {\n\t/**\n\t * @return\n\t * \t\trouting target information or null, if the URI didn't match\n\t */\n\tpublic RoutingTarget routeUri(HttpServletRequest request);\n\t\n\t/**\n\t * routers should be able to access the configuration and path resolver\n\t */\n\tpublic void setConfig(Weberknecht... | [
"0.6415922",
"0.6377646",
"0.62237227",
"0.61657965",
"0.61147714",
"0.61147714",
"0.6044255",
"0.6004163",
"0.59989434",
"0.59453756",
"0.59043175",
"0.58917814",
"0.58264077",
"0.5821707",
"0.5805509",
"0.5769907",
"0.57496816",
"0.5746269",
"0.5669434",
"0.5663894",
"0.565... | 0.0 | -1 |
send to bridge clients if we have bridge | public static void broadcastPermissionMessage(String message, String permission)
{
if (haveBridge)
{
bridge.broadcastMessage(message, permission, true);
}
else
{
//standard broadcast
server.broadcast(message, permission);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean enterBridge(BridgeEntity bridge);",
"public boolean isBridge() {\n return (getAccessFlags() & Constants.ACCESS_BRIDGE) > 0;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic synchronized boolean doActivity() {\n\t\tJSONObject json = new JSONObject();\n\t\tjson.put(\"command\", SERVER_A... | [
"0.61976856",
"0.6157875",
"0.6025647",
"0.5953993",
"0.58297163",
"0.57791",
"0.5713403",
"0.5702355",
"0.5687605",
"0.5644922",
"0.5626474",
"0.5609882",
"0.5593409",
"0.5582336",
"0.5554863",
"0.55390346",
"0.5505767",
"0.5499297",
"0.54976106",
"0.54923964",
"0.5490928",
... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Link createLink(String caption, String url) {
return new ListLink(caption, url);
} | {
"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 Tray createTray(String caption) {
return new ListTray(caption);
} | {
"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 Page createPage(String title, String author) {
return new ListPage(title, author);
} | {
"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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0... | 0.0 | -1 |
set current active history and activate it | private void setActiveHistory(History activeHistory) {
this.activeHistory = activeHistory;
activeHistory.activate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void switchToHistory() {\r\n\t\thistoryPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"historyPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}",
"public void activate(){\r\n\t\tactive=true;\r\n\t}",
"@Override\r\n public void activate() {\r\n super.getShell().setActive();\r\n }",
... | [
"0.6781022",
"0.6591345",
"0.64583445",
"0.61609346",
"0.6158667",
"0.61345196",
"0.612999",
"0.60974",
"0.60610086",
"0.6033234",
"0.6033234",
"0.5914948",
"0.5895287",
"0.5893504",
"0.58862966",
"0.5865155",
"0.5854025",
"0.5852525",
"0.5849549",
"0.5836823",
"0.5825095",
... | 0.8212736 | 0 |
save all(two) used historys | public void saveAllHistory() {
for (Map.Entry<Integer, History> entry : mapOfHistorys.entrySet()) {
History history = entry.getValue();
history.save();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveHistoryToStorage() {\r\n\t\tfor(Document i: strategy.getEntireHistory()) {\r\n\t\t\tif(!i.getContent().isEmpty()) {\r\n\t\t\t\ti.save(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void storeFileHistory() {\n\t\ttheFileHistory.store(theConfiguration);\n\t}",
"public void saveHistory(OperatorSelect... | [
"0.6908162",
"0.66873044",
"0.6604459",
"0.6584165",
"0.653183",
"0.6525347",
"0.6509158",
"0.6460949",
"0.6182111",
"0.59972423",
"0.5969321",
"0.59690744",
"0.5906623",
"0.5857627",
"0.58564234",
"0.5855428",
"0.58439004",
"0.5832412",
"0.5822509",
"0.57773787",
"0.5766541"... | 0.7883226 | 0 |
The API of the Model component. | public interface Model {
/**
* {@code Predicate} that always evaluate to true
*/
Predicate<Module> PREDICATE_SHOW_ALL_MODULES = unused -> true;
/**
* Replaces user prefs data with the data in {@code userPrefs}.
*/
void setUserPrefs(ReadOnlyUserPrefs userPrefs);
/**
* Returns the user prefs.
*/
ReadOnlyUserPrefs getUserPrefs();
/**
* Returns the user prefs' GUI settings.
*/
GuiSettings getGuiSettings();
/**
* Sets the user prefs' GUI settings.
*/
void setGuiSettings(GuiSettings guiSettings);
/**
* Returns the user prefs' mod book file path.
*/
Path getModBookFilePath();
/**
* Sets the user prefs' mod book file path.
*/
void setModBookFilePath(Path modBookFilePath);
/**
* Replaces mod book data with the data in {@code modBook}.
*/
void setModBook(ReadOnlyModBook modBook);
/**
* Returns the ModBook
*/
ReadOnlyModBook getModBook();
/**
* Returns true if a module with the same identity as {@code module} exists in the mod book.
*/
boolean hasModule(Module module);
/**
* Deletes the given module.
* The module must exist in the mod book.
*/
void deleteModule(Module module);
/**
* Adds the given module.
* {@code module} must not already exist in the mod book.
*/
void addModule(Module module);
/**
* Gets the requested module based on given modCode.
*
* @param modCode Used to find module.
* @return Module.
* @throws CommandException If module does not exist.
*/
Module getModule(ModuleCode modCode) throws CommandException;
/**
* Deletes the Exam from the specified module's lessons list.
*/
void deleteExam(Module module, Exam target);
/**
* Deletes the Lesson from the specified module's lessons list.
*/
void deleteLesson(Module module, Lesson target);
/**
* Checks if a module has the lesson
*/
boolean moduleHasLesson(Module module, Lesson lesson);
/**
* Adds a lesson to a module.
*/
void addLessonToModule(Module module, Lesson lesson);
/**
* Checks if a module has the lesson
*/
boolean moduleHasExam(Module module, Exam exam);
/**
* Adds a lesson to a module.
*/
void addExamToModule(Module module, Exam exam);
/**
* Replaces the {@code target} Exam with {@code newExam} from the specified module's exams list.
*/
void setExam(Module module, Exam target, Exam newExam);
/**
* Replaces the {@code target} Exam with {@code newLesson} from the specified module's lessons list.
*/
void setLesson(Module module, Lesson target, Lesson newLesson);
/**
* Replaces the given module {@code target} with {@code editedModule}.
* {@code target} must exist in the mod book.
* The module identity of {@code editedModule} must not be the same as another existing module in the mod book.
*/
void setModule(Module target, Module editedModule);
/**
* Returns an unmodifiable view of the filtered module list
*/
ObservableList<Module> getFilteredModuleList();
/**
* Updates the filter of the filtered module list to filter by the given {@code predicate}.
*
* @throws NullPointerException if {@code predicate} is null.
*/
void updateFilteredModuleList(Predicate<Module> predicate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ModelData getModel();",
"public Model getModel () { return _model; }",
"public ModelBean provideModel();",
"Model getModel();",
"Model getModel();",
"Model getModel();",
"public interface ModelAPI {\n\n @GET(\"repository/models\")\n Paging<Model> getModels();\n\n @GET(\"repository/models\")\n ... | [
"0.7456265",
"0.73385507",
"0.7203751",
"0.7105992",
"0.7105992",
"0.7105992",
"0.70494694",
"0.70432985",
"0.7040317",
"0.6914594",
"0.6824597",
"0.68210256",
"0.6791134",
"0.6721404",
"0.67041063",
"0.66958684",
"0.66915065",
"0.66754895",
"0.6666074",
"0.66529065",
"0.6641... | 0.0 | -1 |
Returns the user prefs. | ReadOnlyUserPrefs getUserPrefs(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BwPreferences getUserPreferences() {\n return userPreferences;\n }",
"public ReactivePreferences preferences() {\n\t\treturn ReactivePreferences.userRoot();\n\t}",
"public GamePreferences getPrefs() {\n\t\treturn prefs;\n\t}",
"public User getPrefsUser() {\n Gson gson = new Gson();\n ... | [
"0.78049165",
"0.739698",
"0.73004234",
"0.7297378",
"0.7254111",
"0.7189983",
"0.71783674",
"0.7154654",
"0.7022628",
"0.6791623",
"0.67755044",
"0.66378444",
"0.658612",
"0.6542232",
"0.6534369",
"0.64963627",
"0.64962536",
"0.64730734",
"0.64500004",
"0.64146733",
"0.64043... | 0.7810087 | 3 |
Returns the user prefs' GUI settings. | GuiSettings getGuiSettings(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ReactivePreferences preferences() {\n\t\treturn ReactivePreferences.userRoot();\n\t}",
"GuiSettings getCurrentGuiSetting() {\n return new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(),\n (int) primaryStage.getX(), (int) primaryStage.getY());\n }",
"ReadOnlyUserPr... | [
"0.6814523",
"0.6770192",
"0.6742717",
"0.6742717",
"0.6742717",
"0.6742717",
"0.6701116",
"0.66649663",
"0.65583646",
"0.6490545",
"0.6487666",
"0.6462761",
"0.63182724",
"0.63171756",
"0.62954676",
"0.6285168",
"0.62453854",
"0.6163197",
"0.6160784",
"0.6115528",
"0.6109718... | 0.78347003 | 5 |
Sets the user prefs' GUI settings. | void setGuiSettings(GuiSettings guiSettings); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setSettings(UserPrefs prefs) {\n tfDataPath.setText(prefs.getProperty(UserPrefs.DATA_ROOT));\n // Save this for a comparison later\n existingDataPath = prefs.getProperty(UserPrefs.DATA_ROOT);\n\n String backup = prefs.getProperty(UserPrefs.BACKUP_FOLDER);\n // Nothing... | [
"0.7848523",
"0.68278533",
"0.67510957",
"0.66116303",
"0.66024584",
"0.65460485",
"0.65337104",
"0.6515219",
"0.6337692",
"0.6258978",
"0.6220632",
"0.6197733",
"0.6196499",
"0.618944",
"0.6137472",
"0.6090067",
"0.6086726",
"0.6069736",
"0.6054004",
"0.60514116",
"0.6047249... | 0.77513474 | 6 |
Returns the user prefs' mod book file path. | Path getModBookFilePath(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Path getUserPrefsFilePath() {\n return userPrefsStorage.getUserPrefsFilePath();\n }",
"public static Path getUserSaveDir() {\n\t\treturn Paths.get(prefs.get(Constants.PREF_USERSAVE_DIR, null));\n\t}",
"Path getManageMeFilePath();",
"public static String getPreferenceDirectory(... | [
"0.72817165",
"0.67007947",
"0.66129667",
"0.65981376",
"0.6575513",
"0.64676034",
"0.63436335",
"0.60753596",
"0.6061457",
"0.6058332",
"0.5951997",
"0.59010744",
"0.58965147",
"0.58220154",
"0.5820551",
"0.5781186",
"0.57786155",
"0.5719123",
"0.57186913",
"0.5711117",
"0.5... | 0.78442013 | 0 |
Sets the user prefs' mod book file path. | void setModBookFilePath(Path modBookFilePath); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setManageMeFilePath(Path manageMeFilePath);",
"@Override\n public Path getUserPrefsFilePath() {\n return userPrefsStorage.getUserPrefsFilePath();\n }",
"Path getModBookFilePath();",
"public void setPath(String newPath) {\n String id = PREF_DEFAULTDIR + getId();\n idv.getStateM... | [
"0.6523556",
"0.6234065",
"0.62316054",
"0.6169025",
"0.61611414",
"0.6147683",
"0.60448253",
"0.5846425",
"0.5739553",
"0.57107407",
"0.5649195",
"0.5571281",
"0.5540813",
"0.55386996",
"0.55314255",
"0.5518262",
"0.5508202",
"0.5504053",
"0.54874444",
"0.5473936",
"0.546727... | 0.78631276 | 0 |
Deletes the given module. The module must exist in the mod book. | void deleteModule(Module module); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteModule(int moduleId) {\n\t\tModule m = (Module)this.getHibernateTemplate().load(Module.class, moduleId);\n\t\t\n\t\tif(m.getChildren().size()>0){\n\t\t\tthrow new RuntimeException(\"有子模块\");\n\t\t}\n\t\tthis.getHibernateTemplate().delete(m);\n\t}",
"@Override\n\tpublic void deleteModule(String ... | [
"0.7072958",
"0.69937426",
"0.69458044",
"0.69297373",
"0.6836185",
"0.6621391",
"0.63683677",
"0.6234377",
"0.6216494",
"0.6148034",
"0.60615814",
"0.60140437",
"0.5999438",
"0.59936994",
"0.5955656",
"0.5841199",
"0.57526445",
"0.57217556",
"0.5547915",
"0.55460083",
"0.536... | 0.8323938 | 0 |
Gets the requested module based on given modCode. | Module getModule(ModuleCode modCode) throws CommandException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Module findModule(String moduleName) {\n if(modules.containsKey(moduleName))\n return modules.get(moduleName);\n //TODO: search in joined mobiles\n return null;\n }",
"public String getModuleCode() {\r\n\t\treturn moduleCode;\r\n\t}",
"public String getModuleCode() {\r... | [
"0.6407209",
"0.61871743",
"0.61871743",
"0.61531407",
"0.61531407",
"0.610308",
"0.6083734",
"0.59093857",
"0.58156997",
"0.57817835",
"0.57799727",
"0.5741218",
"0.56413174",
"0.5595914",
"0.5509826",
"0.54978186",
"0.54639167",
"0.54107666",
"0.54098594",
"0.5402195",
"0.5... | 0.75847304 | 0 |
Deletes the Exam from the specified module's lessons list. | void deleteExam(Module module, Exam target); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void deleteLesson(Module module, Lesson target);",
"void deleteModule(Module module);",
"@Override\r\n\tpublic Exam deleteExam(int id)\r\n\t{\n\t\treturn null;\r\n\t}",
"void delete(Exam exam);",
"@Override\n\tpublic void deleteExam(ExamBean exam) {\n\t\t\n\t}",
"@Override\n\tpublic void deleteModule() t... | [
"0.72418445",
"0.60194236",
"0.59702486",
"0.59545237",
"0.57058865",
"0.55827963",
"0.55635166",
"0.55275065",
"0.54711497",
"0.54486734",
"0.54395545",
"0.543794",
"0.5419731",
"0.5396074",
"0.5338943",
"0.5315166",
"0.5310191",
"0.5300252",
"0.52898484",
"0.5266891",
"0.52... | 0.7410544 | 0 |
Deletes the Lesson from the specified module's lessons list. | void deleteLesson(Module module, Lesson target); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void deleteModule(Module module);",
"void deleteExam(Module module, Exam target);",
"void addLessonToModule(Module module, Lesson lesson);",
"void deleteLesson(int id) throws DataAccessException;",
"public void removeModule(Discipline discipline, int module_id) throws SQLException{\r\n discipline.mo... | [
"0.63540643",
"0.6182484",
"0.6145424",
"0.5869483",
"0.580221",
"0.5751647",
"0.5592725",
"0.55467266",
"0.54923433",
"0.54546595",
"0.5316989",
"0.52768993",
"0.5261847",
"0.5240669",
"0.522373",
"0.51641244",
"0.5160301",
"0.5128733",
"0.51160187",
"0.50960207",
"0.5094838... | 0.79487926 | 0 |
Checks if a module has the lesson | boolean moduleHasLesson(Module module, Lesson lesson); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean moduleHasExam(Module module, Exam exam);",
"boolean hasTutorial();",
"boolean isPresent(ExamPackage examPackage);",
"synchronized boolean hasModule(Module module)\n {\n for (int i = 0; i < m_modules.size(); i++)\n {\n if (m_modules.get(i) == module)\n {\n ... | [
"0.7526017",
"0.66395986",
"0.6349177",
"0.6289102",
"0.6191716",
"0.6185571",
"0.6120657",
"0.61134773",
"0.6072784",
"0.60727733",
"0.60579395",
"0.5949234",
"0.5913107",
"0.58077466",
"0.57618195",
"0.57547796",
"0.57426566",
"0.5736073",
"0.57333946",
"0.57307875",
"0.573... | 0.87382853 | 0 |
Adds a lesson to a module. | void addLessonToModule(Module module, Lesson lesson); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addExamToModule(Module module, Exam exam);",
"private CommandResult addLesson() throws KolinuxException {\n try {\n timetable.executeAdd(parsedArguments, false);\n } catch (ExceedWorkloadException exception) {\n new TimetablePromptHandler(exception.getMessage(), timetable... | [
"0.74173445",
"0.6660921",
"0.66467535",
"0.65050876",
"0.6395161",
"0.6074155",
"0.59791994",
"0.59528065",
"0.59009457",
"0.56868106",
"0.5664817",
"0.5647412",
"0.5597827",
"0.5585596",
"0.5462557",
"0.54480517",
"0.5413717",
"0.5370926",
"0.53488594",
"0.5273323",
"0.5271... | 0.9163757 | 0 |
Checks if a module has the lesson | boolean moduleHasExam(Module module, Exam exam); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean moduleHasLesson(Module module, Lesson lesson);",
"boolean hasTutorial();",
"boolean isPresent(ExamPackage examPackage);",
"synchronized boolean hasModule(Module module)\n {\n for (int i = 0; i < m_modules.size(); i++)\n {\n if (m_modules.get(i) == module)\n {\n ... | [
"0.873815",
"0.6638247",
"0.63475615",
"0.6290226",
"0.61907667",
"0.6182883",
"0.6120115",
"0.61131227",
"0.60729057",
"0.6072823",
"0.6056542",
"0.5948954",
"0.5911962",
"0.5806136",
"0.5759848",
"0.57546157",
"0.57430273",
"0.5735463",
"0.57317007",
"0.57305366",
"0.572744... | 0.7526295 | 1 |
Adds a lesson to a module. | void addExamToModule(Module module, Exam exam); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addLessonToModule(Module module, Lesson lesson);",
"private CommandResult addLesson() throws KolinuxException {\n try {\n timetable.executeAdd(parsedArguments, false);\n } catch (ExceedWorkloadException exception) {\n new TimetablePromptHandler(exception.getMessage(), tim... | [
"0.9163312",
"0.6660737",
"0.6645157",
"0.6504214",
"0.63927877",
"0.6070341",
"0.59789675",
"0.5949735",
"0.59048307",
"0.568288",
"0.56651706",
"0.56487143",
"0.5594843",
"0.5585322",
"0.5459427",
"0.5447035",
"0.5411503",
"0.53674716",
"0.5349294",
"0.52749807",
"0.5270656... | 0.74155825 | 1 |
Returns an unmodifiable view of the filtered module list | ObservableList<Module> getFilteredModuleList(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected List<Object> getModules() {\n return new ArrayList<>();\n }",
"public List<Module> getModules(){\r\n return modules;\r\n }",
"public Set<String> moduleList() {\n return moduleList;\n }",
"public List<AModule> getModules()\n\t{\n\t\treturn new ArrayList<>(module... | [
"0.6462423",
"0.6316132",
"0.61775136",
"0.6104569",
"0.60309815",
"0.5951299",
"0.59248793",
"0.59146774",
"0.5906084",
"0.59026015",
"0.58433366",
"0.58312905",
"0.5824867",
"0.57743007",
"0.5736625",
"0.57030296",
"0.56027955",
"0.55839336",
"0.5567091",
"0.5544899",
"0.55... | 0.79727924 | 1 |
Initializes a new instance of the Submarine ship with length = 1 | public Submarine() {
length = 1;
hit = new boolean[1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Submarine() {\n\t\tsuper(size);\n\t}",
"protected Ship(int length) {\n this.length = length;\n size = 0;\n cells = new Cell[length];\n }",
"public RegularUnit(Location location, int length, int width, int height){\n // initialise instance variables\n super(location,... | [
"0.75123566",
"0.6689562",
"0.59113085",
"0.57845944",
"0.57354486",
"0.5648449",
"0.56228024",
"0.559855",
"0.55952823",
"0.5587863",
"0.5585737",
"0.55712134",
"0.5537553",
"0.55085164",
"0.5508069",
"0.5499166",
"0.5495031",
"0.54556507",
"0.54538584",
"0.54536945",
"0.545... | 0.76787794 | 0 |
Add header to accept gzip content | public void process(HttpRequest request, HttpContext context) {
if (!request.containsHeader(HEADER_ACCEPT_ENCODING)) {
request.addHeader(HEADER_ACCEPT_ENCODING, ENCODING_GZIP);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void addGzipHeader(Request request, Response response) {\n response.header(\"Content-Encoding\", \"gzip\");\n }",
"private void serviceGZipCompressed(Connection conn) \n throws IOException {\n conn.getResponse().setContentType(getContnentType().getMimeType());\n conn.get... | [
"0.7943524",
"0.65302026",
"0.6190305",
"0.599023",
"0.5872702",
"0.57059795",
"0.5626093",
"0.5529697",
"0.54872483",
"0.53891623",
"0.5356309",
"0.53457433",
"0.53426343",
"0.5326529",
"0.5324221",
"0.52450866",
"0.519523",
"0.5191486",
"0.51657623",
"0.5144474",
"0.5140171... | 0.66809756 | 1 |
Inflate any responses compressed with gzip | public void process(HttpResponse response, HttpContext context) {
final HttpEntity entity = response.getEntity();
if (entity != null) {
final Header encoding = entity.getContentEncoding();
if (encoding != null) {
for (HeaderElement element : encoding.getElements()) {
if (element.getName().equalsIgnoreCase(
ENCODING_GZIP)) {
response.setEntity(new InflatingEntity(response
.getEntity()));
break;
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void serviceGZipCompressed(Connection conn) \n throws IOException {\n conn.getResponse().setContentType(getContnentType().getMimeType());\n conn.getResponse().setHeader(\"Content-Encoding\", \"gzip\");\n conn.getOutputStream().write(gzipContent);\n }",
"private static void addG... | [
"0.635747",
"0.61234355",
"0.5974734",
"0.5891944",
"0.5817336",
"0.57226276",
"0.56778795",
"0.56004",
"0.5546635",
"0.5532003",
"0.5515078",
"0.55139065",
"0.5510591",
"0.5433853",
"0.5431205",
"0.5290378",
"0.52605754",
"0.5254241",
"0.5233543",
"0.5221271",
"0.52130604",
... | 0.6788542 | 0 |
Build and return a useragent string that can identify this application to remote servers. Contains the package name and version code. | private static String buildUserAgent(Context context) {
try {
final PackageManager manager = context.getPackageManager();
final PackageInfo info = manager.getPackageInfo(
context.getPackageName(), 0);
// Some APIs require "(gzip)" in the user-agent string.
return info.packageName + "/" + info.versionName + " ("
+ info.versionCode + ") (gzip)";
} catch (NameNotFoundException e) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getUserAgent() {\n java.lang.Object ref = userAgent_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf... | [
"0.6909344",
"0.6904488",
"0.68859947",
"0.6720294",
"0.67171043",
"0.65743077",
"0.6561993",
"0.6542531",
"0.6538336",
"0.65079635",
"0.6474109",
"0.6463705",
"0.64413124",
"0.6423798",
"0.6382271",
"0.637921",
"0.6266476",
"0.62613565",
"0.61267567",
"0.6114649",
"0.6098445... | 0.74517405 | 0 |
minimal constructor full constructor Property accessors | public String getTeid() {
return this.teid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Property() {}",
"public Property() {\n this(0, 0, 0, 0);\n }",
"public Property()\r\n {\r\n }",
"private PropertyAccess() {\n\t\tsuper();\n\t}",
"private void __sep__Constructors__() {}",
"public Propuestas() {}",
"public Properties(){\n\n }",
"public Constructor()... | [
"0.73289424",
"0.73047435",
"0.72857964",
"0.70668024",
"0.6991728",
"0.6978641",
"0.688696",
"0.68103564",
"0.67404914",
"0.6640894",
"0.6631651",
"0.654951",
"0.65166205",
"0.651238",
"0.6501782",
"0.6463848",
"0.6428599",
"0.64285725",
"0.642824",
"0.64140916",
"0.63180673... | 0.0 | -1 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof Personal)) {
return false;
}
Personal other = (Personal) object;
if ((this.idper == null && other.idper != null) || (this.idper != null && !this.idper.equals(other.idper))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.6896886",
"0.6838461",
"0.67056817",
"0.66419715",
"0.66419715",
"0.6592331",
"0.6579151",
"0.6579151",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.65624106",
"0.65624106",
"0.65441847",
"0.65243006",
"0.65154546",
"0.6487427",
"0.64778... | 0.0 | -1 |
return super.onCreateView(inflater, container, savedInstanceState); | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mRoot = inflater.inflate(R.layout.fragment_train_list, container, false);
ButterKnife.inject(this, mRoot);
return mRoot;
// mLayoutManager = new LinearLayoutManager(this.getActivity());
/// mTrainList.setLayoutManager(mLayoutManager);
// return mRoot;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return super.onCreateView(inflater, container, savedInstanceState);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState... | [
"0.8520813",
"0.8520813",
"0.847007",
"0.8439895",
"0.82387525",
"0.82387525",
"0.82015836",
"0.81712425",
"0.8142262",
"0.81095177",
"0.80202746",
"0.7959163",
"0.79340607",
"0.791035",
"0.790481",
"0.7901562",
"0.78917783",
"0.7888019",
"0.7887485",
"0.7875566",
"0.7838798"... | 0.0 | -1 |
Type your code here. | int main()
{
int a;
std::cin>>a;
int b=(a%10)+(a/1000);
std::cout<<b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void generateCode()\n {\n \n }",
"@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}",
"CD withCode();",
"@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}",
"public void genCode(CodeFile code) {\n... | [
"0.69842434",
"0.665857",
"0.65043616",
"0.64650613",
"0.63898635",
"0.6277537",
"0.6139541",
"0.6012061",
"0.5984972",
"0.5979616",
"0.59751785",
"0.596551",
"0.5955566",
"0.59450895",
"0.59450895",
"0.59450895",
"0.59450895",
"0.59450895",
"0.5809104",
"0.57985586",
"0.5777... | 0.0 | -1 |
================================== Fim do Merge sorting===================== ===================== Inicio do QuickSort ============================== | public String[][] quickSort(String[][] arr, int inicio, int fim, int requiredData) { // Função que realiza
if (requiredData != 4) {
if (inicio < fim) {
int pivo;
pivo = Integer.parseInt(arr[fim][requiredData]); // Pivo ser� o ultimo de cada galho
int i = (inicio - 1);
for (int j = inicio; j <= fim - 1; j++) {
if (Integer.parseInt(arr[j][requiredData]) < pivo) {
i++;
String[] aux = arr[i];
arr[i] = arr[j];
arr[j] = aux;
}
}
String[] aux = arr[i + 1];
arr[i + 1] = arr[fim];
arr[fim] = aux;
int piAux = i + 1;
// Funcao recursiva para cada ramo da arvore
quickSort(arr, inicio, piAux - 1, requiredData);
quickSort(arr, piAux + 1, fim, requiredData);
return arr;
}
} else {
Collator collator = Collator.getInstance();
collator.setStrength(Collator.NO_DECOMPOSITION);
if (inicio < fim) {
String pivo = arr[fim][requiredData];
int i = (inicio - 1);
for (int j = inicio; j <= fim - 1; j++) {
if (collator.compare(pivo, arr[j][requiredData]) > 0) {
i++;
String[] aux = arr[i];
arr[i] = arr[j];
arr[j] = aux;
}
}
String[] aux = arr[i + 1];
arr[i + 1] = arr[fim];
arr[fim] = aux;
int piAux = i + 1;
// Funcao recursiva para cada ramo da arvore
quickSort(arr, inicio, piAux - 1, requiredData);
quickSort(arr, piAux + 1, fim, requiredData);
}
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void merge() {\n for (int i = low; i<high; i++){\n temparray[i]=nums[i];\n }\n\n int i = low;\n int j = middle;\n //index of the original array for which we are making compare\n int index = low;\n //copy the smallest from the left and right partit... | [
"0.73808473",
"0.7138228",
"0.7120298",
"0.7036974",
"0.7006026",
"0.6963342",
"0.69429463",
"0.6936854",
"0.6924753",
"0.6915164",
"0.6902832",
"0.6901035",
"0.6895995",
"0.68912935",
"0.68819636",
"0.68625975",
"0.68571335",
"0.6846859",
"0.6844296",
"0.68201166",
"0.681929... | 0.0 | -1 |
===================== Final do QuickSort ============================= ==================== Inicio da mediana de 3=========================== | public String[][] medianaDeTres(String[][] arr, int primeiro, int ultimo, int requiredData) {
if (requiredData != 4) {
if (primeiro < ultimo) {
int meio = ((primeiro + ultimo) / 2);
int a = Integer.parseInt(arr[primeiro][requiredData]);
int b = Integer.parseInt(arr[meio][requiredData]);
int c = Integer.parseInt(arr[ultimo][requiredData]);
int medianaIndice;
if (a < b) {
if (b < c) {
// a < b && b < c
medianaIndice = meio;
} else {
if (a < c) {
// a < c && c <= b
medianaIndice = ultimo;
} else {
// c <= a && a < b
medianaIndice = primeiro;
}
}
} else {
if (c < b) {
// c < b && b <= a
medianaIndice = meio;
} else {
if (c < a) {
// b <= c && c < a
medianaIndice = ultimo;
} else {
// b <= a && a <= c
medianaIndice = primeiro;
}
}
}
swap(arr, medianaIndice, ultimo);
int pivo = Integer.parseInt(arr[ultimo][requiredData]);
int i = (primeiro - 1);
for (int j = primeiro; j <= ultimo - 1; j++) {
if (Integer.parseInt(arr[j][requiredData]) < pivo) {
i++;
String[] aux = arr[i];
arr[i] = arr[j];
arr[j] = aux;
}
}
String[] aux = arr[i + 1];
arr[i + 1] = arr[ultimo];
arr[ultimo] = aux;
int piAux = i + 1;
medianaDeTres(arr, primeiro, piAux - 1, requiredData);
medianaDeTres(arr, piAux + 1, ultimo, requiredData);
}
} else {
if (primeiro < ultimo) {
Collator collator = Collator.getInstance();
collator.setStrength(Collator.NO_DECOMPOSITION);
int meio = ((primeiro + ultimo) / 2);
String a = (arr[primeiro][requiredData]);
String b = (arr[meio][requiredData]);
String c = (arr[ultimo][requiredData]);
int medianaIndice;
if (collator.compare(b, a) > 0) {
if (collator.compare(c, b) > 0) {
// a < b && b < c
medianaIndice = meio;
} else {
if (collator.compare(c, a) > 0) {
// a < c && c <= b
medianaIndice = ultimo;
} else {
// c <= a && a < b
medianaIndice = primeiro;
}
}
} else {
if (collator.compare(b, c) > 0) {
// c < b && b <= a
medianaIndice = meio;
} else {
if (collator.compare(a, c) > 0) {
// b <= c && c < a
medianaIndice = ultimo;
} else {
// b <= a && a <= c
medianaIndice = primeiro;
}
}
}
swap(arr, medianaIndice, ultimo);
String pivo = (arr[ultimo][requiredData]);
int i = (primeiro - 1);
for (int j = primeiro; j <= ultimo - 1; j++) {
if (collator.compare(pivo, arr[j][requiredData]) > 0) {
i++;
String[] aux = arr[i];
arr[i] = arr[j];
arr[j] = aux;
}
}
String[] aux = arr[i + 1];
arr[i + 1] = arr[ultimo];
arr[ultimo] = aux;
int piAux = i + 1;
medianaDeTres(arr, primeiro, piAux - 1, requiredData);
medianaDeTres(arr, piAux + 1, ultimo, requiredData);
}
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private QuickSort3Way() {}",
"private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater ele... | [
"0.76459235",
"0.7553792",
"0.7542818",
"0.73877114",
"0.7374344",
"0.7368993",
"0.73388374",
"0.732567",
"0.73107904",
"0.7310267",
"0.7286064",
"0.727553",
"0.7270889",
"0.7259906",
"0.7210986",
"0.71969956",
"0.7185969",
"0.7179258",
"0.7158112",
"0.71495664",
"0.7117257",... | 0.0 | -1 |
==================== Fim da mediana de 3========================= ==================== Inicio do heapify=========================== | public String[][] sort(String[][] arr, int requiredData) {
int n = arr.length;
for (int i = n / 2 - 1; i >= 1; i--)
heapify(arr, n, i, requiredData);
for (int i = n - 1; i > 1; i--) {
String[] temp = arr[0];
arr[0] = arr[i];
arr[i] = temp;
heapify(arr, i, 0, requiredData);
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void heapify() {\n for (int i=N/2; i>=1; i--)\n sink(i);\n }",
"public static void heapify() {\n //배열을 heap 자료형으로 만든다.\n // 1d 2d 2d 3d 3d 3d 3d 4d\n// int[] numbers = {9, 12, 1, 3, 6, 2, 8, 4};\n // 1depth의 자식노드 numbers[2i], numbers[2i+1]\n... | [
"0.749711",
"0.7496643",
"0.7452341",
"0.7127477",
"0.70963377",
"0.7091346",
"0.70633084",
"0.70151496",
"0.700288",
"0.69755006",
"0.68606985",
"0.6839667",
"0.6757959",
"0.6738045",
"0.67035997",
"0.669334",
"0.66864014",
"0.6681492",
"0.66797614",
"0.66746473",
"0.6663320... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.