query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Return current lengthof Doubly LinkedList | public int length() {
return length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int length() {\n int ret_val = 1;\n LinkedList i = this;\n\n while (i.next != null) {\n i = i.next;\n ret_val++;\n }\n return ret_val;\n }",
"public int sizeOfLinkedList(){\n\t\treturn size;\n\t}",
"public int length(){\r\n int counter =... | [
"0.85197806",
"0.81836855",
"0.8171478",
"0.8107905",
"0.80140793",
"0.7937197",
"0.78383243",
"0.7827252",
"0.77585983",
"0.7687707",
"0.7684501",
"0.7665825",
"0.7647538",
"0.7607818",
"0.7587338",
"0.7539668",
"0.75308955",
"0.75038",
"0.74983335",
"0.74176174",
"0.7413876... | 0.66567725 | 90 |
CASE 1: Add a new value to the front of the list.(AFTER HEAD & BEFORE TAIL) | public void insertAtHead(int newValue) {
DoublyLinkedList newNode = new DoublyLinkedList(newValue, head, head.getNext());
newNode.getNext().setPrev(newNode);
head.setNext(newNode);
length += 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void addToHead(T val)\n\t{\n\t\tListElement<T> newElm = new ListElement<T>(val, head);\n\t\t\n\t\tif(head != null)\n\t\t\thead.setPrev(newElm);\n\t\telse\n\t\t\t//If list was empty befor addition\n\t\t\ttail = newElm;\n\t\t\t\n\t\thead = newElm;\n\t}",
"void pushFront(T value) throws ListException;",
... | [
"0.7377282",
"0.7034304",
"0.67992085",
"0.6786794",
"0.66770834",
"0.65174395",
"0.65089166",
"0.6494166",
"0.6490549",
"0.6453737",
"0.6427566",
"0.64005226",
"0.6332149",
"0.6282056",
"0.62713796",
"0.6269509",
"0.6259891",
"0.6248318",
"0.6244586",
"0.6228779",
"0.6227808... | 0.0 | -1 |
CASE 2: Add a new value at a given position | public void insertAtPosition(int data, int position) {
//fix the position
if (position < 0) position = 0;
if (position > length) position = length;
//if the list is empty, this is going to be the only element in the list.
if (head == null) {
head = new DoublyLinkedList(data);
tail = head;
}
//if the element is added at the front of list
else if (position == 0) {
DoublyLinkedList temp = new DoublyLinkedList(data);
temp.next = head;
head = temp;
}
//locate the exact position and add the element now
else {
DoublyLinkedList temp = head;
int i = 1;
while (i < position) {
temp = temp.getNext();
}
DoublyLinkedList newNode = new DoublyLinkedList(data);
newNode.next = temp.next;
newNode.prev = temp;
newNode.next.prev = newNode;
newNode.prev.next = newNode; // temp.next = newNode;
}
//finally increment the length
length += 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void add(int idx, float incr);",
"public void addValue(int i) {\n value = value + i;\n }",
"public int addPosition(int faceValue){\n position += faceValue;\n\n if(position > 12){\n position -= 12;\n }\n return position;\n }",
"private static void addAtTest( int... | [
"0.6735805",
"0.6594136",
"0.6534475",
"0.64605147",
"0.638313",
"0.6357671",
"0.63344806",
"0.6294734",
"0.6292356",
"0.625702",
"0.6226846",
"0.61575544",
"0.61533815",
"0.614504",
"0.61395204",
"0.61363506",
"0.60749805",
"0.6018751",
"0.60122925",
"0.6002253",
"0.5960912"... | 0.0 | -1 |
CASE 3: Add a node to the rear.(BEFORE TAIL) | public void insertAtTail(int newValue) {
DoublyLinkedList newNode = new DoublyLinkedList(newValue, tail.getPrev(), tail);
newNode.getPrev().setNext(newNode);
tail.setPrev(newNode);
length += 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addToRear(T element){\n LinearNode<T> node = new LinearNode<T>(element);\n // modify both front and rear when appending to an empty list\n if (isEmpty()){\n front = rear = node;\n }else{\n rear.setNext(node);\n rear = node;\n }\n count++;\n }",
"@Test\n\tpublic void ... | [
"0.72691983",
"0.6986246",
"0.6961009",
"0.667196",
"0.65824383",
"0.6581469",
"0.6571282",
"0.64994",
"0.6495083",
"0.6476832",
"0.64665407",
"0.6457385",
"0.6388131",
"0.63733673",
"0.6366939",
"0.6358629",
"0.6324468",
"0.63222194",
"0.63054144",
"0.6296694",
"0.62920636",... | 0.0 | -1 |
String representation of the DLL | public String toString() {
String result = "[]";
if (length == 0) return result;
result = "[" + head.getNext().getData();
DoublyLinkedList temp = head.getNext().getNext();
while (temp != tail) {
result += "," + temp.getData();
temp = temp.getNext();
}
return result + "]";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString() {\n return \"Module Dependency : \" + getName() + \":\" + getVersion();\n }",
"public String toString() {\r\n\treturn \"interfaceID = \" + interfaceID + \"; versionInfoID = \" + versionInfoID + \"; blender = \" + blender;\r\n }",
"public String getDumpString() {\n return... | [
"0.5902853",
"0.5863904",
"0.58156127",
"0.58019894",
"0.57986367",
"0.5796126",
"0.57823354",
"0.57413554",
"0.5736837",
"0.57343584",
"0.5719363",
"0.56830055",
"0.56781965",
"0.56626105",
"0.5620633",
"0.5609851",
"0.556225",
"0.5530639",
"0.5529641",
"0.5507377",
"0.54972... | 0.0 | -1 |
An object that handles all types of client. Depends on annotation Client. | public interface ClientApi extends Api {
/**
* To parse client request
*
* @param message
* the request message from client to be parsed
* @return IsoBuffer object the implementation of {@link ConcurrentHashMap}
* @throws PosException
* thrown when an exception occurs during parsing
*/
public IsoBuffer parse(String message) throws PosException;
/**
* To parse emv data
*
* @param isoBuffer
* the parsed buffer containing emv data
* @return Map object containing tags and data as key value pair
*/
public Map<EmvTags, String> parseEmvData(IsoBuffer isoBuffer);
/**
* To modify the {@link IsoBuffer} object for client response.
*
* @param isoBuffer
* the buffer need to modified for response
*/
public void modifyBits4Response(IsoBuffer isoBuffer, Data data);
/**
* To build the client message
*
* @param isoBuffer
* the buffer holding all fields and data need to be formed as
* response
* @return response formed response {@link String} object need to responded
* to client
*/
public String build(IsoBuffer isoBuffer);
public String getStoredProcedure();
public Boolean checkHostToHost();
public boolean errorDescriptionRequired();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int getClientType() {\n\n return clientType;\n\n }",
"public abstract Client getClient();",
"interface Client {\n\n /**\n * Returns an ID string for this client.\n * The returned string should be unique among all clients in the system.\n *\n * @return An unique ID string ... | [
"0.7059662",
"0.70440435",
"0.67982024",
"0.67358017",
"0.67301124",
"0.66357493",
"0.65045226",
"0.6490169",
"0.63852763",
"0.6357297",
"0.62872636",
"0.6255354",
"0.6254933",
"0.6239449",
"0.62308395",
"0.6198037",
"0.6135405",
"0.6112758",
"0.6099653",
"0.60981566",
"0.609... | 0.0 | -1 |
To parse emv data | public Map<EmvTags, String> parseEmvData(IsoBuffer isoBuffer); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void parseData() {\n\t\t\r\n\t}",
"public void parse(){\r\n\t\t//StringTokenizer st = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tst = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tString sv = \"\";\r\n\r\n\t\ttry{\r\n\t\t\tnmeaHeader = st.nextToken();//Global Positioning System Fix Data\r\n\t\t\tm... | [
"0.61832726",
"0.59983623",
"0.58220214",
"0.5803177",
"0.56125766",
"0.5582071",
"0.5567091",
"0.55611074",
"0.54440695",
"0.5440364",
"0.5433749",
"0.5408231",
"0.53772604",
"0.5374872",
"0.5307699",
"0.5298916",
"0.5287632",
"0.5287417",
"0.52581155",
"0.5255195",
"0.52411... | 0.63564235 | 0 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof Locacao)) {
return false;
}
Locacao other = (Locacao) object;
if ((this.idLocacao == null && other.idLocacao != null) || (this.idLocacao != null && !this.idLocacao.equals(other.idLocacao))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void se... | [
"0.6896886",
"0.6838461",
"0.67056817",
"0.66419715",
"0.66419715",
"0.6592331",
"0.6579151",
"0.6579151",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.65624106",
"0.65624106",
"0.65441847",
"0.65243006",
"0.65154546",
"0.6487427",
"0.64778... | 0.0 | -1 |
/ renamed from: io.reactivex.functions.Predicate | public interface Predicate<T> {
boolean test(@NonNull T t) throws Exception;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Predicate<I> extends Function<I,Boolean> {}",
"@FunctionalInterface\n/* */ public interface Predicate<T>\n/* */ {\n/* */ default Predicate<T> and(Predicate<? super T> paramPredicate) {\n/* 68 */ Objects.requireNonNull(paramPredicate);\n/* 69 */ return paramObject -> (test... | [
"0.6759018",
"0.66738486",
"0.66279817",
"0.6537236",
"0.6521747",
"0.652019",
"0.64903206",
"0.6479712",
"0.64784515",
"0.64627427",
"0.6427581",
"0.64155126",
"0.6415196",
"0.6408243",
"0.6406156",
"0.6362702",
"0.6314803",
"0.627675",
"0.6272706",
"0.62623423",
"0.6257329"... | 0.64816165 | 7 |
/ Metodo toString del aliado | @Override
public String toString() {
return nom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString() ;",
"@Override\n String toString();",
"@Override\n String toString();",
"@Override\n\tString toString();",
"@Override\r\n String toString();",
"@Override\n public final String toString() {\n return asString(0, 4);\n }",
"@Override\n String toString();",
... | [
"0.7904777",
"0.7746123",
"0.7746123",
"0.7702174",
"0.76637506",
"0.7621499",
"0.7589863",
"0.75898045",
"0.75832796",
"0.7575646",
"0.7563688",
"0.75627863",
"0.75595224",
"0.7551528",
"0.7543546",
"0.75423944",
"0.75423944",
"0.75416243",
"0.7521781",
"0.75122666",
"0.7512... | 0.0 | -1 |
creates an input stream for the file to be parsed | public static void beautify(File input, File output) throws IOException,
ParseException {
FileInputStream in = new FileInputStream(input);
CompilationUnit cu;
try {
// parse the file
cu = JavaParser.parse(in);
orderImports(cu);
} finally {
in.close();
}
// prints the resulting compilation unit to default system output
System.out.println(cu.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SYEParser(InputStream input, String name) throws FileNotFoundException {\n super(input);\n this.filename = name;\n }",
"protected abstract InputStream getInStreamImpl(String filename) throws IOException;",
"@Override\n public InputStream openInputFile(String pathname) throws IOExcep... | [
"0.67260146",
"0.67066514",
"0.650775",
"0.64766437",
"0.6413909",
"0.6378263",
"0.63261104",
"0.62950504",
"0.6271372",
"0.6137105",
"0.6121564",
"0.61108994",
"0.6103169",
"0.60598224",
"0.5980119",
"0.5975469",
"0.59438944",
"0.59400773",
"0.5926593",
"0.5922425",
"0.59195... | 0.0 | -1 |
get the full package name as would be printed | private static String getFullyQualifiedImport(
ImportDeclaration importDeclaration) {
NameExpr nameExpr = importDeclaration.getName();
String buf = nameExpr.getName();
while (nameExpr instanceof QualifiedNameExpr) {
nameExpr = ((QualifiedNameExpr) nameExpr).getQualifier();
buf = nameExpr.getName() + "." + buf;
}
return buf;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getPackage();",
"String getPackageName() {\n final int lastSlash = name.lastIndexOf('/');\n final String parentPath = name.substring(0, lastSlash);\n return parentPath.replace('/', '.');\n }",
"public DsByteString getFullPackageName() {\n if (m_subPac... | [
"0.8057319",
"0.76376045",
"0.75915885",
"0.7560494",
"0.7442466",
"0.74194914",
"0.7413661",
"0.74130094",
"0.7401434",
"0.73946047",
"0.73465425",
"0.7288446",
"0.7283229",
"0.7224086",
"0.71648234",
"0.7143577",
"0.7109618",
"0.7088709",
"0.70728594",
"0.7065189",
"0.70563... | 0.0 | -1 |
Restricted constructor for Singleton creation. Visibility is relaxed from private to protected for testing purposes. The constructor should never be invoked outside of the class. | protected InterestRate() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Singleton() { }",
"private Singleton() {\n\t}",
"private Singleton()\n\t\t{\n\t\t}",
"private Singleton(){}",
"private LazySingleton() {\n if (null != INSTANCE) {\n throw new InstantiationError(\"Instance creation not allowed\");\n }\n }",
"private Singleton() {\n ... | [
"0.8469356",
"0.8372574",
"0.83484054",
"0.83279866",
"0.814648",
"0.8072138",
"0.80062616",
"0.79832023",
"0.78554815",
"0.7813375",
"0.75717247",
"0.7461472",
"0.74520385",
"0.7425358",
"0.73334813",
"0.7331536",
"0.727219",
"0.7242965",
"0.72080356",
"0.7202224",
"0.717927... | 0.0 | -1 |
returns random double between 3.0 and 9.0, based on todays date | public double todaysRate() {
randomDelay(1.0, 2.0);
LocalDate today = LocalDate.now();
int seed = today.getDayOfMonth() + today.getMonthValue() + today.getYear();
return new Random(1000 * seed).nextDouble() * 6.0 + 3.0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Date randomDate() {\n return VALUES.get(RND.nextInt(SIZE));\n }",
"private Date randomDate() {\n int minDay = (int) LocalDate.of(2012, 1, 1).toEpochDay();\n int maxDay = (int) LocalDate.now().toEpochDay();\n int randomDay = minDay + intRandom(maxDay - minDay);\n ... | [
"0.7358303",
"0.7251427",
"0.7230785",
"0.7117023",
"0.69570553",
"0.69232506",
"0.6842604",
"0.67754674",
"0.6769486",
"0.6761304",
"0.6736435",
"0.6729014",
"0.67241454",
"0.6702574",
"0.6671628",
"0.66597086",
"0.6595591",
"0.6578401",
"0.6533773",
"0.6484119",
"0.646404",... | 0.7723608 | 0 |
min, max in secs | private void randomDelay(double min, double max) {
try {
double delaySecs = rnd.nextDouble() * (max - min) + min;
Thread.sleep((long) (delaySecs * 1000));
} catch (InterruptedException e) {
// ignore
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float getMaxTimeSeconds() { return getMaxTime()/1000f; }",
"private int secToMin(int sec){\n return sec/60;\n }",
"public int getMaxTime() { return _maxTime; }",
"public void setTimeRange(int itmin, int itmax) {\n _itmin = itmin;\n _itmax = itmax;\n }",
"public int getEleMinTimeOu... | [
"0.71722144",
"0.6909575",
"0.6502331",
"0.61718154",
"0.61075824",
"0.6094885",
"0.6086159",
"0.60451853",
"0.6030242",
"0.5973898",
"0.5962164",
"0.59511065",
"0.5940225",
"0.5939569",
"0.5923072",
"0.588528",
"0.5857275",
"0.5841352",
"0.5840775",
"0.583513",
"0.58132976",... | 0.5478338 | 57 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, MENU_CLEAR_ID, 0, "CLEAR");
menu.add(0, MENU_QIET_ID, 0, "QUIET");
return super.onCreateOptionsMenu(menu);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7246102",
"0.7201358",
"0.7194834",
"0.7176498",
"0.71066517",
"0.7039537",
"0.7037961",
"0.70112145",
"0.70094734",
"0.69807225",
"0.6944953",
"0.69389373",
"0.6933199",
"0.6916928",
"0.6916928",
"0.6891486",
"0.68831646",
"0.68754137",
"0.68745375",
"0.68621665",
"0.6862... | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_CLEAR_ID:
editText1.setText("");
editText2.setText("");
textView.setText("");
break;
case MENU_QIET_ID:
finish();
break;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.79041183",
"0.7805934",
"0.77659106",
"0.7727251",
"0.7631684",
"0.7621701",
"0.75839096",
"0.75300384",
"0.74873656",
"0.7458051",
"0.7458051",
"0.7438486",
"0.742157",
"0.7403794",
"0.7391802",
"0.73870087",
"0.7379108",
"0.7370295",
"0.7362194",
"0.7355759",
"0.73454577... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
Prompt p = new LogInPrompt();
while(true) {
p = p.run();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Gets an immutable list of out edges of the given node. | public abstract List<? extends DiGraphEdge<N, E>> getOutEdges(N nodeValue); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int[] getOutEdges(int... nodes);",
"public ExtendedListIterable<Edge> edges(Node node, Direction direction) {\n return inspectableGraph.edges(node, Direction.EITHER);\n }",
"@Override\n\tpublic Set<ET> getAdjacentEdges(N node)\n\t{\n\t\t// implicitly returns null if gn is not in the nodeEdgeMap\n\t\t... | [
"0.72519296",
"0.6997939",
"0.6993243",
"0.6942154",
"0.6834504",
"0.676144",
"0.67443573",
"0.6599746",
"0.6583681",
"0.6560321",
"0.6557796",
"0.6532383",
"0.6459377",
"0.6440547",
"0.6431046",
"0.6398349",
"0.6364605",
"0.6361578",
"0.6347961",
"0.63251716",
"0.63184094",
... | 0.7406083 | 0 |
Gets an immutable list of in edges of the given node. | public abstract List<? extends DiGraphEdge<N, E>> getInEdges(N nodeValue); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public LinkedList<Edgeq> getAllEdges(String node) {\n return this.graph.get(node);\n }",
"int[] getInEdges(int... nodes);",
"public Collection<Edge> getE(int node_id) {\n\tCollection<Edge> list=new ArrayList<Edge>();\n\t\n\tif(getNodes().containsKey(node_id))\n\t{\n\t\tNode n=(Node) getNodes().get(no... | [
"0.7065019",
"0.7019859",
"0.70057",
"0.6996845",
"0.6980905",
"0.6962302",
"0.67063767",
"0.65826106",
"0.6576253",
"0.6550945",
"0.6529412",
"0.65071654",
"0.6505329",
"0.64785725",
"0.64647716",
"0.6435732",
"0.6411741",
"0.63138175",
"0.63047546",
"0.62793195",
"0.6261211... | 0.7166141 | 0 |
Disconnects all edges from n1 to n2. | public abstract void disconnectInDirection(N n1, N n2); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void disconnect(N n1, N n2);",
"public void removeEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode n1 = (Node) getNodes().get(node1);\n\t\tNode n2 = (Node) getNodes().get(node2);\n\n\t\tif(n1.getEdgesOf().containsKey(node2))\n\t\t{... | [
"0.7092443",
"0.65287095",
"0.65112984",
"0.6462319",
"0.6386112",
"0.6286524",
"0.6153374",
"0.61235267",
"0.6054608",
"0.60528827",
"0.59488887",
"0.58981913",
"0.5867816",
"0.58408386",
"0.58007556",
"0.5787011",
"0.5737339",
"0.57135105",
"0.56672484",
"0.56672484",
"0.56... | 0.7234519 | 0 |
Checks whether two nodes in the graph are connected via a directed edge. | public abstract boolean isConnectedInDirection(N n1, N n2); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasEdge(int node1, int node2)\n{\n\tNode s=(Node)this.getNodes().get(node1);\n return s.hasNi(node2);\n\t\n}",
"public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);",
"public abstract boolean isConnected(N n1, E e, N n2);",
"public boolean isConnected(String node1, Strin... | [
"0.73590183",
"0.7291389",
"0.6944598",
"0.69328403",
"0.6922876",
"0.6902349",
"0.6740398",
"0.6709522",
"0.66992974",
"0.6686229",
"0.6676074",
"0.6656443",
"0.6634948",
"0.6580686",
"0.65613794",
"0.65441525",
"0.6539624",
"0.6525597",
"0.6519768",
"0.64835274",
"0.6469383... | 0.6985535 | 2 |
Checks whether two nodes in the graph are connected via a directed edge with the given value. | public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean isConnected(N n1, E e, N n2);",
"public boolean isConnectedTo(A e) {\n\t\n\t\tif (g == null) return false;\n\t\t\n\t\tfor (Object o: g.getEdges()) {\n\t\t\t\n\t\t\tif (((Edge<?>)o).getFrom().equals(this) && ((Edge<?>)o).getTo().getValue().equals(e)) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\... | [
"0.6582158",
"0.65211505",
"0.6508783",
"0.6506281",
"0.64694184",
"0.6441131",
"0.6437776",
"0.6373637",
"0.63668007",
"0.636585",
"0.6314122",
"0.62654346",
"0.62174463",
"0.62046766",
"0.6189634",
"0.61831003",
"0.618143",
"0.61486053",
"0.6139392",
"0.6132998",
"0.6120272... | 0.7669619 | 0 |
A generic directed graph node. | public static interface DiGraphNode<N, E> extends GraphNode<N, E> {
public List<? extends DiGraphEdge<N, E>> getOutEdges();
public List<? extends DiGraphEdge<N, E>> getInEdges();
/** Returns whether a priority has been set. */
boolean hasPriority();
/**
* Returns a nonnegative integer priority which can be used to order nodes.
*
* <p>Throws if a priority has not been set.
*/
int getPriority();
/** Sets a node priority, must be non-negative. */
void setPriority(int priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Node getNode();",
"public abstract GraphNode<N, E> createNode(N value);",
"public interface DirectedGraph {\n\n /**\n * Set a graph label\n * @param label a graph label\n */\n void setGraphLabel(String label);\n\n /**\n * @return the graph label\n */\n String get... | [
"0.68134344",
"0.6725307",
"0.6657897",
"0.64515734",
"0.64292634",
"0.6365775",
"0.63344336",
"0.63344336",
"0.6234595",
"0.61761564",
"0.61573434",
"0.6145779",
"0.61043394",
"0.6102411",
"0.60768837",
"0.6064285",
"0.60604405",
"0.6017786",
"0.6016498",
"0.5980538",
"0.597... | 0.70225644 | 0 |
Returns whether a priority has been set. | boolean hasPriority(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSetPriority() {\n return EncodingUtils.testBit(__isset_bitfield, __PRIORITY_ISSET_ID);\n }",
"public boolean isSetPriority() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PRIORITY_ISSET_ID);\n }",
"public boolean getPriority() {\n\t\treturn priority;\n\t}... | [
"0.8242238",
"0.8211453",
"0.69749355",
"0.69749355",
"0.67121005",
"0.63831246",
"0.63096136",
"0.6192075",
"0.61433417",
"0.61405987",
"0.6089644",
"0.6057054",
"0.60357916",
"0.6007829",
"0.5998231",
"0.5986581",
"0.5973681",
"0.58702415",
"0.58694917",
"0.58515286",
"0.58... | 0.7675001 | 4 |
Returns a nonnegative integer priority which can be used to order nodes. Throws if a priority has not been set. | int getPriority(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int priority()\n\t{\n\t\treturn priority;\n\t}",
"int getPriority( int priority );",
"public Integer getPriority() {\n return priority;\n }",
"public Integer getPriority() {\n return priority;\n }",
"public Integer getPriority() {\n return priority;\n }",
"public int getPriority(... | [
"0.75713944",
"0.7497062",
"0.7484751",
"0.748089",
"0.748089",
"0.7475192",
"0.74291795",
"0.7401932",
"0.7401932",
"0.7401932",
"0.7401932",
"0.7395223",
"0.73865193",
"0.7376829",
"0.7366506",
"0.7366506",
"0.7366506",
"0.7366506",
"0.7366506",
"0.7366506",
"0.734816",
"... | 0.7352333 | 27 |
Sets a node priority, must be nonnegative. | void setPriority(int priority); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPriority(long priority) {\n\t\tsuper.priority = priority;\n\t}",
"public void setPriority(Priority priority);",
"public void setPriority(int priority) \n {\n if (this.priority == priority)\n return;\n\n t... | [
"0.69807166",
"0.6960399",
"0.6931398",
"0.69264877",
"0.67895985",
"0.67502075",
"0.6748812",
"0.6733384",
"0.67199767",
"0.6707588",
"0.6707588",
"0.6699782",
"0.66942036",
"0.6677424",
"0.666814",
"0.66230434",
"0.6611988",
"0.6610274",
"0.65995765",
"0.6590068",
"0.654178... | 0.74455076 | 1 |
A generic directed graph edge. | public static interface DiGraphEdge<N, E> extends GraphEdge<N, E> {
public DiGraphNode<N, E> getSource();
public DiGraphNode<N, E> getDestination();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Edge createEdge(Vertex src, Vertex tgt, boolean directed);",
"public interface Edge<NodeType extends Comparable<NodeType>,\n WeightType extends Comparable<WeightType>> \n\textends Comparable<Edge<NodeType,WeightType>> {\n\n\t/**\n\t * @return The description of the edge.\n\t */\n\tpublic Str... | [
"0.7310592",
"0.7252605",
"0.7146868",
"0.68928576",
"0.6869475",
"0.68614244",
"0.66802025",
"0.66536057",
"0.6613309",
"0.6557706",
"0.6499943",
"0.6496203",
"0.64456546",
"0.63840103",
"0.63807946",
"0.6334212",
"0.63214666",
"0.63193727",
"0.63118213",
"0.63036394",
"0.62... | 0.74264145 | 0 |
Create a new match statement. | public Match(final Expr expr, final List<MatchAbstractBranch> branchList) {
this.expr = expr;
this.branchList = branchList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Match createMatch();",
"public Match( ) {\n\n }",
"public Match(){\n this(-1, null, 0, 0, null, null);\n }",
"public abstract Match match();",
"public static void matchMaker()\n {\n \n }",
"private OFMatch construct_match() throws IllegalArgumentException \n {\n List<S... | [
"0.74053955",
"0.6330564",
"0.61226237",
"0.60491234",
"0.5922575",
"0.5883325",
"0.5854743",
"0.57337433",
"0.56358624",
"0.55596167",
"0.5501918",
"0.5493746",
"0.5465383",
"0.54083365",
"0.5373455",
"0.53277344",
"0.529744",
"0.529744",
"0.529744",
"0.52734333",
"0.5255893... | 0.48267856 | 55 |
Convert a term representing a Match statement into such a statement. | public static Match termToStatement(final Term term) throws TermConversionException {
if (term.size() != 2 || ! (term.lastMember() instanceof SetlList)) {
throw new TermConversionException("malformed " + FUNCTIONAL_CHARACTER);
} else {
final Expr expr = TermConverter.valueToExpr(term.firstMember());
final SetlList branches = (SetlList) term.lastMember();
final List<MatchAbstractBranch> branchList = new ArrayList<MatchAbstractBranch>(branches.size());
for (final Value v : branches) {
branchList.add(MatchAbstractBranch.valueToMatchAbstractBranch(v));
}
return new Match(expr, branchList);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String buildWordMatch(Matcher matcher, String word){\n return \"(\" + matcher.replaceAll(\"% \"+word+\" %\")\n + \" or \" + matcher.replaceAll(word+\" %\")\n + \" or \" + matcher.replaceAll(word)\n + \" or \" + matcher.replaceAll(\"% \"+word) + \")\" ;\n }... | [
"0.54279906",
"0.535434",
"0.53062344",
"0.53062344",
"0.52202964",
"0.5170521",
"0.5073644",
"0.4996289",
"0.49805248",
"0.4970792",
"0.49673203",
"0.49210307",
"0.48798126",
"0.48785532",
"0.48565736",
"0.4771485",
"0.47559136",
"0.47022745",
"0.46958062",
"0.46513322",
"0.... | 0.6605722 | 0 |
ref, no class info, is required | public ValueOrRef readRef(Element element) {
String ref = element.getTextContent();
ValueOrRef defaultValueOrRef = DefaultValueOrRef.ref(null, ref, true);
return defaultValueOrRef;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void ref() {\n\n\t}",
"java.lang.String getRef();",
"@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}",
"public String getRef() {\n return ref;\n }",
"Symbol getRef();",
"public abstract T ref(ID id);",
"public void setReference(Reference ref)\n {\n this.ref = ref;\n }",... | [
"0.76872253",
"0.7136362",
"0.70882446",
"0.68540895",
"0.68127126",
"0.6806154",
"0.6793857",
"0.66277343",
"0.66277343",
"0.6594209",
"0.6594209",
"0.65676564",
"0.64835",
"0.64705753",
"0.6466073",
"0.64650655",
"0.64342517",
"0.6331316",
"0.6322728",
"0.63025224",
"0.6299... | 0.0 | -1 |
plainValue, no class info | public ValueOrRef readValue(Element element) {
String value = element.getTextContent();
ValueOrRef defaultValueOrRef = DefaultValueOrRef.plainValue(null, value);
return defaultValueOrRef;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Object getRawValue();",
"Object value();",
"public T getRawValue(){\n return mValue;\n }",
"public Object getValue();",
"public Object getValue();",
"public Object getValue();",
"public Object getValue();",
"public Object getValue();",
"Object getValue();",
"Object getValue();",
... | [
"0.7674081",
"0.7531805",
"0.7477044",
"0.7412968",
"0.7412968",
"0.7412968",
"0.7412968",
"0.7412968",
"0.73920643",
"0.73920643",
"0.73920643",
"0.73920643",
"0.73920643",
"0.73920643",
"0.73920643",
"0.7306109",
"0.7306109",
"0.7306109",
"0.7233871",
"0.71550125",
"0.71323... | 0.0 | -1 |
Declaracion de metodos Metodos CRUD | public void registrarAdministrador() throws IOException {
//asignamos al usuario la imagen de perfil default
usuarioView.setUsuarioFotoRuta(getPathDefaultUsuario());
usuarioView.setUsuarioFotoNombre(getNameDefaultUsuario());
//Se genera un login y un pass aleatorio que se le envia al proveedor
MD5 md = new MD5();
GenerarPassword pass = new GenerarPassword();
SendEmail email = new SendEmail();
password = pass.generarPass(6);//Generamos pass aleatorio
//Encriptamos las contraseñas
usuarioView.setUsuarioPassword(md.getMD5(password));//Se encripta la contreseña
usuarioView.setUsuarioRememberToken(md.getMD5(password));
//el metodo recibe los atributos, agrega al atributo ciudad del objeto usuario un objeto correspondiente,
//de la misma forma comprueba el rol y lo asocia, por ultimo persiste el usuario en la base de datos
usuarioView.setSmsCiudad(ciudadDao.consultarCiudad(usuarioView.getSmsCiudad()));//Asociamos una ciudad a un usuario
usuarioView.setSmsRol(rolDao.consultarRol(usuarioView.getSmsRol()));//Asociamos un rol a un usuario
usuarioView.setUsuarioEstadoUsuario(1);//Asignamos un estado de cuenta
usuarioView.setSmsNacionalidad(nacionalidadDao.consultarNacionalidad(usuarioView.getSmsNacionalidad()));
//registramos el usuario y recargamos la lista de clientes
usuarioDao.registrarUsuario(usuarioView);
usuariosListView = adminDao.consultarUsuariosAdministradores();
//Enviar correo
email.sendEmailAdministradorBienvenida(usuarioView, password);
//limpiamos objetos
usuarioView = new SmsUsuario();
password = "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public JanelaTipoContato() {\r\n initComponents();\r\n try {\r\n\r\n List<TipoContato> tipoContatos = (List<TipoContato>) (Object) tipoContatoDao.pesquisarTodos();\r\n adicionarListaTipoContatosTabela(tipoContatos);\r\n } catch (Exception exception) {\r\n }\r\n ... | [
"0.64706504",
"0.6195466",
"0.61720973",
"0.6128519",
"0.599518",
"0.5866762",
"0.58098704",
"0.57937616",
"0.5772344",
"0.5735212",
"0.5734489",
"0.5721649",
"0.571512",
"0.5709663",
"0.5699933",
"0.5652049",
"0.56464005",
"0.56309646",
"0.5606052",
"0.55974567",
"0.5594383"... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean registerEmployDetails(String firstName, String lastName, String userName, String password) {
boolean flag = false;
log.info("Impl form values called"+firstName+lastName+userName+password);
try {
resourceResolver = resolverFactory.getServiceResourceResolver(getSubServiceMap());
session = resourceResolver.adaptTo(Session.class); //adapt method is used to convert any type of object, here we are converting resourceResolver object into session object.
log.info("register session ****" + session);
resource = resourceResolver.getResource(resourcePath);
//create Random numbers
java.util.Random r = new java.util.Random();
int low = 1;
int high = 100;
int result = r.nextInt(high-low)+low;
log.info("result=="+result);
String numberValues = "employees" + result;
Node node = resource.adaptTo(Node.class); //converting resource object into node
if (node != null) {
Node empRoot = node.addNode(numberValues, "nt:unstructured"); //addNode is a predefined method;
empRoot.setProperty("FirstName", firstName);
empRoot.setProperty("LastName", lastName);
empRoot.setProperty("UserName", userName);
empRoot.setProperty("Password", password);
session.save();
flag = true;
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
} finally {
if (session != null) {
session.logout();
}
}
return flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean employLogin(String userName, String password) {
boolean flag = false;
log.info("username ="+userName+"password ="+password);
try {
resourceResolver = resolverFactory.getServiceResourceResolver(getSubServiceMap());
session = resourceResolver.adaptTo(Session.class);
log.info("login session ****" + session);
resource = resourceResolver.getResource(resourcePath);
Node node = resource.adaptTo(Node.class);
NodeIterator nodeItr = node.getNodes(); //getting nodes which is created in above register method
while (nodeItr.hasNext()) {
Node cNode = nodeItr.nextNode();
String username = cNode.getProperty("UserName").getValue().getString();
String pwd = cNode.getProperty("Password").getValue().getString();
Map<String, String> map = new HashMap<String, String>();
map.put("usn", username);
map.put("pswd", pwd);
if (map.containsValue(userName) && map.containsValue(password)) {
log.info("login ok");
flag = true;
break;
} else {
log.info("failed to login");
flag = false;
}
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
This method is used for ACCESSING SYSTEM USER by storing into serviceMap Object | private Map<String, Object> getSubServiceMap() {
log.info("*****Inside getSubservice method **");
Map<String, Object> serviceMap = null;
try {
serviceMap = new HashMap<String, Object>();
serviceMap.put(ResourceResolverFactory.SUBSERVICE, "sam");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
log.info("errors ***" + errors.toString());
}
log.info("*****getSubservice Method End**");
return serviceMap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface UserService {\n\n //创建一个用户\n public void createUser(Sysuser sysuser);\n //修改用户信息\n public void saveUser(Sysuser sysuser);\n\n //根据传入的用户信息查询用户主要用户名和密码,返回list<map>\n public List<Map<String,Object>> signIn(Sysuser sysuser);\n\n //根据传入的用户信息查询用户主要用户名和密码,返回list<Sysuser>\n public ... | [
"0.64785653",
"0.62813133",
"0.62813133",
"0.62813133",
"0.6276285",
"0.62637407",
"0.61862594",
"0.60558736",
"0.6053232",
"0.6051097",
"0.5999697",
"0.59900767",
"0.59847844",
"0.59737116",
"0.5967755",
"0.5954098",
"0.5938163",
"0.5905109",
"0.5898415",
"0.5892178",
"0.587... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public NodeOprations getNodeProperties() {
NodeOprations bean=null;
try {
log.info("entered into impl.......");
//resourceResolver=resolverFactory.getServiceResourceResolver(getSubServiceMap());
//resource=resourceResolver.getResource(resourcePath);
//log.info("resource---------------"+resource);
//Node node=resource.adaptTo(Node.class);
resourceResolver = resolverFactory.getResourceResolver(getSubServiceMap());
resource = resourceResolver.getResource(resourcePath);
log.info(" resource................+ resource");
Node node = resource.adaptTo(Node.class);
String firstName=node.getProperty("firstName").getValue().getString();
log.info("fname--------------"+firstName);
String lastName=node.getProperty("lastName").getValue().getString();
log.info("lastname--------------"+lastName);
String username=node.getProperty("userName").getValue().getString();
log.info("username--------------"+username);
String password=node.getProperty("password").getValue().getString();
log.info("pwd--------------"+password);
bean=new NodeOprations();
bean.setFirstName(firstName);
bean.setLastName(lastName);
bean.setUserName(username);
bean.setPassword(password);
} catch (Exception e) {
// TODO: handle exception
}
return bean;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
/ perform the smell function and return the smell value | public int smell() {
synchronized (this) {
Node[][] AllHexNode = new Node[world.worldArray.length][world.worldArray[0].length];
int HexAmount = 0;
for (int i = 0; i < world.worldArray.length; i++)
for (int j = 0; j < world.worldArray[0].length; j++) {
if (world.isValidHex(i, j)) {
AllHexNode[i][j] = new Node(i, j, Integer.MAX_VALUE, -1, -1);
HexAmount++;
}
}
PriorityQueue<Node> frontier = new PriorityQueue<Node>(HexAmount, new Node(c, r, 0, 0, 0));
// Place the six hex around it first
if (world.isValidHex(c, r + 1))
if (world.worldArray[c][r + 1] instanceof EmptySpace || world.worldArray[c][r + 1] instanceof Food) {
if (direction == 0) {
AllHexNode[c][r + 1].setddd(0, 0, 0);
frontier.add(AllHexNode[c][r + 1]);
}
if (direction == 1) {
AllHexNode[c][r + 1].setddd(1, 0, 5);
frontier.add(AllHexNode[c][r + 1]);
}
if (direction == 2) {
AllHexNode[c][r + 1].setddd(2, 0, 4);
frontier.add(AllHexNode[c][r + 1]);
}
if (direction == 3) {
AllHexNode[c][r + 1].setddd(3, 0, 3);
frontier.add(AllHexNode[c][r + 1]);
}
if (direction == 4) {
AllHexNode[c][r + 1].setddd(2, 0, 2);
frontier.add(AllHexNode[c][r + 1]);
}
if (direction == 5) {
AllHexNode[c][r + 1].setddd(1, 0, 1);
frontier.add(AllHexNode[c][r + 1]);
}
}
if (world.isValidHex(c + 1, r + 1))
if (world.worldArray[c + 1][r + 1] instanceof EmptySpace
|| world.worldArray[c + 1][r + 1] instanceof Food) {
if (direction == 0) {
AllHexNode[c + 1][r + 1].setddd(1, 1, 1);
frontier.add(AllHexNode[c + 1][r + 1]);
}
if (direction == 1) {
AllHexNode[c + 1][r + 1].setddd(0, 1, 0);
frontier.add(AllHexNode[c + 1][r + 1]);
}
if (direction == 2) {
AllHexNode[c + 1][r + 1].setddd(1, 1, 5);
frontier.add(AllHexNode[c + 1][r + 1]);
}
if (direction == 3) {
AllHexNode[c + 1][r + 1].setddd(2, 1, 4);
frontier.add(AllHexNode[c + 1][r + 1]);
}
if (direction == 4) {
AllHexNode[c + 1][r + 1].setddd(3, 1, 3);
frontier.add(AllHexNode[c + 1][r + 1]);
}
if (direction == 5) {
AllHexNode[c + 1][r + 1].setddd(2, 1, 2);
frontier.add(AllHexNode[c + 1][r + 1]);
}
}
if (world.isValidHex(c + 1, r))
if (world.worldArray[c + 1][r] instanceof EmptySpace || world.worldArray[c + 1][r] instanceof Food) {
if (direction == 0) {
AllHexNode[c + 1][r].setddd(2, 2, 2);
frontier.add(AllHexNode[c + 1][r]);
}
if (direction == 1) {
AllHexNode[c + 1][r].setddd(1, 2, 1);
frontier.add(AllHexNode[c + 1][r]);
}
if (direction == 2) {
AllHexNode[c + 1][r].setddd(0, 2, 0);
frontier.add(AllHexNode[c + 1][r]);
}
if (direction == 3) {
AllHexNode[c + 1][r].setddd(1, 2, 5);
frontier.add(AllHexNode[c + 1][r]);
}
if (direction == 4) {
AllHexNode[c + 1][r].setddd(2, 2, 4);
frontier.add(AllHexNode[c + 1][r]);
}
if (direction == 5) {
AllHexNode[c + 1][r].setddd(3, 2, 3);
frontier.add(AllHexNode[c + 1][r]);
}
}
if (world.isValidHex(c, r - 1))
if (world.worldArray[c][r - 1] instanceof EmptySpace || world.worldArray[c][r - 1] instanceof Food) {
if (direction == 0) {
AllHexNode[c][r - 1].setddd(3, 3, 3);
frontier.add(AllHexNode[c][r - 1]);
}
if (direction == 1) {
AllHexNode[c][r - 1].setddd(2, 3, 2);
frontier.add(AllHexNode[c][r - 1]);
}
if (direction == 2) {
AllHexNode[c][r - 1].setddd(1, 3, 1);
frontier.add(AllHexNode[c][r - 1]);
}
if (direction == 3) {
AllHexNode[c][r - 1].setddd(0, 3, 0);
frontier.add(AllHexNode[c][r - 1]);
}
if (direction == 4) {
AllHexNode[c][r - 1].setddd(1, 3, 5);
frontier.add(AllHexNode[c][r - 1]);
}
if (direction == 5) {
AllHexNode[c][r - 1].setddd(2, 3, 4);
frontier.add(AllHexNode[c][r - 1]);
}
}
if (world.isValidHex(c - 1, r - 1))
if (world.worldArray[c - 1][r - 1] instanceof EmptySpace
|| world.worldArray[c - 1][r - 1] instanceof Food) {
if (direction == 0) {
AllHexNode[c - 1][r - 1].setddd(2, 4, 4);
frontier.add(AllHexNode[c - 1][r - 1]);
}
if (direction == 1) {
AllHexNode[c - 1][r - 1].setddd(3, 4, 3);
frontier.add(AllHexNode[c - 1][r - 1]);
}
if (direction == 2) {
AllHexNode[c - 1][r - 1].setddd(2, 4, 2);
frontier.add(AllHexNode[c - 1][r - 1]);
}
if (direction == 3) {
AllHexNode[c - 1][r - 1].setddd(1, 4, 1);
frontier.add(AllHexNode[c - 1][r - 1]);
}
if (direction == 4) {
AllHexNode[c - 1][r - 1].setddd(0, 4, 0);
frontier.add(AllHexNode[c - 1][r - 1]);
}
if (direction == 5) {
AllHexNode[c - 1][r - 1].setddd(1, 4, 5);
frontier.add(AllHexNode[c - 1][r - 1]);
}
}
if (world.isValidHex(c - 1, r))
if (world.worldArray[c - 1][r] instanceof EmptySpace || world.worldArray[c - 1][r] instanceof Food) {
if (direction == 0) {
AllHexNode[c - 1][r].setddd(1, 5, 5);
frontier.add(AllHexNode[c - 1][r]);
}
if (direction == 1) {
AllHexNode[c - 1][r].setddd(2, 5, 4);
frontier.add(AllHexNode[c - 1][r]);
}
if (direction == 2) {
AllHexNode[c - 1][r].setddd(3, 5, 3);
frontier.add(AllHexNode[c - 1][r]);
}
if (direction == 3) {
AllHexNode[c - 1][r].setddd(2, 5, 2);
frontier.add(AllHexNode[c - 1][r]);
}
if (direction == 4) {
AllHexNode[c - 1][r].setddd(1, 5, 1);
frontier.add(AllHexNode[c - 1][r]);
}
if (direction == 5) {
AllHexNode[c - 1][r].setddd(0, 5, 0);
frontier.add(AllHexNode[c - 1][r]);
}
}
while (!frontier.isEmpty()) {
Node v = frontier.poll(); // extracts element with smallest
// v.dist on the queue
if (world.worldArray[v.col][v.row] instanceof Food) {
return v.distance * 1000 + v.directionResult;
}
if (world.isValidHex(v.col, v.row + 1))
if (world.worldArray[v.col][v.row + 1] instanceof EmptySpace
|| world.worldArray[v.col][v.row + 1] instanceof Food) {
if (v.direction == 0)
if (AllHexNode[v.col][v.row + 1].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col][v.row + 1].setddd(v.distance + 1, 0, v.directionResult);
frontier.add(AllHexNode[v.col][v.row + 1]);
}
if (v.direction == 1)
if (AllHexNode[v.col][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col][v.row + 1].setddd(v.distance + 2, 0, v.directionResult);
frontier.add(AllHexNode[v.col][v.row + 1]);
}
if (v.direction == 5)
if (AllHexNode[v.col][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col][v.row + 1].setddd(v.distance + 2, 0, v.directionResult);
frontier.add(AllHexNode[v.col][v.row + 1]);
}
}
if (world.isValidHex(v.col + 1, v.row + 1))
if (world.worldArray[v.col + 1][v.row + 1] instanceof EmptySpace
|| world.worldArray[v.col + 1][v.row + 1] instanceof Food) {
if (v.direction == 0)
if (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 2, 1, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row + 1]);
}
if (v.direction == 1)
if (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 1, 1, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row + 1]);
}
if (v.direction == 2)
if (AllHexNode[v.col + 1][v.row + 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col + 1][v.row + 1].setddd(v.distance + 2, 1, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row + 1]);
}
}
if (world.isValidHex(v.col + 1, v.row))
if (world.worldArray[v.col + 1][v.row] instanceof EmptySpace
|| world.worldArray[v.col + 1][v.row] instanceof Food) {
if (v.direction == 1)
if (AllHexNode[v.col + 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col + 1][v.row].setddd(v.distance + 2, 2, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row]);
}
if (v.direction == 2)
if (AllHexNode[v.col + 1][v.row].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col + 1][v.row].setddd(v.distance + 1, 2, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row]);
}
if (v.direction == 3)
if (AllHexNode[v.col + 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col + 1][v.row].setddd(v.distance + 2, 2, v.directionResult);
frontier.add(AllHexNode[v.col + 1][v.row]);
}
}
if (world.isValidHex(v.col, v.row - 1))
if (world.worldArray[v.col][v.row - 1] instanceof EmptySpace
|| world.worldArray[v.col][v.row - 1] instanceof Food) {
if (v.direction == 2)
if (AllHexNode[v.col][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col][v.row - 1].setddd(v.distance + 2, 3, v.directionResult);
frontier.add(AllHexNode[v.col][v.row - 1]);
}
if (v.direction == 3)
if (AllHexNode[v.col][v.row - 1].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col][v.row - 1].setddd(v.distance + 1, 3, v.directionResult);
frontier.add(AllHexNode[v.col][v.row - 1]);
}
if (v.direction == 4)
if (AllHexNode[v.col][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col][v.row - 1].setddd(v.distance + 2, 3, v.directionResult);
frontier.add(AllHexNode[v.col][v.row - 1]);
}
}
if (world.isValidHex(v.col - 1, v.row - 1))
if (world.worldArray[v.col - 1][v.row - 1] instanceof EmptySpace
|| world.worldArray[v.col - 1][v.row - 1] instanceof Food) {
if (v.direction == 3)
if (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 2, 4, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row - 1]);
}
if (v.direction == 4)
if (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 1, 4, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row - 1]);
}
if (v.direction == 5)
if (AllHexNode[v.col - 1][v.row - 1].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col - 1][v.row - 1].setddd(v.distance + 2, 4, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row - 1]);
}
}
if (world.isValidHex(v.col - 1, v.row))
if (world.worldArray[v.col - 1][v.row] instanceof EmptySpace
|| world.worldArray[v.col - 1][v.row] instanceof Food) {
if (v.direction == 0)
if (AllHexNode[v.col - 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col - 1][v.row].setddd(v.distance + 2, 5, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row]);
}
if (v.direction == 4)
if (AllHexNode[v.col - 1][v.row].distance > v.distance + 2 && v.distance + 2 <= 10) {
AllHexNode[v.col - 1][v.row].setddd(v.distance + 2, 5, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row]);
}
if (v.direction == 5)
if (AllHexNode[v.col - 1][v.row].distance > v.distance + 1 && v.distance + 1 <= 10) {
AllHexNode[v.col - 1][v.row].setddd(v.distance + 1, 5, v.directionResult);
frontier.add(AllHexNode[v.col - 1][v.row]);
}
}
}
return 1000000;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void smell() {\n\t\t\n\t}",
"abstract int pregnancy();",
"private void smell() {\n try {\n this.console.println(MapControl.checkSmell(FireSwamp.getPlayer().getPlayerPosition(),\n FireSwamp.getCurrentGame().getGameMap()));\n } catch (MapControlException ex) {\n... | [
"0.7323529",
"0.57905924",
"0.5664483",
"0.56606686",
"0.55043143",
"0.54481447",
"0.5437854",
"0.54238105",
"0.54170215",
"0.537562",
"0.5362012",
"0.53315395",
"0.5330569",
"0.52922463",
"0.5249874",
"0.52430815",
"0.52409726",
"0.52349484",
"0.5230487",
"0.52260435",
"0.52... | 0.0 | -1 |
A 25% chance to mutate once by calling the helper method, 6.25% to mutate twice, etc. | public void mutate() {
synchronized (this) {
Random rand = new Random();
int mutate = rand.nextInt(4);
while (mutate == 0) {
mutateHelper();
mutate = rand.nextInt(4);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void mutateHelper() {\n\t\tsynchronized (this) {\n\t\t\tRandom rand = new Random();\n\t\t\tint mutateType = rand.nextInt(5);\n\t\t\tif (rules.size() >= 14) {\n\t\t\t\tmutateType = rand.nextInt(6);\n\t\t\t}\n\t\t\tint index = rand.nextInt(rules.size());\n\t\t\tMutation m = null;\n\t\t\tswitch (mutateType) {... | [
"0.6484642",
"0.63608915",
"0.6201108",
"0.6197484",
"0.6021557",
"0.5908211",
"0.5898058",
"0.5873883",
"0.58296067",
"0.5824832",
"0.58144635",
"0.5810416",
"0.5728519",
"0.5717035",
"0.57110256",
"0.56882167",
"0.5684224",
"0.5682234",
"0.5658831",
"0.56543165",
"0.5649751... | 0.75884783 | 0 |
copied from main.java from A4 | private void mutateHelper() {
synchronized (this) {
Random rand = new Random();
int mutateType = rand.nextInt(5);
if (rules.size() >= 14) {
mutateType = rand.nextInt(6);
}
int index = rand.nextInt(rules.size());
Mutation m = null;
switch (mutateType) {
case 0:
m = MutationFactory.getDuplicate();
m.addRules(rules.root);
m.mutate(index);
break;
case 1:
m = MutationFactory.getInsert();
m.addRules(rules.root);
m.mutate(index);
break;
case 5:
m = MutationFactory.getRemove();
m.addRules(rules.root);
m.mutate(index);
break;
case 3:
m = MutationFactory.getReplace();
m.addRules(rules.root);
m.mutate(index);
break;
case 4:
m = MutationFactory.getSwap();
m.addRules(rules.root);
m.mutate(index);
break;
case 2:
m = MutationFactory.getTransform();
m.addRules(rules.root);
m.mutate(index);
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args)\r\t{",
"public static void main(String[] args) {\n \n \n \n\t}",
"public static void main(String[] args) {\n \r\n\t}",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"public static void main(String[] ar... | [
"0.67683566",
"0.6490455",
"0.64878756",
"0.6481974",
"0.6475537",
"0.6429796",
"0.6429796",
"0.6429796",
"0.6429796",
"0.6429796",
"0.6429796",
"0.6428261",
"0.6420936",
"0.63850486",
"0.63850486",
"0.63825125",
"0.6381185",
"0.6375376",
"0.6375376",
"0.63710076",
"0.6371007... | 0.0 | -1 |
/////////////////////////////////////////////////// PRIVATE METHODS /////////////////////////////////////////////////// IsConnected | private boolean isConnected() {
return (this.serverConnection!=null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"... | [
"0.90619093",
"0.90619093",
"0.90619093",
"0.90619093",
"0.90619093",
"0.89359653",
"0.89359653",
"0.89359653",
"0.89359653",
"0.89359653",
"0.89359653",
"0.89359653",
"0.89359653",
"0.8900192",
"0.8371113",
"0.8337778",
"0.83101916",
"0.8289558",
"0.82398",
"0.8233209",
"0.8... | 0.7750974 | 62 |
Genera evento di notifica | private synchronized void notifyAlert(Event ObjEvent,String StrMessage) {
// Variabili locali
List<WireRecord> ObjWireRecords;
Map<String, TypedValue<?>> ObjWireValues;
// Manda il messaggio in log con il giusto livello di severity
switch (ObjEvent) {
case DATA_EVENT: return;
case CONNECT_EVENT: logger.info(StrMessage); break;
case DISCONNECT_EVENT: logger.warn(StrMessage); break;
case WARNING_EVENT: logger.warn(StrMessage); break;
case ERROR_EVENT: logger.error(StrMessage); break;
}
// Se la notifica dell'alert non Ŕ disabilitata emette wire record
if (this.actualConfiguration.Alerting) {
// Prepara le proprietÓ dell'evento
ObjWireValues = new HashMap<>();
ObjWireValues.put("id", TypedValues.newStringValue(this.actualConfiguration.DeviceId));
ObjWireValues.put("host", TypedValues.newStringValue(this.actualConfiguration.Host));
ObjWireValues.put("port", TypedValues.newIntegerValue(this.actualConfiguration.Port));
ObjWireValues.put("eventId", TypedValues.newIntegerValue(ObjEvent.id));
ObjWireValues.put("event", TypedValues.newStringValue(ObjEvent.description));
// Se si tratta di alert di warning o di errore
if ((ObjEvent==Event.WARNING_EVENT)||(ObjEvent==Event.ERROR_EVENT)) {
ObjWireValues.put("message", TypedValues.newStringValue(StrMessage));
}
// Se c'Ŕ un enrichment per gli alert lo aggiunge
if (this.actualConfiguration.AlertEnrichment.size()>0) {
ObjWireValues.putAll(this.actualConfiguration.AlertEnrichment);
}
ObjWireRecords = new ArrayList<>();
ObjWireRecords.add(new WireRecord(ObjWireValues));
// Notifica evento
this.wireSupport.emit(ObjWireRecords);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void ingresar_a_la_Opcion_de_eventos() {\n\t\t\n\t}",
"private void createEvents() {\n\t}",
"BasicEvents createBasicEvents();",
"public void crear_un_evento_recurrente_para_el_dia_de_hoy() {\n\t\t\n\t}",
"private UIEvent generateModifyEvent(){\n List<DataAttribut> dataAttributeList = new Arra... | [
"0.68658334",
"0.65037996",
"0.62535566",
"0.62172556",
"0.6209054",
"0.61416477",
"0.59602135",
"0.5953649",
"0.5951951",
"0.59467846",
"0.59289235",
"0.5906532",
"0.58600956",
"0.5846872",
"0.5845612",
"0.57944447",
"0.57770115",
"0.5771619",
"0.5734962",
"0.5733557",
"0.57... | 0.0 | -1 |
/////////////////////////////////////////////////// TIMER CALLBACK /////////////////////////////////////////////////// | @Override
public void run() {
// Inizializza nome thread
Thread.currentThread().setName("Timer");
// Richiama procedura di gestione aggiornamento configurazione
update();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TimerStatus onTimer();",
"private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.s... | [
"0.7435775",
"0.7309502",
"0.71939075",
"0.7185545",
"0.71830195",
"0.7156643",
"0.6916592",
"0.6899537",
"0.67578566",
"0.67310953",
"0.67248315",
"0.6672487",
"0.665966",
"0.6654921",
"0.66350853",
"0.6572843",
"0.6571679",
"0.65641797",
"0.6551256",
"0.65399414",
"0.652646... | 0.6090843 | 98 |
/////////////////////////////////////////////////// J60870 CALLBACK /////////////////////////////////////////////////// | @Override
public void newASdu(ASdu ObjASDU) {
// Inizializza nome thread
Thread.currentThread().setName("Receiver");
// Variabili locali
int IntIOA;
boolean BolIOA;
List<WireRecord> ObjWireRecords;
InformationObject[] ObjInformationObjects;
Map<String, TypedValue<?>> ObjWireValues;
Map<String, TypedValue<?>> ObjCommonValues;
// Esegue logging
logger.info("Received ASDU [tcp://"+this.actualConfiguration.Host+":"+this.actualConfiguration.Port+"]");
// Acquisisce puntatore agli information object
ObjInformationObjects = ObjASDU.getInformationObjects();
// Se l'ASDU non contiene oggetti genera warning ed esce
if ((ObjInformationObjects==null)||(ObjInformationObjects.length==0)) {
notifyAlert(Event.WARNING_EVENT,"Received ASDU cannot be decoded. Reason: empty");
return;
}
// Prepara le proprietÓ di testata dell'ASDU condivise da tutti gli information objects
ObjCommonValues = new HashMap<>();
ObjCommonValues.put("id", TypedValues.newStringValue(this.actualConfiguration.DeviceId));
ObjCommonValues.put("host", TypedValues.newStringValue(this.actualConfiguration.Host));
ObjCommonValues.put("port", TypedValues.newIntegerValue(this.actualConfiguration.Port));
ObjCommonValues.put("eventId", TypedValues.newIntegerValue(Event.DATA_EVENT.id));
ObjCommonValues.put("event", TypedValues.newStringValue(Event.DATA_EVENT.description));
ObjCommonValues.put("type", TypedValues.newStringValue(ObjASDU.getTypeIdentification().name()));
ObjCommonValues.put("test", TypedValues.newStringValue(ObjASDU.isTestFrame()?("y"):("n")));
ObjCommonValues.put("cot", TypedValues.newStringValue(ObjASDU.getCauseOfTransmission().name()));
ObjCommonValues.put("oa", TypedValues.newIntegerValue(ObjASDU.getOriginatorAddress()));
ObjCommonValues.put("ca", TypedValues.newIntegerValue(ObjASDU.getCommonAddress()));
// Crea un wirerecord per ciascun oggetto
ObjWireRecords = new ArrayList<>();
// Ciclo di scansione di tutti gli information object
for (InformationObject ObjInformationObject : ObjInformationObjects) {
// Aggiorna lo IOA condiviso da tutti gli information element
IntIOA = ObjInformationObject.getInformationObjectAddress();
// Verifica se lo IOA Ŕ matchato da una regola di enrichment
BolIOA = this.actualConfiguration.MatchingEnrichment.containsKey(IntIOA);
// Se l'IOA non matcha ed Ŕ attivo il filtro sull'enrichment esegue, altrimenti procede
if (!BolIOA&&this.actualConfiguration.Filtering) {
// Esegue logging
logger.debug("Discarded ASDU [tcp://"+this.actualConfiguration.Host+":"+this.actualConfiguration.Port+"/IOA="+String.valueOf(IntIOA)+"]");
} else {
// Inizializza un nuovo wirerecord con le proprietÓ comuni
ObjWireValues = new HashMap<>();
ObjWireValues.putAll(ObjCommonValues);
ObjWireValues.put("ioa", TypedValues.newIntegerValue(IntIOA));
// Se l'IOA matcha con regola di enrichment aggiunge metriche, altrimenti aggiunge quelle di default
if (BolIOA) {
ObjWireValues.putAll(this.actualConfiguration.MatchingEnrichment.get(IntIOA));
} else if (this.actualConfiguration.DefaultEnrichment.size()>0) {
ObjWireValues.putAll(this.actualConfiguration.DefaultEnrichment);
}
// Ciclo di scansione di tutti gli information element
for (InformationElement[] ObjInformationElementSet : ObjInformationObject.getInformationElements()) {
// Decodifica l'information element in base al tipo di ASDU e aggiunge record alla lista
try {
Iec104Decoder.decode(ObjASDU.getTypeIdentification(), ObjInformationElementSet, ObjWireValues);
ObjWireRecords.add(new WireRecord(ObjWireValues));
}
catch (Exception e) {
notifyAlert(Event.WARNING_EVENT,"Received ASDU cannot be decoded. Reason: "+e.getMessage());
}
}
}
}
// Se ci sono record da trasmettere procede
if (ObjWireRecords.size()>0) {
this.wireSupport.emit(ObjWireRecords);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void callback() {\n }",
"@Override\n\tpublic void onCallback() {\n\t\t\n\t}",
"public void callback();",
"@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}",
"@Override\n\tpublic void callback() {\n\t}",
"protected void javaCallback() {\n\t}",
"public void mo55177a() {\n this.... | [
"0.6881214",
"0.67587626",
"0.67220986",
"0.6628263",
"0.66062975",
"0.65874976",
"0.6455183",
"0.6215186",
"0.61600816",
"0.60870755",
"0.60352623",
"0.59904087",
"0.5988581",
"0.59775496",
"0.59447825",
"0.59412813",
"0.58529836",
"0.5848295",
"0.58174247",
"0.58123463",
"0... | 0.0 | -1 |
/ Song Default Constructor Sideeffects: Assigns some default ensemble, title and and year of your choosing ASSIGNMENT: Create the first Song constructor | Song() {
mEnsemble = ensemble;
mTitle = "Strawberry Fields";
mYearReleased = 1969;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Song(String t, String alb, String art, String y){\n title = t;\n album = alb;\n artist = art;\n year = y; \n }",
"public Song(String name, String artist, String album, String year) {\n this.name = name;\n this.artist = artist;\n this.album = album;\n ... | [
"0.7683121",
"0.72916085",
"0.7280287",
"0.71176183",
"0.69928724",
"0.69662595",
"0.6918706",
"0.6768057",
"0.6713673",
"0.66041845",
"0.6588576",
"0.64939755",
"0.64742404",
"0.64246815",
"0.6412756",
"0.64009684",
"0.6313904",
"0.6305716",
"0.621665",
"0.6192354",
"0.61827... | 0.77253085 | 0 |
/ Song Sideeffects: Sets the year of release to 0 | Song(Ensemble pEnsemble, String pTitle) {
this.mEnsemble = pEnsemble;
this.mTitle = pTitle;
mYearReleased = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setYear(int _year) { year = _year; }",
"public void setOriginalReleaseYear(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALRELEASEYEAR, value);\r\n\t}",
"public void setYear (int yr) {\n year = yr;\n }",
"public void setYear(short value) {\n ... | [
"0.7410243",
"0.71517175",
"0.71176904",
"0.70299536",
"0.7029233",
"0.7002897",
"0.6996608",
"0.698491",
"0.69730926",
"0.696296",
"0.693195",
"0.6922829",
"0.6916096",
"0.6908021",
"0.6908021",
"0.6908021",
"0.68996733",
"0.68563116",
"0.6830355",
"0.6802644",
"0.67922926",... | 0.0 | -1 |
Display the earthquake title in the UI | private void updateUi(ArrayList<Book> books) {
ListView booksList = (ListView) activity.findViewById(R.id.books_list);
BookAdapter adapter = new BookAdapter(activity, books);
booksList.setAdapter(adapter);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IDisplayString getTitle();",
"void showTitle(String title);",
"public void display_title_screen() {\n parent.textAlign(CENTER);\n parent.textFont(myFont);\n parent.textSize(displayH/10);\n parent.fill(255, 255, 0);\n parent.text(\"PACMA... | [
"0.663121",
"0.64804155",
"0.64747614",
"0.6472824",
"0.631792",
"0.6279561",
"0.62479764",
"0.62427247",
"0.6228086",
"0.6222048",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
"0.6216627",
... | 0.0 | -1 |
Returns new URL object from the given string URL. | private URL createUrl(String stringUrl) {
URL url = null;
try {
url = new URL(stringUrl);
} catch (MalformedURLException exception) {
Log.e(LOG_TAG, "Error with creating URL", exception);
return null;
}
return url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static URL stringToUrl(String stringUrl) throws MalformedURLException{\r\n\t\treturn new URL(stringUrl);\r\n\t}",
"private static URL createURL(String urlString) {\n\n // Create an empty url\n URL url = null;\n\n try {\n // Try to make a url from urlString param\n ... | [
"0.7393641",
"0.7377555",
"0.72374487",
"0.72127926",
"0.72127926",
"0.7199948",
"0.71360546",
"0.7127599",
"0.7083861",
"0.7062112",
"0.6744751",
"0.6743828",
"0.66651833",
"0.66642255",
"0.6656008",
"0.65968347",
"0.65944374",
"0.6502286",
"0.6437796",
"0.6249654",
"0.62065... | 0.7281861 | 2 |
Make an HTTP request to the given URL and return a String as the response. | private String makeHttpRequest(URL url) throws IOException {
String jsonResponse = "";
HttpURLConnection urlConnection = null;
InputStream inputStream = null;
try {
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setReadTimeout(10000 /* milliseconds */);
urlConnection.setConnectTimeout(15000 /* milliseconds */);
urlConnection.connect();
if (urlConnection.getResponseCode() == 200) {
inputStream = urlConnection.getInputStream();
jsonResponse = readFromStream(inputStream);
return jsonResponse;
}
} catch (IOException e) {
Log.e(LOG_TAG, "Problem Http Request", e);
} catch (Exception e) {
Log.e(LOG_TAG, "Problem Http Request", e);
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
if (inputStream != null) {
// function must handle java.io.IOException here
inputStream.close();
}
}
return jsonResponse;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String getHTTPResponse(URL url){\n\t\t\n\t\tStringBuilder response = new StringBuilder();\n\t\t\n\t\ttry{\n\t\t\tURLConnection connection = url.openConnection();\n\t\t\tBufferedReader res = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\t\t\tString responseLine;\n\t\t\t\n\... | [
"0.7588554",
"0.74719566",
"0.73666817",
"0.7298077",
"0.71523833",
"0.71420467",
"0.700661",
"0.69952714",
"0.6898827",
"0.6898273",
"0.6897492",
"0.68913054",
"0.68853784",
"0.6879528",
"0.6840855",
"0.68196535",
"0.6812248",
"0.6811214",
"0.67705256",
"0.6765857",
"0.67496... | 0.691461 | 8 |
TODO Autogenerated method stub | @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return super.shouldOverrideUrlLoading(view, url);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Exercise API functions on the hashtable argument | private void doAPITest(Map<Object,Object> table) {
int size = table.size();
Object key, value;
Map<Object,Object> clone = cloneMap(table);
// retrieve values using values()
Collection<Object> values = table.values();
// retrieve keys using keySet()
Set<Object> keySet = table.keySet();
Object[] keySetArray = keySet.toArray();
int step = 1 + random.nextInt(5);
for (int i=0; i<keySetArray.length; i=i+step)
{
key = keySetArray[i];
// retrieve value
value = table.get(key);
// assert value is in the table
assertTrue(table.containsValue(value));
/*
* assertTrue(table.contains(value)); // Removed as not supported by the Map interface, and identical to containsValue
* if value is a wrapped key then check it's equal
* to the key
*/
if (value instanceof CustomValue)
{
assertEquals(key, ((CustomValue)value).key);
}
// count how many occurrences of this value there are
int occurrences = numberOccurrences(values, value);
// find the Map.Entry
Set<Map.Entry<Object, Object>> entrySet = table.entrySet();
Iterator<Map.Entry<Object, Object>> entrySetIterator = entrySet.iterator();
Map.Entry<Object,Object> entry = null;
do
{
entry = entrySetIterator.next();
} while (!entry.getKey().equals(key));
// remove from table in different ways
switch (i % 3)
{
case 0:
table.remove(key);
break;
case 1:
keySet.remove(key);
break;
default:
entrySet.remove(entry);
}
// assert key is no longer in the table
assertFalse(table.containsKey(key));
// assert key is no longer in the keyset
assertFalse(keySet.contains(key));
// assert key is no longer in the entrySet
assertFalse(entrySet.contains(entry));
// assert that there's one fewer of this value in the hashtable
assertEquals(occurrences, numberOccurrences(values, value) + 1);
// re-insert key
table.put(key, value);
// assert key is in the table
assertTrue(table.containsKey(key));
// assert key is in the keyset
assertTrue(keySet.contains(key));
// assert EntrySet is same size
assertEquals(size, entrySet.size());
}
// test hashtable is the same size
assertEquals(size, table.size());
// test keySet is expected size
assertEquals(size, keySet.size());
// retrieve keys using keys()
Iterator<?> keys = table.keySet().iterator();
// remove a subset of elements from the table. store in a map
int counter = table.size() / 4;
Map<Object,Object> map = new HashMap<Object, Object>();
while (keys.hasNext() && counter-- >= 0)
{
key = keys.next();
value = table.get(key);
map.put(key, value);
keys.remove(); // removes the most recent retrieved element
}
// re-add the elements using putAll
table.putAll(map);
// test equal to copy
assertEquals(clone, table);
// clear the copy
clone.clear();
// assert size of clone is zero
assertEquals(0, clone.size());
// assert size of original is the same
assertEquals(size, table.size());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\t\tHashtable h = new Hashtable();\n\t\th.put(\"A\", \"Test\");//h.put(key, value);\n\t\th.put(\"B\", \"Hello\");\n\t\th.put(\"C\", \"World\");\n\t\tSystem.out.println(h.size());\n\t\t\n\t\th.put(1, 100);//put to insert data\n\t\th.put(2, 200);\n\t\th.put(3, 300);\n\t\th.p... | [
"0.6330431",
"0.60662645",
"0.60553557",
"0.60488796",
"0.60269904",
"0.60102403",
"0.60048705",
"0.5997787",
"0.59772575",
"0.59660304",
"0.59474933",
"0.5915317",
"0.59111905",
"0.5898475",
"0.5893226",
"0.5868564",
"0.5851985",
"0.5850839",
"0.58177274",
"0.5737672",
"0.57... | 0.5689896 | 24 |
Not all implementations of Map support the clone interface, so clone where possible, or do our own version of clone. | @SuppressWarnings("unchecked")
Map<Object,Object> cloneMap(Map<Object,Object> toClone) {
if (toClone instanceof Hashtable) {
return (Map<Object, Object>)((Hashtable<?, ?>)toClone).clone();
}
if (toClone instanceof HashMap) {
return (Map<Object,Object>)((HashMap<Object,Object>)toClone).clone();
}
if (toClone instanceof LinkedHashMap) {
return (Map<Object,Object>)((LinkedHashMap<Object,Object>)toClone).clone();
}
Map<Object,Object> cloned = null;
if (toClone instanceof WeakHashMap) {
cloned = new WeakHashMap<Object,Object>();
} else if (toClone instanceof ConcurrentHashMap){
cloned = new ConcurrentHashMap<Object,Object>();
} else {
throw new RuntimeException("Unexpected subclass of Map");
}
Set<Object> keys = toClone.keySet();
for (Object key: keys) {
cloned.put(key, toClone.get(key));
}
return cloned;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Object clone() throws CloneNotSupportedException {\n/* 172 */ StrokeMap clone = (StrokeMap)super.clone();\n/* 173 */ clone.store = new TreeMap();\n/* 174 */ clone.store.putAll(this.store);\n/* */ \n/* */ \n/* 177 */ return clone;\n/* */ }",
"@Override\n\tpublic MapNode cl... | [
"0.7923331",
"0.78767246",
"0.74749464",
"0.74373156",
"0.74367756",
"0.74139035",
"0.6850154",
"0.6799894",
"0.6792416",
"0.6740767",
"0.67381203",
"0.6656937",
"0.6634195",
"0.6634195",
"0.6634195",
"0.6634195",
"0.6621002",
"0.66081375",
"0.66081375",
"0.6588369",
"0.65798... | 0.78000003 | 2 |
setelah loading maka akan langsung berpindah ke home activity | @Override
public void run() {
if(id_user.equals("default")) {
Intent home = new Intent(SplashScreen.this, Login.class);
startActivity(home);
finish();
}else{
Intent home = new Intent(SplashScreen.this, MainActivity.class);
startActivity(home);
finish();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"private void loadHome(){\n In... | [
"0.6997444",
"0.69627655",
"0.6776124",
"0.66660047",
"0.6657007",
"0.6635147",
"0.65938395",
"0.65762144",
"0.6539846",
"0.6526255",
"0.6512462",
"0.6463345",
"0.64625806",
"0.6403205",
"0.6371294",
"0.6371294",
"0.6360811",
"0.63571465",
"0.6357096",
"0.63404197",
"0.633058... | 0.0 | -1 |
join self or any node with specified meta data | public String join(NodeMeta meta)
throws IOException, KeeperException, InterruptedException {
return zk.create(thisPrefix + "/" + GROUP,
serializer.serialize(meta), DEFAULT_ACL, CreateMode.PERSISTENT_SEQUENTIAL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override public List<Node> visitJoin(@NotNull XQueryParser.JoinContext ctx) {\n\t\tHashMap<String, List<Node>> hashJoin = new HashMap<String, List<Node>>();\n\t\tList<Node> result = new ArrayList<Node>();\n\t\tList<Node> left = new ArrayList<Node>(visit(ctx.query(0)));\n\t\tList<Node> right = new ArrayList<Node>(... | [
"0.5757736",
"0.542126",
"0.5369955",
"0.5249318",
"0.5233",
"0.5203126",
"0.5199318",
"0.51742244",
"0.51432014",
"0.5034645",
"0.5032728",
"0.50322926",
"0.50083387",
"0.5004283",
"0.49678734",
"0.49628574",
"0.49542144",
"0.49432328",
"0.4887041",
"0.48744082",
"0.48677495... | 0.6653766 | 0 |
join self with default meta information. default meta is composed of IP + timestamp + random number | public String join() throws IOException, KeeperException, InterruptedException {
NodeMeta meta = NodeMeta.defaultNodeMeta.with("sig", NodeMeta.signature().getBytes());
return join(meta);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Value joinMeta(Value v) {\n Value r = new Value(this);\n r.flags |= v.flags & META;\n return canonicalize(r);\n }",
"public String join(NodeMeta meta)\n throws IOException, KeeperException, InterruptedException {\n return zk.create(thisPrefix + \"/\" + GROUP,\n ... | [
"0.5251745",
"0.4926883",
"0.48333767",
"0.4707227",
"0.4576809",
"0.45457006",
"0.45327523",
"0.45053005",
"0.4454082",
"0.43889967",
"0.43660197",
"0.43408218",
"0.432069",
"0.42813805",
"0.42783853",
"0.42783853",
"0.42783853",
"0.42783853",
"0.42783853",
"0.4276354",
"0.4... | 0.3997703 | 70 |
find all nodes in current group. NOTE the returned list may already outofdate. | public List<String> getAll() throws KeeperException, InterruptedException {
List<String> copy = new ArrayList<>();
copy.addAll(members);
return copy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Collection<Node> allNodes();",
"protected abstract Node[] getAllNodes();",
"public List<INode> getAllNodes();",
"public List<Node> getNodes();",
"List<Node> getNodes();",
"private List<Node> getNodes() {\n List<Node> nodes = new ArrayList<Node>();\n NodeApi.GetConnectedNodesResult rawNodes ... | [
"0.76304954",
"0.7396985",
"0.7380443",
"0.7116423",
"0.70930934",
"0.7063521",
"0.7058413",
"0.7028089",
"0.6919487",
"0.683072",
"0.67184156",
"0.6693056",
"0.66929036",
"0.667055",
"0.66693705",
"0.6646655",
"0.6632589",
"0.66077965",
"0.65972173",
"0.6579051",
"0.65327",
... | 0.0 | -1 |
sync local group membership with zookeeper server. this might also change the result of getAll(). | public void sync() throws KeeperException, InterruptedException {
members = zk.getChildren(thisPrefix, groupWatcher, null); // also reset the watcher
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void syncGroup();",
"void syncGroup(Context context);",
"public synchronized void updateGroup() {\n RaftGroup newGroup = getCurrentGroup();\n if (!newGroup.equals(mRaftGroup)) {\n LOG.info(\"Raft group updated: old {}, new {}\", mRaftGroup, newGroup);\n mRaftGroup = newGroup;\n }\n }",
"@... | [
"0.72026867",
"0.6501201",
"0.632137",
"0.61671364",
"0.5712368",
"0.56731033",
"0.5597756",
"0.54533756",
"0.5389426",
"0.53708076",
"0.5347089",
"0.5341119",
"0.53154016",
"0.5271181",
"0.52662325",
"0.52431995",
"0.52274394",
"0.52269363",
"0.5225429",
"0.52135646",
"0.519... | 0.7104806 | 1 |
Log the new app start count for the next start | private void appStartCountIncrease(int currentAppStartCount) {
Prefs p = new Prefs(c);
p.save("app_start_count", currentAppStartCount + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private synchronized void updateLogCount() {\n this.logCount++;\n }",
"public void increase() {\r\n\t\t\tsynchronized (activity.getTaskTracker()) {\r\n\t\t\t\tactivity.getTaskTracker().count++;\r\n\t\t\t\tLog.d(LOGTAG, \"Incremented task count to \" + count);\r\n\t\t\t}\r\n\t\t}",
"private void showExecuti... | [
"0.64127094",
"0.5903771",
"0.57905823",
"0.5705616",
"0.56399536",
"0.5631528",
"0.56236255",
"0.5566117",
"0.55437326",
"0.55359524",
"0.5517261",
"0.5483074",
"0.54343826",
"0.5433432",
"0.541366",
"0.5376347",
"0.5360208",
"0.5342474",
"0.5333076",
"0.53041744",
"0.530347... | 0.7507104 | 0 |
Show the remind to rate dialog. Any checks whether or not it should be showed must be done before calling this method | private void showRemindRateDialog() {
final Dialog remindDialog = new Dialog(c);
remindDialog.setTitle(R.string.remind_rate_dialog_title);
remindDialog.setContentView(R.layout.dialog_remind_to_rate);
TextView tvStartCount = (TextView) remindDialog
.findViewById(R.id.tvRemindStartCount);
tvStartCount.setText(DResources.getString(c,
R.string.remind_rate_dialog_content));
Button bOpenMarket = (Button) remindDialog
.findViewById(R.id.bOpenMarket);
TextView tvHidePermanently = (TextView) remindDialog
.findViewById(R.id.tvRemindHidePermanently);
class ButtonListener implements OnClickListener {
public void onClick(View v) {
switch (v.getId()) {
case R.id.tvRemindHidePermanently:
// Never remind to rate anymore
Prefs p = new Prefs(c);
p.save("already_rated_app", true);
break;
case R.id.bOpenMarket:
try {
DApp.openGooglePlayStore(c);
} catch (DException e) {
e.printStackTrace();
}
break;
}
remindDialog.dismiss();
}
}
// Setup the click listeners for the buttons inside the remind dialog
bOpenMarket.setOnClickListener(new ButtonListener());
tvHidePermanently.setOnClickListener(new ButtonListener());
remindDialog.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void display() {\r\n dlgRates.show();\r\n }",
"public static void showRateDialog() {\n dialog = new Dialog(mContext, android.R.style.Theme_DeviceDefault_Dialog_NoActionBar);\n\n LayoutInflater inflater = mContext.getLayoutInflater();\n View rootView = inflater.inflate(R.layo... | [
"0.6986354",
"0.6933164",
"0.66478264",
"0.62996775",
"0.62948406",
"0.6264416",
"0.62386817",
"0.61859864",
"0.6010387",
"0.5945307",
"0.58991784",
"0.5898705",
"0.5893716",
"0.58888555",
"0.58329904",
"0.5823026",
"0.58177495",
"0.58151555",
"0.5786415",
"0.57749534",
"0.57... | 0.8591999 | 0 |
/ Create Console Handler | public ConsoleHandler createConsoleHandler () {
ConsoleHandler consoleHandler = null;
try {
consoleHandler = new ConsoleHandler();
} catch (SecurityException e) {
e.printStackTrace();
}
return consoleHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected ConsoleHandler() {\n super();\n setConsole(System.err);\n setFormatter(LOG_FORMATTER);\n setLevel(DEFAULT_LEVEL);\n }",
"public Console(/*@ non_null */ CommandHandler ch)\n\t{\n\t\tsuper(\"Console\");\n\t\tthis._handler = ch;\n\t}",
"public ConsoleCo... | [
"0.66510934",
"0.6511327",
"0.63791555",
"0.63607377",
"0.62594044",
"0.61983514",
"0.6193738",
"0.60693264",
"0.6055734",
"0.591574",
"0.59015995",
"0.58775336",
"0.58143955",
"0.57822037",
"0.57579464",
"0.5665142",
"0.5656477",
"0.5649337",
"0.56219244",
"0.56010514",
"0.5... | 0.80604166 | 0 |
/ Create XML Formatted Log File | public FileHandler createXmlFileHandler ( String fileName
, boolean append
) {
FileHandler xmlFileHandler = null;
try {
xmlFileHandler = new FileHandler(fileName, append);
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
return xmlFileHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toXML() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"<logfilter>\\n\");\n\t\t// write description\n\t\tsb.append(\"<description>\" + description + \"</description>\\n\");\n\t\t// write logdata\n\t\tsb.append(\"<logdata>\" + logData + \"</logdata>\");\n\t\t// write accepted type... | [
"0.6450681",
"0.6049599",
"0.6031565",
"0.6021803",
"0.60045844",
"0.58909965",
"0.5867717",
"0.57506675",
"0.5742406",
"0.5714184",
"0.5670238",
"0.5625727",
"0.55957997",
"0.55752057",
"0.5519637",
"0.54680043",
"0.54392976",
"0.5437466",
"0.5408387",
"0.5407468",
"0.539005... | 0.0 | -1 |
/ Create XML Formatted Log File | public FileHandler createHtmlFileHandler ( String fileName
, boolean append
) {
FileHandler htmlFileHandler = null;
try {
htmlFileHandler = new FileHandler(fileName, append);
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
return htmlFileHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toXML() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"<logfilter>\\n\");\n\t\t// write description\n\t\tsb.append(\"<description>\" + description + \"</description>\\n\");\n\t\t// write logdata\n\t\tsb.append(\"<logdata>\" + logData + \"</logdata>\");\n\t\t// write accepted type... | [
"0.6450681",
"0.6049599",
"0.6031565",
"0.6021803",
"0.60045844",
"0.58909965",
"0.5867717",
"0.57506675",
"0.5742406",
"0.5714184",
"0.5670238",
"0.5625727",
"0.55957997",
"0.55752057",
"0.5519637",
"0.54680043",
"0.54392976",
"0.5437466",
"0.5408387",
"0.5407468",
"0.539005... | 0.0 | -1 |
/ Create handler for memory file. > target the Handler to which to publish output. > size the number of log records to buffer (must be greater than zero) > pushLevel message level to push on | public MemoryHandler createMemoryHandler ( Handler diskFileHandler
, int recordNumber
, Level levelValue
) {
MemoryHandler memoryHandler = null;
try {
memoryHandler = new MemoryHandler(diskFileHandler, recordNumber, levelValue);
} catch (SecurityException e) {
e.printStackTrace();
}
return memoryHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MemoryLogger(int size) {\n\t\tthis.size = size;\n\t}",
"public FileHandler createRollingLogHandler ( String \tfileName\r\n\t\t\t\t\t\t\t\t\t\t\t\t, int \t\tlimitFileSize\r\n\t\t\t\t\t\t\t\t\t\t\t\t, int \t\tmaximumFileNumbers\r\n\t\t\t\t\t\t\t\t\t\t\t\t, boolean\tappend\r\n\t\t\t\t\t\t\t\t\t\t\t\t) {\r\n... | [
"0.5693851",
"0.53540653",
"0.5231541",
"0.50963116",
"0.50737965",
"0.5070996",
"0.5047219",
"0.50174534",
"0.50065714",
"0.49652272",
"0.48860243",
"0.48844787",
"0.48268104",
"0.48157048",
"0.4805422",
"0.47832736",
"0.47320503",
"0.47276306",
"0.4688822",
"0.4686445",
"0.... | 0.6867008 | 0 |
/ Create a file handler with a limit of 2 megabytes | public FileHandler createRollingLogHandler ( String fileName
, int limitFileSize
, int maximumFileNumbers
, boolean append
) {
FileHandler logHandler = null;
try {
logHandler = new FileHandler(fileName, limitFileSize, maximumFileNumbers, append);
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
return logHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setMaxFileSize(int sINGLESIZE) {\n\t\t\r\n\t}",
"long getMaxFileSizeBytes();",
"static ServletFileUpload createUpload() {\n DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();\n diskFileItemFactory.setSizeThreshold(MEM_MAX_SIZE);\n ServletFileUpload upload = ne... | [
"0.5891853",
"0.56290776",
"0.5628743",
"0.56004614",
"0.5586431",
"0.5550729",
"0.5510616",
"0.5437996",
"0.5326787",
"0.53210986",
"0.5281561",
"0.52635777",
"0.5161425",
"0.5160209",
"0.51515085",
"0.5148813",
"0.5148813",
"0.5148813",
"0.5148813",
"0.51103127",
"0.5100915... | 0.6009326 | 0 |
/ Create stream handler. | public StreamHandler createStreamHandler (OutputStream outStream) {
StreamHandler streamHandler = null;
try {
streamHandler = new StreamHandler(outStream, new SimpleFormatter());
} catch (SecurityException e) {
e.printStackTrace();
}
return streamHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"CreateHandler()\n {\n }",
"protected void openStream ()\n {\n stream = Util.stream (entry, \"Holder.java\");\n }",
"default Handler asHandler() {\n return new HandlerBuffer(this);\n }",
"abstract public TelnetServerHandler createHandler(TelnetSocket s);",
"public Http2MultiplexHandler(... | [
"0.6169144",
"0.5975664",
"0.5858012",
"0.5779613",
"0.5685318",
"0.56722826",
"0.56370693",
"0.55826044",
"0.5582359",
"0.5522097",
"0.5490319",
"0.5448207",
"0.5419214",
"0.54160076",
"0.53992504",
"0.5390173",
"0.5316555",
"0.5315309",
"0.5256592",
"0.5256548",
"0.5247418"... | 0.7732112 | 0 |
/ Create stream handler. | public SocketHandler createSocketHandler (String host, int port) {
SocketHandler socketHandler = null;
try {
socketHandler = new SocketHandler(host, port);
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
return socketHandler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public StreamHandler createStreamHandler (OutputStream outStream) {\r\n\t\t\t\t\t\r\n\t\tStreamHandler streamHandler = null;\r\n\r\n\t\ttry {\r\n\t\t\t\t \t\r\n\t\t\tstreamHandler = new StreamHandler(outStream, new SimpleFormatter());\r\n\t\t\t\t\t\t\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t\t\t\t\r\n\t\... | [
"0.7732112",
"0.6169144",
"0.5975664",
"0.5858012",
"0.5779613",
"0.5685318",
"0.56722826",
"0.56370693",
"0.55826044",
"0.5582359",
"0.5522097",
"0.5490319",
"0.5448207",
"0.5419214",
"0.54160076",
"0.53992504",
"0.5390173",
"0.5316555",
"0.5315309",
"0.5256592",
"0.5256548"... | 0.5180145 | 30 |
Adds data points to given DataSet for given data arrays. | public static void addDataPoints(DataSet aDataSet, double[] dataX, double[] dataY, double[] dataZ, String[] dataC)
{
// Get min length of staged data
int xlen = dataX != null ? dataX.length : Integer.MAX_VALUE;
int ylen = dataY != null ? dataY.length : Integer.MAX_VALUE;
int zlen = dataZ != null ? dataZ.length : Integer.MAX_VALUE;
int clen = dataC != null ? dataC.length : Integer.MAX_VALUE;
int len = Math.min(xlen, Math.min(ylen, Math.min(zlen, clen)));
if (len == Integer.MAX_VALUE)
return;
// Iterate over data arrays and add to DataSet
for (int i = 0; i < len; i++) {
Double valX = dataX != null ? dataX[i] : null;
Double valY = dataY != null ? dataY[i] : null;
Double valZ = dataZ != null ? dataZ[i] : null;
String valC = dataC != null ? dataC[i] : null;
DataPoint dataPoint = new DataPoint(valX, valY, valZ, valC);
int index = aDataSet.getPointCount();
aDataSet.addPoint(dataPoint, index);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addData(double[][] data) {\n for (int i = 0; i < data.length; i++) {\n addData(data[i][0], data[i][1]);\n }\n }",
"public void addData(DataPoint point)\n {\n data.add(point);\n }",
"private void appendData() {\n XYDataset tempdata = getDataset();\n\n ... | [
"0.67949563",
"0.61852103",
"0.6126006",
"0.60026634",
"0.59895927",
"0.59747595",
"0.59617513",
"0.5952175",
"0.5943932",
"0.59019655",
"0.58942443",
"0.58643156",
"0.5843534",
"0.5828094",
"0.582228",
"0.58220345",
"0.57969576",
"0.5790008",
"0.57684785",
"0.57615304",
"0.5... | 0.7529488 | 0 |
Returns the index of the first value that is inside or inside adjacent for given min/max. | public static int getStartIndexForRange(DataSet aDataSet, double aMin, double aMax)
{
int start = 0;
int pointCount = aDataSet.getPointCount();
while (start<pointCount && !isArrayValueAtIndexInsideOrInsideAdjacent(aDataSet, start, pointCount, aMin, aMax))
start++;
return start;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int findCoordElementRegular(double coordValue, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n if (n == 1 && bounded)\n return 0;\n\n double distance = coordValue - orgGridAxis.getCoordEdge1(0);\n double exactNumSteps = distance / orgGridAxis.getResolution();\n // int index = (... | [
"0.6476983",
"0.646101",
"0.63903344",
"0.637149",
"0.6338647",
"0.6041276",
"0.59990156",
"0.5996247",
"0.59356654",
"0.5925458",
"0.59000236",
"0.58843064",
"0.58585995",
"0.5837159",
"0.58315367",
"0.5830217",
"0.58272237",
"0.5817335",
"0.58037955",
"0.57973087",
"0.57913... | 0.6461299 | 1 |
Returns the index of the last value that is inside or inside adjacent for given min/max. | public static int getEndIndexForRange(DataSet aDataSet, double aMin, double aMax)
{
int pointCount = aDataSet.getPointCount();
int end = pointCount - 1;
while (end>0 && !isArrayValueAtIndexInsideOrInsideAdjacent(aDataSet, end, pointCount, aMin, aMax))
end--;
return end;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (... | [
"0.63972455",
"0.6371264",
"0.6286719",
"0.62358284",
"0.6088121",
"0.60669196",
"0.60294896",
"0.60251534",
"0.59897715",
"0.5979002",
"0.5970468",
"0.59682626",
"0.5932647",
"0.5919689",
"0.5907016",
"0.5903789",
"0.5868121",
"0.583795",
"0.5821413",
"0.5813228",
"0.5799337... | 0.68901217 | 0 |
Returns true if given data/index value is inside range or adjacent to point inside. | private static final boolean isArrayValueAtIndexInsideOrInsideAdjacent(DataSet aDataSet, int i, int pointCount, double aMin, double aMax)
{
// If val at index in range, return true
double val = aDataSet.getX(i);
if (val >= aMin && val <= aMax)
return true;
// If val at next index in range, return true
if (i+1 < pointCount)
{
double nextVal = aDataSet.getX(i + 1);
if (val < aMin && nextVal >= aMin || val > aMax && nextVal <= aMax)
return true;
}
// If val at previous index in range, return true
if (i > 0)
{
double prevVal = aDataSet.getX(i - 1);
if ( val < aMin && prevVal >= aMin || val > aMax && prevVal <= aMax)
return true;
}
// Return false since nothing in range
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isInInterval(int baseIndex);",
"public static boolean inRange (Position defPos, Position atkPos, int range) {\n\t\tint defX = defPos.getX();\n\t\tint defY = defPos.getY();\n\t\t\n\t\tint atkX = atkPos.getX();\n\t\tint atkY = atkPos.getY();\n\t\t\n\t\tif (defX -range <= atkX &&\n\t\t\t\tdefX + range >= at... | [
"0.6690947",
"0.66295326",
"0.66135895",
"0.65491366",
"0.6477205",
"0.64749026",
"0.64551824",
"0.6351523",
"0.63144845",
"0.62862426",
"0.6273316",
"0.62060803",
"0.617845",
"0.6174896",
"0.61618555",
"0.615026",
"0.6141762",
"0.61251223",
"0.611444",
"0.61111057",
"0.60947... | 0.757256 | 0 |
Returns a copy of given DataSet processed with given expressions. | public static DataSet getProcessedData(DataSet aDataSet, String exprX, String exprY, String exprZ)
{
// If both expressions empty, just return
boolean isEmptyX = exprX == null || exprX.length() == 0;
boolean isEmptyY = exprY == null || exprY.length() == 0;
boolean isEmptyZ = exprZ == null || exprZ.length() == 0;
if (isEmptyX && isEmptyY && isEmptyZ)
return aDataSet;
// Get KeyChains
KeyChain keyChainX = !isEmptyX ? KeyChain.getKeyChain(exprX.toLowerCase()) : null;
KeyChain keyChainY = !isEmptyY ? KeyChain.getKeyChain(exprY.toLowerCase()) : null;
KeyChain keyChainZ = !isEmptyZ ? KeyChain.getKeyChain(exprZ.toLowerCase()) : null;
// Get DataX
DataType dataType = aDataSet.getDataType();
int pointCount = aDataSet.getPointCount();
boolean hasZ = dataType.hasZ();
double[] dataX = new double[pointCount];
double[] dataY = new double[pointCount];
double[] dataZ = hasZ ? new double[pointCount] : null;
Map map = new HashMap();
for (int i=0; i<pointCount; i++) {
double valX = aDataSet.getX(i);
double valY = aDataSet.getY(i);
double valZ = hasZ ? aDataSet.getZ(i) : 0;
map.put("x", valX);
map.put("y", valY);
if (hasZ)
map.put("z", valZ);
dataX[i] = isEmptyX ? valX : KeyChain.getDoubleValue(map, keyChainX);
dataY[i] = isEmptyY ? valY : KeyChain.getDoubleValue(map, keyChainY);
if (hasZ)
dataZ[i] = isEmptyZ ? valZ : KeyChain.getDoubleValue(map, keyChainZ);
}
// Return new DataSet for type and values
return DataSet.newDataSetForTypeAndValues(dataType, dataX, dataY, dataZ);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Dataset FilterDataset(Dataset dataset)\n {\n Dataset result = new Dataset();\n for(HashMap<String, Object> row : dataset.dataset){\n if(this.eventExpression.MatchExpression(row))\n result.addRow(row);\n }\n return result;\n }",
"public T evaluate... | [
"0.563946",
"0.5406028",
"0.5323963",
"0.50672615",
"0.50327474",
"0.49858063",
"0.49102634",
"0.46703047",
"0.4659137",
"0.46280184",
"0.45728564",
"0.4549244",
"0.45473522",
"0.45460242",
"0.45243877",
"0.44945505",
"0.4493215",
"0.447499",
"0.44692975",
"0.44662365",
"0.44... | 0.6364521 | 0 |
Returns a copy of given DataSet with values converted to log. | public static DataSet getLogData(DataSet aDataSet, boolean doLogX, boolean doLogY)
{
// Get DataX
DataType dataType = aDataSet.getDataType();
int pointCount = aDataSet.getPointCount();
boolean hasZ = dataType.hasZ();
double[] dataX = new double[pointCount];
double[] dataY = new double[pointCount];
double[] dataZ = hasZ ? new double[pointCount] : null;
for (int i=0; i<pointCount; i++) {
double valX = aDataSet.getX(i);
double valY = aDataSet.getY(i);
double valZ = hasZ ? aDataSet.getZ(i) : 0;
dataX[i] = doLogX ? ChartViewUtils.log10(valX) : valX;
dataY[i] = doLogY ? ChartViewUtils.log10(valY) : valY;
if (hasZ)
dataZ[i] = valZ;
}
// Return new DataSet for type and values
return DataSet.newDataSetForTypeAndValues(dataType, dataX, dataY, dataZ);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DataSet toDataSet(Object adaptee);",
"public String toLogData() { \n\t return gson.toJson(this);\n\t}",
"public void logCopy(Dataset ds, ArrayList<int[]> listSelCell){\n dataProcessToolPanel.logCopy(dataset, listSelCell);\n }",
"public void logCut(Dataset ds){\n dataProcessToolPanel.log... | [
"0.5826014",
"0.53199404",
"0.5142035",
"0.5074752",
"0.49481937",
"0.49348727",
"0.4915158",
"0.49018356",
"0.48900756",
"0.4805679",
"0.47653437",
"0.47614855",
"0.47603926",
"0.46964365",
"0.4643053",
"0.46025896",
"0.45888084",
"0.45711136",
"0.45708555",
"0.45702678",
"0... | 0.60321623 | 0 |
Returns DataSet for given polar type. | public static DataSet getPolarDataForType(DataSet aDataSet, DataType aDataType)
{
// If already polar, just return
if (aDataSet.getDataType().isPolar())
return aDataSet;
// Complain if DataType arg isn't polar
if (!aDataType.isPolar())
throw new IllegalArgumentException("DataSetUtils.getPolarDataForType: Come on, man: " + aDataType);
// Otherwise, get DataX array and create dataT array
int pointCount = aDataSet.getPointCount();
double[] dataT = new double[pointCount];
// Get min/max X to scale to polar
double minX = aDataSet.getMinX();
double maxX = aDataSet.getMaxX();
double maxAngle = 2 * Math.PI; // 360 degrees
// Iterate over X values and convert to 0 - 360 scale
for (int i = 0; i < pointCount; i++) {
double valX = aDataSet.getX(i);
double valTheta = (valX - minX) / (maxX - minX) * maxAngle;
dataT[i] = valTheta;
}
// Get DataR and DataZ
double[] dataR = aDataSet.getDataY();
double[] dataZ = aDataSet.getDataType().hasZ() ? aDataSet.getDataZ() : null;
if (aDataType.hasZ() && dataZ == null)
dataZ = new double[pointCount];
// Create new DataSet for type and values and return
DataSet polarData = DataSet.newDataSetForTypeAndValues(aDataType, dataT, dataR, dataZ);
polarData.setThetaUnit(DataUnit.Radians);
return polarData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Data getData(HelperDataType type);",
"public static DataSet getPolarXYDataForPolar(DataSet aDataSet)\n {\n // If already non-polar, just return\n if (!aDataSet.getDataType().isPolar())\n return aDataSet;\n\n // Get pointCount and create dataX/dataY arrays\n int po... | [
"0.63008857",
"0.6226188",
"0.6003403",
"0.5887702",
"0.58519876",
"0.5733374",
"0.5731527",
"0.5608523",
"0.5333179",
"0.53155875",
"0.51681674",
"0.51620305",
"0.5154945",
"0.5143132",
"0.5124487",
"0.5124203",
"0.51110935",
"0.5080083",
"0.5058673",
"0.50566226",
"0.504629... | 0.6635365 | 0 |
Returns DataSet of XY points for given Polar type DataSet. This is probably bogus since it makes assumptions about the XY range. | public static DataSet getPolarXYDataForPolar(DataSet aDataSet)
{
// If already non-polar, just return
if (!aDataSet.getDataType().isPolar())
return aDataSet;
// Get pointCount and create dataX/dataY arrays
int pointCount = aDataSet.getPointCount();
double[] dataX = new double[pointCount];
double[] dataY = new double[pointCount];
// Get whether to convert to radians
boolean convertToRadians = aDataSet.getThetaUnit() != DataUnit.Radians;
// Iterate over X values and convert to 0 - 360 scale
for (int i = 0; i < pointCount; i++) {
// Get Theta and Radius
double dataTheta = aDataSet.getT(i);
double dataRadius = aDataSet.getR(i);
if (convertToRadians)
dataTheta = Math.toRadians(dataTheta);
// Convert to display coords
dataX[i] = Math.cos(dataTheta) * dataRadius;
dataY[i] = Math.sin(dataTheta) * dataRadius;
}
// Get DataZ and DataType
double[] dataZ = aDataSet.getDataType().hasZ() ? aDataSet.getDataZ() : null;
DataType dataType = dataZ == null ? DataType.XY : DataType.XYZ;
// Return new DataSet for type and values
return DataSet.newDataSetForTypeAndValues(dataType, dataX, dataY, dataZ);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static List<Point> createLinearDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 100);\r\n add(data, 5, 200);\r\n add(data, 10, 300);\r\n add(data, 15, 400);\r\n return data;\r\n }",
"public static DataSet getPolarDataForType(DataSet ... | [
"0.61773545",
"0.5975913",
"0.5923326",
"0.57036275",
"0.5620473",
"0.5543019",
"0.5458534",
"0.53477794",
"0.53088003",
"0.5301725",
"0.5269713",
"0.5242551",
"0.5235601",
"0.5220911",
"0.51927",
"0.51845235",
"0.5166969",
"0.511845",
"0.5097014",
"0.50890374",
"0.5088536",
... | 0.6826988 | 0 |
Returns whether given DataSet is has same X values as this one. | public static boolean isAlignedX(DataSet aDataSet1, DataSet aDataSet2)
{
// If PointCounts don't match, return false
int pointCount = aDataSet1.getPointCount();
if (pointCount != aDataSet2.getPointCount())
return false;
// Iterate over X coords and return false if they don't match
for (int i = 0; i < pointCount; i++) {
double x0 = aDataSet1.getX(i);
double x1 = aDataSet2.getX(i);
if (!MathUtils.equals(x0, x1))
return false;
}
// Return true since X coords are aligned
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplica... | [
"0.6501156",
"0.6484039",
"0.62895715",
"0.6236076",
"0.6085593",
"0.60297585",
"0.60014254",
"0.60009193",
"0.59662604",
"0.59636194",
"0.5921688",
"0.59149224",
"0.58594525",
"0.584003",
"0.578994",
"0.57847613",
"0.57616884",
"0.5758094",
"0.5694694",
"0.5673458",
"0.56547... | 0.6595996 | 0 |
Returns the Y value for given X value. | public static double getYForX(DataSet aDataSet, double aX)
{
// If empty, just return
int pointCount = aDataSet.getPointCount();
if (pointCount == 0)
return 0;
// Get index for given X value
double[] dataX = aDataSet.getDataX();
int index = Arrays.binarySearch(dataX, aX);
if (index >= 0)
return aDataSet.getY(index);
// Get lower/upper indexes
int highIndex = -index - 1;
int lowIndex = highIndex - 1;
// If beyond end, just return last Y
if (highIndex >= pointCount)
return aDataSet.getY(pointCount - 1);
// If before start, just return first Y
if (lowIndex < 0)
return aDataSet.getY(0);
// Otherwise, return weighted average
double x0 = aDataSet.getX(lowIndex);
double y0 = aDataSet.getY(lowIndex);
double x1 = aDataSet.getX(highIndex);
double y1 = aDataSet.getY(highIndex);
double weightX = (aX - x0) / (x1 - x0);
double y = weightX * (y1 - y0) + y0;
return y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"public double getYValue(){\n return(yValue);\n }",
"public double get(int y, int x);",
"public... | [
"0.7078041",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.70173144",
"0.69630325",
"0.6883465",
"0.6864026",
"0.6852736",
"0.6768006",
"0.6762585",
"0.6759607",
"0.6753895",
"0.6749338",
"0.6749338",
"0.674... | 0.0 | -1 |
Find the _Fields constant that matches fieldId, or null if its not found. | public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // DATAS
return DATAS;
default:
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // REFERRAL_LOG_IDS\n return REFERRAL_LOG_IDS;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n ... | [
"0.79869914",
"0.7915354",
"0.78808534",
"0.78808534",
"0.78808534",
"0.78808534",
"0.78808534",
"0.78808534",
"0.77862614",
"0.7779145",
"0.77291805",
"0.7727816",
"0.7721567",
"0.77125883",
"0.77125883",
"0.7709597",
"0.7708822",
"0.7701162",
"0.7699386",
"0.76957756",
"0.7... | 0.0 | -1 |
Find the _Fields constant that matches fieldId, throwing an exception if it is not found. | public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByThriftId(int fieldId) {\n switch(fieldId) {\n case 1: // E\n return E;\n default:\n return null;\n }\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields find... | [
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7626831",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"0.7621988",
"... | 0.0 | -1 |
Find the _Fields constant that matches name, or null if its not found. | public static _Fields findByName(String name) {
return byName.get(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache.thrift.annotation.Nullable\n public static _Fields findByName(java.lang.String name) {\n return byName.get(name);\n }",
"@org.apache... | [
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"0.7641586",
"... | 0.0 | -1 |
Performs a deep copy on other. | public DTO(DTO other) {
if (other.isSetDatas()) {
Map<String,String> __this__datas = new HashMap<String,String>(other.datas);
this.datas = __this__datas;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Prototype makeCopy();",
"public void copy (WorldState other)\n\t{\n\t\tresetProperties();\n\t\t//Iterate through other state and clone it's properties into this states properties\n\t\tCollection<WorldStateProperty> otherProperties = other.properties.values();\n\t\tfor (WorldStateProperty property : otherProperti... | [
"0.7214815",
"0.6982586",
"0.6743959",
"0.66792786",
"0.6563397",
"0.6549605",
"0.65230364",
"0.652084",
"0.64842516",
"0.64743775",
"0.6450891",
"0.6438907",
"0.64186275",
"0.640633",
"0.6403375",
"0.63743764",
"0.6373319",
"0.6358263",
"0.6322797",
"0.63214344",
"0.62839",
... | 0.6194176 | 28 |
Returns true if field datas is set (has been assigned a value) and false otherwise | public boolean isSetDatas() {
return this.datas != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"public boolean is_set_data() {\n return this.data != null;\n }",
"public boolean is_set_data() {\n return this.data != null;\n }",
"public bool... | [
"0.7934651",
"0.7934651",
"0.77464455",
"0.77464455",
"0.74981475",
"0.7402354",
"0.7378717",
"0.73549044",
"0.7341075",
"0.7225458",
"0.7225458",
"0.7189815",
"0.709653",
"0.7096029",
"0.7053636",
"0.70366156",
"0.70239",
"0.7007464",
"0.6899203",
"0.6894836",
"0.68872166",
... | 0.75033844 | 5 |
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case DATAS:
return isSetDatas();
}
throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"public boolean isSetField() {\r\n return this.field != null;\r\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n ... | [
"0.79056656",
"0.79056656",
"0.78333884",
"0.78036314",
"0.77937067",
"0.7780796",
"0.7780796",
"0.7780796",
"0.7780796",
"0.76468164",
"0.754723",
"0.75451803",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179",
"0.7542179... | 0.73933053 | 74 |
check for required fields check for substruct validity | public void validate() throws org.apache.thrift.TException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void validate() throws org.apache.thrift.TException {\n if (institutionID == null) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'institutionID' was not present! Struct: \" + toString());\n }\n if (productids == null) {\n throw new org.apache.thrift.protocol... | [
"0.75401354",
"0.74719286",
"0.7333375",
"0.7304861",
"0.72982836",
"0.729518",
"0.72577775",
"0.7225706",
"0.71371984",
"0.7129901",
"0.7116786",
"0.7092598",
"0.70728713",
"0.70518136",
"0.70367175",
"0.70314413",
"0.69580764",
"0.690188",
"0.68602306",
"0.6692948",
"0.6679... | 0.0 | -1 |
For given integer x, find out after binary conversion, how many ones it will have 6 = 0b110 > 2 | public static void main(String[] args) {
int x = 7;
System.out.println(new BinaryNumberOfOnes().convert(x));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static int ones()\n {\n char[] binArray = binary.toCharArray();\n int count = 0;\n int max = 0; \n for(int i = 0; i < binary.length(); i++)\n {\n if(binArray[i] == '0'){\n count = 0;\n }else {\n count++;\n max ... | [
"0.65348864",
"0.63511753",
"0.63481236",
"0.62826127",
"0.6260107",
"0.6255478",
"0.6244229",
"0.6170179",
"0.61675453",
"0.61420065",
"0.6113849",
"0.61088854",
"0.60984623",
"0.60852915",
"0.60752445",
"0.60017776",
"0.59986407",
"0.598645",
"0.5962516",
"0.595966",
"0.595... | 0.0 | -1 |
Get the items to list | public Item[] getItems()
{
return items;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Item> getItemList();",
"java.util.List<com.rpg.framework.database.Protocol.Item> \n getItemsList();",
"Object getTolist();",
"java.util.List<io.opencannabis.schema.commerce.OrderItem.Item> \n getItemList();",
"java.util.List<java.lang.Integer> getItemsList();",
"private static L... | [
"0.7854103",
"0.7770162",
"0.7604487",
"0.7448821",
"0.7275085",
"0.7122336",
"0.7008993",
"0.69570434",
"0.69254035",
"0.69109595",
"0.6902568",
"0.68922406",
"0.689025",
"0.6854865",
"0.684677",
"0.6841828",
"0.6815964",
"0.68084383",
"0.6788104",
"0.67611533",
"0.6739802",... | 0.6370086 | 59 |
Set the items to list | public void setItems(Item[] itemsIn)
{
items = itemsIn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void setList(List<T> items);",
"public void setNewList(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n mItems = new ArrayList<>(items);\n mapPossibleTypes(mItems);\n getFastAdapter().notifyAdapterDataSetChanged();... | [
"0.7668621",
"0.74790853",
"0.7381361",
"0.73339784",
"0.73263603",
"0.7250509",
"0.722824",
"0.7002588",
"0.6851791",
"0.68489504",
"0.67998445",
"0.6780601",
"0.6772303",
"0.672641",
"0.6589865",
"0.6588322",
"0.65838337",
"0.65568733",
"0.6551191",
"0.65459937",
"0.65315",... | 0.70653486 | 7 |
Get the row to highlight null or 1 for no row | public String getHighlightrow()
{
return String.valueOf(highlightRow);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unchecked\")\n private int getHighlightedRows() {\n int rowNumber = 0;\n // first check if any rows have been clicked on\n for (TableRow row: rows) {\n Drawable background = row.getBackground();\n if (background instanceof ColorDrawable) {\n ... | [
"0.66681",
"0.6309199",
"0.61275417",
"0.6083232",
"0.6054937",
"0.598251",
"0.59759104",
"0.59587336",
"0.5912342",
"0.5868616",
"0.5844666",
"0.5823883",
"0.5808743",
"0.58077186",
"0.58029985",
"0.5796033",
"0.5795772",
"0.5784609",
"0.57794654",
"0.5756417",
"0.57512665",... | 0.6898954 | 0 |
Set the row to highlight | public void setHighlightrow(String highlightRowIn)
{
if (highlightRowIn == null || highlightRowIn.equals(""))
{
highlightRow = -1;
}
else
{
try
{
highlightRow = Integer.parseInt(highlightRowIn);
}
catch(NumberFormatException nfe)
{
highlightRow = -1;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void highlightEnable() {\n actualFillColor = new Color(0, 255, 0, 150);\n repaint();\n revalidate();\n }",
"public void setHighlight(boolean high);",
"default void highlight()\n {\n JavascriptExecutor executor = (JavascriptExecutor) environment().getDriver();\n\n ... | [
"0.6849174",
"0.676253",
"0.66380703",
"0.6470737",
"0.6469678",
"0.64327145",
"0.64210445",
"0.63877094",
"0.6329672",
"0.63197166",
"0.6317775",
"0.6256638",
"0.62213975",
"0.61982626",
"0.6150764",
"0.61233413",
"0.6117668",
"0.6086459",
"0.6046237",
"0.603099",
"0.5990713... | 0.6752674 | 2 |
Get the column to emphasise "title", "date" or null | public String getEmphcolumn()
{
return emphColumn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected String getColumn()\n\t{\n\t\treturn null;\n\t}",
"@Override\r\n public String getColumnName(int col) {\r\n return title[col];\r\n }",
"String getColumnField(String javaField) throws NullPointerException;",
"public String getColumnForPrimaryKey() {\n return null;\n ... | [
"0.6328313",
"0.6099074",
"0.60845315",
"0.6010741",
"0.59672844",
"0.59672844",
"0.59672844",
"0.5956391",
"0.589012",
"0.58705956",
"0.58393466",
"0.58188444",
"0.5775984",
"0.5731566",
"0.5714624",
"0.5685421",
"0.56757313",
"0.5622899",
"0.5601071",
"0.5581193",
"0.555980... | 0.5452516 | 27 |
Set the column to emphasise "title", "date" or null | public void setEmphcolumn(String emphColumnIn)
{
emphColumn = emphColumnIn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected String getColumn()\n\t{\n\t\treturn null;\n\t}",
"private void setColumnNullInternal(String column)\n {\n data.put(canonicalize(column), NULL_OBJECT);\n }",
"private TableColumn<Object, ?> fillColumns() {\n\t\t\n\t\treturn null;\n\t}",
"@Override\r\n\tprotected String d... | [
"0.61805063",
"0.6064831",
"0.58797526",
"0.58178973",
"0.5746482",
"0.5728074",
"0.56495184",
"0.55980724",
"0.54824466",
"0.5477846",
"0.5425134",
"0.5393129",
"0.53890425",
"0.5376512",
"0.5370681",
"0.5350847",
"0.5350847",
"0.5350847",
"0.5350847",
"0.53435",
"0.53435",
... | 0.5304334 | 37 |
INVOCATIONS (WHERE THIS VISITOR DOES ITS JOB) | public void registerInvocation(Invocation inv) {
if(inv == null) return;
//If it is already used we were already here
boolean alreadyChecked = inv.isUsed();
//The invocation is used indeed
inv.use();
AbstractFunction invocationTarget = inv.getWhichFunction();
//XPilot: invocationTarget is null for default constructors
if(invocationTarget == null) return;
if(!alreadyChecked&&invocationTarget.getScope().getInclusionType() != AndromedaFileInfo.TYPE_NATIVE) {
//Only check it if it is no function defined in blizzard's libs
invocationTarget.getDefinition().accept(parent);
}
//Check if we can inline this function call
int inlineType = InlineDecider.decide(inv);
if(inlineType != InlineDecider.INLINE_NO) {
invocationTarget.addInline();
throw new Error("inline not yet supported.");
} else {
invocationTarget.addInvocation();
//visit(invocationTarget);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void beforeJobExecution() {\n\t}",
"public interface WorkflowExecutionListener {}",
"@Override\n\t\t\t\t\t\tpublic void onInvateComplet() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}",
"public void interactWhenApproaching() {\r\n\t\t\r\n\t}",
"@Override\n public void scanActuatorsParked() {\n }",
"@O... | [
"0.5736508",
"0.5736413",
"0.56973654",
"0.5660386",
"0.55624413",
"0.55579937",
"0.550343",
"0.5423401",
"0.5423401",
"0.5423401",
"0.54213023",
"0.54202914",
"0.5382581",
"0.53599787",
"0.53331363",
"0.5318362",
"0.5300663",
"0.52865726",
"0.526689",
"0.526689",
"0.5256421"... | 0.0 | -1 |
number of valid moves sprites have made on the grid. Constructor for a new Grid. | public Grid() {
this.moveCtr = 0;
listOfSquares = new ArrayList<Square>();
//populating grid array with squares
for(int y = 0; y < GridLock.HEIGHT; y++) {
for(int x = 0; x < GridLock.WIDTH; x++) { //square coordinates go from (0,0) to (5,5)
Square square;
//Setting up a square which has index values x,y and the size of square.
square = new Square(x, y, GridLock.SQUARE_SIZE, GridLock.SQUARE_SIZE);
grid[x][y] = square;
listOfSquares.add(square);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Grid ()\n {\n mGrid = new Move[3][3];\n for (int row = 0; row < 3; row++)\n for (int column = 0; column < 3; column++)\n mGrid[row][column] = new Move(Player.NONE, row, column);\n }",
"Board() {\n this(INITIAL_PIECES, BLACK);\n _countBlack = 12;\... | [
"0.67594737",
"0.6539017",
"0.6443412",
"0.64267164",
"0.63723236",
"0.6292118",
"0.6260198",
"0.61590594",
"0.6156941",
"0.6154743",
"0.61312705",
"0.61196333",
"0.60799706",
"0.6022006",
"0.60191107",
"0.59889024",
"0.5985234",
"0.5973324",
"0.59695023",
"0.5968636",
"0.595... | 0.6823967 | 0 |
Getter method for the squares in the grid. | public ArrayList<Square> getListOfSquares(){
return this.listOfSquares;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Square> getSquareGrid();",
"public Square[][] getSquares()\n {\n return squares;\n }",
"public Square[][] getSquares() {\n \treturn squares;\n }",
"public Square[][] getGrid() {\n\t\treturn this.grid;\n\t}",
"@Override\r\n\t@Basic\r\n\tpublic Collection<Square> getSquares() {... | [
"0.8242964",
"0.78479904",
"0.7811558",
"0.770363",
"0.7616684",
"0.74297106",
"0.72383183",
"0.7145604",
"0.71284384",
"0.7085531",
"0.7033413",
"0.70132256",
"0.69985026",
"0.6942467",
"0.69003755",
"0.6887692",
"0.6884769",
"0.6877283",
"0.6848207",
"0.682364",
"0.6774689"... | 0.7101618 | 9 |
Getter method for the grid array itself. | public Square[][] getGrid() {
return this.grid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Tile[][] getGrid() { return grid; }",
"public int[][] getGrid()\n {\n return grid;\n }",
"public Cell[][] getGrid() {\n return grid;\n }",
"public GameObject[][] getGrid(){\n\t\t\r\n\t\treturn this.grid;\r\n\t}",
"public Box[][] getGrid() {\n return this.grid;\n }",... | [
"0.77397084",
"0.7696455",
"0.7583141",
"0.7541405",
"0.7375339",
"0.734105",
"0.7163139",
"0.7127359",
"0.70839804",
"0.69659585",
"0.69587535",
"0.69456553",
"0.6944357",
"0.6943914",
"0.6937089",
"0.6925997",
"0.68601525",
"0.68540025",
"0.6844777",
"0.6842089",
"0.6834791... | 0.72462237 | 6 |
Getter method for the square object at the index coordinates | public Square getSquareAtPosition(int x, int y) {
return this.grid[x][y];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t@Basic\r\n\tpublic Square getSquareAt(Point position) {\r\n\t\t// get() does an equality check, not a reference check\r\n\t\treturn squares.get(position);\r\n\t}",
"Square getSquare(int x, int y);",
"Square getSquare(int x, int y){\n return board[x][y];\n }",
"public GeometricalObjec... | [
"0.7046468",
"0.70306396",
"0.7021676",
"0.69531554",
"0.6901677",
"0.6885568",
"0.68677485",
"0.68475825",
"0.68200797",
"0.6706159",
"0.66986245",
"0.6659595",
"0.6604921",
"0.6599298",
"0.6593995",
"0.65772736",
"0.65243894",
"0.6510934",
"0.6466463",
"0.63836074",
"0.6333... | 0.6853462 | 7 |
Convert the pixel/position on the main panel to a grid square index | public double toGrid(double pixel) {
return (pixel + GridLock.SQUARE_SIZE / 2) / GridLock.SQUARE_SIZE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default int gridToSlot(int x, int y) {\n return y * 9 + x;\n }",
"public static int getGridPosition(int x, int y, int width){\n\t\treturn (y*width)+x;\n\t}",
"private int matrixRowToGridCol(int i) \n {\n return (i % dimSquared) / gDim + 1;\n }",
"private int xyToOneD(int row, int col) ... | [
"0.6778018",
"0.67694056",
"0.67242634",
"0.6519112",
"0.6490065",
"0.6487237",
"0.64357334",
"0.6393307",
"0.6358643",
"0.63492244",
"0.63272554",
"0.63040394",
"0.6280771",
"0.62524027",
"0.621621",
"0.6203746",
"0.6188251",
"0.6098176",
"0.6085764",
"0.60679394",
"0.604939... | 0.55910337 | 68 |
Remove a sprite from the grid by resetting the spriteID's of the squares it used to occupy. | public void removeSpriteOnGrid(Sprite s, int x, int y) {
int i;
int id=-1;
if(s.getDirection()==Sprite.Direction.HORIZONTAL) {
for(i=0; i<s.getSize(); i++) {
//set squares occupied by the length of the sprite, starting at grid[x][y] to sprite id -1 to
//signal they are now free
grid[x+i][y].setSpriteID(id);
}
}else {
for(i=0; i<s.getSize(); i++) {
grid[x][y+i].setSpriteID(id);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeSprites(){\r\n\r\n\t}",
"public void resetSprites() {\n\t\tSPRITE_LIST.clear();\n\t}",
"public void removeSprite(Sprite s) {\r\n sprites.removeSprite(s);\r\n }",
"public void removeSprite(Sprite s) {\n this.sprites.removeSprite(s);\n }",
"public void removeSprite(Sprit... | [
"0.7347875",
"0.7163991",
"0.7085277",
"0.6906521",
"0.653507",
"0.65152",
"0.64482796",
"0.64274895",
"0.6418103",
"0.6376821",
"0.61186093",
"0.6009125",
"0.5998343",
"0.5934923",
"0.5864485",
"0.5810112",
"0.5801661",
"0.57912636",
"0.5730423",
"0.57110524",
"0.57110524",
... | 0.78818125 | 0 |
Compute the farthest y coordinate that the sprite can move to before collision. | public double furthestMoveYdirection(Sprite s, int oldX,int oldY, boolean upwards ) {
int id=s.getID(); //id of our sprite
int y;
//moving up
if(upwards) {
//going upwards, y coordinates decrease to 0
for(y=oldY; y>=0; y--) {
//find where the front end of the sprite meets another sprite
if(grid[oldX][y].getSpriteID()!=-1 && grid[oldX][y].getSpriteID()!=id) {
//System.out.println("upward detected at y coord "+ y);
return y+1;
}
}
return 0; //no collisions detected so the farthest y-coordinate position for the top of the sprite is y=0
}else {
//going downwards, y coordinates increase
for(y=oldY; y<= GridLock.WIDTH- s.getSize(); y++) {
//find where the tail end of the sprite meets another sprite
if(grid[oldX][y].getSpriteID()!=-1 &&grid[oldX][y].getSpriteID()!=id) {
//System.out.println("downard collision detected at y coord "+ y);
return y-1;
}
//check length of sprite after its first square
//to prevent dragging part-way over another sprite.
for(int k=0; k<s.getSize(); k++) {
if(grid[oldX][y+k].getSpriteID()!=id && grid[oldX][y+k].getSpriteID()!=-1 ) {
return (y+k)-s.getSize() < 0? 0: (y+k)-s.getSize();
}
}
}
//maximum y position for the top/first square of the sprite going downwards is when it's tail touches the
//bottom of the grid.
return GridLock.WIDTH- s.getSize();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getBiggestY() {\r\n double y = 0;\r\n List<Enemy> enemyLowest = this.lowestLine();\r\n if (enemyLowest.size() > 0) {\r\n y = enemyLowest.get(0).getCollisionRectangle().getBoundaries().getLowY();\r\n for (Enemy e: enemyLowest) {\r\n if (e.getCo... | [
"0.72014576",
"0.69716203",
"0.6950355",
"0.6873473",
"0.683227",
"0.673946",
"0.67242193",
"0.6708904",
"0.6702272",
"0.6674799",
"0.65973735",
"0.6594858",
"0.6569892",
"0.6569695",
"0.65406233",
"0.6537872",
"0.65187216",
"0.64890236",
"0.6485847",
"0.64837265",
"0.6448694... | 0.6328368 | 38 |
Resets the moveCtr to 0, for when a game is reset. | public void resetMoveCtr() {
moveCtr=0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetMoveCount() {\r\n\t\tmoveCount = 0;\r\n\t}",
"public void resetMove() {\n pointer = 0;\n }",
"public void resetMove() {\n\t\tthis.moveMade = false;\n\t}",
"public void resetMove(Move move) {\n board[move.x * LENGTH + move.y] = Player.None;\n numMoves--;\n }",
"pu... | [
"0.78231126",
"0.7685235",
"0.7538618",
"0.724573",
"0.711485",
"0.70544523",
"0.70250946",
"0.6985235",
"0.6918685",
"0.68746006",
"0.6758075",
"0.6757468",
"0.67031866",
"0.6693166",
"0.6684023",
"0.66086245",
"0.6597311",
"0.65569055",
"0.6552043",
"0.65498114",
"0.6535743... | 0.89203906 | 0 |
Getter method for number of moves that Sprites have made on the grid. | public int getMovectr() {
return moveCtr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumberOfMoves();",
"public int getNumberOfMoves() {\r\n return numberOfMoves;\r\n }",
"public int moves()\n {\n return numberOfMoves;\n }",
"public int getNumMoves() {\n\t\treturn numMoves;\n\t}",
"public int getTotalNumberOfSprites() {\n return this.getRows() * this... | [
"0.7884831",
"0.7602669",
"0.7532383",
"0.75242245",
"0.74487317",
"0.73931867",
"0.7240287",
"0.7236959",
"0.7110805",
"0.71100044",
"0.7092237",
"0.6970754",
"0.68792266",
"0.6832487",
"0.6832487",
"0.68275267",
"0.6788025",
"0.6765113",
"0.6751633",
"0.6701675",
"0.6689524... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.