hexsha
stringlengths 40
40
| repo
stringlengths 6
126
| path
stringlengths 6
1.02k
| license
sequence | language
stringclasses 1
value | identifier
stringlengths 1
220
| return_type
stringlengths 1
110
⌀ | original_string
stringlengths 39
223k
| original_docstring
stringlengths 16
34.8k
| docstring
stringlengths 11
3.41k
| docstring_tokens
sequence | code
stringlengths 26
223k
| code_tokens
sequence | short_docstring
stringlengths 0
3.02k
| short_docstring_tokens
sequence | comment
sequence | parameters
list | docstring_params
dict | input_ids
sequence | attention_mask
sequence | labels
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39963a291aca2c3259969dbe09709e75ba6a3fae | KSayrs/randomized-dequeus-and-queues | src/Deque.java | [
"MIT"
] | Java | addFirst | null | public void addFirst(Item item){
if(item == null){ throw new NullPointerException("Cannot add a null item."); }
if(itemCount == 0){ // resetting nodes back to one
pointHead = new Node(item);
pointTail = pointHead;
} else {
Node oldHead = pointHead; //old data
pointHead = new Node(item); // replacing the head pointer
pointHead.next = oldHead; // old value is the next one in the line
oldHead.prev = pointHead;
}
itemCount++; // adding an item =]
} | /** add the item to the front of the deque. Cannot add a null item. */ | add the item to the front of the deque. Cannot add a null item. | [
"add",
"the",
"item",
"to",
"the",
"front",
"of",
"the",
"deque",
".",
"Cannot",
"add",
"a",
"null",
"item",
"."
] | public void addFirst(Item item){
if(item == null){ throw new NullPointerException("Cannot add a null item."); }
if(itemCount == 0){
pointHead = new Node(item);
pointTail = pointHead;
} else {
Node oldHead = pointHead;
pointHead = new Node(item);
pointHead.next = oldHead;
oldHead.prev = pointHead;
}
itemCount++;
} | [
"public",
"void",
"addFirst",
"(",
"Item",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Cannot add a null item.\"",
")",
";",
"}",
"if",
"(",
"itemCount",
"==",
"0",
")",
"{",
"pointHead",
"=",
"new",
"Node",
"(",
"item",
")",
";",
"pointTail",
"=",
"pointHead",
";",
"}",
"else",
"{",
"Node",
"oldHead",
"=",
"pointHead",
";",
"pointHead",
"=",
"new",
"Node",
"(",
"item",
")",
";",
"pointHead",
".",
"next",
"=",
"oldHead",
";",
"oldHead",
".",
"prev",
"=",
"pointHead",
";",
"}",
"itemCount",
"++",
";",
"}"
] | add the item to the front of the deque. | [
"add",
"the",
"item",
"to",
"the",
"front",
"of",
"the",
"deque",
"."
] | [
"// resetting nodes back to one",
"//old data",
"// replacing the head pointer",
"// old value is the next one in the line",
"// adding an item =]"
] | [
{
"param": "item",
"type": "Item"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "item",
"type": "Item",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
527,
3759,
12,
1180,
761,
15329,
203,
3639,
309,
12,
1726,
422,
446,
15329,
604,
394,
10108,
2932,
4515,
527,
279,
446,
761,
1199,
1769,
289,
203,
203,
3639,
309,
12,
1726,
1380,
422,
374,
15329,
9079,
368,
30691,
2199,
1473,
358,
1245,
203,
5411,
1634,
1414,
273,
394,
2029,
12,
1726,
1769,
203,
5411,
1634,
12363,
273,
1634,
1414,
31,
203,
3639,
289,
469,
288,
203,
5411,
2029,
1592,
1414,
273,
1634,
1414,
31,
377,
368,
1673,
501,
203,
5411,
1634,
1414,
273,
394,
2029,
12,
1726,
1769,
282,
368,
13993,
326,
910,
4407,
203,
5411,
1634,
1414,
18,
4285,
273,
1592,
1414,
31,
377,
368,
1592,
460,
353,
326,
1024,
1245,
316,
326,
980,
203,
5411,
1592,
1414,
18,
10001,
273,
1634,
1414,
31,
203,
3639,
289,
203,
3639,
761,
1380,
9904,
31,
2868,
368,
6534,
392,
761,
273,
65,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
527,
326,
761,
358,
326,
6641,
434,
326,
21147,
18,
14143,
527,
279,
446,
761,
18,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
39963a291aca2c3259969dbe09709e75ba6a3fae | KSayrs/randomized-dequeus-and-queues | src/Deque.java | [
"MIT"
] | Java | addLast | null | public void addLast(Item item){
if(item == null){ throw new NullPointerException("Cannot add a null item."); }
if(isEmpty()){ // resetting nodes back to one
pointTail = new Node(item);
pointHead = pointTail;
} else {
Node oldTail = pointTail;
pointTail = new Node(item);
oldTail.next = pointTail;
pointTail.prev = oldTail;
}
itemCount++;
} | /** add the item to the end of the deque */ | add the item to the end of the deque | [
"add",
"the",
"item",
"to",
"the",
"end",
"of",
"the",
"deque"
] | public void addLast(Item item){
if(item == null){ throw new NullPointerException("Cannot add a null item."); }
if(isEmpty()){
pointTail = new Node(item);
pointHead = pointTail;
} else {
Node oldTail = pointTail;
pointTail = new Node(item);
oldTail.next = pointTail;
pointTail.prev = oldTail;
}
itemCount++;
} | [
"public",
"void",
"addLast",
"(",
"Item",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Cannot add a null item.\"",
")",
";",
"}",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"pointTail",
"=",
"new",
"Node",
"(",
"item",
")",
";",
"pointHead",
"=",
"pointTail",
";",
"}",
"else",
"{",
"Node",
"oldTail",
"=",
"pointTail",
";",
"pointTail",
"=",
"new",
"Node",
"(",
"item",
")",
";",
"oldTail",
".",
"next",
"=",
"pointTail",
";",
"pointTail",
".",
"prev",
"=",
"oldTail",
";",
"}",
"itemCount",
"++",
";",
"}"
] | add the item to the end of the deque | [
"add",
"the",
"item",
"to",
"the",
"end",
"of",
"the",
"deque"
] | [
"// resetting nodes back to one"
] | [
{
"param": "item",
"type": "Item"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "item",
"type": "Item",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
28426,
12,
1180,
761,
15329,
203,
3639,
309,
12,
1726,
422,
446,
15329,
604,
394,
10108,
2932,
4515,
527,
279,
446,
761,
1199,
1769,
289,
203,
3639,
309,
12,
291,
1921,
10756,
95,
6647,
368,
30691,
2199,
1473,
358,
1245,
203,
5411,
1634,
12363,
273,
394,
2029,
12,
1726,
1769,
203,
5411,
1634,
1414,
273,
1634,
12363,
31,
203,
3639,
289,
469,
288,
203,
5411,
2029,
1592,
12363,
273,
1634,
12363,
31,
203,
5411,
1634,
12363,
273,
394,
2029,
12,
1726,
1769,
203,
5411,
1592,
12363,
18,
4285,
273,
1634,
12363,
31,
203,
5411,
1634,
12363,
18,
10001,
273,
1592,
12363,
31,
203,
3639,
289,
203,
3639,
761,
1380,
9904,
31,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
39963a291aca2c3259969dbe09709e75ba6a3fae | KSayrs/randomized-dequeus-and-queues | src/Deque.java | [
"MIT"
] | Java | removeFirst | Item | public Item removeFirst(){
if(isEmpty()){ throw new NoSuchElementException("Cannot remove an item from an empty deque."); }
Item item = pointHead.item; // old
if(itemCount == 1){ // reset when empties
pointTail = null;
pointHead = null;
} else {
pointHead = pointHead.next; // moving the node dowwwwn
pointHead.prev = null; // nothing before, now
}
itemCount--; // removing an item =[
return item; // return the removed item
} | /** remove and return the item from the front of the deque. Throws an error if called when the deque is empty. */ | remove and return the item from the front of the deque. Throws an error if called when the deque is empty. | [
"remove",
"and",
"return",
"the",
"item",
"from",
"the",
"front",
"of",
"the",
"deque",
".",
"Throws",
"an",
"error",
"if",
"called",
"when",
"the",
"deque",
"is",
"empty",
"."
] | public Item removeFirst(){
if(isEmpty()){ throw new NoSuchElementException("Cannot remove an item from an empty deque."); }
Item item = pointHead.item;
if(itemCount == 1){
pointTail = null;
pointHead = null;
} else {
pointHead = pointHead.next;
pointHead.prev = null;
}
itemCount--;
return item;
} | [
"public",
"Item",
"removeFirst",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"Cannot remove an item from an empty deque.\"",
")",
";",
"}",
"Item",
"item",
"=",
"pointHead",
".",
"item",
";",
"if",
"(",
"itemCount",
"==",
"1",
")",
"{",
"pointTail",
"=",
"null",
";",
"pointHead",
"=",
"null",
";",
"}",
"else",
"{",
"pointHead",
"=",
"pointHead",
".",
"next",
";",
"pointHead",
".",
"prev",
"=",
"null",
";",
"}",
"itemCount",
"--",
";",
"return",
"item",
";",
"}"
] | remove and return the item from the front of the deque. | [
"remove",
"and",
"return",
"the",
"item",
"from",
"the",
"front",
"of",
"the",
"deque",
"."
] | [
"// old",
"// reset when empties",
"// moving the node dowwwwn",
"// nothing before, now",
"// removing an item =[",
"// return the removed item"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
4342,
1206,
3759,
1435,
95,
203,
3639,
309,
12,
291,
1921,
10756,
95,
604,
394,
23104,
2932,
4515,
1206,
392,
761,
628,
392,
1008,
21147,
1199,
1769,
289,
203,
203,
3639,
4342,
761,
273,
1634,
1414,
18,
1726,
31,
368,
1592,
203,
3639,
309,
12,
1726,
1380,
422,
404,
15329,
377,
368,
2715,
1347,
801,
337,
606,
203,
5411,
1634,
12363,
273,
446,
31,
203,
5411,
1634,
1414,
273,
446,
31,
203,
3639,
289,
469,
288,
203,
5411,
1634,
1414,
273,
1634,
1414,
18,
4285,
31,
368,
12499,
326,
756,
22095,
5591,
82,
203,
5411,
1634,
1414,
18,
10001,
273,
446,
31,
1377,
368,
5083,
1865,
16,
2037,
203,
3639,
289,
203,
3639,
761,
1380,
413,
31,
7734,
368,
9427,
392,
761,
273,
63,
203,
3639,
327,
761,
31,
7734,
368,
327,
326,
3723,
761,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
1206,
471,
327,
326,
761,
628,
326,
6641,
434,
326,
21147,
18,
22435,
392,
555,
309,
2566,
1347,
326,
21147,
353,
1008,
18,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
39963a291aca2c3259969dbe09709e75ba6a3fae | KSayrs/randomized-dequeus-and-queues | src/Deque.java | [
"MIT"
] | Java | removeLast | Item | public Item removeLast(){
if(isEmpty()){ throw new NoSuchElementException("Cannot remove an item from an empty deque."); }
Item item = pointTail.item; // old
if(itemCount == 1){
pointTail = null;
pointHead = null;
} else {
pointTail = pointTail.prev; // moving the node uuuuup
pointTail.next = null; // nothing after, now
}
itemCount--;
return item; // return the removed item
} | /** remove and return the item from the end of the deque. Throws an error if called when the deque is empty. */ | remove and return the item from the end of the deque. Throws an error if called when the deque is empty. | [
"remove",
"and",
"return",
"the",
"item",
"from",
"the",
"end",
"of",
"the",
"deque",
".",
"Throws",
"an",
"error",
"if",
"called",
"when",
"the",
"deque",
"is",
"empty",
"."
] | public Item removeLast(){
if(isEmpty()){ throw new NoSuchElementException("Cannot remove an item from an empty deque."); }
Item item = pointTail.item;
if(itemCount == 1){
pointTail = null;
pointHead = null;
} else {
pointTail = pointTail.prev;
pointTail.next = null;
}
itemCount--;
return item;
} | [
"public",
"Item",
"removeLast",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"Cannot remove an item from an empty deque.\"",
")",
";",
"}",
"Item",
"item",
"=",
"pointTail",
".",
"item",
";",
"if",
"(",
"itemCount",
"==",
"1",
")",
"{",
"pointTail",
"=",
"null",
";",
"pointHead",
"=",
"null",
";",
"}",
"else",
"{",
"pointTail",
"=",
"pointTail",
".",
"prev",
";",
"pointTail",
".",
"next",
"=",
"null",
";",
"}",
"itemCount",
"--",
";",
"return",
"item",
";",
"}"
] | remove and return the item from the end of the deque. | [
"remove",
"and",
"return",
"the",
"item",
"from",
"the",
"end",
"of",
"the",
"deque",
"."
] | [
"// old",
"// moving the node uuuuup",
"// nothing after, now",
"// return the removed item"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
4342,
1206,
3024,
1435,
95,
203,
3639,
309,
12,
291,
1921,
10756,
95,
604,
394,
23104,
2932,
4515,
1206,
392,
761,
628,
392,
1008,
21147,
1199,
1769,
289,
203,
3639,
4342,
761,
273,
1634,
12363,
18,
1726,
31,
368,
1592,
203,
3639,
309,
12,
1726,
1380,
422,
404,
15329,
203,
5411,
1634,
12363,
273,
446,
31,
203,
5411,
1634,
1414,
273,
446,
31,
203,
3639,
289,
469,
288,
203,
5411,
1634,
12363,
273,
1634,
12363,
18,
10001,
31,
368,
12499,
326,
756,
582,
24286,
89,
416,
203,
5411,
1634,
12363,
18,
4285,
273,
446,
31,
1377,
368,
5083,
1839,
16,
2037,
203,
3639,
289,
203,
3639,
761,
1380,
413,
31,
203,
3639,
327,
761,
31,
7734,
368,
327,
326,
3723,
761,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
1206,
471,
327,
326,
761,
628,
326,
679,
434,
326,
21147,
18,
22435,
392,
555,
309,
2566,
1347,
326,
21147,
353,
1008,
18,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
1045e5176088a42222dc33070d290ef8a3f1b79b | KSayrs/randomized-dequeus-and-queues | src/RandomizedQueue.java | [
"MIT"
] | Java | enqueue | null | public void enqueue(Item item){
if (item == null){ throw new NullPointerException("Cannot add a null item"); }
// fill the nulls
if(itemCount < array.length) {
for(int i=0;i<array.length;i++) {
if(array[i] == null) {
array[i] = item;
break;
}
}
}
// resize when too big
if(itemCount == array.length){
resize(2*itemCount);
array[itemCount] = item;
}
itemCount++; // Item added!!
} | /** Add the item to the queue. Null items cannot be added. */ | Add the item to the queue. Null items cannot be added. | [
"Add",
"the",
"item",
"to",
"the",
"queue",
".",
"Null",
"items",
"cannot",
"be",
"added",
"."
] | public void enqueue(Item item){
if (item == null){ throw new NullPointerException("Cannot add a null item"); }
if(itemCount < array.length) {
for(int i=0;i<array.length;i++) {
if(array[i] == null) {
array[i] = item;
break;
}
}
}
if(itemCount == array.length){
resize(2*itemCount);
array[itemCount] = item;
}
itemCount++;
} | [
"public",
"void",
"enqueue",
"(",
"Item",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Cannot add a null item\"",
")",
";",
"}",
"if",
"(",
"itemCount",
"<",
"array",
".",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"array",
"[",
"i",
"]",
"==",
"null",
")",
"{",
"array",
"[",
"i",
"]",
"=",
"item",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"itemCount",
"==",
"array",
".",
"length",
")",
"{",
"resize",
"(",
"2",
"*",
"itemCount",
")",
";",
"array",
"[",
"itemCount",
"]",
"=",
"item",
";",
"}",
"itemCount",
"++",
";",
"}"
] | Add the item to the queue. | [
"Add",
"the",
"item",
"to",
"the",
"queue",
"."
] | [
"// fill the nulls",
"// resize when too big",
"// Item added!!"
] | [
{
"param": "item",
"type": "Item"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "item",
"type": "Item",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
12850,
12,
1180,
761,
15329,
203,
3639,
309,
261,
1726,
422,
446,
15329,
604,
394,
10108,
2932,
4515,
527,
279,
446,
761,
8863,
289,
203,
203,
3639,
368,
3636,
326,
27778,
203,
3639,
309,
12,
1726,
1380,
411,
526,
18,
2469,
13,
288,
203,
5411,
364,
12,
474,
277,
33,
20,
31,
77,
32,
1126,
18,
2469,
31,
77,
27245,
288,
203,
7734,
309,
12,
1126,
63,
77,
65,
422,
446,
13,
288,
203,
10792,
526,
63,
77,
65,
273,
761,
31,
203,
10792,
898,
31,
203,
7734,
289,
203,
5411,
289,
203,
3639,
289,
203,
3639,
368,
7041,
1347,
4885,
5446,
203,
3639,
309,
12,
1726,
1380,
422,
526,
18,
2469,
15329,
203,
5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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
225,
1436,
326,
761,
358,
326,
2389,
18,
4112,
1516,
2780,
506,
3096,
18,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
1045e5176088a42222dc33070d290ef8a3f1b79b | KSayrs/randomized-dequeus-and-queues | src/RandomizedQueue.java | [
"MIT"
] | Java | dequeue | Item | public Item dequeue(){
if(itemCount == 0){ throw new NoSuchElementException("Queue is empty"); }
int rand = StdRandom.uniform(itemCount);
while(array[rand] == null){ // if it's a null value (only happens after dequeing)
rand = StdRandom.uniform(array.length); // pick another one
}
Item item = array[rand]; // get the item
array[rand] = null; // D E S T R O Y
itemCount--; // decrement the item count
return item; // return the item
} | /** Remove and return a random item. This will throw an error if called when the queue is empty. */ | Remove and return a random item. This will throw an error if called when the queue is empty. | [
"Remove",
"and",
"return",
"a",
"random",
"item",
".",
"This",
"will",
"throw",
"an",
"error",
"if",
"called",
"when",
"the",
"queue",
"is",
"empty",
"."
] | public Item dequeue(){
if(itemCount == 0){ throw new NoSuchElementException("Queue is empty"); }
int rand = StdRandom.uniform(itemCount);
while(array[rand] == null){
rand = StdRandom.uniform(array.length);
}
Item item = array[rand];
array[rand] = null;
itemCount--;
return item;
} | [
"public",
"Item",
"dequeue",
"(",
")",
"{",
"if",
"(",
"itemCount",
"==",
"0",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"Queue is empty\"",
")",
";",
"}",
"int",
"rand",
"=",
"StdRandom",
".",
"uniform",
"(",
"itemCount",
")",
";",
"while",
"(",
"array",
"[",
"rand",
"]",
"==",
"null",
")",
"{",
"rand",
"=",
"StdRandom",
".",
"uniform",
"(",
"array",
".",
"length",
")",
";",
"}",
"Item",
"item",
"=",
"array",
"[",
"rand",
"]",
";",
"array",
"[",
"rand",
"]",
"=",
"null",
";",
"itemCount",
"--",
";",
"return",
"item",
";",
"}"
] | Remove and return a random item. | [
"Remove",
"and",
"return",
"a",
"random",
"item",
"."
] | [
"// if it's a null value (only happens after dequeing)",
"// pick another one",
"// get the item",
"// D E S T R O Y",
"// decrement the item count",
"// return the item"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
4342,
29964,
1435,
95,
203,
3639,
309,
12,
1726,
1380,
422,
374,
15329,
604,
394,
23104,
2932,
3183,
353,
1008,
8863,
289,
203,
203,
3639,
509,
5605,
273,
6276,
8529,
18,
24120,
12,
1726,
1380,
1769,
203,
3639,
1323,
12,
1126,
63,
7884,
65,
422,
446,
15329,
1171,
368,
309,
518,
1807,
279,
446,
460,
261,
3700,
10555,
1839,
21147,
310,
13,
203,
5411,
5605,
273,
6276,
8529,
18,
24120,
12,
1126,
18,
2469,
1769,
225,
368,
6002,
4042,
1245,
203,
3639,
289,
203,
3639,
4342,
761,
273,
526,
63,
7884,
15533,
10792,
368,
336,
326,
761,
203,
3639,
526,
63,
7884,
65,
273,
446,
31,
7682,
368,
463,
512,
348,
399,
534,
531,
1624,
203,
3639,
761,
1380,
413,
31,
27573,
368,
15267,
326,
761,
1056,
203,
3639,
327,
761,
31,
27573,
368,
327,
326,
761,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
225,
3581,
471,
327,
279,
2744,
761,
18,
1220,
903,
604,
392,
555,
309,
2566,
1347,
326,
2389,
353,
1008,
18,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
1045e5176088a42222dc33070d290ef8a3f1b79b | KSayrs/randomized-dequeus-and-queues | src/RandomizedQueue.java | [
"MIT"
] | Java | sample | Item | public Item sample(){
if(itemCount == 0){
throw new NoSuchElementException("Queue is empty");
}
int rand = StdRandom.uniform(array.length);
while(array[rand] == null){ // if it's a null value
rand = StdRandom.uniform(array.length); // pick another one
}
return array[rand];
} | /** return a random item (but do not remove it).
* This will throw an error if called when the queue is empty.
* */ | return a random item (but do not remove it).
This will throw an error if called when the queue is empty. | [
"return",
"a",
"random",
"item",
"(",
"but",
"do",
"not",
"remove",
"it",
")",
".",
"This",
"will",
"throw",
"an",
"error",
"if",
"called",
"when",
"the",
"queue",
"is",
"empty",
"."
] | public Item sample(){
if(itemCount == 0){
throw new NoSuchElementException("Queue is empty");
}
int rand = StdRandom.uniform(array.length);
while(array[rand] == null){
rand = StdRandom.uniform(array.length);
}
return array[rand];
} | [
"public",
"Item",
"sample",
"(",
")",
"{",
"if",
"(",
"itemCount",
"==",
"0",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"\"Queue is empty\"",
")",
";",
"}",
"int",
"rand",
"=",
"StdRandom",
".",
"uniform",
"(",
"array",
".",
"length",
")",
";",
"while",
"(",
"array",
"[",
"rand",
"]",
"==",
"null",
")",
"{",
"rand",
"=",
"StdRandom",
".",
"uniform",
"(",
"array",
".",
"length",
")",
";",
"}",
"return",
"array",
"[",
"rand",
"]",
";",
"}"
] | return a random item (but do not remove it). | [
"return",
"a",
"random",
"item",
"(",
"but",
"do",
"not",
"remove",
"it",
")",
"."
] | [
"// if it's a null value",
"// pick another one"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
4342,
3296,
1435,
95,
203,
3639,
309,
12,
1726,
1380,
422,
374,
15329,
203,
5411,
604,
394,
23104,
2932,
3183,
353,
1008,
8863,
203,
3639,
289,
203,
3639,
509,
5605,
273,
6276,
8529,
18,
24120,
12,
1126,
18,
2469,
1769,
203,
3639,
1323,
12,
1126,
63,
7884,
65,
422,
446,
15329,
1171,
368,
309,
518,
1807,
279,
446,
460,
203,
5411,
5605,
273,
6276,
8529,
18,
24120,
12,
1126,
18,
2469,
1769,
225,
368,
6002,
4042,
1245,
203,
3639,
289,
203,
3639,
327,
526,
63,
7884,
15533,
203,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
26873,
327,
279,
2744,
761,
261,
12885,
741,
486,
1206,
518,
2934,
203,
377,
380,
1220,
903,
604,
392,
555,
309,
2566,
1347,
326,
2389,
353,
1008,
18,
203,
377,
380,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
1045e5176088a42222dc33070d290ef8a3f1b79b | KSayrs/randomized-dequeus-and-queues | src/RandomizedQueue.java | [
"MIT"
] | Java | reset | null | private void reset(){
int j=0;
for(int i=0; i<array.length; i++){
if(j == itemCount) {return;}
if(array[i]!=null){
temp[j] = array[i];
j++;
}
}
} | // not strictly necessary to have a separate method here, but hey it helped in the process | not strictly necessary to have a separate method here, but hey it helped in the process | [
"not",
"strictly",
"necessary",
"to",
"have",
"a",
"separate",
"method",
"here",
"but",
"hey",
"it",
"helped",
"in",
"the",
"process"
] | private void reset(){
int j=0;
for(int i=0; i<array.length; i++){
if(j == itemCount) {return;}
if(array[i]!=null){
temp[j] = array[i];
j++;
}
}
} | [
"private",
"void",
"reset",
"(",
")",
"{",
"int",
"j",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"j",
"==",
"itemCount",
")",
"{",
"return",
";",
"}",
"if",
"(",
"array",
"[",
"i",
"]",
"!=",
"null",
")",
"{",
"temp",
"[",
"j",
"]",
"=",
"array",
"[",
"i",
"]",
";",
"j",
"++",
";",
"}",
"}",
"}"
] | not strictly necessary to have a separate method here, but hey it helped in the process | [
"not",
"strictly",
"necessary",
"to",
"have",
"a",
"separate",
"method",
"here",
"but",
"hey",
"it",
"helped",
"in",
"the",
"process"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
3238,
918,
2715,
1435,
95,
203,
5411,
509,
525,
33,
20,
31,
203,
5411,
364,
12,
474,
277,
33,
20,
31,
277,
32,
1126,
18,
2469,
31,
277,
27245,
95,
203,
7734,
309,
12,
78,
422,
761,
1380,
13,
288,
2463,
31,
97,
203,
7734,
309,
12,
1126,
63,
77,
65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
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
476d964e4b060a8357c7d748f3b70c6617835eb1 | iedadata/geomapapp | haxby/db/mgg/MGGData.java | [
"Apache-2.0"
] | Java | drawCurrentPoint | null | protected void drawCurrentPoint() {
if( map==null || currentPoint==null || !map.isVisible() ) return;
synchronized (map.getTreeLock() ) {
Graphics2D g = map.getGraphics2D();
Graphics2D g2 = map.getGraphics2D();
float zoom = (float)map.getZoom();
g.setStroke( new BasicStroke( 5f/ zoom ) );
Rectangle2D rect = map.getClipRect2D();
double wrap = map.getWrap();
if( wrap>0. ) while( currentPoint.x-wrap > rect.getX() ) currentPoint.x-=wrap;
double size = 10./map.getZoom();
Arc2D.Double arc = new Arc2D.Double( 0., currentPoint.y,
size/6, size/6, 0., 360., Arc2D.CHORD);
Arc2D.Double arc2 = new Arc2D.Double( 0., currentPoint.y-.5*size,
size, size, 0., 360., Arc2D.CHORD);
if( wrap>0. ) {
while( currentPoint.x < rect.getX()+rect.getWidth() ) {
g.setColor(Color.red);
g.setStroke( new BasicStroke( 5f/ zoom ) );
g.draw(currentSeg);
g.setColor(Color.white);
g.setStroke( new BasicStroke( 2.f/ zoom ) );
arc.x = currentPoint.x;
g.draw(arc);
arc2.x = currentPoint.x-.5*size;
g2.setXORMode( Color.white );
g2.setStroke( new BasicStroke( 4f/ zoom ) );
g2.draw(arc2);
currentPoint.x += wrap;
}
} else {
g.setColor(Color.red);
g.setStroke( new BasicStroke( 5f/ zoom ) );
g.draw(currentSeg);
g.setColor(Color.white);
g.setStroke( new BasicStroke( 2.f/ zoom ) );
arc.x = currentPoint.x;
g.draw(arc);
arc2.x = currentPoint.x-.5*size;
g2.setXORMode( Color.white );
g2.setStroke( new BasicStroke( 4f/ zoom ) );
g2.draw(arc2);
}
}
} | // you are looking at; circle is now thicker | you are looking at; circle is now thicker | [
"you",
"are",
"looking",
"at",
";",
"circle",
"is",
"now",
"thicker"
] | protected void drawCurrentPoint() {
if( map==null || currentPoint==null || !map.isVisible() ) return;
synchronized (map.getTreeLock() ) {
Graphics2D g = map.getGraphics2D();
Graphics2D g2 = map.getGraphics2D();
float zoom = (float)map.getZoom();
g.setStroke( new BasicStroke( 5f/ zoom ) );
Rectangle2D rect = map.getClipRect2D();
double wrap = map.getWrap();
if( wrap>0. ) while( currentPoint.x-wrap > rect.getX() ) currentPoint.x-=wrap;
double size = 10./map.getZoom();
Arc2D.Double arc = new Arc2D.Double( 0., currentPoint.y,
size/6, size/6, 0., 360., Arc2D.CHORD);
Arc2D.Double arc2 = new Arc2D.Double( 0., currentPoint.y-.5*size,
size, size, 0., 360., Arc2D.CHORD);
if( wrap>0. ) {
while( currentPoint.x < rect.getX()+rect.getWidth() ) {
g.setColor(Color.red);
g.setStroke( new BasicStroke( 5f/ zoom ) );
g.draw(currentSeg);
g.setColor(Color.white);
g.setStroke( new BasicStroke( 2.f/ zoom ) );
arc.x = currentPoint.x;
g.draw(arc);
arc2.x = currentPoint.x-.5*size;
g2.setXORMode( Color.white );
g2.setStroke( new BasicStroke( 4f/ zoom ) );
g2.draw(arc2);
currentPoint.x += wrap;
}
} else {
g.setColor(Color.red);
g.setStroke( new BasicStroke( 5f/ zoom ) );
g.draw(currentSeg);
g.setColor(Color.white);
g.setStroke( new BasicStroke( 2.f/ zoom ) );
arc.x = currentPoint.x;
g.draw(arc);
arc2.x = currentPoint.x-.5*size;
g2.setXORMode( Color.white );
g2.setStroke( new BasicStroke( 4f/ zoom ) );
g2.draw(arc2);
}
}
} | [
"protected",
"void",
"drawCurrentPoint",
"(",
")",
"{",
"if",
"(",
"map",
"==",
"null",
"||",
"currentPoint",
"==",
"null",
"||",
"!",
"map",
".",
"isVisible",
"(",
")",
")",
"return",
";",
"synchronized",
"(",
"map",
".",
"getTreeLock",
"(",
")",
")",
"{",
"Graphics2D",
"g",
"=",
"map",
".",
"getGraphics2D",
"(",
")",
";",
"Graphics2D",
"g2",
"=",
"map",
".",
"getGraphics2D",
"(",
")",
";",
"float",
"zoom",
"=",
"(",
"float",
")",
"map",
".",
"getZoom",
"(",
")",
";",
"g",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"5f",
"/",
"zoom",
")",
")",
";",
"Rectangle2D",
"rect",
"=",
"map",
".",
"getClipRect2D",
"(",
")",
";",
"double",
"wrap",
"=",
"map",
".",
"getWrap",
"(",
")",
";",
"if",
"(",
"wrap",
">",
"0.",
")",
"while",
"(",
"currentPoint",
".",
"x",
"-",
"wrap",
">",
"rect",
".",
"getX",
"(",
")",
")",
"currentPoint",
".",
"x",
"-=",
"wrap",
";",
"double",
"size",
"=",
"10.",
"/",
"map",
".",
"getZoom",
"(",
")",
";",
"Arc2D",
".",
"Double",
"arc",
"=",
"new",
"Arc2D",
".",
"Double",
"(",
"0.",
",",
"currentPoint",
".",
"y",
",",
"size",
"/",
"6",
",",
"size",
"/",
"6",
",",
"0.",
",",
"360.",
",",
"Arc2D",
".",
"CHORD",
")",
";",
"Arc2D",
".",
"Double",
"arc2",
"=",
"new",
"Arc2D",
".",
"Double",
"(",
"0.",
",",
"currentPoint",
".",
"y",
"-",
".5",
"*",
"size",
",",
"size",
",",
"size",
",",
"0.",
",",
"360.",
",",
"Arc2D",
".",
"CHORD",
")",
";",
"if",
"(",
"wrap",
">",
"0.",
")",
"{",
"while",
"(",
"currentPoint",
".",
"x",
"<",
"rect",
".",
"getX",
"(",
")",
"+",
"rect",
".",
"getWidth",
"(",
")",
")",
"{",
"g",
".",
"setColor",
"(",
"Color",
".",
"red",
")",
";",
"g",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"5f",
"/",
"zoom",
")",
")",
";",
"g",
".",
"draw",
"(",
"currentSeg",
")",
";",
"g",
".",
"setColor",
"(",
"Color",
".",
"white",
")",
";",
"g",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"2.f",
"/",
"zoom",
")",
")",
";",
"arc",
".",
"x",
"=",
"currentPoint",
".",
"x",
";",
"g",
".",
"draw",
"(",
"arc",
")",
";",
"arc2",
".",
"x",
"=",
"currentPoint",
".",
"x",
"-",
".5",
"*",
"size",
";",
"g2",
".",
"setXORMode",
"(",
"Color",
".",
"white",
")",
";",
"g2",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"4f",
"/",
"zoom",
")",
")",
";",
"g2",
".",
"draw",
"(",
"arc2",
")",
";",
"currentPoint",
".",
"x",
"+=",
"wrap",
";",
"}",
"}",
"else",
"{",
"g",
".",
"setColor",
"(",
"Color",
".",
"red",
")",
";",
"g",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"5f",
"/",
"zoom",
")",
")",
";",
"g",
".",
"draw",
"(",
"currentSeg",
")",
";",
"g",
".",
"setColor",
"(",
"Color",
".",
"white",
")",
";",
"g",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"2.f",
"/",
"zoom",
")",
")",
";",
"arc",
".",
"x",
"=",
"currentPoint",
".",
"x",
";",
"g",
".",
"draw",
"(",
"arc",
")",
";",
"arc2",
".",
"x",
"=",
"currentPoint",
".",
"x",
"-",
".5",
"*",
"size",
";",
"g2",
".",
"setXORMode",
"(",
"Color",
".",
"white",
")",
";",
"g2",
".",
"setStroke",
"(",
"new",
"BasicStroke",
"(",
"4f",
"/",
"zoom",
")",
")",
";",
"g2",
".",
"draw",
"(",
"arc2",
")",
";",
"}",
"}",
"}"
] | you are looking at; circle is now thicker | [
"you",
"are",
"looking",
"at",
";",
"circle",
"is",
"now",
"thicker"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
4750,
918,
3724,
3935,
2148,
1435,
288,
203,
202,
202,
430,
12,
852,
631,
2011,
747,
783,
2148,
631,
2011,
747,
401,
1458,
18,
291,
6207,
1435,
262,
327,
31,
203,
202,
202,
22043,
261,
1458,
18,
588,
2471,
2531,
1435,
262,
288,
203,
1082,
202,
17558,
22,
40,
314,
273,
852,
18,
588,
17558,
22,
40,
5621,
203,
1082,
202,
17558,
22,
40,
314,
22,
273,
852,
18,
588,
17558,
22,
40,
5621,
203,
1082,
202,
5659,
7182,
273,
261,
5659,
13,
1458,
18,
588,
11497,
5621,
203,
203,
1082,
202,
75,
18,
542,
14602,
12,
394,
7651,
14602,
12,
1381,
74,
19,
7182,
262,
11272,
203,
203,
1082,
202,
19463,
22,
40,
4917,
273,
852,
18,
588,
15339,
6120,
22,
40,
5621,
203,
1082,
202,
9056,
2193,
273,
852,
18,
588,
2964,
5621,
203,
1082,
202,
430,
12,
2193,
34,
20,
18,
262,
1323,
12,
783,
2148,
18,
92,
17,
4113,
405,
4917,
18,
588,
60,
1435,
262,
783,
2148,
18,
92,
17,
33,
4113,
31,
203,
1082,
202,
9056,
963,
273,
1728,
18,
19,
1458,
18,
588,
11497,
5621,
203,
203,
1082,
202,
14598,
22,
40,
18,
5265,
8028,
273,
394,
24881,
22,
40,
18,
5265,
12,
374,
12990,
783,
2148,
18,
93,
16,
7010,
6862,
1082,
202,
1467,
19,
26,
16,
963,
19,
26,
16,
374,
12990,
12360,
12990,
24881,
22,
40,
18,
30555,
40,
1769,
203,
1082,
202,
14598,
22,
40,
18,
5265,
8028,
22,
273,
394,
24881,
22,
40,
18,
5265,
12,
374,
12990,
783,
2148,
18,
93,
17,
18,
25,
14,
1467,
16,
7010,
6862,
202,
1467,
16,
963,
16,
374,
12990,
12360,
12990,
24881,
22,
40,
18,
30555,
40,
1769,
203,
1082,
202,
430,
12,
2193,
34,
20,
18,
262,
288,
203,
9506,
202,
17523,
12,
783,
2148,
18,
92,
411,
4917,
18,
588,
60,
1435,
15,
2607,
18,
588,
2384,
1435,
262,
288,
203,
6862,
202,
75,
18,
542,
2957,
12,
2957,
18,
1118,
1769,
203,
6862,
202,
75,
18,
542,
14602,
12,
394,
7651,
14602,
12,
1381,
74,
19,
7182,
262,
11272,
203,
6862,
202,
75,
18,
9446,
12,
2972,
3289,
1769,
203,
6862,
202,
75,
18,
542,
2957,
12,
2957,
18,
14739,
1769,
203,
6862,
202,
75,
18,
542,
14602,
12,
394,
7651,
14602,
12,
576,
18,
74,
19,
7182,
262,
11272,
203,
6862,
202,
11828,
18,
92,
273,
783,
2148,
18,
92,
31,
203,
6862,
202,
75,
18,
9446,
12,
11828,
1769,
203,
6862,
202,
11828,
22,
18,
92,
273,
783,
2148,
18,
92,
17,
18,
25,
14,
1467,
31,
203,
6862,
202,
75,
22,
18,
542,
60,
916,
2309,
12,
5563,
18,
14739,
11272,
203,
6862,
202,
75,
22,
18,
542,
14602,
12,
394,
7651,
14602,
12,
1059,
74,
19,
7182,
262,
11272,
203,
6862,
202,
75,
22,
18,
9446,
12,
11828,
22,
1769,
203,
6862,
202,
2972,
2148,
18,
92,
1011,
2193,
31,
203,
9506,
202,
97,
203,
1082,
202,
97,
469,
288,
203,
9506,
202,
75,
18,
542,
2957,
12,
2957,
18,
1118,
1769,
203,
9506,
202,
75,
18,
542,
14602,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | [
1,
759,
202,
19940,
854,
7849,
622,
31,
12470,
353,
2037,
286,
5448,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
476d964e4b060a8357c7d748f3b70c6617835eb1 | iedadata/geomapapp | haxby/db/mgg/MGGData.java | [
"Apache-2.0"
] | Java | inDisplayedMap | null | public boolean inDisplayedMap(Point2D p) {
double x = p.getX();
double y = p.getY();
//get the displayed area
Rectangle2D rect = map.getClipRect2D();
float yMin = (float)rect.getY();
float yMax = (float)(rect.getY() + rect.getHeight());
float xMin = (float)rect.getX();
float xMax = (float)(rect.getX() + rect.getWidth());
float wrap = (float)map.getWrap();
if (wrap>0f){
while (x>xMin+wrap) x-=wrap;
while (x<xMax-wrap) x+=wrap;
}
if (x >= xMin && x <= xMax && y >= yMin && y <= yMax) return true;
return false;
} | /*
* Determine if a point is located on the displayed map
*/ | Determine if a point is located on the displayed map | [
"Determine",
"if",
"a",
"point",
"is",
"located",
"on",
"the",
"displayed",
"map"
] | public boolean inDisplayedMap(Point2D p) {
double x = p.getX();
double y = p.getY();
Rectangle2D rect = map.getClipRect2D();
float yMin = (float)rect.getY();
float yMax = (float)(rect.getY() + rect.getHeight());
float xMin = (float)rect.getX();
float xMax = (float)(rect.getX() + rect.getWidth());
float wrap = (float)map.getWrap();
if (wrap>0f){
while (x>xMin+wrap) x-=wrap;
while (x<xMax-wrap) x+=wrap;
}
if (x >= xMin && x <= xMax && y >= yMin && y <= yMax) return true;
return false;
} | [
"public",
"boolean",
"inDisplayedMap",
"(",
"Point2D",
"p",
")",
"{",
"double",
"x",
"=",
"p",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"p",
".",
"getY",
"(",
")",
";",
"Rectangle2D",
"rect",
"=",
"map",
".",
"getClipRect2D",
"(",
")",
";",
"float",
"yMin",
"=",
"(",
"float",
")",
"rect",
".",
"getY",
"(",
")",
";",
"float",
"yMax",
"=",
"(",
"float",
")",
"(",
"rect",
".",
"getY",
"(",
")",
"+",
"rect",
".",
"getHeight",
"(",
")",
")",
";",
"float",
"xMin",
"=",
"(",
"float",
")",
"rect",
".",
"getX",
"(",
")",
";",
"float",
"xMax",
"=",
"(",
"float",
")",
"(",
"rect",
".",
"getX",
"(",
")",
"+",
"rect",
".",
"getWidth",
"(",
")",
")",
";",
"float",
"wrap",
"=",
"(",
"float",
")",
"map",
".",
"getWrap",
"(",
")",
";",
"if",
"(",
"wrap",
">",
"0f",
")",
"{",
"while",
"(",
"x",
">",
"xMin",
"+",
"wrap",
")",
"x",
"-=",
"wrap",
";",
"while",
"(",
"x",
"<",
"xMax",
"-",
"wrap",
")",
"x",
"+=",
"wrap",
";",
"}",
"if",
"(",
"x",
">=",
"xMin",
"&&",
"x",
"<=",
"xMax",
"&&",
"y",
">=",
"yMin",
"&&",
"y",
"<=",
"yMax",
")",
"return",
"true",
";",
"return",
"false",
";",
"}"
] | Determine if a point is located on the displayed map | [
"Determine",
"if",
"a",
"point",
"is",
"located",
"on",
"the",
"displayed",
"map"
] | [
"//get the displayed area"
] | [
{
"param": "p",
"type": "Point2D"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p",
"type": "Point2D",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
1250,
316,
4236,
329,
863,
12,
2148,
22,
40,
293,
13,
288,
203,
202,
202,
9056,
619,
273,
293,
18,
588,
60,
5621,
203,
202,
202,
9056,
677,
273,
293,
18,
588,
61,
5621,
203,
202,
202,
759,
588,
326,
10453,
5091,
203,
202,
202,
19463,
22,
40,
4917,
273,
852,
18,
588,
15339,
6120,
22,
40,
5621,
203,
202,
202,
5659,
677,
2930,
273,
261,
5659,
13,
2607,
18,
588,
61,
5621,
203,
202,
202,
5659,
677,
2747,
273,
261,
5659,
21433,
2607,
18,
588,
61,
1435,
397,
4917,
18,
588,
2686,
10663,
203,
202,
202,
5659,
619,
2930,
273,
261,
5659,
13,
2607,
18,
588,
60,
5621,
203,
202,
202,
5659,
619,
2747,
273,
261,
5659,
21433,
2607,
18,
588,
60,
1435,
397,
4917,
18,
588,
2384,
10663,
203,
202,
202,
5659,
2193,
273,
261,
5659,
13,
1458,
18,
588,
2964,
5621,
203,
203,
202,
202,
430,
261,
4113,
34,
20,
74,
15329,
203,
1082,
202,
17523,
261,
92,
34,
92,
2930,
15,
4113,
13,
619,
17,
33,
4113,
31,
203,
1082,
202,
17523,
261,
92,
32,
92,
2747,
17,
4113,
13,
619,
15,
33,
4113,
31,
203,
202,
202,
97,
203,
1082,
203,
202,
202,
430,
261,
92,
1545,
619,
2930,
597,
619,
1648,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
20308,
203,
202,
380,
10229,
309,
279,
1634,
353,
13801,
603,
326,
10453,
852,
203,
202,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
476d964e4b060a8357c7d748f3b70c6617835eb1 | iedadata/geomapapp | haxby/db/mgg/MGGData.java | [
"Apache-2.0"
] | Java | tryPopUp | null | public void tryPopUp(MouseEvent evt){
String osName = System.getProperty("os.name");
if ( !evt.isControlDown() ) {
if ( osName.startsWith("Mac OS") && evt.isShiftDown() ) {
pm.show(evt.getComponent(), evt.getX(), evt.getY() );
}
else if ( evt.isPopupTrigger() ) {
pm.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
} | // the current point to the clipboard. | the current point to the clipboard. | [
"the",
"current",
"point",
"to",
"the",
"clipboard",
"."
] | public void tryPopUp(MouseEvent evt){
String osName = System.getProperty("os.name");
if ( !evt.isControlDown() ) {
if ( osName.startsWith("Mac OS") && evt.isShiftDown() ) {
pm.show(evt.getComponent(), evt.getX(), evt.getY() );
}
else if ( evt.isPopupTrigger() ) {
pm.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
} | [
"public",
"void",
"tryPopUp",
"(",
"MouseEvent",
"evt",
")",
"{",
"String",
"osName",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"if",
"(",
"!",
"evt",
".",
"isControlDown",
"(",
")",
")",
"{",
"if",
"(",
"osName",
".",
"startsWith",
"(",
"\"Mac OS\"",
")",
"&&",
"evt",
".",
"isShiftDown",
"(",
")",
")",
"{",
"pm",
".",
"show",
"(",
"evt",
".",
"getComponent",
"(",
")",
",",
"evt",
".",
"getX",
"(",
")",
",",
"evt",
".",
"getY",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"evt",
".",
"isPopupTrigger",
"(",
")",
")",
"{",
"pm",
".",
"show",
"(",
"evt",
".",
"getComponent",
"(",
")",
",",
"evt",
".",
"getX",
"(",
")",
",",
"evt",
".",
"getY",
"(",
")",
")",
";",
"}",
"}",
"}"
] | the current point to the clipboard. | [
"the",
"current",
"point",
"to",
"the",
"clipboard",
"."
] | [] | [
{
"param": "evt",
"type": "MouseEvent"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "evt",
"type": "MouseEvent",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
775,
7049,
1211,
12,
9186,
1133,
6324,
15329,
203,
202,
202,
780,
1140,
461,
273,
2332,
18,
588,
1396,
2932,
538,
18,
529,
8863,
203,
202,
202,
430,
261,
401,
73,
11734,
18,
291,
3367,
4164,
1435,
262,
288,
203,
1082,
202,
430,
261,
1140,
461,
18,
17514,
1190,
2932,
9990,
5932,
7923,
597,
6324,
18,
291,
10544,
4164,
1435,
262,
288,
203,
9506,
202,
7755,
18,
4500,
12,
73,
11734,
18,
588,
1841,
9334,
6324,
18,
588,
60,
9334,
6324,
18,
588,
61,
1435,
11272,
203,
1082,
202,
97,
203,
1082,
202,
12107,
309,
261,
6324,
18,
291,
13770,
6518,
1435,
262,
288,
203,
9506,
202,
7755,
18,
4500,
12,
73,
11734,
18,
588,
1841,
9334,
6324,
18,
588,
60,
9334,
6324,
18,
588,
61,
10663,
203,
1082,
202,
97,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
202,
5787,
783,
1634,
358,
326,
20304,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
476d964e4b060a8357c7d748f3b70c6617835eb1 | iedadata/geomapapp | haxby/db/mgg/MGGData.java | [
"Apache-2.0"
] | Java | loadFromDataFile | MGGData | static MGGData loadFromDataFile(XMap map, String leg) throws IOException {
MGGData data = null;
BufferedReader dataIn;
File dataFile;
DataInputStream controlIn;
String name, s;
ArrayList<Double> lon = new ArrayList<Double>();
ArrayList<Double> lat = new ArrayList<Double>();
ArrayList<Float> topo = new ArrayList<Float>();
ArrayList<Float> grav = new ArrayList<Float>();
ArrayList<Float> mag = new ArrayList<Float>();
// First search the control files to find which one contains our data set.
// The control file include the data set name.
// The data file has the same timestamp in the file name, so once we have found
// the control file, we can work out the data file.
if ( MGG.MGG_control_dir.exists() ) {
File[] MGG_control_files = MGG.MGG_control_dir.listFiles();
for ( int m = 0; m < MGG_control_files.length; m++ ) {
if ( MGG_control_files[m].getName().indexOf( "mgg_control" ) != -1 ) {
controlIn = new DataInputStream( new BufferedInputStream( new FileInputStream( MGG_control_files[m] ) ) );
name = "";
try {
name = controlIn.readUTF();
} catch (EOFException ex) {
break;
}
controlIn.close();
if (name.equals(leg)) {
//we have found the right control file, now read the data file
dataFile = new File (MGG.MGG_data_dir, "mgg_data_" + leg);
try {
dataIn = new BufferedReader( new InputStreamReader(new FileInputStream( dataFile )));
} catch (Exception ex) {
continue;
}
while ( ( s = dataIn.readLine() ) != null ) {
StringTokenizer st = new StringTokenizer(s);
String date = st.nextToken(); //don't need this
lon.add(Double.parseDouble(st.nextToken()));
lat.add(Double.parseDouble(st.nextToken()));
topo.add(Float.parseFloat(st.nextToken()));
grav.add(Float.parseFloat(st.nextToken()));
mag.add(Float.parseFloat(st.nextToken()));
}
dataIn.close();
//create the MGDData structure (need to convert the arrayLists to arrays first)
data = new MGGData( map, leg, GeneralUtils.arrayList2doubles(lon), GeneralUtils.arrayList2doubles(lat),
GeneralUtils.arrayList2floats(topo), GeneralUtils.arrayList2floats(grav), GeneralUtils.arrayList2floats(mag));
}
}
}
}
return data;
} | /*
* for imported data sets, load from the data file stored on the user's hard drive
*/ | for imported data sets, load from the data file stored on the user's hard drive | [
"for",
"imported",
"data",
"sets",
"load",
"from",
"the",
"data",
"file",
"stored",
"on",
"the",
"user",
"'",
"s",
"hard",
"drive"
] | static MGGData loadFromDataFile(XMap map, String leg) throws IOException {
MGGData data = null;
BufferedReader dataIn;
File dataFile;
DataInputStream controlIn;
String name, s;
ArrayList<Double> lon = new ArrayList<Double>();
ArrayList<Double> lat = new ArrayList<Double>();
ArrayList<Float> topo = new ArrayList<Float>();
ArrayList<Float> grav = new ArrayList<Float>();
ArrayList<Float> mag = new ArrayList<Float>();
if ( MGG.MGG_control_dir.exists() ) {
File[] MGG_control_files = MGG.MGG_control_dir.listFiles();
for ( int m = 0; m < MGG_control_files.length; m++ ) {
if ( MGG_control_files[m].getName().indexOf( "mgg_control" ) != -1 ) {
controlIn = new DataInputStream( new BufferedInputStream( new FileInputStream( MGG_control_files[m] ) ) );
name = "";
try {
name = controlIn.readUTF();
} catch (EOFException ex) {
break;
}
controlIn.close();
if (name.equals(leg)) {
dataFile = new File (MGG.MGG_data_dir, "mgg_data_" + leg);
try {
dataIn = new BufferedReader( new InputStreamReader(new FileInputStream( dataFile )));
} catch (Exception ex) {
continue;
}
while ( ( s = dataIn.readLine() ) != null ) {
StringTokenizer st = new StringTokenizer(s);
String date = st.nextToken();
lon.add(Double.parseDouble(st.nextToken()));
lat.add(Double.parseDouble(st.nextToken()));
topo.add(Float.parseFloat(st.nextToken()));
grav.add(Float.parseFloat(st.nextToken()));
mag.add(Float.parseFloat(st.nextToken()));
}
dataIn.close();
data = new MGGData( map, leg, GeneralUtils.arrayList2doubles(lon), GeneralUtils.arrayList2doubles(lat),
GeneralUtils.arrayList2floats(topo), GeneralUtils.arrayList2floats(grav), GeneralUtils.arrayList2floats(mag));
}
}
}
}
return data;
} | [
"static",
"MGGData",
"loadFromDataFile",
"(",
"XMap",
"map",
",",
"String",
"leg",
")",
"throws",
"IOException",
"{",
"MGGData",
"data",
"=",
"null",
";",
"BufferedReader",
"dataIn",
";",
"File",
"dataFile",
";",
"DataInputStream",
"controlIn",
";",
"String",
"name",
",",
"s",
";",
"ArrayList",
"<",
"Double",
">",
"lon",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
")",
";",
"ArrayList",
"<",
"Double",
">",
"lat",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
")",
";",
"ArrayList",
"<",
"Float",
">",
"topo",
"=",
"new",
"ArrayList",
"<",
"Float",
">",
"(",
")",
";",
"ArrayList",
"<",
"Float",
">",
"grav",
"=",
"new",
"ArrayList",
"<",
"Float",
">",
"(",
")",
";",
"ArrayList",
"<",
"Float",
">",
"mag",
"=",
"new",
"ArrayList",
"<",
"Float",
">",
"(",
")",
";",
"if",
"(",
"MGG",
".",
"MGG_control_dir",
".",
"exists",
"(",
")",
")",
"{",
"File",
"[",
"]",
"MGG_control_files",
"=",
"MGG",
".",
"MGG_control_dir",
".",
"listFiles",
"(",
")",
";",
"for",
"(",
"int",
"m",
"=",
"0",
";",
"m",
"<",
"MGG_control_files",
".",
"length",
";",
"m",
"++",
")",
"{",
"if",
"(",
"MGG_control_files",
"[",
"m",
"]",
".",
"getName",
"(",
")",
".",
"indexOf",
"(",
"\"mgg_control\"",
")",
"!=",
"-",
"1",
")",
"{",
"controlIn",
"=",
"new",
"DataInputStream",
"(",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(",
"MGG_control_files",
"[",
"m",
"]",
")",
")",
")",
";",
"name",
"=",
"\"\"",
";",
"try",
"{",
"name",
"=",
"controlIn",
".",
"readUTF",
"(",
")",
";",
"}",
"catch",
"(",
"EOFException",
"ex",
")",
"{",
"break",
";",
"}",
"controlIn",
".",
"close",
"(",
")",
";",
"if",
"(",
"name",
".",
"equals",
"(",
"leg",
")",
")",
"{",
"dataFile",
"=",
"new",
"File",
"(",
"MGG",
".",
"MGG_data_dir",
",",
"\"mgg_data_\"",
"+",
"leg",
")",
";",
"try",
"{",
"dataIn",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"dataFile",
")",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"continue",
";",
"}",
"while",
"(",
"(",
"s",
"=",
"dataIn",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"s",
")",
";",
"String",
"date",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"lon",
".",
"add",
"(",
"Double",
".",
"parseDouble",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
")",
";",
"lat",
".",
"add",
"(",
"Double",
".",
"parseDouble",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
")",
";",
"topo",
".",
"add",
"(",
"Float",
".",
"parseFloat",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
")",
";",
"grav",
".",
"add",
"(",
"Float",
".",
"parseFloat",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
")",
";",
"mag",
".",
"add",
"(",
"Float",
".",
"parseFloat",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
")",
";",
"}",
"dataIn",
".",
"close",
"(",
")",
";",
"data",
"=",
"new",
"MGGData",
"(",
"map",
",",
"leg",
",",
"GeneralUtils",
".",
"arrayList2doubles",
"(",
"lon",
")",
",",
"GeneralUtils",
".",
"arrayList2doubles",
"(",
"lat",
")",
",",
"GeneralUtils",
".",
"arrayList2floats",
"(",
"topo",
")",
",",
"GeneralUtils",
".",
"arrayList2floats",
"(",
"grav",
")",
",",
"GeneralUtils",
".",
"arrayList2floats",
"(",
"mag",
")",
")",
";",
"}",
"}",
"}",
"}",
"return",
"data",
";",
"}"
] | for imported data sets, load from the data file stored on the user's hard drive | [
"for",
"imported",
"data",
"sets",
"load",
"from",
"the",
"data",
"file",
"stored",
"on",
"the",
"user",
"'",
"s",
"hard",
"drive"
] | [
"// First search the control files to find which one contains our data set.",
"// The control file include the data set name.",
"// The data file has the same timestamp in the file name, so once we have found",
"// the control file, we can work out the data file.",
"//we have found the right control file, now read the data file",
"//don't need this",
"//create the MGDData structure (need to convert the arrayLists to arrays first)"
] | [
{
"param": "map",
"type": "XMap"
},
{
"param": "leg",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "map",
"type": "XMap",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "leg",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
760,
490,
19491,
751,
24935,
751,
812,
12,
60,
863,
852,
16,
514,
4553,
13,
1216,
1860,
288,
7010,
202,
202,
49,
19491,
751,
501,
273,
446,
31,
203,
202,
202,
17947,
2514,
501,
382,
31,
203,
202,
202,
812,
501,
812,
31,
203,
202,
202,
751,
4348,
3325,
382,
31,
203,
202,
202,
780,
508,
16,
272,
31,
203,
202,
202,
19558,
32,
5265,
34,
4281,
273,
394,
2407,
32,
5265,
34,
5621,
203,
202,
202,
19558,
32,
5265,
34,
2516,
273,
394,
2407,
32,
5265,
34,
5621,
203,
202,
202,
19558,
32,
4723,
34,
17671,
273,
394,
2407,
32,
4723,
34,
5621,
203,
202,
202,
19558,
32,
4723,
34,
3087,
90,
273,
394,
2407,
32,
4723,
34,
5621,
203,
202,
202,
19558,
32,
4723,
34,
4447,
273,
394,
2407,
32,
4723,
34,
5621,
203,
202,
202,
759,
5783,
1623,
326,
3325,
1390,
358,
1104,
1492,
1245,
1914,
3134,
501,
444,
18,
203,
202,
202,
759,
1021,
3325,
585,
2341,
326,
501,
444,
508,
18,
203,
202,
202,
759,
1021,
501,
585,
711,
326,
1967,
2858,
316,
326,
585,
508,
16,
1427,
3647,
732,
1240,
1392,
203,
202,
202,
759,
326,
3325,
585,
16,
732,
848,
1440,
596,
326,
501,
585,
18,
203,
202,
202,
430,
261,
490,
19491,
18,
49,
19491,
67,
7098,
67,
1214,
18,
1808,
1435,
262,
288,
203,
1082,
202,
812,
8526,
490,
19491,
67,
7098,
67,
2354,
273,
490,
19491,
18,
49,
19491,
67,
7098,
67,
1214,
18,
1098,
2697,
5621,
203,
1082,
202,
1884,
261,
509,
312,
273,
374,
31,
312,
411,
490,
19491,
67,
7098,
67,
2354,
18,
2469,
31,
312,
9904,
262,
288,
203,
9506,
202,
430,
261,
490,
19491,
67,
7098,
67,
2354,
63,
81,
8009,
17994,
7675,
31806,
12,
315,
81,
14253,
67,
7098,
6,
262,
480,
300,
21,
262,
288,
203,
6862,
202,
7098,
382,
273,
394,
29382,
12,
394,
24742,
12,
394,
11907,
12,
490,
19491,
67,
7098,
67,
2354,
63,
81,
65,
262,
262,
11272,
203,
6862,
202,
529,
273,
1408,
31,
203,
6862,
202,
698,
288,
203,
25083,
202,
529,
273,
3325,
382,
18,
896,
5159,
5621,
203,
6862,
202,
97,
1044,
261,
12706,
503,
431,
13,
288,
203,
25083,
202,
8820,
31,
203,
6862,
202,
97,
203,
6862,
202,
7098,
382,
18,
4412,
5621,
203,
25083,
203,
6862,
202,
430,
261,
529,
18,
14963,
12,
1935,
3719,
288,
203,
25083,
202,
759,
1814,
1240,
1392,
326,
2145,
3325,
585,
16,
2037,
855,
326,
501,
585,
203,
25083,
202,
892,
812,
273,
394,
1387,
261,
49,
19491,
18,
49,
19491,
67,
892,
67,
1214,
16,
315,
81,
14253,
67,
892,
9548,
397,
4553,
1769,
203,
25083,
202,
698,
288,
203,
6862,
1082,
202,
892,
382,
273,
394,
10633,
12,
394,
15322,
12,
2704,
11907,
12,
501,
812,
8623,
1769,
203,
25083,
202,
97,
1044,
261,
503,
431,
13,
288,
203,
6862,
1082,
202,
17143,
31,
203,
25083,
202,
97,
203,
25083,
202,
17523,
261,
261,
272,
273,
501,
382,
18,
896,
1670,
1435,
262,
480,
446,
262,
288,
203,
6862,
1082,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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501,
1678,
16,
1262,
628,
326,
501,
585,
4041,
603,
326,
729,
1807,
7877,
14316,
203,
202,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
daf5396ce61f1e4e971fac0ddfd95d91386cb8f9 | iedadata/geomapapp | haxby/db/pdb/PDBSampleModel.java | [
"Apache-2.0"
] | Java | sortByColumn | null | public synchronized void sortByColumn(int col) {
if (lastSortedCol == col)
ascent = !ascent;
else
ascent = true;
lastSortedCol = col;
Collections.sort(samples, columnSorter);
updateSampleIndexMap();
fireTableDataChanged();
} | // Sorts on column col, alternating between ascent and descent | Sorts on column col, alternating between ascent and descent | [
"Sorts",
"on",
"column",
"col",
"alternating",
"between",
"ascent",
"and",
"descent"
] | public synchronized void sortByColumn(int col) {
if (lastSortedCol == col)
ascent = !ascent;
else
ascent = true;
lastSortedCol = col;
Collections.sort(samples, columnSorter);
updateSampleIndexMap();
fireTableDataChanged();
} | [
"public",
"synchronized",
"void",
"sortByColumn",
"(",
"int",
"col",
")",
"{",
"if",
"(",
"lastSortedCol",
"==",
"col",
")",
"ascent",
"=",
"!",
"ascent",
";",
"else",
"ascent",
"=",
"true",
";",
"lastSortedCol",
"=",
"col",
";",
"Collections",
".",
"sort",
"(",
"samples",
",",
"columnSorter",
")",
";",
"updateSampleIndexMap",
"(",
")",
";",
"fireTableDataChanged",
"(",
")",
";",
"}"
] | Sorts on column col, alternating between ascent and descent | [
"Sorts",
"on",
"column",
"col",
"alternating",
"between",
"ascent",
"and",
"descent"
] | [] | [
{
"param": "col",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "col",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
3852,
918,
14021,
1494,
12,
474,
645,
13,
288,
203,
202,
202,
430,
261,
2722,
11739,
914,
422,
645,
13,
203,
1082,
202,
345,
2998,
273,
401,
345,
2998,
31,
203,
202,
202,
12107,
203,
1082,
202,
345,
2998,
273,
638,
31,
203,
202,
202,
2722,
11739,
914,
273,
645,
31,
203,
203,
202,
202,
15150,
18,
3804,
12,
7319,
16,
1057,
24952,
1769,
203,
203,
202,
202,
2725,
8504,
1016,
863,
5621,
203,
202,
202,
12179,
1388,
751,
5033,
5621,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
5928,
87,
603,
1057,
645,
16,
6416,
1776,
3086,
487,
2998,
471,
3044,
319,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
68fd99c9178f42cdb6a30101d6cbbeb6d8eb7417 | iedadata/geomapapp | haxby/db/xmcs/XMCS.java | [
"Apache-2.0"
] | Java | checkListForProjection | null | private boolean checkListForProjection(String listPath) {
URL url;
try {
url = URLFactory.url(listPath);
BufferedReader in = new BufferedReader( new InputStreamReader(url.openStream()));
String inStr;
while ((inStr = in.readLine()) != null) {
String[] split = inStr.split("\t");
if (split.length != 6) continue; // improper entry
int mapType = MapApp.MERCATOR_MAP;
if (map.getApp() instanceof MapApp)
mapType =((MapApp) map.getApp()).getMapType();
try {
int cruiseType = Integer.parseInt(split[1]);
switch (mapType) {
case MapApp.MERCATOR_MAP:
if ((cruiseType & MERCATOR_MAP) != 0) return true;
break;
case MapApp.SOUTH_POLAR_MAP:
if ((cruiseType & SOUTH_POLAR_MAP) != 0) return true;
break;
case MapApp.NORTH_POLAR_MAP:
if ((cruiseType & NORTH_POLAR_MAP) != 0) return true;
break;
}
} catch (NumberFormatException ex) {
return false;
}
}
} catch (Exception e) {
return false;
}
return false;
} | /*
* check the cruise list to see if it contains cruises for the current
* map projection
*/ | check the cruise list to see if it contains cruises for the current
map projection | [
"check",
"the",
"cruise",
"list",
"to",
"see",
"if",
"it",
"contains",
"cruises",
"for",
"the",
"current",
"map",
"projection"
] | private boolean checkListForProjection(String listPath) {
URL url;
try {
url = URLFactory.url(listPath);
BufferedReader in = new BufferedReader( new InputStreamReader(url.openStream()));
String inStr;
while ((inStr = in.readLine()) != null) {
String[] split = inStr.split("\t");
if (split.length != 6) continue;
int mapType = MapApp.MERCATOR_MAP;
if (map.getApp() instanceof MapApp)
mapType =((MapApp) map.getApp()).getMapType();
try {
int cruiseType = Integer.parseInt(split[1]);
switch (mapType) {
case MapApp.MERCATOR_MAP:
if ((cruiseType & MERCATOR_MAP) != 0) return true;
break;
case MapApp.SOUTH_POLAR_MAP:
if ((cruiseType & SOUTH_POLAR_MAP) != 0) return true;
break;
case MapApp.NORTH_POLAR_MAP:
if ((cruiseType & NORTH_POLAR_MAP) != 0) return true;
break;
}
} catch (NumberFormatException ex) {
return false;
}
}
} catch (Exception e) {
return false;
}
return false;
} | [
"private",
"boolean",
"checkListForProjection",
"(",
"String",
"listPath",
")",
"{",
"URL",
"url",
";",
"try",
"{",
"url",
"=",
"URLFactory",
".",
"url",
"(",
"listPath",
")",
";",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"url",
".",
"openStream",
"(",
")",
")",
")",
";",
"String",
"inStr",
";",
"while",
"(",
"(",
"inStr",
"=",
"in",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"inStr",
".",
"split",
"(",
"\"\\t\"",
")",
";",
"if",
"(",
"split",
".",
"length",
"!=",
"6",
")",
"continue",
";",
"int",
"mapType",
"=",
"MapApp",
".",
"MERCATOR_MAP",
";",
"if",
"(",
"map",
".",
"getApp",
"(",
")",
"instanceof",
"MapApp",
")",
"mapType",
"=",
"(",
"(",
"MapApp",
")",
"map",
".",
"getApp",
"(",
")",
")",
".",
"getMapType",
"(",
")",
";",
"try",
"{",
"int",
"cruiseType",
"=",
"Integer",
".",
"parseInt",
"(",
"split",
"[",
"1",
"]",
")",
";",
"switch",
"(",
"mapType",
")",
"{",
"case",
"MapApp",
".",
"MERCATOR_MAP",
":",
"if",
"(",
"(",
"cruiseType",
"&",
"MERCATOR_MAP",
")",
"!=",
"0",
")",
"return",
"true",
";",
"break",
";",
"case",
"MapApp",
".",
"SOUTH_POLAR_MAP",
":",
"if",
"(",
"(",
"cruiseType",
"&",
"SOUTH_POLAR_MAP",
")",
"!=",
"0",
")",
"return",
"true",
";",
"break",
";",
"case",
"MapApp",
".",
"NORTH_POLAR_MAP",
":",
"if",
"(",
"(",
"cruiseType",
"&",
"NORTH_POLAR_MAP",
")",
"!=",
"0",
")",
"return",
"true",
";",
"break",
";",
"}",
"}",
"catch",
"(",
"NumberFormatException",
"ex",
")",
"{",
"return",
"false",
";",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"false",
";",
"}"
] | check the cruise list to see if it contains cruises for the current
map projection | [
"check",
"the",
"cruise",
"list",
"to",
"see",
"if",
"it",
"contains",
"cruises",
"for",
"the",
"current",
"map",
"projection"
] | [
"// improper entry"
] | [
{
"param": "listPath",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "listPath",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
3238,
1250,
866,
682,
1290,
14789,
12,
780,
666,
743,
13,
288,
203,
202,
202,
1785,
880,
31,
203,
202,
202,
698,
288,
203,
1082,
202,
718,
273,
1976,
1733,
18,
718,
12,
1098,
743,
1769,
203,
1082,
202,
17947,
2514,
316,
273,
394,
10633,
12,
394,
15322,
12,
718,
18,
3190,
1228,
1435,
10019,
203,
202,
203,
1082,
202,
780,
316,
1585,
31,
203,
1082,
202,
17523,
14015,
267,
1585,
273,
316,
18,
896,
1670,
10756,
480,
446,
13,
288,
203,
9506,
202,
780,
8526,
1416,
273,
316,
1585,
18,
4939,
31458,
88,
8863,
203,
9506,
202,
430,
261,
4939,
18,
2469,
480,
1666,
13,
1324,
31,
368,
13069,
457,
1241,
203,
202,
203,
9506,
202,
474,
852,
559,
273,
1635,
3371,
18,
20969,
39,
3575,
67,
8352,
31,
203,
9506,
202,
430,
261,
1458,
18,
588,
3371,
1435,
1276,
1635,
3371,
13,
203,
6862,
202,
1458,
559,
273,
12443,
863,
3371,
13,
852,
18,
588,
3371,
1435,
2934,
588,
863,
559,
5621,
203,
202,
203,
9506,
202,
698,
288,
203,
6862,
202,
474,
4422,
89,
784,
559,
273,
2144,
18,
2670,
1702,
12,
4939,
63,
21,
19226,
203,
6862,
202,
9610,
261,
1458,
559,
13,
288,
203,
25083,
202,
3593,
1635,
3371,
18,
20969,
39,
3575,
67,
8352,
30,
203,
6862,
1082,
202,
430,
14015,
3353,
89,
784,
559,
473,
490,
654,
39,
3575,
67,
8352,
13,
480,
374,
13,
327,
638,
31,
203,
6862,
1082,
202,
8820,
31,
203,
25083,
202,
3593,
1635,
3371,
18,
3584,
5844,
67,
14232,
985,
67,
8352,
30,
203,
6862,
1082,
202,
430,
14015,
3353,
89,
784,
559,
473,
348,
5069,
44,
67,
14232,
985,
67,
8352,
13,
480,
374,
13,
327,
638,
31,
203,
6862,
1082,
202,
8820,
31,
203,
25083,
202,
3593,
1635,
3371,
18,
50,
28212,
67,
14232,
985,
67,
8352,
30,
203,
6862,
1082,
202,
430,
14015,
3353,
89,
784,
559,
473,
423,
28212,
67,
14232,
985,
67,
8352,
13,
480,
374,
13,
327,
638,
31,
203,
6862,
1082,
202,
8820,
31,
203,
6862,
202,
97,
203,
202,
203,
9506,
202,
97,
1044,
261,
1854,
9291,
431,
13,
288,
203,
6862,
202,
2463,
629,
31,
203,
9506,
202,
97,
203,
1082,
202,
97,
203,
202,
202,
97,
1044,
261,
503,
425,
13,
288,
203,
1082,
202,
2463,
629,
31,
203,
202,
202,
97,
202,
203,
202,
202,
2463,
629,
31,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
20308,
203,
202,
380,
866,
326,
4422,
89,
784,
666,
358,
2621,
309,
518,
1914,
4422,
89,
6141,
364,
326,
783,
7010,
202,
380,
852,
8106,
203,
202,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
626a6895ee8b9c3da8e8a876def4e5b57a0c4f7e | iedadata/geomapapp | haxby/db/ship/ShipTrack.java | [
"Apache-2.0"
] | Java | hasAllKeywords | null | public boolean hasAllKeywords(ArrayList<String> keys)
{
for(String key:keys)
{
if((keywords.contains(key.toLowerCase()))==false)
return false;
}
return true;
} | /*Checks to see if a Ship has all of the keywords contained in the argument*/ | Checks to see if a Ship has all of the keywords contained in the argument | [
"Checks",
"to",
"see",
"if",
"a",
"Ship",
"has",
"all",
"of",
"the",
"keywords",
"contained",
"in",
"the",
"argument"
] | public boolean hasAllKeywords(ArrayList<String> keys)
{
for(String key:keys)
{
if((keywords.contains(key.toLowerCase()))==false)
return false;
}
return true;
} | [
"public",
"boolean",
"hasAllKeywords",
"(",
"ArrayList",
"<",
"String",
">",
"keys",
")",
"{",
"for",
"(",
"String",
"key",
":",
"keys",
")",
"{",
"if",
"(",
"(",
"keywords",
".",
"contains",
"(",
"key",
".",
"toLowerCase",
"(",
")",
")",
")",
"==",
"false",
")",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] | Checks to see if a Ship has all of the keywords contained in the argument | [
"Checks",
"to",
"see",
"if",
"a",
"Ship",
"has",
"all",
"of",
"the",
"keywords",
"contained",
"in",
"the",
"argument"
] | [] | [
{
"param": "keys",
"type": "ArrayList<String>"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "keys",
"type": "ArrayList<String>",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
1250,
711,
1595,
14149,
12,
19558,
32,
780,
34,
1311,
13,
206,
203,
202,
95,
1082,
206,
203,
202,
202,
1884,
12,
780,
498,
30,
2452,
13,
206,
203,
202,
202,
95,
206,
203,
1082,
202,
430,
12443,
11771,
18,
12298,
12,
856,
18,
869,
5630,
1435,
3719,
631,
5743,
13,
206,
203,
9506,
202,
2463,
629,
31,
206,
203,
202,
202,
97,
206,
203,
1082,
206,
203,
202,
202,
2463,
638,
31,
206,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
20308,
4081,
358,
2621,
309,
279,
2638,
625,
711,
777,
434,
326,
7093,
7542,
316,
326,
1237,
5549,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
a5fcf797454b948fa1d2763a7b86d452b5d2eedd | iedadata/geomapapp | haxby/db/dig/LineSegmentsObject.java | [
"Apache-2.0"
] | Java | updatePoints | null | protected void updatePoints() {
for (Object point : points) {
double[] xyz = (double[])point;
Point2D.Double p = new Point2D.Double(xyz[0], xyz[1]);
xyz[2] = getZ(p);
}
} | //update z-values for points | update z-values for points | [
"update",
"z",
"-",
"values",
"for",
"points"
] | protected void updatePoints() {
for (Object point : points) {
double[] xyz = (double[])point;
Point2D.Double p = new Point2D.Double(xyz[0], xyz[1]);
xyz[2] = getZ(p);
}
} | [
"protected",
"void",
"updatePoints",
"(",
")",
"{",
"for",
"(",
"Object",
"point",
":",
"points",
")",
"{",
"double",
"[",
"]",
"xyz",
"=",
"(",
"double",
"[",
"]",
")",
"point",
";",
"Point2D",
".",
"Double",
"p",
"=",
"new",
"Point2D",
".",
"Double",
"(",
"xyz",
"[",
"0",
"]",
",",
"xyz",
"[",
"1",
"]",
")",
";",
"xyz",
"[",
"2",
"]",
"=",
"getZ",
"(",
"p",
")",
";",
"}",
"}"
] | update z-values for points | [
"update",
"z",
"-",
"values",
"for",
"points"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
4750,
918,
1089,
5636,
1435,
288,
203,
202,
202,
1884,
261,
921,
1634,
294,
3143,
13,
288,
203,
1082,
202,
9056,
8526,
14779,
273,
261,
9056,
63,
5717,
1153,
31,
203,
1082,
202,
2148,
22,
40,
18,
5265,
293,
273,
394,
4686,
22,
40,
18,
5265,
12,
17177,
63,
20,
6487,
14779,
63,
21,
19226,
203,
1082,
202,
17177,
63,
22,
65,
273,
23448,
12,
84,
1769,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
2725,
998,
17,
2372,
364,
3143,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
eb29f49f25a5bbbdbc2f6aa6e039d725c1744bfd | iedadata/geomapapp | haxby/util/PathUtil.java | [
"Apache-2.0"
] | Java | loadNewPaths | null | public static void loadNewPaths(String path) {
keyToURL2 = new HashMap<String, String>();
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringComments(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse( URLFactory.url(path).openStream() );
Node root = getElement(dom, "GMA_paths");
for (Node layer : getElements(root, "layer"))
addLayer(layer, null);
} catch (IOException ex) {
ex.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
String rootPath = getPath("ROOT_PATH", MapApp.BASE_URL);
for (String key : keyToURL2.keySet()) {
String url = keyToURL2.get(key);
System.out.println("np url"+ url);
if (url.contains("http://"))
continue;
keyToURL2.put(key, rootPath + url);
}
} | // Loads another GMA paths file from another location
| Loads another GMA paths file from another location | [
"Loads",
"another",
"GMA",
"paths",
"file",
"from",
"another",
"location"
] | public static void loadNewPaths(String path) {
keyToURL2 = new HashMap<String, String>();
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringComments(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse( URLFactory.url(path).openStream() );
Node root = getElement(dom, "GMA_paths");
for (Node layer : getElements(root, "layer"))
addLayer(layer, null);
} catch (IOException ex) {
ex.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
String rootPath = getPath("ROOT_PATH", MapApp.BASE_URL);
for (String key : keyToURL2.keySet()) {
String url = keyToURL2.get(key);
System.out.println("np url"+ url);
if (url.contains("http://"))
continue;
keyToURL2.put(key, rootPath + url);
}
} | [
"public",
"static",
"void",
"loadNewPaths",
"(",
"String",
"path",
")",
"{",
"keyToURL2",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"try",
"{",
"DocumentBuilderFactory",
"dbf",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"dbf",
".",
"setIgnoringComments",
"(",
"true",
")",
";",
"DocumentBuilder",
"db",
"=",
"dbf",
".",
"newDocumentBuilder",
"(",
")",
";",
"Document",
"dom",
"=",
"db",
".",
"parse",
"(",
"URLFactory",
".",
"url",
"(",
"path",
")",
".",
"openStream",
"(",
")",
")",
";",
"Node",
"root",
"=",
"getElement",
"(",
"dom",
",",
"\"GMA_paths\"",
")",
";",
"for",
"(",
"Node",
"layer",
":",
"getElements",
"(",
"root",
",",
"\"layer\"",
")",
")",
"addLayer",
"(",
"layer",
",",
"null",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"ex",
".",
"printStackTrace",
"(",
")",
";",
"}",
"catch",
"(",
"ParserConfigurationException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"catch",
"(",
"SAXException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"String",
"rootPath",
"=",
"getPath",
"(",
"\"ROOT_PATH\"",
",",
"MapApp",
".",
"BASE_URL",
")",
";",
"for",
"(",
"String",
"key",
":",
"keyToURL2",
".",
"keySet",
"(",
")",
")",
"{",
"String",
"url",
"=",
"keyToURL2",
".",
"get",
"(",
"key",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"np url\"",
"+",
"url",
")",
";",
"if",
"(",
"url",
".",
"contains",
"(",
"\"http://\"",
")",
")",
"continue",
";",
"keyToURL2",
".",
"put",
"(",
"key",
",",
"rootPath",
"+",
"url",
")",
";",
"}",
"}"
] | Loads another GMA paths file from another location | [
"Loads",
"another",
"GMA",
"paths",
"file",
"from",
"another",
"location"
] | [] | [
{
"param": "path",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
760,
918,
1262,
1908,
4466,
12,
780,
589,
13,
288,
206,
203,
202,
202,
856,
774,
1785,
22,
273,
394,
4317,
32,
780,
16,
514,
34,
5621,
206,
203,
206,
203,
202,
202,
698,
288,
206,
203,
1082,
202,
2519,
20692,
1319,
74,
273,
30236,
18,
2704,
1442,
5621,
206,
203,
1082,
202,
1966,
74,
18,
542,
21702,
9051,
12,
3767,
1769,
206,
203,
206,
203,
1082,
202,
2519,
1263,
1319,
273,
1319,
74,
18,
2704,
2519,
1263,
5621,
206,
203,
1082,
202,
2519,
4092,
273,
1319,
18,
2670,
12,
1976,
1733,
18,
718,
12,
803,
2934,
3190,
1228,
1435,
11272,
206,
203,
206,
203,
1082,
202,
907,
1365,
273,
7426,
12,
9859,
16,
315,
43,
5535,
67,
4481,
8863,
206,
203,
1082,
202,
1884,
261,
907,
3018,
294,
8886,
12,
3085,
16,
315,
6363,
6,
3719,
206,
203,
9506,
202,
1289,
4576,
12,
6363,
16,
446,
1769,
206,
203,
206,
203,
202,
202,
97,
1044,
261,
14106,
431,
13,
288,
206,
203,
1082,
202,
338,
18,
1188,
6332,
5621,
206,
203,
202,
202,
97,
1044,
261,
2678,
10737,
425,
13,
288,
206,
203,
1082,
202,
73,
18,
1188,
6332,
5621,
206,
203,
202,
202,
97,
1044,
261,
55,
2501,
503,
425,
13,
288,
206,
203,
1082,
202,
73,
18,
1188,
6332,
5621,
206,
203,
202,
202,
97,
206,
203,
206,
203,
202,
202,
780,
13959,
273,
4339,
2932,
9185,
67,
4211,
3113,
1635,
3371,
18,
8369,
67,
1785,
1769,
206,
203,
206,
203,
202,
202,
1884,
261,
780,
498,
294,
498,
774,
1785,
22,
18,
856,
694,
10756,
288,
206,
203,
1082,
202,
780,
880,
273,
498,
774,
1785,
22,
18,
588,
12,
856,
1769,
206,
203,
1082,
202,
3163,
18,
659,
18,
8222,
2932,
6782,
880,
6,
15,
880,
1769,
206,
203,
1082,
202,
430,
261,
718,
18,
12298,
2932,
2505,
14334,
3719,
206,
203,
9506,
202,
17143,
31,
206,
203,
206,
203,
1082,
202,
856,
774,
1785,
22,
18,
458,
12,
856,
16,
13959,
397,
880,
1769,
206,
203,
202,
202,
97,
206,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
4444,
87,
4042,
611,
5535,
2953,
585,
628,
4042,
2117,
206,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
eb29f49f25a5bbbdbc2f6aa6e039d725c1744bfd | iedadata/geomapapp | haxby/util/PathUtil.java | [
"Apache-2.0"
] | Java | replacePlaceHolder | null | public static void replacePlaceHolder (String placeHolder, String var) {
for (Map.Entry<String, String> entry : keyToURL.entrySet()) {
entry.setValue(entry.getValue().replace(placeHolder, var));
}
} | /*
* replace any placeholders in path names with variables, eg version numbers
*/ | replace any placeholders in path names with variables, eg version numbers | [
"replace",
"any",
"placeholders",
"in",
"path",
"names",
"with",
"variables",
"eg",
"version",
"numbers"
] | public static void replacePlaceHolder (String placeHolder, String var) {
for (Map.Entry<String, String> entry : keyToURL.entrySet()) {
entry.setValue(entry.getValue().replace(placeHolder, var));
}
} | [
"public",
"static",
"void",
"replacePlaceHolder",
"(",
"String",
"placeHolder",
",",
"String",
"var",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"keyToURL",
".",
"entrySet",
"(",
")",
")",
"{",
"entry",
".",
"setValue",
"(",
"entry",
".",
"getValue",
"(",
")",
".",
"replace",
"(",
"placeHolder",
",",
"var",
")",
")",
";",
"}",
"}"
] | replace any placeholders in path names with variables, eg version numbers | [
"replace",
"any",
"placeholders",
"in",
"path",
"names",
"with",
"variables",
"eg",
"version",
"numbers"
] | [] | [
{
"param": "placeHolder",
"type": "String"
},
{
"param": "var",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "placeHolder",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "var",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
760,
918,
1453,
6029,
6064,
261,
780,
3166,
6064,
16,
514,
569,
13,
288,
206,
203,
202,
202,
1884,
261,
863,
18,
1622,
32,
780,
16,
514,
34,
1241,
294,
498,
774,
1785,
18,
4099,
694,
10756,
288,
206,
203,
1082,
202,
4099,
18,
542,
620,
12,
4099,
18,
24805,
7675,
2079,
12,
964,
6064,
16,
569,
10019,
206,
203,
202,
202,
97,
206,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
20308,
206,
203,
202,
380,
1453,
1281,
12150,
316,
589,
1257,
598,
3152,
16,
9130,
1177,
5600,
206,
203,
202,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b4c00dfedb7e539a0727a75d146f5c309e50732a | iedadata/geomapapp | haxby/db/surveyplanner/SurveyPlannerDataDisplay.java | [
"Apache-2.0"
] | Java | saveToFile | null | private void saveToFile() {
JFileChooser jfc = new JFileChooser(System.getProperty("user.home"));
File f=new File("SurveyLines.txt");
jfc.setSelectedFile(f);
do {
int c = jfc.showSaveDialog(null);
if (c==JFileChooser.CANCEL_OPTION||c==JFileChooser.ERROR_OPTION) return;
f = jfc.getSelectedFile();
if (f.exists()) {
c=JOptionPane.showConfirmDialog(null, "File Already Exists\nConfirm Overwrite");
if (c==JOptionPane.OK_OPTION) break;
if (c==JOptionPane.CANCEL_OPTION) return;
}
} while (f.exists());
try {
BufferedWriter out = new BufferedWriter(new FileWriter(f));
//add disclaimer at the top of the output file
out.write("#NOT TO BE USED FOR NAVIGATION PURPOSES\n");
boolean firstCol = true;
for (int i=0;i<tm.getColumnCount();i++) {
if (i == sp.getSurveyLineColumn()) continue;
if (firstCol) {
out.write(tm.getColumnName(i));
firstCol = false;
} else {
out.write("\t" + tm.getColumnName(i));
}
}
out.write("\n");
int[] ind;
ind = new int[tm.getRowCount()];
for (int i=0; i<tm.getRowCount(); i++) ind[i] = i;
for (int i=0;i<tm.getRowCount();i++) {
firstCol = true;
for (int j=0; j<tm.getColumnCount();j++) {
if (j == sp.getSurveyLineColumn()) continue;
Object o = tm.getValueAt(i, j);
if (o instanceof String && ((String)o).equals("NaN")) o = "";
if (firstCol) {
out.write(o.toString());
firstCol = false;
} else {
out.write("\t"+ o);
}
}
out.write("\n");
}
out.close();
} catch (IOException e){
JOptionPane.showMessageDialog(panel, "Unable to save file", "Save Error", JOptionPane.ERROR_MESSAGE);
System.out.println(e);
}
} | /*
* save the survey lines to a text file
*/ | save the survey lines to a text file | [
"save",
"the",
"survey",
"lines",
"to",
"a",
"text",
"file"
] | private void saveToFile() {
JFileChooser jfc = new JFileChooser(System.getProperty("user.home"));
File f=new File("SurveyLines.txt");
jfc.setSelectedFile(f);
do {
int c = jfc.showSaveDialog(null);
if (c==JFileChooser.CANCEL_OPTION||c==JFileChooser.ERROR_OPTION) return;
f = jfc.getSelectedFile();
if (f.exists()) {
c=JOptionPane.showConfirmDialog(null, "File Already Exists\nConfirm Overwrite");
if (c==JOptionPane.OK_OPTION) break;
if (c==JOptionPane.CANCEL_OPTION) return;
}
} while (f.exists());
try {
BufferedWriter out = new BufferedWriter(new FileWriter(f));
out.write("#NOT TO BE USED FOR NAVIGATION PURPOSES\n");
boolean firstCol = true;
for (int i=0;i<tm.getColumnCount();i++) {
if (i == sp.getSurveyLineColumn()) continue;
if (firstCol) {
out.write(tm.getColumnName(i));
firstCol = false;
} else {
out.write("\t" + tm.getColumnName(i));
}
}
out.write("\n");
int[] ind;
ind = new int[tm.getRowCount()];
for (int i=0; i<tm.getRowCount(); i++) ind[i] = i;
for (int i=0;i<tm.getRowCount();i++) {
firstCol = true;
for (int j=0; j<tm.getColumnCount();j++) {
if (j == sp.getSurveyLineColumn()) continue;
Object o = tm.getValueAt(i, j);
if (o instanceof String && ((String)o).equals("NaN")) o = "";
if (firstCol) {
out.write(o.toString());
firstCol = false;
} else {
out.write("\t"+ o);
}
}
out.write("\n");
}
out.close();
} catch (IOException e){
JOptionPane.showMessageDialog(panel, "Unable to save file", "Save Error", JOptionPane.ERROR_MESSAGE);
System.out.println(e);
}
} | [
"private",
"void",
"saveToFile",
"(",
")",
"{",
"JFileChooser",
"jfc",
"=",
"new",
"JFileChooser",
"(",
"System",
".",
"getProperty",
"(",
"\"user.home\"",
")",
")",
";",
"File",
"f",
"=",
"new",
"File",
"(",
"\"SurveyLines.txt\"",
")",
";",
"jfc",
".",
"setSelectedFile",
"(",
"f",
")",
";",
"do",
"{",
"int",
"c",
"=",
"jfc",
".",
"showSaveDialog",
"(",
"null",
")",
";",
"if",
"(",
"c",
"==",
"JFileChooser",
".",
"CANCEL_OPTION",
"||",
"c",
"==",
"JFileChooser",
".",
"ERROR_OPTION",
")",
"return",
";",
"f",
"=",
"jfc",
".",
"getSelectedFile",
"(",
")",
";",
"if",
"(",
"f",
".",
"exists",
"(",
")",
")",
"{",
"c",
"=",
"JOptionPane",
".",
"showConfirmDialog",
"(",
"null",
",",
"\"File Already Exists\\nConfirm Overwrite\"",
")",
";",
"if",
"(",
"c",
"==",
"JOptionPane",
".",
"OK_OPTION",
")",
"break",
";",
"if",
"(",
"c",
"==",
"JOptionPane",
".",
"CANCEL_OPTION",
")",
"return",
";",
"}",
"}",
"while",
"(",
"f",
".",
"exists",
"(",
")",
")",
";",
"try",
"{",
"BufferedWriter",
"out",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"f",
")",
")",
";",
"out",
".",
"write",
"(",
"\"#NOT TO BE USED FOR NAVIGATION PURPOSES\\n\"",
")",
";",
"boolean",
"firstCol",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tm",
".",
"getColumnCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
"==",
"sp",
".",
"getSurveyLineColumn",
"(",
")",
")",
"continue",
";",
"if",
"(",
"firstCol",
")",
"{",
"out",
".",
"write",
"(",
"tm",
".",
"getColumnName",
"(",
"i",
")",
")",
";",
"firstCol",
"=",
"false",
";",
"}",
"else",
"{",
"out",
".",
"write",
"(",
"\"\\t\"",
"+",
"tm",
".",
"getColumnName",
"(",
"i",
")",
")",
";",
"}",
"}",
"out",
".",
"write",
"(",
"\"\\n\"",
")",
";",
"int",
"[",
"]",
"ind",
";",
"ind",
"=",
"new",
"int",
"[",
"tm",
".",
"getRowCount",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tm",
".",
"getRowCount",
"(",
")",
";",
"i",
"++",
")",
"ind",
"[",
"i",
"]",
"=",
"i",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tm",
".",
"getRowCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"firstCol",
"=",
"true",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"tm",
".",
"getColumnCount",
"(",
")",
";",
"j",
"++",
")",
"{",
"if",
"(",
"j",
"==",
"sp",
".",
"getSurveyLineColumn",
"(",
")",
")",
"continue",
";",
"Object",
"o",
"=",
"tm",
".",
"getValueAt",
"(",
"i",
",",
"j",
")",
";",
"if",
"(",
"o",
"instanceof",
"String",
"&&",
"(",
"(",
"String",
")",
"o",
")",
".",
"equals",
"(",
"\"NaN\"",
")",
")",
"o",
"=",
"\"\"",
";",
"if",
"(",
"firstCol",
")",
"{",
"out",
".",
"write",
"(",
"o",
".",
"toString",
"(",
")",
")",
";",
"firstCol",
"=",
"false",
";",
"}",
"else",
"{",
"out",
".",
"write",
"(",
"\"\\t\"",
"+",
"o",
")",
";",
"}",
"}",
"out",
".",
"write",
"(",
"\"\\n\"",
")",
";",
"}",
"out",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"JOptionPane",
".",
"showMessageDialog",
"(",
"panel",
",",
"\"Unable to save file\"",
",",
"\"Save Error\"",
",",
"JOptionPane",
".",
"ERROR_MESSAGE",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"e",
")",
";",
"}",
"}"
] | save the survey lines to a text file | [
"save",
"the",
"survey",
"lines",
"to",
"a",
"text",
"file"
] | [
"//add disclaimer at the top of the output file"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
3238,
918,
1923,
15450,
1435,
288,
203,
203,
202,
202,
46,
812,
17324,
525,
7142,
273,
394,
804,
812,
17324,
12,
3163,
18,
588,
1396,
2932,
1355,
18,
8712,
7923,
1769,
203,
202,
202,
812,
284,
33,
2704,
1387,
2932,
22165,
5763,
18,
5830,
8863,
203,
202,
202,
78,
7142,
18,
542,
7416,
812,
12,
74,
1769,
203,
202,
202,
2896,
288,
203,
1082,
202,
474,
276,
273,
525,
7142,
18,
4500,
4755,
6353,
12,
2011,
1769,
203,
1082,
202,
430,
261,
71,
631,
46,
812,
17324,
18,
25268,
67,
7425,
20081,
71,
631,
46,
812,
17324,
18,
3589,
67,
7425,
13,
327,
31,
203,
1082,
202,
74,
273,
525,
7142,
18,
588,
7416,
812,
5621,
203,
1082,
202,
430,
261,
74,
18,
1808,
10756,
288,
203,
9506,
202,
71,
33,
46,
1895,
8485,
18,
4500,
11269,
6353,
12,
2011,
16,
315,
812,
17009,
17277,
64,
82,
11269,
29747,
8863,
203,
9506,
202,
430,
261,
71,
631,
46,
1895,
8485,
18,
3141,
67,
7425,
13,
898,
31,
203,
9506,
202,
430,
261,
71,
631,
46,
1895,
8485,
18,
25268,
67,
7425,
13,
327,
31,
203,
1082,
202,
97,
203,
202,
202,
97,
1323,
261,
74,
18,
1808,
10663,
203,
203,
202,
202,
698,
288,
203,
1082,
202,
17947,
2289,
596,
273,
394,
22490,
12,
2704,
24639,
12,
74,
10019,
203,
9506,
203,
1082,
202,
759,
1289,
1015,
830,
69,
4417,
622,
326,
1760,
434,
326,
876,
585,
203,
1082,
202,
659,
18,
2626,
2932,
7,
4400,
8493,
9722,
14988,
40,
12108,
423,
5856,
3047,
2689,
30817,
55,
64,
82,
8863,
203,
1082,
202,
6494,
1122,
914,
273,
638,
31,
203,
1082,
202,
1884,
261,
474,
277,
33,
20,
31,
77,
32,
16925,
18,
588,
1494,
1380,
5621,
77,
27245,
288,
203,
9506,
202,
430,
261,
77,
422,
1694,
18,
588,
22165,
1670,
1494,
10756,
1324,
31,
203,
9506,
202,
430,
261,
3645,
914,
13,
288,
203,
6862,
202,
659,
18,
2626,
12,
16925,
18,
588,
8516,
12,
77,
10019,
203,
6862,
202,
3645,
914,
273,
629,
31,
203,
9506,
202,
97,
469,
288,
203,
6862,
202,
659,
18,
2626,
31458,
88,
6,
397,
6118,
18,
588,
8516,
12,
77,
10019,
203,
9506,
202,
97,
203,
1082,
202,
97,
203,
1082,
202,
659,
18,
2626,
31458,
82,
8863,
203,
9506,
203,
1082,
202,
474,
8526,
1547,
31,
203,
1082,
202,
728,
273,
394,
509,
63,
16925,
18,
588,
26359,
1435,
15533,
203,
1082,
202,
1884,
261,
474,
277,
33,
20,
31,
277,
32,
16925,
18,
588,
26359,
5621,
277,
27245,
1547,
63,
77,
65,
273,
277,
31,
203,
9506,
203,
1082,
202,
1884,
261,
474,
277,
33,
20,
31,
77,
32,
16925,
18,
588,
26359,
5621,
77,
27245,
288,
203,
9506,
202,
3645,
914,
273,
638,
31,
203,
9506,
202,
1884,
261,
474,
525,
33,
20,
31,
525,
32,
16925,
18,
588,
1494,
1380,
5621,
78,
27245,
288,
203,
6862,
202,
430,
261,
78,
422,
1694,
18,
588,
22165,
1670,
1494,
10756,
1324,
31,
203,
6862,
202,
921,
320,
273,
6118,
18,
24805,
861,
12,
77,
16,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1
] | [
1,
20308,
203,
202,
380,
1923,
326,
14902,
2362,
358,
279,
977,
585,
203,
202,
1195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
3bfee38c45538bcdd15494ac601f7b01e095f864 | iedadata/geomapapp | haxby/map/CylindricalMapBorder.java | [
"Apache-2.0"
] | Java | formatNum2 | String | public String formatNum2(double inValue){
DecimalFormat twoDec = new DecimalFormat("0.00");
twoDec.setGroupingUsed(false);
return twoDec.format(inValue);
} | // Formats double into preferred decimal place. | Formats double into preferred decimal place. | [
"Formats",
"double",
"into",
"preferred",
"decimal",
"place",
"."
] | public String formatNum2(double inValue){
DecimalFormat twoDec = new DecimalFormat("0.00");
twoDec.setGroupingUsed(false);
return twoDec.format(inValue);
} | [
"public",
"String",
"formatNum2",
"(",
"double",
"inValue",
")",
"{",
"DecimalFormat",
"twoDec",
"=",
"new",
"DecimalFormat",
"(",
"\"0.00\"",
")",
";",
"twoDec",
".",
"setGroupingUsed",
"(",
"false",
")",
";",
"return",
"twoDec",
".",
"format",
"(",
"inValue",
")",
";",
"}"
] | Formats double into preferred decimal place. | [
"Formats",
"double",
"into",
"preferred",
"decimal",
"place",
"."
] | [] | [
{
"param": "inValue",
"type": "double"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "inValue",
"type": "double",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
514,
740,
2578,
22,
12,
9056,
316,
620,
15329,
203,
202,
202,
5749,
1630,
2795,
1799,
273,
394,
29665,
2932,
20,
18,
713,
8863,
203,
202,
202,
15415,
1799,
18,
542,
21014,
6668,
12,
5743,
1769,
203,
202,
202,
2463,
2795,
1799,
18,
2139,
12,
267,
620,
1769,
203,
202,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
2748,
2323,
1645,
1368,
9119,
6970,
3166,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
f2e4de63f50740f88f572088a6cd7238eeddfb7b | iedadata/geomapapp | haxby/db/custom/CustomDB.java | [
"Apache-2.0"
] | Java | save | null | public void save() {
if ( save.getSelectedItem() == "Copy Selection to Clipboard" ) {
copy();
}else if ( save.getSelectedItem() == " -Table Data to ASCII File" ) {
exportASCII("all");
}else if ( save.getSelectedItem() == " -Table Data to Excel File (.xls)" ) {
exportExcel("all");
}else if ( save.getSelectedItem() == " -Table Data to Excel File (.xlsx)" ) {
exportExcelXLSX("all");
}else if ( save.getSelectedItem() == " -Plotted Data to ASCII File" ) {
exportASCII("plottable");
}else if ( save.getSelectedItem() == " -Plotted Data to Excel File (.xls)" ) {
exportExcel("plottable");
}else if ( save.getSelectedItem() == " -Plotted Data to Excel File (.xlsx)" ) {
exportExcelXLSX("plottable");
}else if ( save.getSelectedItem() == " -Selection to ASCII File" ) {
exportASCII("selection");
}else if ( save.getSelectedItem() == " -Selection to Excel File (.xls)" ) {
exportExcel("selection");
}else if ( save.getSelectedItem() == " -Selection to Excel File (.xlsx)" ) {
exportExcelXLSX("selection");
}else if (save.getSelectedItem() == " -Table Data to Google Earth (KMZ)") {
exportKML("all");
}else if (save.getSelectedItem() == " -Plotted Data to Google Earth (KMZ)") {
exportKML("plottable");
}else if (save.getSelectedItem() == " -Selection to Google Earth (KMZ)") {
exportKML("selection");
}
save.setSelectedIndex(0); // JOC: This will now return the save combo selection back to "Save"
} | // ***** GMA 1.4.8: The save() function checks the option selected from the save combo box and invokes the appropriate save function
| GMA 1.4.8: The save() function checks the option selected from the save combo box and invokes the appropriate save function | [
"GMA",
"1",
".",
"4",
".",
"8",
":",
"The",
"save",
"()",
"function",
"checks",
"the",
"option",
"selected",
"from",
"the",
"save",
"combo",
"box",
"and",
"invokes",
"the",
"appropriate",
"save",
"function"
] | public void save() {
if ( save.getSelectedItem() == "Copy Selection to Clipboard" ) {
copy();
}else if ( save.getSelectedItem() == " -Table Data to ASCII File" ) {
exportASCII("all");
}else if ( save.getSelectedItem() == " -Table Data to Excel File (.xls)" ) {
exportExcel("all");
}else if ( save.getSelectedItem() == " -Table Data to Excel File (.xlsx)" ) {
exportExcelXLSX("all");
}else if ( save.getSelectedItem() == " -Plotted Data to ASCII File" ) {
exportASCII("plottable");
}else if ( save.getSelectedItem() == " -Plotted Data to Excel File (.xls)" ) {
exportExcel("plottable");
}else if ( save.getSelectedItem() == " -Plotted Data to Excel File (.xlsx)" ) {
exportExcelXLSX("plottable");
}else if ( save.getSelectedItem() == " -Selection to ASCII File" ) {
exportASCII("selection");
}else if ( save.getSelectedItem() == " -Selection to Excel File (.xls)" ) {
exportExcel("selection");
}else if ( save.getSelectedItem() == " -Selection to Excel File (.xlsx)" ) {
exportExcelXLSX("selection");
}else if (save.getSelectedItem() == " -Table Data to Google Earth (KMZ)") {
exportKML("all");
}else if (save.getSelectedItem() == " -Plotted Data to Google Earth (KMZ)") {
exportKML("plottable");
}else if (save.getSelectedItem() == " -Selection to Google Earth (KMZ)") {
exportKML("selection");
}
save.setSelectedIndex(0);
} | [
"public",
"void",
"save",
"(",
")",
"{",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\"Copy Selection to Clipboard\"",
")",
"{",
"copy",
"(",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Table Data to ASCII File\"",
")",
"{",
"exportASCII",
"(",
"\"all\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Table Data to Excel File (.xls)\"",
")",
"{",
"exportExcel",
"(",
"\"all\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Table Data to Excel File (.xlsx)\"",
")",
"{",
"exportExcelXLSX",
"(",
"\"all\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Plotted Data to ASCII File\"",
")",
"{",
"exportASCII",
"(",
"\"plottable\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Plotted Data to Excel File (.xls)\"",
")",
"{",
"exportExcel",
"(",
"\"plottable\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Plotted Data to Excel File (.xlsx)\"",
")",
"{",
"exportExcelXLSX",
"(",
"\"plottable\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Selection to ASCII File\"",
")",
"{",
"exportASCII",
"(",
"\"selection\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Selection to Excel File (.xls)\"",
")",
"{",
"exportExcel",
"(",
"\"selection\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Selection to Excel File (.xlsx)\"",
")",
"{",
"exportExcelXLSX",
"(",
"\"selection\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Table Data to Google Earth (KMZ)\"",
")",
"{",
"exportKML",
"(",
"\"all\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Plotted Data to Google Earth (KMZ)\"",
")",
"{",
"exportKML",
"(",
"\"plottable\"",
")",
";",
"}",
"else",
"if",
"(",
"save",
".",
"getSelectedItem",
"(",
")",
"==",
"\" -Selection to Google Earth (KMZ)\"",
")",
"{",
"exportKML",
"(",
"\"selection\"",
")",
";",
"}",
"save",
".",
"setSelectedIndex",
"(",
"0",
")",
";",
"}"
] | GMA 1.4.8: The save() function checks the option selected from the save combo box and invokes the appropriate save function | [
"GMA",
"1",
".",
"4",
".",
"8",
":",
"The",
"save",
"()",
"function",
"checks",
"the",
"option",
"selected",
"from",
"the",
"save",
"combo",
"box",
"and",
"invokes",
"the",
"appropriate",
"save",
"function"
] | [
"// JOC: This will now return the save combo selection back to \"Save\"\r"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
1923,
1435,
288,
206,
203,
202,
202,
430,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
2951,
12977,
358,
385,
3169,
3752,
6,
262,
288,
206,
203,
1082,
202,
3530,
5621,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
1388,
1910,
358,
11768,
1387,
6,
262,
288,
206,
203,
1082,
202,
6530,
13756,
2932,
454,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
1388,
1910,
358,
17674,
1387,
261,
18,
92,
3251,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
2932,
454,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
1388,
1910,
358,
17674,
1387,
261,
18,
92,
14917,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
60,
3045,
60,
2932,
454,
8863,
202,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
11532,
2344,
1910,
358,
11768,
1387,
6,
262,
288,
206,
203,
1082,
202,
6530,
13756,
2932,
4032,
2121,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
11532,
2344,
1910,
358,
17674,
1387,
261,
18,
92,
3251,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
2932,
4032,
2121,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
11532,
2344,
1910,
358,
17674,
1387,
261,
18,
92,
14917,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
60,
3045,
60,
2932,
4032,
2121,
8863,
9506,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
6233,
358,
11768,
1387,
6,
262,
288,
206,
203,
1082,
202,
6530,
13756,
2932,
10705,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
6233,
358,
17674,
1387,
261,
18,
92,
3251,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
2932,
10705,
8863,
206,
203,
202,
202,
97,
12107,
309,
261,
1923,
18,
588,
7416,
1180,
1435,
422,
315,
300,
6233,
358,
17674,
1387,
261,
18,
92,
14917,
2225,
262,
288,
206,
203,
1082,
202,
6530,
7177,
60,
3045,
60,
2932,
10705,
8863,
1082,
206,
203,
202,
202,
97,
12107,
309,
261,
5688,
18,
588,
7416,
1180,
1435,
422,
315,
300,
1388,
1910,
358,
6124,
512,
27076,
261,
47,
49,
62,
2225,
13,
288,
206,
203,
1082,
202,
6530,
47,
1495,
2932,
454,
8863,
1082,
206,
203,
202,
202,
97,
12107,
309,
261,
5688,
18,
588,
7416,
1180,
1435,
422,
315,
300,
11532,
2344,
1910,
358,
6124,
512,
27076,
261,
47,
49,
62,
2225,
13,
288,
206,
203,
1082,
202,
6530,
47,
1495,
2932,
4032,
2121,
8863,
202,
206,
203,
202,
202,
97,
12107,
309,
261,
5688,
18,
588,
7416,
1180,
1435,
422,
315,
300,
6233,
358,
6124,
512,
27076,
261,
47,
49,
62,
2225,
13,
288,
206,
203,
1082,
202,
6530,
47,
1495,
2932,
10705,
8863,
206,
203,
202,
202,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
326,
1923,
16778,
3919,
471,
18058,
326,
5505,
1923,
445,
206,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
f2e4de63f50740f88f572088a6cd7238eeddfb7b | iedadata/geomapapp | haxby/db/custom/CustomDB.java | [
"Apache-2.0"
] | Java | togglePlotAll | null | public void togglePlotAll() {
UnknownDataSet d = (UnknownDataSet) box.getSelectedItem();
if ( plotAllB.isSelected() ) {
d.rememberPlottableStatus();
d.makeAllPlottable();
} else {
d.revertToOldPlottableStatus();
}
map.moveOverlayToTop(d);
d.dataT.repaint();
map.repaint();
} | //toggle between plotting all datapoints and only the ones that the user has selected
| toggle between plotting all datapoints and only the ones that the user has selected | [
"toggle",
"between",
"plotting",
"all",
"datapoints",
"and",
"only",
"the",
"ones",
"that",
"the",
"user",
"has",
"selected"
] | public void togglePlotAll() {
UnknownDataSet d = (UnknownDataSet) box.getSelectedItem();
if ( plotAllB.isSelected() ) {
d.rememberPlottableStatus();
d.makeAllPlottable();
} else {
d.revertToOldPlottableStatus();
}
map.moveOverlayToTop(d);
d.dataT.repaint();
map.repaint();
} | [
"public",
"void",
"togglePlotAll",
"(",
")",
"{",
"UnknownDataSet",
"d",
"=",
"(",
"UnknownDataSet",
")",
"box",
".",
"getSelectedItem",
"(",
")",
";",
"if",
"(",
"plotAllB",
".",
"isSelected",
"(",
")",
")",
"{",
"d",
".",
"rememberPlottableStatus",
"(",
")",
";",
"d",
".",
"makeAllPlottable",
"(",
")",
";",
"}",
"else",
"{",
"d",
".",
"revertToOldPlottableStatus",
"(",
")",
";",
"}",
"map",
".",
"moveOverlayToTop",
"(",
"d",
")",
";",
"d",
".",
"dataT",
".",
"repaint",
"(",
")",
";",
"map",
".",
"repaint",
"(",
")",
";",
"}"
] | toggle between plotting all datapoints and only the ones that the user has selected | [
"toggle",
"between",
"plotting",
"all",
"datapoints",
"and",
"only",
"the",
"ones",
"that",
"the",
"user",
"has",
"selected"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
10486,
11532,
1595,
1435,
288,
206,
203,
202,
202,
4874,
13676,
302,
273,
261,
4874,
13676,
13,
3919,
18,
588,
7416,
1180,
5621,
206,
203,
206,
203,
202,
202,
430,
261,
3207,
1595,
38,
18,
291,
7416,
1435,
262,
288,
206,
203,
1082,
202,
72,
18,
28155,
11532,
2121,
1482,
5621,
206,
203,
1082,
202,
72,
18,
6540,
1595,
11532,
2121,
5621,
206,
203,
202,
202,
97,
469,
288,
206,
203,
1082,
202,
72,
18,
266,
1097,
774,
7617,
11532,
2121,
1482,
5621,
206,
203,
202,
202,
97,
206,
203,
202,
202,
1458,
18,
8501,
11627,
774,
3401,
12,
72,
1769,
206,
203,
202,
202,
72,
18,
892,
56,
18,
14462,
1598,
5621,
206,
203,
202,
202,
1458,
18,
14462,
1598,
5621,
206,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
14401,
3086,
20947,
777,
27725,
471,
1338,
326,
5945,
716,
326,
729,
711,
3170,
206,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
7cf4dc0f86a6ff1246c8f7a658013b39d01d5502 | iedadata/geomapapp | haxby/db/pdb/PDBAnalysisModel.java | [
"Apache-2.0"
] | Java | sortByColumn | null | public synchronized void sortByColumn(int col) {
if (lastSortedCol == col)
ascent = !ascent;
else
ascent = true;
lastSortedCol = col;
Collections.sort(analyses, columnSorter);
updateAnalysisIndexMap();
fireTableDataChanged();
} | // Sorts on column col, alternating between ascent and descent | Sorts on column col, alternating between ascent and descent | [
"Sorts",
"on",
"column",
"col",
"alternating",
"between",
"ascent",
"and",
"descent"
] | public synchronized void sortByColumn(int col) {
if (lastSortedCol == col)
ascent = !ascent;
else
ascent = true;
lastSortedCol = col;
Collections.sort(analyses, columnSorter);
updateAnalysisIndexMap();
fireTableDataChanged();
} | [
"public",
"synchronized",
"void",
"sortByColumn",
"(",
"int",
"col",
")",
"{",
"if",
"(",
"lastSortedCol",
"==",
"col",
")",
"ascent",
"=",
"!",
"ascent",
";",
"else",
"ascent",
"=",
"true",
";",
"lastSortedCol",
"=",
"col",
";",
"Collections",
".",
"sort",
"(",
"analyses",
",",
"columnSorter",
")",
";",
"updateAnalysisIndexMap",
"(",
")",
";",
"fireTableDataChanged",
"(",
")",
";",
"}"
] | Sorts on column col, alternating between ascent and descent | [
"Sorts",
"on",
"column",
"col",
"alternating",
"between",
"ascent",
"and",
"descent"
] | [] | [
{
"param": "col",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "col",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
3852,
918,
14021,
1494,
12,
474,
645,
13,
288,
203,
202,
202,
430,
261,
2722,
11739,
914,
422,
645,
13,
203,
1082,
202,
345,
2998,
273,
401,
345,
2998,
31,
203,
202,
202,
12107,
203,
1082,
202,
345,
2998,
273,
638,
31,
203,
202,
202,
2722,
11739,
914,
273,
645,
31,
203,
203,
202,
202,
15150,
18,
3804,
12,
304,
23723,
16,
1057,
24952,
1769,
203,
203,
202,
202,
2725,
9418,
1016,
863,
5621,
203,
202,
202,
12179,
1388,
751,
5033,
5621,
203,
202,
97,
2,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
5928,
87,
603,
1057,
645,
16,
6416,
1776,
3086,
487,
2998,
471,
3044,
319,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | loadSessionCustomMainMenu | null | public void loadSessionCustomMainMenu() {
//Retrieving XML main menus
String mainMenuURL = System.getProperty("geomapapp.menus_url");
// Check to make sure xml files are in layers dir.
File customMenuURL = new File(layerSessionDir, "SessionsMenu.xml");
File sessionsFile = new File(layerSessionDir, "MySessions.xml");
if (mainMenuURL == null) {
//mainMenuURL = PathUtil.getPath("MENU_PATH",MapApp.BASE_URL+"/gma_menus/main_menu.xml"); // 3.5.2 and older
mainMenuURL = PathUtil.getPath("NEW_MENU_PATH_2015",MapApp.BASE_URL+"/gma_menus/main_menu_new_2015.xml");
}
if(!customMenuURL.exists()) {
//Check and create.
LayerManager.checkLayerFileStructure();
}
try {
XML_Menu.setMapApp(this);
menuBar = XML_Menu.createMainMenuBars(XML_Menu.parse(mainMenuURL),XML_Menu.parse(customMenuURL));
frame.setJMenuBar(menuBar);
//Delete the tmp Session file
File tmp = new File(layerSessionDir + File.separator + "MySessions.xml.tmp");
if (tmp.exists() && !tmp.delete()) {
System.out.println("Could not delete file");
return;
}
} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
} catch (ParserConfigurationException e1) {
e1.printStackTrace();
} catch (SAXException e1) {
e1.printStackTrace();
}
} | // Loads custom GMA regular XML menu | Loads custom GMA regular XML menu | [
"Loads",
"custom",
"GMA",
"regular",
"XML",
"menu"
] | public void loadSessionCustomMainMenu() {
String mainMenuURL = System.getProperty("geomapapp.menus_url");
File customMenuURL = new File(layerSessionDir, "SessionsMenu.xml");
File sessionsFile = new File(layerSessionDir, "MySessions.xml");
if (mainMenuURL == null) {
mainMenuURL = PathUtil.getPath("NEW_MENU_PATH_2015",MapApp.BASE_URL+"/gma_menus/main_menu_new_2015.xml");
}
if(!customMenuURL.exists()) {
LayerManager.checkLayerFileStructure();
}
try {
XML_Menu.setMapApp(this);
menuBar = XML_Menu.createMainMenuBars(XML_Menu.parse(mainMenuURL),XML_Menu.parse(customMenuURL));
frame.setJMenuBar(menuBar);
File tmp = new File(layerSessionDir + File.separator + "MySessions.xml.tmp");
if (tmp.exists() && !tmp.delete()) {
System.out.println("Could not delete file");
return;
}
} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
} catch (ParserConfigurationException e1) {
e1.printStackTrace();
} catch (SAXException e1) {
e1.printStackTrace();
}
} | [
"public",
"void",
"loadSessionCustomMainMenu",
"(",
")",
"{",
"String",
"mainMenuURL",
"=",
"System",
".",
"getProperty",
"(",
"\"geomapapp.menus_url\"",
")",
";",
"File",
"customMenuURL",
"=",
"new",
"File",
"(",
"layerSessionDir",
",",
"\"SessionsMenu.xml\"",
")",
";",
"File",
"sessionsFile",
"=",
"new",
"File",
"(",
"layerSessionDir",
",",
"\"MySessions.xml\"",
")",
";",
"if",
"(",
"mainMenuURL",
"==",
"null",
")",
"{",
"mainMenuURL",
"=",
"PathUtil",
".",
"getPath",
"(",
"\"NEW_MENU_PATH_2015\"",
",",
"MapApp",
".",
"BASE_URL",
"+",
"\"/gma_menus/main_menu_new_2015.xml\"",
")",
";",
"}",
"if",
"(",
"!",
"customMenuURL",
".",
"exists",
"(",
")",
")",
"{",
"LayerManager",
".",
"checkLayerFileStructure",
"(",
")",
";",
"}",
"try",
"{",
"XML_Menu",
".",
"setMapApp",
"(",
"this",
")",
";",
"menuBar",
"=",
"XML_Menu",
".",
"createMainMenuBars",
"(",
"XML_Menu",
".",
"parse",
"(",
"mainMenuURL",
")",
",",
"XML_Menu",
".",
"parse",
"(",
"customMenuURL",
")",
")",
";",
"frame",
".",
"setJMenuBar",
"(",
"menuBar",
")",
";",
"File",
"tmp",
"=",
"new",
"File",
"(",
"layerSessionDir",
"+",
"File",
".",
"separator",
"+",
"\"MySessions.xml.tmp\"",
")",
";",
"if",
"(",
"tmp",
".",
"exists",
"(",
")",
"&&",
"!",
"tmp",
".",
"delete",
"(",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Could not delete file\"",
")",
";",
"return",
";",
"}",
"}",
"catch",
"(",
"MalformedURLException",
"e1",
")",
"{",
"e1",
".",
"printStackTrace",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e1",
")",
"{",
"e1",
".",
"printStackTrace",
"(",
")",
";",
"}",
"catch",
"(",
"ParserConfigurationException",
"e1",
")",
"{",
"e1",
".",
"printStackTrace",
"(",
")",
";",
"}",
"catch",
"(",
"SAXException",
"e1",
")",
"{",
"e1",
".",
"printStackTrace",
"(",
")",
";",
"}",
"}"
] | Loads custom GMA regular XML menu | [
"Loads",
"custom",
"GMA",
"regular",
"XML",
"menu"
] | [
"//Retrieving XML main menus",
"// Check to make sure xml files are in layers dir.",
"//mainMenuURL = PathUtil.getPath(\"MENU_PATH\",MapApp.BASE_URL+\"/gma_menus/main_menu.xml\"); // 3.5.2 and older",
"//Check and create.",
"//Delete the tmp Session file"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
1262,
2157,
3802,
6376,
4599,
1435,
288,
203,
202,
202,
759,
3848,
6282,
3167,
2774,
21374,
203,
202,
202,
780,
2774,
4599,
1785,
273,
2332,
18,
588,
1396,
2932,
10049,
438,
2910,
18,
26065,
67,
718,
8863,
203,
202,
202,
759,
2073,
358,
1221,
3071,
2025,
1390,
854,
316,
6623,
1577,
18,
203,
202,
202,
812,
1679,
4599,
1785,
273,
394,
1387,
12,
6363,
2157,
1621,
16,
315,
13566,
4599,
18,
2902,
8863,
203,
202,
202,
812,
8856,
812,
273,
394,
1387,
12,
6363,
2157,
1621,
16,
315,
12062,
13566,
18,
2902,
8863,
203,
203,
202,
202,
430,
261,
5254,
4599,
1785,
422,
446,
13,
288,
203,
1082,
202,
759,
5254,
4599,
1785,
273,
2666,
1304,
18,
588,
743,
2932,
29227,
67,
4211,
3113,
863,
3371,
18,
8369,
67,
1785,
9078,
19,
75,
2540,
67,
26065,
19,
5254,
67,
5414,
18,
2902,
8863,
368,
890,
18,
25,
18,
22,
471,
12156,
203,
1082,
202,
5254,
4599,
1785,
273,
2666,
1304,
18,
588,
743,
2932,
12917,
67,
29227,
67,
4211,
67,
26709,
3113,
863,
3371,
18,
8369,
67,
1785,
9078,
19,
75,
2540,
67,
26065,
19,
5254,
67,
5414,
67,
2704,
67,
26709,
18,
2902,
8863,
203,
202,
202,
97,
203,
202,
202,
430,
12,
5,
3662,
4599,
1785,
18,
1808,
10756,
288,
203,
1082,
202,
759,
1564,
471,
752,
18,
203,
9506,
202,
4576,
1318,
18,
1893,
4576,
812,
6999,
5621,
203,
1082,
202,
97,
203,
203,
202,
202,
698,
288,
203,
1082,
202,
4201,
67,
4599,
18,
542,
863,
3371,
12,
2211,
1769,
203,
1082,
202,
5414,
5190,
273,
3167,
67,
4599,
18,
2640,
6376,
4599,
5190,
87,
12,
4201,
67,
4599,
18,
2670,
12,
5254,
4599,
1785,
3631,
4201,
67,
4599,
18,
2670,
12,
3662,
4599,
1785,
10019,
203,
1082,
202,
3789,
18,
542,
46,
4599,
5190,
12,
5414,
5190,
1769,
203,
203,
1082,
202,
759,
2613,
326,
1853,
3877,
585,
203,
1082,
202,
812,
1853,
273,
394,
1387,
12,
6363,
2157,
1621,
397,
1387,
18,
11287,
397,
315,
12062,
13566,
18,
2902,
18,
5645,
8863,
203,
1082,
202,
430,
261,
5645,
18,
1808,
1435,
597,
401,
5645,
18,
3733,
10756,
288,
203,
9506,
202,
3163,
18,
659,
18,
8222,
2932,
4445,
486,
1430,
585,
8863,
203,
9506,
202,
2463,
31,
203,
1082,
202,
97,
203,
202,
202,
97,
1044,
261,
18695,
20160,
425,
21,
13,
288,
203,
1082,
202,
73,
21,
18,
1188,
6332,
5621,
203,
202,
202,
97,
1044,
261,
14106,
425,
21,
13,
288,
203,
1082,
202,
73,
21,
18,
1188,
6332,
5621,
203,
202,
202,
97,
1044,
261,
2678,
10737,
425,
21,
13,
288,
203,
1082,
202,
73,
21,
18,
1188,
6332,
5621,
203,
202,
202,
97,
1044,
261,
55,
2501,
503,
425,
21,
13,
288,
203,
1082,
202,
73,
21,
18,
1188,
6332,
5621,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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
3167,
3824,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | accessDatabaseMenuItems | null | public void accessDatabaseMenuItems(final String accessItem) {
for( int i=0 ; i<db.length ; i++) {
if( accessItem.equals( db[i].getDBName()) ) {
final Database database = db[i];
addProcessingTask(database.getDBName(), new Runnable() {
public void run() {
Runtime rt = Runtime.getRuntime();
long free = rt.freeMemory()/1024/1024;
long total = rt.totalMemory()/1024/1024;
System.out.println("before:\t" + free +" MB Free,\t" + (total-free) +" MB used");
if(database.loadDB()) {
disableCurrentDB();
currentDB = database;
currentDB.setEnabled(true);
addCurrentDBToDisplay();
while( map.hasOverlay( database ) ) {
map.removeOverlay(database);
}
map.addOverlay(database.getDBName(), database );
}
free = rt.freeMemory()/1024/1024;
total = rt.totalMemory()/1024/1024;
System.out.println("after:\t" + free +" MB Free,\t" + (total-free) +" MB used");
map.repaint();
}
});
}
}
if ( accessItem == "Drilling-DSDP/ODP/BRG" ) {
showDSDP();
}
} | // ***** GMA 1.5.2: Add function to access "Database" menu menu items | GMA 1.5.2: Add function to access "Database" menu menu items | [
"GMA",
"1",
".",
"5",
".",
"2",
":",
"Add",
"function",
"to",
"access",
"\"",
"Database",
"\"",
"menu",
"menu",
"items"
] | public void accessDatabaseMenuItems(final String accessItem) {
for( int i=0 ; i<db.length ; i++) {
if( accessItem.equals( db[i].getDBName()) ) {
final Database database = db[i];
addProcessingTask(database.getDBName(), new Runnable() {
public void run() {
Runtime rt = Runtime.getRuntime();
long free = rt.freeMemory()/1024/1024;
long total = rt.totalMemory()/1024/1024;
System.out.println("before:\t" + free +" MB Free,\t" + (total-free) +" MB used");
if(database.loadDB()) {
disableCurrentDB();
currentDB = database;
currentDB.setEnabled(true);
addCurrentDBToDisplay();
while( map.hasOverlay( database ) ) {
map.removeOverlay(database);
}
map.addOverlay(database.getDBName(), database );
}
free = rt.freeMemory()/1024/1024;
total = rt.totalMemory()/1024/1024;
System.out.println("after:\t" + free +" MB Free,\t" + (total-free) +" MB used");
map.repaint();
}
});
}
}
if ( accessItem == "Drilling-DSDP/ODP/BRG" ) {
showDSDP();
}
} | [
"public",
"void",
"accessDatabaseMenuItems",
"(",
"final",
"String",
"accessItem",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"db",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"accessItem",
".",
"equals",
"(",
"db",
"[",
"i",
"]",
".",
"getDBName",
"(",
")",
")",
")",
"{",
"final",
"Database",
"database",
"=",
"db",
"[",
"i",
"]",
";",
"addProcessingTask",
"(",
"database",
".",
"getDBName",
"(",
")",
",",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"Runtime",
"rt",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
";",
"long",
"free",
"=",
"rt",
".",
"freeMemory",
"(",
")",
"/",
"1024",
"/",
"1024",
";",
"long",
"total",
"=",
"rt",
".",
"totalMemory",
"(",
")",
"/",
"1024",
"/",
"1024",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"before:\\t\"",
"+",
"free",
"+",
"\" MB Free,\\t\"",
"+",
"(",
"total",
"-",
"free",
")",
"+",
"\" MB used\"",
")",
";",
"if",
"(",
"database",
".",
"loadDB",
"(",
")",
")",
"{",
"disableCurrentDB",
"(",
")",
";",
"currentDB",
"=",
"database",
";",
"currentDB",
".",
"setEnabled",
"(",
"true",
")",
";",
"addCurrentDBToDisplay",
"(",
")",
";",
"while",
"(",
"map",
".",
"hasOverlay",
"(",
"database",
")",
")",
"{",
"map",
".",
"removeOverlay",
"(",
"database",
")",
";",
"}",
"map",
".",
"addOverlay",
"(",
"database",
".",
"getDBName",
"(",
")",
",",
"database",
")",
";",
"}",
"free",
"=",
"rt",
".",
"freeMemory",
"(",
")",
"/",
"1024",
"/",
"1024",
";",
"total",
"=",
"rt",
".",
"totalMemory",
"(",
")",
"/",
"1024",
"/",
"1024",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"after:\\t\"",
"+",
"free",
"+",
"\" MB Free,\\t\"",
"+",
"(",
"total",
"-",
"free",
")",
"+",
"\" MB used\"",
")",
";",
"map",
".",
"repaint",
"(",
")",
";",
"}",
"}",
")",
";",
"}",
"}",
"if",
"(",
"accessItem",
"==",
"\"Drilling-DSDP/ODP/BRG\"",
")",
"{",
"showDSDP",
"(",
")",
";",
"}",
"}"
] | GMA 1.5.2: Add function to access "Database" menu menu items | [
"GMA",
"1",
".",
"5",
".",
"2",
":",
"Add",
"function",
"to",
"access",
"\"",
"Database",
"\"",
"menu",
"menu",
"items"
] | [] | [
{
"param": "accessItem",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "accessItem",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
2006,
4254,
4599,
3126,
12,
6385,
514,
2006,
1180,
13,
288,
203,
202,
202,
1884,
12,
509,
277,
33,
20,
274,
277,
32,
1966,
18,
2469,
274,
277,
27245,
288,
203,
1082,
202,
430,
12,
2006,
1180,
18,
14963,
12,
1319,
63,
77,
8009,
588,
2290,
461,
10756,
262,
288,
203,
203,
9506,
202,
6385,
5130,
2063,
273,
1319,
63,
77,
15533,
203,
9506,
202,
1289,
7798,
2174,
12,
6231,
18,
588,
2290,
461,
9334,
394,
10254,
1435,
288,
203,
6862,
202,
482,
918,
1086,
1435,
288,
203,
25083,
202,
5576,
8253,
273,
2509,
18,
588,
5576,
5621,
203,
25083,
202,
5748,
4843,
273,
8253,
18,
9156,
6031,
1435,
19,
2163,
3247,
19,
2163,
3247,
31,
203,
25083,
202,
5748,
2078,
273,
8253,
18,
4963,
6031,
1435,
19,
2163,
3247,
19,
2163,
3247,
31,
203,
25083,
202,
3163,
18,
659,
18,
8222,
2932,
5771,
5581,
88,
6,
397,
4843,
397,
6,
17897,
15217,
17211,
88,
6,
397,
261,
4963,
17,
9156,
13,
397,
6,
17897,
1399,
8863,
203,
25083,
202,
430,
12,
6231,
18,
945,
2290,
10756,
288,
203,
6862,
1082,
202,
8394,
3935,
2290,
5621,
203,
203,
6862,
1082,
202,
2972,
2290,
273,
2063,
31,
203,
6862,
1082,
202,
2972,
2290,
18,
542,
1526,
12,
3767,
1769,
203,
203,
6862,
1082,
202,
1289,
3935,
2290,
774,
4236,
5621,
203,
203,
6862,
1082,
202,
17523,
12,
852,
18,
5332,
11627,
12,
2063,
262,
262,
288,
203,
6862,
9506,
202,
1458,
18,
4479,
11627,
12,
6231,
1769,
203,
6862,
1082,
202,
97,
203,
6862,
1082,
202,
1458,
18,
1289,
11627,
12,
6231,
18,
588,
2290,
461,
9334,
2063,
11272,
203,
25083,
202,
97,
203,
25083,
202,
9156,
273,
8253,
18,
9156,
6031,
1435,
19,
2163,
3247,
19,
2163,
3247,
31,
203,
25083,
202,
4963,
273,
8253,
18,
4963,
6031,
1435,
19,
2163,
3247,
19,
2163,
3247,
31,
203,
25083,
202,
3163,
18,
659,
18,
8222,
2932,
5205,
5581,
88,
6,
397,
4843,
397,
6,
17897,
15217,
17211,
88,
6,
397,
261,
4963,
17,
9156,
13,
397,
6,
17897,
1399,
8863,
203,
25083,
202,
1458,
18,
14462,
1598,
5621,
203,
6862,
202,
97,
203,
9506,
202,
22938,
203,
1082,
202,
97,
203,
202,
202,
97,
203,
202,
202,
430,
261,
2006,
1180,
422,
315,
8956,
5789,
17,
3948,
8640,
19,
1212,
52,
19,
7192,
43,
6,
262,
288,
203,
1082,
202,
4500,
3948,
8640,
5621,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
202,
23490,
611,
5535,
404,
18,
25,
18,
22,
30,
1436,
445,
358,
2006,
315,
4254,
6,
3824,
3824,
1516,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | addShapeFile | null | public void addShapeFile(String layerURL) {
try {
tools.suite.addShapeFile(layerURL);
if ( !tools.shapeTB.isSelected() ) {
tools.shapeTB.doClick();
}
else {
tools.shapes.setVisible(true);
}
initializeColorScale();
} catch (IOException e) {
e.printStackTrace();
}
} | // GMA 1.5.2: Get tools.suite.layers for the layer tree to give to data portal | GMA 1.5.2: Get tools.suite.layers for the layer tree to give to data portal | [
"GMA",
"1",
".",
"5",
".",
"2",
":",
"Get",
"tools",
".",
"suite",
".",
"layers",
"for",
"the",
"layer",
"tree",
"to",
"give",
"to",
"data",
"portal"
] | public void addShapeFile(String layerURL) {
try {
tools.suite.addShapeFile(layerURL);
if ( !tools.shapeTB.isSelected() ) {
tools.shapeTB.doClick();
}
else {
tools.shapes.setVisible(true);
}
initializeColorScale();
} catch (IOException e) {
e.printStackTrace();
}
} | [
"public",
"void",
"addShapeFile",
"(",
"String",
"layerURL",
")",
"{",
"try",
"{",
"tools",
".",
"suite",
".",
"addShapeFile",
"(",
"layerURL",
")",
";",
"if",
"(",
"!",
"tools",
".",
"shapeTB",
".",
"isSelected",
"(",
")",
")",
"{",
"tools",
".",
"shapeTB",
".",
"doClick",
"(",
")",
";",
"}",
"else",
"{",
"tools",
".",
"shapes",
".",
"setVisible",
"(",
"true",
")",
";",
"}",
"initializeColorScale",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"}"
] | GMA 1.5.2: Get tools.suite.layers for the layer tree to give to data portal | [
"GMA",
"1",
".",
"5",
".",
"2",
":",
"Get",
"tools",
".",
"suite",
".",
"layers",
"for",
"the",
"layer",
"tree",
"to",
"give",
"to",
"data",
"portal"
] | [] | [
{
"param": "layerURL",
"type": "String"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "layerURL",
"type": "String",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
527,
8500,
812,
12,
780,
3018,
1785,
13,
288,
203,
202,
202,
698,
288,
203,
1082,
202,
6642,
18,
30676,
18,
1289,
8500,
812,
12,
6363,
1785,
1769,
203,
1082,
202,
430,
261,
401,
6642,
18,
4867,
25730,
18,
291,
7416,
1435,
262,
288,
203,
9506,
202,
6642,
18,
4867,
25730,
18,
2896,
6563,
5621,
203,
1082,
202,
97,
203,
1082,
202,
12107,
288,
203,
9506,
202,
6642,
18,
17648,
18,
542,
6207,
12,
3767,
1769,
203,
1082,
202,
97,
203,
1082,
202,
11160,
2957,
5587,
5621,
203,
203,
202,
202,
97,
1044,
261,
14106,
425,
13,
288,
203,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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
611,
5535,
404,
18,
25,
18,
22,
30,
968,
8513,
18,
30676,
18,
10396,
364,
326,
3018,
2151,
358,
8492,
358,
501,
11899,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | autoFocus | null | public void autoFocus() {
synchronized (autoFocusLock) {
if (focusTime == -1) {
focusTime = System.currentTimeMillis() + AUTO_FOCUS_WAIT;
Thread t =new Thread("Focus Thread" + focusTime) {
public void run() {
while (System.currentTimeMillis() < focusTime)
try {
sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (focusTime!=-1) {
mapFocus();
}
}
};
t.setDaemon(true);
t.start();
} else{
focusTime = System.currentTimeMillis() + AUTO_FOCUS_WAIT;
}
}
} | /**
* Adds another request for an autofocus.
* MapApp will wait AUTO_FOCUS_WAIT ms until focusing
* MapApp will only autofocus if the autoFocus Check box is selected
* If autoFocus() is called while waiting the timer will be set back to 0
* and wait another AUTO_FOCUS_WAIT seconds
*/ | Adds another request for an autofocus.
MapApp will wait AUTO_FOCUS_WAIT ms until focusing
MapApp will only autofocus if the autoFocus Check box is selected
If autoFocus() is called while waiting the timer will be set back to 0
and wait another AUTO_FOCUS_WAIT seconds | [
"Adds",
"another",
"request",
"for",
"an",
"autofocus",
".",
"MapApp",
"will",
"wait",
"AUTO_FOCUS_WAIT",
"ms",
"until",
"focusing",
"MapApp",
"will",
"only",
"autofocus",
"if",
"the",
"autoFocus",
"Check",
"box",
"is",
"selected",
"If",
"autoFocus",
"()",
"is",
"called",
"while",
"waiting",
"the",
"timer",
"will",
"be",
"set",
"back",
"to",
"0",
"and",
"wait",
"another",
"AUTO_FOCUS_WAIT",
"seconds"
] | public void autoFocus() {
synchronized (autoFocusLock) {
if (focusTime == -1) {
focusTime = System.currentTimeMillis() + AUTO_FOCUS_WAIT;
Thread t =new Thread("Focus Thread" + focusTime) {
public void run() {
while (System.currentTimeMillis() < focusTime)
try {
sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (focusTime!=-1) {
mapFocus();
}
}
};
t.setDaemon(true);
t.start();
} else{
focusTime = System.currentTimeMillis() + AUTO_FOCUS_WAIT;
}
}
} | [
"public",
"void",
"autoFocus",
"(",
")",
"{",
"synchronized",
"(",
"autoFocusLock",
")",
"{",
"if",
"(",
"focusTime",
"==",
"-",
"1",
")",
"{",
"focusTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"AUTO_FOCUS_WAIT",
";",
"Thread",
"t",
"=",
"new",
"Thread",
"(",
"\"Focus Thread\"",
"+",
"focusTime",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"while",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"<",
"focusTime",
")",
"try",
"{",
"sleep",
"(",
"200",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"if",
"(",
"focusTime",
"!=",
"-",
"1",
")",
"{",
"mapFocus",
"(",
")",
";",
"}",
"}",
"}",
";",
"t",
".",
"setDaemon",
"(",
"true",
")",
";",
"t",
".",
"start",
"(",
")",
";",
"}",
"else",
"{",
"focusTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"AUTO_FOCUS_WAIT",
";",
"}",
"}",
"}"
] | Adds another request for an autofocus. | [
"Adds",
"another",
"request",
"for",
"an",
"autofocus",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
3656,
9233,
1435,
288,
203,
202,
202,
22043,
261,
6079,
9233,
2531,
13,
288,
203,
1082,
202,
430,
261,
13923,
950,
422,
300,
21,
13,
288,
203,
9506,
202,
13923,
950,
273,
2332,
18,
2972,
28512,
1435,
397,
17191,
67,
3313,
39,
3378,
67,
19046,
31,
203,
9506,
202,
3830,
268,
273,
2704,
4884,
2932,
9233,
4884,
6,
397,
7155,
950,
13,
288,
203,
6862,
202,
482,
918,
1086,
1435,
288,
203,
25083,
202,
17523,
261,
3163,
18,
2972,
28512,
1435,
411,
7155,
950,
13,
203,
6862,
1082,
202,
698,
288,
203,
6862,
9506,
202,
19607,
12,
6976,
1769,
203,
6862,
1082,
202,
97,
1044,
261,
24485,
503,
425,
13,
288,
203,
6862,
9506,
202,
73,
18,
1188,
6332,
5621,
203,
25083,
202,
97,
203,
25083,
202,
430,
261,
13923,
950,
5,
29711,
21,
13,
288,
203,
6862,
1082,
202,
1458,
9233,
5621,
203,
25083,
202,
97,
203,
6862,
202,
97,
203,
9506,
202,
20451,
203,
9506,
202,
88,
18,
542,
12858,
12,
3767,
1769,
203,
9506,
202,
88,
18,
1937,
5621,
203,
1082,
202,
97,
469,
95,
203,
9506,
202,
13923,
950,
273,
2332,
18,
2972,
28512,
1435,
397,
17191,
67,
3313,
39,
3378,
67,
19046,
31,
203,
1082,
202,
97,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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,
203,
202,
14,
1635,
3371,
903,
2529,
17191,
67,
3313,
39,
3378,
67,
19046,
4086,
3180,
7155,
310,
203,
202,
14,
1635,
3371,
903,
1338,
30181,
4560,
309,
326,
3656,
9233,
2073,
3919,
353,
3170,
203,
202,
14,
971,
3656,
9233,
1435,
353,
2566,
1323,
7336,
326,
5441,
903,
506,
444,
1473,
358,
374,
203,
202,
14,
225,
471,
2529,
4042,
17191,
67,
3313,
39,
3378,
67,
19046,
3974,
203,
202,
5549,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | clearCache | null | protected static void clearCache(File file) throws IOException {
if(file.isDirectory()) {
//directory is empty, then delete it
if(file.list().length==0) {
file.delete();
} else {
//List all the directory contents
String files[] = file.list();
for (String temp : files) {
//Construct the file structure
File fileDelete = new File(file, temp);
//Recursive delete
clearCache(fileDelete);
}
//Check the directory again, if empty then delete it
if(file.list().length==0) {
file.delete();
//System.out.println("Removed Cache directory: " + file.getAbsolutePath());
}
}
} else {
//if file, then delete it
file.delete();
//System.out.println("Removed Cache File : " + file.getAbsolutePath());
}
} | // Clear cache recursively from given dir. | Clear cache recursively from given dir. | [
"Clear",
"cache",
"recursively",
"from",
"given",
"dir",
"."
] | protected static void clearCache(File file) throws IOException {
if(file.isDirectory()) {
if(file.list().length==0) {
file.delete();
} else {
String files[] = file.list();
for (String temp : files) {
File fileDelete = new File(file, temp);
clearCache(fileDelete);
}
if(file.list().length==0) {
file.delete();
}
}
} else {
file.delete();
}
} | [
"protected",
"static",
"void",
"clearCache",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"if",
"(",
"file",
".",
"list",
"(",
")",
".",
"length",
"==",
"0",
")",
"{",
"file",
".",
"delete",
"(",
")",
";",
"}",
"else",
"{",
"String",
"files",
"[",
"]",
"=",
"file",
".",
"list",
"(",
")",
";",
"for",
"(",
"String",
"temp",
":",
"files",
")",
"{",
"File",
"fileDelete",
"=",
"new",
"File",
"(",
"file",
",",
"temp",
")",
";",
"clearCache",
"(",
"fileDelete",
")",
";",
"}",
"if",
"(",
"file",
".",
"list",
"(",
")",
".",
"length",
"==",
"0",
")",
"{",
"file",
".",
"delete",
"(",
")",
";",
"}",
"}",
"}",
"else",
"{",
"file",
".",
"delete",
"(",
")",
";",
"}",
"}"
] | Clear cache recursively from given dir. | [
"Clear",
"cache",
"recursively",
"from",
"given",
"dir",
"."
] | [
"//directory is empty, then delete it",
"//List all the directory contents",
"//Construct the file structure",
"//Recursive delete",
"//Check the directory again, if empty then delete it",
"//System.out.println(\"Removed Cache directory: \" + file.getAbsolutePath());",
"//if file, then delete it",
"//System.out.println(\"Removed Cache File : \" + file.getAbsolutePath());"
] | [
{
"param": "file",
"type": "File"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "file",
"type": "File",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
4750,
760,
918,
19346,
12,
812,
585,
13,
1216,
1860,
288,
203,
202,
202,
430,
12,
768,
18,
291,
2853,
10756,
288,
203,
1082,
202,
759,
5149,
353,
1008,
16,
1508,
1430,
518,
203,
1082,
202,
430,
12,
768,
18,
1098,
7675,
2469,
631,
20,
13,
288,
203,
9506,
202,
768,
18,
3733,
5621,
203,
1082,
202,
97,
469,
288,
203,
9506,
202,
759,
682,
777,
326,
1867,
2939,
203,
9506,
202,
780,
1390,
8526,
273,
585,
18,
1098,
5621,
203,
9506,
202,
1884,
261,
780,
1906,
294,
1390,
13,
288,
203,
6862,
202,
759,
7249,
326,
585,
3695,
203,
6862,
202,
812,
585,
2613,
273,
394,
1387,
12,
768,
16,
1906,
1769,
203,
203,
6862,
202,
759,
10483,
1430,
203,
6862,
202,
8507,
1649,
12,
768,
2613,
1769,
203,
9506,
202,
97,
203,
9506,
202,
759,
1564,
326,
1867,
3382,
16,
309,
1008,
1508,
1430,
518,
203,
9506,
202,
430,
12,
768,
18,
1098,
7675,
2469,
631,
20,
13,
288,
203,
6862,
202,
768,
18,
3733,
5621,
203,
6862,
202,
759,
3163,
18,
659,
18,
8222,
2932,
10026,
4379,
1867,
30,
315,
397,
585,
18,
588,
10368,
743,
10663,
203,
9506,
202,
97,
203,
1082,
202,
97,
203,
202,
202,
97,
469,
288,
203,
1082,
202,
759,
430,
585,
16,
1508,
1430,
518,
203,
1082,
202,
768,
18,
3733,
5621,
203,
1082,
202,
759,
3163,
18,
659,
18,
8222,
2932,
10026,
4379,
1387,
294,
315,
397,
585,
18,
588,
10368,
743,
10663,
203,
202,
202,
97,
203,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
10121,
1247,
8536,
628,
864,
1577,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
b0157fed8ae290d96d96ff0a66f05f81bffecba9 | iedadata/geomapapp | haxby/map/MapApp.java | [
"Apache-2.0"
] | Java | addCurrentDBToDisplay | null | public void addCurrentDBToDisplay() {
final Database cDB = currentDB;
// if (cDB == null) return;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
dbLabel.setText( cDB.getDBName() );
dialog.add( cDB.getSelectionDialog(), "Center");
hPane.setRightComponent( dialogScroll );
if( cDB.getSelectionDialog() != null ) {
int w = cDB.getSelectionDialog().getPreferredSize().width;
hPane.setDividerLocation( hPane.getSize().width - w
-hPane.getDividerSize() );
}
if( cDB.getDataDisplay() != null ) {
int h = cDB.getDataDisplay().getPreferredSize().height;
detach_attachB.setEnabled( h > 50 );
if (attached || h < 50) {
//Attaches Tables spreadsheet under the main map.
attachDisplay();
}
else {
detachDisplay();
}
} else {
detach_attachB.setEnabled(false);
}
}
});
} | // Displays Side bar of current DB | Displays Side bar of current DB | [
"Displays",
"Side",
"bar",
"of",
"current",
"DB"
] | public void addCurrentDBToDisplay() {
final Database cDB = currentDB;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
dbLabel.setText( cDB.getDBName() );
dialog.add( cDB.getSelectionDialog(), "Center");
hPane.setRightComponent( dialogScroll );
if( cDB.getSelectionDialog() != null ) {
int w = cDB.getSelectionDialog().getPreferredSize().width;
hPane.setDividerLocation( hPane.getSize().width - w
-hPane.getDividerSize() );
}
if( cDB.getDataDisplay() != null ) {
int h = cDB.getDataDisplay().getPreferredSize().height;
detach_attachB.setEnabled( h > 50 );
if (attached || h < 50) {
attachDisplay();
}
else {
detachDisplay();
}
} else {
detach_attachB.setEnabled(false);
}
}
});
} | [
"public",
"void",
"addCurrentDBToDisplay",
"(",
")",
"{",
"final",
"Database",
"cDB",
"=",
"currentDB",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"dbLabel",
".",
"setText",
"(",
"cDB",
".",
"getDBName",
"(",
")",
")",
";",
"dialog",
".",
"add",
"(",
"cDB",
".",
"getSelectionDialog",
"(",
")",
",",
"\"Center\"",
")",
";",
"hPane",
".",
"setRightComponent",
"(",
"dialogScroll",
")",
";",
"if",
"(",
"cDB",
".",
"getSelectionDialog",
"(",
")",
"!=",
"null",
")",
"{",
"int",
"w",
"=",
"cDB",
".",
"getSelectionDialog",
"(",
")",
".",
"getPreferredSize",
"(",
")",
".",
"width",
";",
"hPane",
".",
"setDividerLocation",
"(",
"hPane",
".",
"getSize",
"(",
")",
".",
"width",
"-",
"w",
"-",
"hPane",
".",
"getDividerSize",
"(",
")",
")",
";",
"}",
"if",
"(",
"cDB",
".",
"getDataDisplay",
"(",
")",
"!=",
"null",
")",
"{",
"int",
"h",
"=",
"cDB",
".",
"getDataDisplay",
"(",
")",
".",
"getPreferredSize",
"(",
")",
".",
"height",
";",
"detach_attachB",
".",
"setEnabled",
"(",
"h",
">",
"50",
")",
";",
"if",
"(",
"attached",
"||",
"h",
"<",
"50",
")",
"{",
"attachDisplay",
"(",
")",
";",
"}",
"else",
"{",
"detachDisplay",
"(",
")",
";",
"}",
"}",
"else",
"{",
"detach_attachB",
".",
"setEnabled",
"(",
"false",
")",
";",
"}",
"}",
"}",
")",
";",
"}"
] | Displays Side bar of current DB | [
"Displays",
"Side",
"bar",
"of",
"current",
"DB"
] | [
"//\tif (cDB == null) return;",
"//Attaches Tables spreadsheet under the main map."
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} | [
1,
3495,
21872,
5110,
30,
1071,
918,
527,
3935,
2290,
774,
4236,
1435,
288,
203,
202,
202,
6385,
5130,
276,
2290,
273,
783,
2290,
31,
203,
202,
759,
202,
430,
261,
71,
2290,
422,
446,
13,
327,
31,
203,
202,
202,
6050,
310,
11864,
18,
14407,
20607,
12,
2704,
10254,
1435,
288,
203,
1082,
202,
482,
918,
1086,
1435,
288,
203,
9506,
202,
1966,
2224,
18,
542,
1528,
12,
276,
2290,
18,
588,
2290,
461,
1435,
11272,
203,
9506,
202,
12730,
18,
1289,
12,
276,
2290,
18,
588,
6233,
6353,
9334,
315,
8449,
8863,
203,
9506,
202,
76,
8485,
18,
542,
4726,
1841,
12,
6176,
6806,
11272,
203,
203,
9506,
202,
430,
12,
276,
2290,
18,
588,
6233,
6353,
1435,
480,
446,
262,
288,
203,
6862,
202,
474,
341,
273,
276,
2290,
18,
588,
6233,
6353,
7675,
588,
16028,
1225,
7675,
2819,
31,
203,
6862,
202,
76,
8485,
18,
542,
25558,
2735,
12,
366,
8485,
18,
588,
1225,
7675,
2819,
300,
341,
203,
6862,
1082,
202,
17,
76,
8485,
18,
588,
25558,
1225,
1435,
11272,
203,
9506,
202,
97,
203,
203,
9506,
202,
430,
12,
276,
2290,
18,
588,
751,
4236,
1435,
480,
446,
262,
288,
203,
6862,
202,
474,
366,
273,
276,
2290,
18,
588,
751,
4236,
7675,
588,
16028,
1225,
7675,
4210,
31,
203,
6862,
202,
8238,
497,
67,
7331,
38,
18,
542,
1526,
12,
366,
405,
6437,
11272,
203,
203,
6862,
202,
430,
261,
24157,
747,
366,
411,
6437,
13,
288,
203,
25083,
202,
759,
4761,
281,
30536,
30775,
3613,
326,
2774,
852,
18,
203,
25083,
202,
7331,
4236,
5621,
203,
6862,
202,
97,
203,
6862,
202,
12107,
288,
203,
25083,
202,
8238,
497,
4236,
5621,
203,
6862,
202,
97,
203,
9506,
202,
97,
469,
288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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
759,
9311,
87,
26248,
4653,
434,
783,
2383,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 8