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
Subtract the given fraction from this fraction and return the result as a third new fraction.
public Fraction sub(Fraction f) { /** Denominators equal */ if( f.getDenominator() == this.denominator ) return new Fraction( this.numerator - f.getNumerator(), this.denominator); /** Denominators different */ /** The least common multiple found between both denominators. */ int lcd = getLCD(this.denominator, f.getDenominator()); /** Common algorithm to find new numerator with least common denominator(lcd): lcd / denominator * numerator */ return new Fraction( (lcd / this.denominator * this.numerator) - (lcd / f.getDenominator() * f.getNumerator()), lcd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Fraction subtract(Fraction f){\n return new Fraction(this.numerator * f.denominator - f.numerator * this.denominator, this.denominator * f.denominator);\n }", "public Fraction subtract(Fraction subtrahend)\n {\n int newDenominator = (this.getDenominator() * subtrahend.getDenominator());\n...
[ "0.7504706", "0.67035145", "0.66", "0.65673155", "0.6499374", "0.6389499", "0.6167525", "0.5982452", "0.59168744", "0.5905128", "0.5850711", "0.5806677", "0.57947105", "0.57696295", "0.57584494", "0.57320863", "0.5726197", "0.5700923", "0.5696824", "0.568926", "0.5679005", ...
0.6090597
7
Produce the string representation of this fraction, of the form "numerator / demoninator", e.g., "1/2" or "3/4".
public String toString() { if(denominator != 1) return "" + this.numerator + "/" + this.denominator; /** The fraction is a whole number */ else return "" + this.numerator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString()\n {\n if(denominator==1)\n return numerator+\"\"; //e.g 4/1 =4 5/1 =5 etc\n else if(numerator%denominator==0)\n {\n return \"\"+numerator/denominator; //e.g 4/2 =2\n }\n else if(numerator%denominator!=0) {\n // e.g if you ...
[ "0.8081139", "0.7814632", "0.7694036", "0.76852864", "0.76386726", "0.7630191", "0.76245785", "0.7456358", "0.7451276", "0.7445009", "0.7394112", "0.73895174", "0.7373863", "0.7358778", "0.7358101", "0.7262899", "0.72546214", "0.6826858", "0.67889816", "0.6766281", "0.6719897...
0.7901542
1
Return the value of this fraction as a real number.
public double value() { return ((double) this.numerator / this.denominator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getRealValue()\r\n\t{\r\n\t\treturn realValue;\r\n\t}", "public double floatValue() {\n\treturn numerator/(double)denominator;\n }", "double getRealValue();", "public double getValue(){\n return (double) numerator / (double) denominator;\n }", "public double getValue() {\n retu...
[ "0.7132419", "0.7119702", "0.7082907", "0.6923947", "0.69080716", "0.6836768", "0.6834126", "0.68204165", "0.6791593", "0.6709257", "0.6709257", "0.6709257", "0.6692947", "0.66538405", "0.6512115", "0.6510116", "0.64960617", "0.6431997", "0.64279467", "0.6421816", "0.6392182"...
0.755534
0
Reduce a string by dividing by the greatest common divisor(GCD).
private void reduce() { /** The fraction is equal to 0. The numerator is 0 in this case */ if(this.numerator == 0) this.denominator = 1; /** The numerator and denominator are not equal */ else if (this.numerator != this.denominator) { /** The greatest common divisor of the numerator and denominator of this fraction */ int gcd = getGCD(Math.abs(this.numerator), Math.abs(this.denominator)); /** There is a greatest common divisor greater than 1 */ if (gcd > 1) { this.numerator /= gcd; this.denominator /= gcd; } } /** The fraction is equal to 1 */ else { this.numerator = 1; this.denominator = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reduce(){\r\n int num = numerator;\r\n int denom = denominator;\r\n int greatest;\r\n \r\n // Find the greater of numerator and denominator\r\n if(numerator < 0){\r\n num = -numerator;\r\n }\r\n if(num > denom){\r\n greatest ...
[ "0.66185576", "0.6614297", "0.62540627", "0.6110252", "0.60986114", "0.59634525", "0.58962643", "0.5861139", "0.5842626", "0.5837479", "0.58184755", "0.5807822", "0.58005834", "0.5718632", "0.5710091", "0.5690356", "0.5685382", "0.5683354", "0.5675487", "0.5664123", "0.564984...
0.54023325
37
Returns greatest common divisor between two numbers. Uses the Euclidean algorithm: 1) If the first number (a) is less than the second number (b), then swap them (put the larger number in a). 2) Divide first number (a) by second number (b) and get remainder (r). If r is 0, return second number (b) as the gcd. 3) Call gcd function again using second number (b) and remainder (r) as the inputs respectively.
private int getGCD(int a, int b) { /** This ensures the larger of the two numbers is in a */ if(a < b){ /** Temp variable used for swapping two variables */ int temp = a; a = b; b = temp; } /** The remainder needs to be stored to recursively find the gcd */ int remainder; if((remainder = a % b) == 0) { return b; } else { return getGCD(b, remainder); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int gcd(int a, int b){\r\n int r, temp;\r\n if( a<b ){ temp = a; a = b; b = temp; }\r\n while( b!=0 ){ r = a%b; a = b; b = r; }\r\n return a;\r\n }", "public static int gcd(int a, int b) {\n\t\t// take absolute values\n\t\tif (a < 0) {\n\t\t\ta *= -1;\n\t\t}\n\t\tif (b < 0) {\n\t\t\...
[ "0.8328491", "0.8133263", "0.80381715", "0.80096984", "0.8005781", "0.792245", "0.79130477", "0.788324", "0.78332037", "0.78084695", "0.77528906", "0.77381593", "0.7705443", "0.76600033", "0.76587903", "0.75965726", "0.7578177", "0.7557523", "0.74571645", "0.74526745", "0.740...
0.79563385
5
Returns the least common denominator between two numbers.
private int getLCD(int a, int b){ return ( (a * b) / getGCD(a, b) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int lowestCommonFactor(int a, int b)\n\t{\n\t\treturn (a * b) / greatestCommonFactor(a, b);\n\t}", "private static int gcd (int a, int b) {\n int m = Math.max (Math.abs (a), Math.abs (b));\n if (m == 0) throw new ArithmeticException (\" zero in gcd \");\n int n = Math.min (Math.abs (...
[ "0.7020934", "0.6765682", "0.67609435", "0.6743376", "0.64915186", "0.64314145", "0.6415563", "0.6388399", "0.6376087", "0.6362408", "0.63584197", "0.63401383", "0.63253427", "0.63223594", "0.63052815", "0.6296821", "0.62805045", "0.6268357", "0.6251485", "0.62148803", "0.621...
0.0
-1
TODO Autogenerated method stub
@Override public boolean AddAppointmentX(Appointment appointment) { return appointmentMapper.AddAppointmentX(appointment); }
{ "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 List<Appointment> findCustCarAppoinmentX(int cust_id) { return appointmentMapper.findCustCarAppoinmentX(cust_id); }
{ "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 delAppointmentByCnumX(String c_num) { return appointmentMapper.delAppointmentByCnumX(c_num); }
{ "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 List<Appointment> findCarAppoinmentX() { return appointmentMapper.findCarAppoinmentX(); }
{ "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 List<Appointment> findCarAppoinmentByCarIDX(int c_id) { return appointmentMapper.findCarAppoinmentByCarIDX(c_id); }
{ "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
/ a static method that constructs a max heap from an unordered int array in linear time this is more efficient than inserting all the array items one by one by using insert()
public void UnorderedMaxPQFromArray(Key[] array){ //copy the array for (int i=0; i<array.length; i++){ this.keys[i+1] = array[i]; } this.size = array.length; //sink to build the max heap, starting from the parent node of the last node for (int i=this.size/2; i>=1; i--) { this.sink(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int[] buildMaxHeap(int [] arr) {\n\t\tint n = arr.length;\n\t\tint startIdx = (n / 2) - 1;\n\t\tfor(int i = startIdx; i >= 0; i--)\n\t\t\theapify(arr, n, i);\n\t\treturn arr;\n\t}", "public static int[] buildMaxHeap(int[] arr){\n int size = arr.length;\n for(int i=size/2; i>0; i--){\n ...
[ "0.83435106", "0.8031693", "0.7959341", "0.7696987", "0.7543531", "0.74582976", "0.7422855", "0.7417364", "0.7328311", "0.7134431", "0.7120951", "0.7094074", "0.7058871", "0.7049406", "0.7040578", "0.7039897", "0.70302886", "0.6998894", "0.6958196", "0.6939455", "0.69193125",...
0.64783126
39
/ swim up: exchange the node with its parent node if the node is greater than its parent node
private void swim(int node){ //we need node/2 > 0 here to stop the loop and prevent the unused keys[0] from being accessed while (node/2 > 0){ //break if the node is smaller than its parent node if (this.keys[node].compareTo(this.keys[node/2])<=0) break; //otherwise exchange the node with its parent this.exch(node, node/2, this.keys); node = node/2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void shiftUp() {\n int index = this.size;\n\n while (hasParent(index) && (parent(index).compareTo(heap[index]) > 0)) {\n swap(index, parentIndex(index));\n index = parentIndex(index);\n }\n }", "protected void siftUp() {\r\n\t\tint child = theHeap.size() - 1...
[ "0.7160834", "0.6974026", "0.6784077", "0.6661581", "0.66048104", "0.6575198", "0.6544479", "0.65213525", "0.64645886", "0.642678", "0.640108", "0.6384178", "0.6346111", "0.6285659", "0.6274335", "0.62554187", "0.6231045", "0.62184393", "0.61784", "0.61515325", "0.61469656", ...
0.620075
18
/ sink down: exchange the node with its LARGER child node if the node is smaller than ANY of its child node
private void sink(int node){ while (node*2 <= this.size){ int largerChild = node * 2; if (node*2+1 <= this.size && this.keys[node*2+1].compareTo(this.keys[largerChild])>0) { largerChild = node*2+1; } //break if the node is greater than both of its child node if (this.keys[node].compareTo(this.keys[largerChild]) > 0) break; //otherwise exchange node with its LARGER child this.exch(node, largerChild, this.keys); node = largerChild; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void shiftDown() {\n int index = 1;\n\n while (hasLeftChild(index)) {\n //compare chield Nodes\n int smallerChild = leftIndex(index);\n\n // shft down with smaller Node if any\n if (hasRightChild(index) && heap[leftIndex(index)].compareTo(heap[right...
[ "0.6441882", "0.63621336", "0.62925494", "0.6291259", "0.6272317", "0.62329745", "0.61958146", "0.6085943", "0.606473", "0.5818207", "0.5801065", "0.578972", "0.5775993", "0.5774223", "0.5765869", "0.576439", "0.5753532", "0.5743568", "0.57257646", "0.5724426", "0.5698147", ...
0.73160416
0
test code goes here
public static void main(String[] args){ UnorderedMaxPQ<Integer> pq = new UnorderedMaxPQ<>(5); pq.insert(1); pq.insert(3); pq.insert(2); System.out.println(pq.delMax()); System.out.println(pq.delMax()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void test() {\n\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n public void runTest() {\n }", "@Test\r\n\tpublic void testSanity() {\n\t}", "public void testGetBasedata() {\n }", "@Override\n\tpublic void test() {\n\t\t\n\t}", "public void testSetBasedata() {\n ...
[ "0.7723942", "0.7720591", "0.73094815", "0.7187314", "0.7185779", "0.7106823", "0.7064164", "0.7046196", "0.70079154", "0.69975585", "0.6956307", "0.6939198", "0.6931111", "0.6895484", "0.68549603", "0.68487114", "0.6847278", "0.6847278", "0.6842789", "0.68223166", "0.6819793...
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Laboratorio)) { return false; } Laboratorio other = (Laboratorio) object; if ((this.idLaboratorio == null && other.idLaboratorio != null) || (this.idLaboratorio != null && !this.idLaboratorio.equals(other.idLaboratorio))) { 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
Returns the corresponding AWT Point object.
public Point getAWTPoint() { return new Point(this.x0, this.y0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Point getPoint() {\n return point;\n }", "public Point getPoint()\n\t{\n\t\treturn point;\n\t}", "public KDPoint getPoint() {\n\t\treturn new KDPoint(this.loc.lat,this.loc.lng,0.0);\n\t}", "public Point getPoint() {\n return this.mPoint;\n }", "Point createPoint();", "public Po...
[ "0.69192046", "0.68770695", "0.68694866", "0.6843159", "0.6838789", "0.6766462", "0.6712957", "0.6712957", "0.65462387", "0.65353316", "0.64843744", "0.6480855", "0.646965", "0.6420568", "0.6395354", "0.63533705", "0.62516165", "0.6231178", "0.6171046", "0.61460763", "0.60757...
0.72769225
0
Given this coordinate and a coordinate b, the displacement vector v is the place vector of this coordinate minus the place vector of the given coordinate b.
public Vector getDisplacementVector(Coord b) { return new Vector(b).minus(new Vector(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Point subtract(Point b)\n {\n return new Point(this.x - b.x, this.y - b.y);\n }", "Position V2Sub(Position a, Position b){\r\n\t\tdouble x = a.getX() - b.getX();\r\n\t\tdouble y = a.getY() - b.getY();\r\n\t\tPosition c = new Position(x, y);\r\n\t\treturn c;\r\n\t}", "private Point2D.Double...
[ "0.67917985", "0.6554782", "0.6505584", "0.6484662", "0.64629805", "0.6337061", "0.62698513", "0.6249699", "0.6245765", "0.61952484", "0.6169258", "0.6159208", "0.6129788", "0.6129644", "0.61029243", "0.59703994", "0.5947984", "0.59384453", "0.5831953", "0.5824906", "0.578601...
0.7704363
0
Returns a string representation of a coordinate.
@Override public String toString() { return "Coord[" + this.x0 + "," + this.y0 + "]"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString() {\n\t\t\n\t\treturn (\"(\" + getX() + \", \" + getY() + \")\");\t\t\t// Returns a string representing the Coordinate object\n\t}", "public String getCoordinatesAsString() {\r\n return String.format(\"%s, %s, %s, %s\\n\", p1, p2, p3, p4);\r\n }", "public String getLocationStri...
[ "0.82181203", "0.7475655", "0.7411174", "0.7234392", "0.72332984", "0.7205969", "0.7176227", "0.7170188", "0.7125979", "0.7098215", "0.708354", "0.708354", "0.708354", "0.7081894", "0.7071682", "0.706296", "0.7051093", "0.7039201", "0.7031997", "0.69865525", "0.69779927", "...
0.73443395
3
TODO Autogenerated method stub
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
//GET RID OF THIS! private ArrayList sensorReadingArrayList; constructor for preexisting (external) queue
public MHLMobileIOClient(BandAccelerometerAppActivity a, MHLBlockingSensorReadingQueue q, String ip, int port, String id){ this.parentActivity = a; this.sensorReadingQueue = q; this.ip = ip; this.port = port; this.userID = id; this.startClient(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public QueueAdapter() {\n list = new ArrayList<>();\n }", "public CincamimisQueue()\r\n {\r\n measurementQueue=new ArrayBlockingQueue(10,true);\r\n }", "private void startClient(){\n if (started) return;\n\n// //GET RID OF THIS!!\n// sensorReadingArrayList = new ArrayList<...
[ "0.6248905", "0.615195", "0.5986438", "0.59472024", "0.5922359", "0.5885929", "0.5845952", "0.5826097", "0.58213156", "0.5807713", "0.57648224", "0.57343674", "0.5719127", "0.5669076", "0.5650695", "0.5642972", "0.56292593", "0.56236786", "0.5607292", "0.55935955", "0.5591993...
0.5633341
16
constructor for selfcontained queue
public MHLMobileIOClient(BandAccelerometerAppActivity a, String ip, int port, String id){ this.parentActivity = a; this.sensorReadingQueue = new MHLBlockingSensorReadingQueue(); this.ip = ip; this.port = port; this.userID = id; this.startClient(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyQueue() {\n \n }", "public Queue() {}", "public MyQueue() {\n\n }", "public MyQueue() {\n\n }", "public MyQueue() {\n\n }", "public Queue()\n\t{\n\t\tsuper();\n\t}", "public SQueue(){\n\n\t}", "private Queue(){\r\n\t\tgenerateQueue();\r\n\t}", "public Queue(){ ...
[ "0.820289", "0.81285596", "0.80770445", "0.8062781", "0.8062781", "0.7979898", "0.7938153", "0.7848393", "0.77451646", "0.7726242", "0.7648498", "0.7641798", "0.7641303", "0.7590786", "0.7574755", "0.7569289", "0.75337815", "0.7523557", "0.75051147", "0.74365556", "0.74175614...
0.0
-1
in the future, this may be set to public and explicitly called by the user
private void startClient(){ if (started) return; // //GET RID OF THIS!! // sensorReadingArrayList = new ArrayList<MHLSensorReading>(); started = true; clientThread = new Thread(new MHLClientThread(ip, port, userID)); clientThread.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "protected boolean func_70814_o() { return true; }", "public final void mo51373a() {\n }", "@Override\n protected void prot() {\n }", "@Override\n\tpublic boolean isPublic() {\n\t\treturn false;\n\t}", "@...
[ "0.68976885", "0.666589", "0.6566616", "0.65197575", "0.62685674", "0.6213182", "0.6201474", "0.6191107", "0.6188357", "0.6173605", "0.61016774", "0.6082272", "0.6082272", "0.6057903", "0.6055112", "0.60354257", "0.60043293", "0.5988116", "0.59879386", "0.59783804", "0.597838...
0.0
-1
A helper comparison function used only for testing.
public boolean compareTo( String tokens_[], String labels_[], String types_[], String constrType_[], String dependId_[], int connectQty_[], int componentId_[]) throws Exception { int N = tokens_.length; ArrayList<String> tokens = new ArrayList<String>(); ArrayList<String> labels = new ArrayList<String>(); ArrayList<FieldType> types = new ArrayList<FieldType>(); ArrayList<ArrayList<ConstraintType>> constrType = new ArrayList<ArrayList<ConstraintType>>(); ArrayList<ArrayList<Integer>> dependId = new ArrayList<ArrayList<Integer>>(); ArrayList<Integer> connectQty = new ArrayList<Integer>(); ArrayList<Integer> componentId = new ArrayList<Integer>(); if (labels_.length != N) throw new Exception( String.format("labels len (%d) != tokens len (%d), args))", N, labels_.length)); if (types_.length != N) throw new Exception( String.format("labels len (%d) != types len (%d), args))", N, types_.length)); if (constrType_.length != N) throw new Exception( String.format("labels len (%d) != constrType len (%d), args))", N, constrType_.length)); if (dependId_.length != N) throw new Exception( String.format("dependId len (%d) != dependId len (%d), args))", N, dependId_.length)); if (connectQty_.length != N) throw new Exception( String.format("labels len (%d) != connectQty len (%d), args))", N, connectQty_.length)); if (componentId_.length != N) throw new Exception( String.format("labels len (%d) != componentId len (%d), args))", N, componentId_.length)); for (int i = 0; i < N; ++i) { tokens.add(tokens_[i]); labels.add(labels_[i]); types.add(FieldType.valueOf(types_[i])); ArrayList<ConstraintType> ct = new ArrayList<ConstraintType>(); for (String t:constrType_[i].split("[,]")) if (!t.isEmpty()) { // "".split(",") returns [""] try { ct.add(ConstraintType.valueOf(t)); } catch (java.lang.IllegalArgumentException e) { throw new Exception("Failed to parse the constraint value: '" + t + "'"); } } constrType.add(ct); ArrayList<Integer> it = new ArrayList<Integer>(); for (String t:dependId_[i].split("[,]")) if (!t.isEmpty()) { // "".split(",") returns [""] try { it.add(Integer.valueOf(t)); } catch (java.lang.IllegalArgumentException e) { throw new Exception("Failed to parse the dependent id value: '" + t + "'"); } } dependId.add(it); connectQty.add(connectQty_[i]); } boolean bTokens = DeepEquals.deepEquals(mTokens, tokens); boolean bLabels = DeepEquals.deepEquals(mLabels, labels); boolean bTypes = DeepEquals.deepEquals(mTypes, types); boolean bConstrType = DeepEquals.deepEquals(mConstrType, constrType); boolean bDependId = DeepEquals.deepEquals(mDependId, dependId); boolean bConnectQty = DeepEquals.deepEquals(mConnectQty, connectQty); boolean bComponentId= DeepEquals.deepEquals(mComponentId, componentId); boolean bFinal = bTokens && bLabels && bTypes && bConstrType && bDependId && bConnectQty; if (!bFinal) { System.out.println(String.format("Comparison failed: \n" + " Tokens : %b \n" + " Labels : %b \n" + " Types : %b \n" + " ConstrType : %b \n" + " DependId : %b \n" + " ConnectQty : %b \n" + " ComponentId : %b \n", bTokens, bLabels, bTypes, bConstrType, bDependId, bConnectQty, bComponentId )); } return bFinal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }", "public abstract void compare();", "public void testObjCompare()\n {\n assertEquals( Comparator.EQUAL, Util.objCompare(null,null) );\n assertEquals( Comparator.LESS, ...
[ "0.72479373", "0.70446503", "0.6969024", "0.67674494", "0.6731058", "0.6702011", "0.6663934", "0.66586506", "0.6649456", "0.65568227", "0.6468756", "0.6467065", "0.6436486", "0.6436486", "0.6428915", "0.64057577", "0.6393033", "0.6391782", "0.63779247", "0.6346663", "0.634395...
0.0
-1
Check if the element label contains only valid symbols.
private boolean checkLabelSymbols(String label) { return label.indexOf(',') == -1 && label.indexOf(' ') == -1 && label.indexOf('(') == -1 && label.indexOf(')') == -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void labelIsNotWithInvalidPattern() {\n String[] invalidLabels = StringUtil.INVALID_USERNAME;\n for (String label : invalidLabels) {\n propertyIsNot(label, descriptionS, CodeI18N.FIELD_PATTERN_INCORRECT_USERNAME,\n \"label property does not fulfill the ...
[ "0.5962552", "0.574682", "0.57259065", "0.56261253", "0.5623374", "0.55767745", "0.55326605", "0.55326605", "0.5499986", "0.54701906", "0.5470048", "0.546216", "0.53812534", "0.5379397", "0.53690535", "0.53606236", "0.5345678", "0.53316647", "0.52973336", "0.5281416", "0.5281...
0.75389
0
Parse constraintrelated info and memorizes it.
private void addConstraint(String tok) throws SyntaxError { assert(tok.startsWith(PREFIX_OP_STR)); if (!tok.endsWith(")")) { throw new SyntaxError(String.format("Wrong format for the constraint '%s', expected format: %s", tok, CONSTR_FMT)); } int pos = tok.indexOf('('); if (pos == -1) { throw new SyntaxError(String.format("Missing '(' in the constraint '%s', expected format: %s", tok, CONSTR_FMT)); } String op = tok.substring(1, pos); ConstraintType type = ConstraintType.CONSTRAINT_PARENT; if (op.equalsIgnoreCase(CONSTR_CONTAINS)) { type = ConstraintType.CONSTRAINT_CONTAINS; } else if (!op.equalsIgnoreCase(CONSTR_PARENT)) { throw new SyntaxError(String.format("Wrong constraint name '%s' in the element '%s'", op, tok)); } // Labels cannot contain commas String parts[] = tok.substring(pos + 1, tok.length() - 1).split(","); if (parts.length < 2) { throw new SyntaxError(String.format( "There should be at least 2 elements between '(' and ')'" + " in the constraint '%s', expected format %s", tok, CONSTR_FMT)); } String headLabel = parts[0].trim(); Integer headId = mLabel2Id.get(headLabel); if (null == headId) { throw new SyntaxError(String.format("Cannot find a lexical entry " + " for the label '%s', constraint '%s'", headLabel, tok)); } ArrayList<ConstraintType> constr = mConstrType.get(headId); ArrayList<Integer> dependIds = mDependId.get(headId); if (ConstraintType.CONSTRAINT_PARENT == type) { if (mTypes.get(headId) != FieldType.FIELD_ANNOTATION) { throw new SyntaxError(String.format( "The parent in the constraint '%s' should be an annotation", tok)); } } for (int i = 1; i < parts.length; ++i) { String depLabel = parts[i].trim(); Integer depId = mLabel2Id.get(depLabel); if (null == depId) { throw new SyntaxError(String.format("Cannot find a lexical entry " + " for the label '%s', constraint '%s'", depLabel, tok)); } if (ConstraintType.CONSTRAINT_PARENT == type) { if (mTypes.get(depId) != FieldType.FIELD_ANNOTATION) { throw new SyntaxError(String.format( "A child (label '%s') in the constraint '%s' should be an annotation", depLabel, tok)); } } constr.add(type); dependIds.add(depId); /* * This is a potentially horrible linear-time complexity search * in an array. However, for a reasonable-size user query * these arrays are going to be tiny and, in practice, * such a linear search be as fast as or likely even faster than * a hash/tree map lookup. */ if (!mEdges.get(depId).contains(headId)) mEdges.get(depId).add(headId); if (!mEdges.get(headId).contains(depId)) mEdges.get(headId).add(depId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void defineConstraints();", "@Override\n\tprotected void getConstraintFromNetlistConstraintFile() {\n\n\t}", "public List<Constraint> getConstraints();", "com.google.cloud.clouddms.v1.ConstraintEntityOrBuilder getConstraintsOrBuilder(int index);", "void visitConstraintValue(ConstraintVal...
[ "0.5784913", "0.5783641", "0.5626565", "0.5614268", "0.5539248", "0.5463738", "0.5426675", "0.5371615", "0.5342834", "0.5290731", "0.527172", "0.527172", "0.5255446", "0.5212129", "0.5187348", "0.516024", "0.51368225", "0.5081707", "0.5074049", "0.5067281", "0.50562936", "0...
0.555764
4
Compute a number of edges each node is connected with in an query graph and assign unique IDs to connected subgraphs.
private void compConnectInfo() { int compIdCounter = 0; int connectQty[] = new int[mTokens.size()]; for (int i = 0; i < mTokens.size(); ++i) { if (!mEdges.get(i).isEmpty()) { int compId = mComponentId.get(i); if (compId < 0) { // Haven't computed connectedness and haven't assigned component id HashSet<Integer> visited = new HashSet<Integer>(); if (!visited.contains(i)) { doVisit(compIdCounter, i, visited); mConnectQty.set(i, visited.size()); connectQty[compIdCounter] = visited.size(); compIdCounter++; } } else { // Connectedness is computed and component id is already assigned mConnectQty.set(i, connectQty[compId]); } } else { mComponentId.set(i, compIdCounter); compIdCounter++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public long[ ][ ] count() {\n // precompute common nodes\n for (int x = 0; x < n; x++) {\n for (int n1 = 0; n1 < deg[x]; n1++) {\n int a = adj[x][n1];\n for (int n2 = n1 + 1; n2 < deg[x]; n2++) {\n int b = adj[x][n2];\n ...
[ "0.63050056", "0.62586915", "0.6221607", "0.61061573", "0.6095352", "0.6091862", "0.60484457", "0.60263497", "0.5994746", "0.5993341", "0.59859174", "0.58719", "0.58687663", "0.58375967", "0.5817889", "0.5809684", "0.5766857", "0.57593817", "0.57480055", "0.57141215", "0.5696...
0.53989327
50
Find the department objects for the provided list of department ids. Result is a privately available list of pamIds of type long.
private List<Department> pamDepts(Long deptId) { PersistenceManager pm = PMF.get().getPersistenceManager(); depts = new ArrayList<Department>(); // add primary dept Department dPrimary = pm.getObjectById(Department.class, deptId); depts.add(dPrimary); // primary dept's mutual aid depts String dMutualAid = dPrimary.getmutualAid(); if (dMutualAid.length() != 0) { if (dMutualAid.contains(",")) { String[] maDepts = dMutualAid.split(", ", -1); for (int i=0; i< maDepts.length; i++) { Long maDeptId = Long.valueOf(maDepts[i]); Department dMAs = pm.getObjectById(Department.class, maDeptId); if (dMAs != null) { depts.add(dMAs); } } } else { Department dMAsolo = pm.getObjectById(Department.class, Long.valueOf((dMutualAid).trim())); if (dMAsolo != null) { depts.add(dMAsolo); } } } System.out.println("Depts Qty: " + depts.size()); System.out.println("Exit: pamDepts"); return depts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptMembers(List<Long> pamDeptIds) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common?\n Query q = pm.newQuery(Member.class, \":p.contains(deptId)\");\n q.setOrdering(\"deptId asc, id asc\"); \n members = (List<Member>)q.execute(pamDeptIds);\n...
[ "0.7143511", "0.7137756", "0.67222565", "0.63347983", "0.5873654", "0.5792435", "0.57687324", "0.57447964", "0.57329315", "0.55781823", "0.55449885", "0.547223", "0.5468887", "0.5453904", "0.54449284", "0.5439085", "0.540086", "0.54000777", "0.5389313", "0.53707", "0.5323402"...
0.6998669
2
Find the department objects for the provided list of department ids. Result is a privately available list of pamIds of type long.
private List<Long> aDeptIds(List<Department> pamDepts) { allDeptIds = new ArrayList<Long>(); // add primary dept (always first in the collection) allDeptIds.add(pamDepts.get(0).getid()); // add any and all mutual aid depts - note: i=1 (not zero) to pass over primary dept for (int i = 1; i < pamDepts.size(); i++) { allDeptIds.add(pamDepts.get(i).getid()); } System.out.println("Exit: aDeptIds"); return allDeptIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptMembers(List<Long> pamDeptIds) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common?\n Query q = pm.newQuery(Member.class, \":p.contains(deptId)\");\n q.setOrdering(\"deptId asc, id asc\"); \n members = (List<Member>)q.execute(pamDeptIds);\n...
[ "0.7144485", "0.6998871", "0.6720888", "0.6335454", "0.58760345", "0.5791349", "0.57688916", "0.5742883", "0.5733193", "0.5577721", "0.5543398", "0.5472076", "0.54677206", "0.54532284", "0.5444795", "0.543924", "0.5400058", "0.5399069", "0.5388004", "0.53700006", "0.5322454",...
0.71366465
1
Create a map of the owned location objects for the provided list of department ids. Result is a privately available map of dept:list.
private void mDeptLocations(List<Long> deptIds) { PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common? mDeptLocations.clear(); for (Long d : deptIds) { List<Location> tempLocations = new ArrayList<Location>(); Query q = pm.newQuery(Location.class, "deptId == " + d ); q.setOrdering("deptId asc, key asc"); tempLocations.addAll((List<Location>) pm.newQuery(q).execute()); System.out.println("deptLocations ending qty: " + tempLocations.size()); mDeptLocations.put(d, tempLocations); System.out.println("mDeptLocations running qty: " + mDeptLocations.size()); } System.out.println("mDeptLocations ending qty: " + mDeptLocations.size()); System.out.println("Exit: mDeptLocations"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptMembers(List<Long> pamDeptIds) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common?\n Query q = pm.newQuery(Member.class, \":p.contains(deptId)\");\n q.setOrdering(\"deptId asc, id asc\"); \n members = (List<Member>)q.execute(pamDeptIds);\n...
[ "0.58575493", "0.56246436", "0.54238445", "0.5332313", "0.5316217", "0.5192877", "0.5151268", "0.4988534", "0.4980745", "0.497325", "0.49727577", "0.49452028", "0.49256283", "0.4872607", "0.4866379", "0.48554432", "0.48275793", "0.4824154", "0.47188377", "0.46913278", "0.4689...
0.7114967
0
Find the owned status objects for the provided list of location ids. Result is a privately available map of dept:list.
public void mDeptLocationStatuses() { System.out.println("Inside mDeptLocationStatuses"); PersistenceManager pm = PMF.get().getPersistenceManager(); mDeptLocationStatuses.clear(); for (int d=0; d<mDeptLocations.size(); d++) { System.out.println("mDeptLocation qty: " + mDeptLocations.size()); // dLocationStatuses.clear(); if (mDeptLocations.get(d) != null) { for (int l=0; l<mDeptLocations.get(d).size(); l++) { List<Status> dLocationStatuses = new ArrayList<Status>(); List<Long> keys = new ArrayList<Long>(); keys.addAll(mDeptLocations.get(d).get(l).getstatusKeys()); Query q = pm.newQuery(Status.class, ":p.contains(id)"); dLocationStatuses.addAll((List<Status>) pm.newQuery(q).execute(keys)); mDeptLocationStatuses.put(mDeptLocations.get(d).get(l).getid(), dLocationStatuses); System.out.println("dLocationStatuses in deptLocStat: " + dLocationStatuses.size()); } } } System.out.println("mDeptLocationStatuses qty: " + mDeptLocationStatuses.size()); System.out.println("Exit: mDeptLocationStatuses"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ResponseList<Status> lookupStatuses(long[] statusIds) throws TwitterException;", "public void mDeptLocationSelectedStatuses() {\n PersistenceManager pm = PMF.get().getPersistenceManager();\n Query q = pm.newQuery(Tracking.class, \"alertId == \" + alertId + \" && type == 'locstat' \");\n q.setOrdering(\...
[ "0.59784937", "0.56573224", "0.56249404", "0.54224753", "0.51879627", "0.49997687", "0.49836195", "0.4951409", "0.49034488", "0.48916838", "0.48877257", "0.48833135", "0.48741126", "0.48363265", "0.48206252", "0.48083192", "0.4789721", "0.4768939", "0.475791", "0.47386467", "...
0.60373306
0
Find the owned status objects for the provided list of location ids. Result is a privately available map of dept:list. Note: mDeptActivityStatus map must be created prior to calling this method.
public void mDeptLocationSelectedStatuses() { PersistenceManager pm = PMF.get().getPersistenceManager(); Query q = pm.newQuery(Tracking.class, "alertId == " + alertId + " && type == 'locstat' "); q.setOrdering("timeStamp desc"); List<Tracking> tracks = (List<Tracking>) pm.newQuery(q).execute(); Map<Long, Long> mDeptLocationSelectedStatuses = new HashMap<Long, Long>(); for (Tracking t : tracks) { if (t.getlocationId() != null) { if (!mDeptLocationSelectedStatuses.containsKey(t.getlocationId())) { mDeptLocationSelectedStatuses.put(t.getlocationId(), t.gettypeId()); } } } System.out.println("Exit: mDeptLocationSelectedStatuses"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptLocationStatuses() {\n System.out.println(\"Inside mDeptLocationStatuses\");\n PersistenceManager pm = PMF.get().getPersistenceManager(); \n mDeptLocationStatuses.clear();\n for (int d=0; d<mDeptLocations.size(); d++) {\n System.out.println(\"mDeptLocation qty: \" + mDeptLocations...
[ "0.64067143", "0.580519", "0.5604012", "0.51689994", "0.5140299", "0.4997916", "0.47097397", "0.46332487", "0.46275297", "0.46251202", "0.45593372", "0.45538333", "0.45393944", "0.45306265", "0.451683", "0.45145285", "0.45129603", "0.4511949", "0.45016155", "0.4457383", "0.44...
0.58757573
1
Find the members currently at each of the primary dept's locations. Result is a public list of all members.
public void mDeptMembers(List<Long> pamDeptIds) { PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common? Query q = pm.newQuery(Member.class, ":p.contains(deptId)"); q.setOrdering("deptId asc, id asc"); members = (List<Member>)q.execute(pamDeptIds); List<Member> tempDeptMembers = new ArrayList<Member>(); for (Long d : pamDeptIds){ for (Member m : members) { if (m.getdeptId().equals(d)){ tempDeptMembers.add(m); } } mDeptMembers.put(d, tempDeptMembers); } System.out.println("Members qty inside deptMembers: " + members.size()); System.out.println("Exit: deptMembers"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptLocationMembers() {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n // dept iterator\n System.out.println(\"111 mDeptLocations inside mDeptLocationMembers: \" + mDeptLocations.size());\n Iterator iterDept = mDeptLocations.entrySet().iterator();\n while (iterDept.ha...
[ "0.7015455", "0.62718505", "0.62101537", "0.614847", "0.61396766", "0.6132266", "0.6108332", "0.60059893", "0.5927283", "0.5917368", "0.586836", "0.586256", "0.58447814", "0.5837917", "0.58300734", "0.58003396", "0.5767971", "0.5760384", "0.56986207", "0.56852305", "0.5676704...
0.63966215
1
Find the members currently at each of the primary dept's locations. Result is a privately available map of dept:list. Note: mDeptActivityStatus map must be created prior to calling this method.
public void mMemberLocation(Long alertId) { PersistenceManager pm = PMF.get().getPersistenceManager(); Query q = pm.newQuery(Tracking.class, "alertId == " + alertId + " && type == 'member' "); q.setOrdering("typeId asc, timeStamp desc"); List<Tracking> tracks = (List<Tracking>) pm.newQuery(q).execute(); System.out.println("tracks where member has a location: " + tracks.size()); mMemberCurrentLocation.clear(); for (final Tracking t : tracks) { if (!mMemberCurrentLocation.containsKey(t.gettypeId())) { mMemberCurrentLocation.put(t.gettypeId(), t); } } System.out.println("mMemberCurrentLocation qty: " + mMemberCurrentLocation.size()); System.out.println("Exit: mMemberCurrentLocation"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptLocationMembers() {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n // dept iterator\n System.out.println(\"111 mDeptLocations inside mDeptLocationMembers: \" + mDeptLocations.size());\n Iterator iterDept = mDeptLocations.entrySet().iterator();\n while (iterDept.ha...
[ "0.7023587", "0.6614134", "0.6069183", "0.5996174", "0.58544403", "0.5832967", "0.56701607", "0.55692947", "0.5505839", "0.54419667", "0.54321647", "0.5401147", "0.5374557", "0.53403705", "0.53031987", "0.5302664", "0.5290725", "0.5257384", "0.52509004", "0.5242922", "0.52151...
0.0
-1
Find the members who have been manually added and not yet assigned a location Result is a privately available list of unassigned members for the provided alert Note: mDeptActivityStatus map must be created prior to calling this method.
public void unassignedMembers() { unassignedMembers.clear(); PersistenceManager pm = PMF.get().getPersistenceManager(); Iterator iter = mMemberCurrentLocation.entrySet().iterator(); while (iter.hasNext()) { Entry<Long, Tracking> pairs = (Entry<Long, Tracking>)iter.next(); if (pairs.getValue().getresponseType().equalsIgnoreCase("manuallyAddMember")) { Member m = pm.getObjectById(Member.class, pairs.getKey()); unassignedMembers.add(m); iter.remove(); } } System.out.println("unassigned members qty: " + unassignedMembers.size()); System.out.println("Exit: unassignedMembers"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mMemberLocation(Long alertId) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n Query q = pm.newQuery(Tracking.class, \"alertId == \" + alertId + \" && type == 'member' \");\n q.setOrdering(\"typeId asc, timeStamp desc\");\n List<Tracking> tracks = (List<Tracking>) pm.n...
[ "0.57390165", "0.5297074", "0.5232043", "0.50359523", "0.5025754", "0.49922872", "0.49561477", "0.48554724", "0.4785599", "0.46952707", "0.46901867", "0.4678036", "0.46646133", "0.4638255", "0.4581345", "0.45673478", "0.45654598", "0.45631266", "0.4554639", "0.45477778", "0.4...
0.6311456
0
Find the members currently at each of the primary dept's locations. Result is a privately available map of dept:list. Note: mDeptActivityStatus map must be created prior to calling this method.
public void mDeptLocationMembers() { PersistenceManager pm = PMF.get().getPersistenceManager(); // dept iterator System.out.println("111 mDeptLocations inside mDeptLocationMembers: " + mDeptLocations.size()); Iterator iterDept = mDeptLocations.entrySet().iterator(); while (iterDept.hasNext()) { Entry<Long, List<Location>> pairsDept = (Entry<Long, List<Location>>)iterDept.next(); if (!pairsDept.getValue().isEmpty()) { // location iterator for (Location l : pairsDept.getValue()) { // member iterator List<Member> mLocationMembers = new ArrayList<Member>(); Iterator iterMember = mMemberCurrentLocation.entrySet().iterator(); while (iterMember.hasNext()) { Entry<Long, Tracking> pairsMember = (Entry<Long, Tracking>)iterMember.next(); // determine members, regardless of dept, at this location if (l.getid().equals(pairsMember.getValue().getlocationId())) { Member m = pm.getObjectById(Member.class, pairsMember.getKey()); mLocationMembers.add(m); System.out.println("m: " + m.getlastName()); System.out.println("mLocationMembers qty: " + mLocationMembers.size()); } } mDeptLocationMembers.put(l.getid(), mLocationMembers); } } } System.out.println("mDeptLocationMembers TOTAL qty: " + mDeptLocationMembers.size()); System.out.println("Exit: mDeptLocationMembers"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mDeptMembers(List<Long> pamDeptIds) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager(); // TODO necessary? common?\n Query q = pm.newQuery(Member.class, \":p.contains(deptId)\");\n q.setOrdering(\"deptId asc, id asc\"); \n members = (List<Member>)q.execute(pamDeptIds);\n...
[ "0.66149056", "0.60696566", "0.5995624", "0.5853171", "0.58342975", "0.5670035", "0.55698323", "0.55063474", "0.54423493", "0.54323334", "0.540299", "0.53748137", "0.53406185", "0.530483", "0.53026384", "0.52893984", "0.52567196", "0.5252007", "0.5243398", "0.5214809", "0.519...
0.7024435
0
create List of Member Types
private void memberTypes(Map<Long, List<Member>> mDeptMembers) { List<String> memberTypes = new ArrayList<String>(); mDeptMemberTypes.clear(); memberTypes = new ArrayList<String>(); for (Entry<Long, List<Member>> entry : mDeptMembers.entrySet()) { for (Member m : entry.getValue()){ if (!memberTypes.contains(m.gettype())) { memberTypes.add(m.gettype()); } } mDeptMemberTypes.put(entry.getKey(), memberTypes); } System.out.println("Exit: memberTypes"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ISourceType[] getMemberTypes();", "List memberClasses();", "public java.util.List getMemberTypes()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.Si...
[ "0.71912324", "0.6559669", "0.6470171", "0.6451612", "0.6323079", "0.6208559", "0.62005097", "0.59962034", "0.5993204", "0.5959457", "0.5931847", "0.5924167", "0.587764", "0.58599794", "0.5809687", "0.5782895", "0.5771331", "0.57461524", "0.5721673", "0.5720523", "0.5692605",...
0.6463194
3
determine which group each Member belongs to based on activity for this alert
private void memberGroups(Map<Long, List<Member>> mDeptLocationMembers) { activeMembers.clear(); //TODO replace with MultiMap Iterator iter = mDeptLocationMembers.entrySet().iterator(); while (iter.hasNext()) { Entry<Long, List<Member>> pairs = (Entry<Long, List<Member>>)iter.next(); if (pairs.getValue() != null) { activeMembers.addAll(pairs.getValue()); } } List<Member> temp = new ArrayList<Member>(); temp.addAll(members); memberGroups.put("active", activeMembers); System.out.println("active qty: " + activeMembers.size()); temp.removeAll(activeMembers); inactiveMembers.clear(); inactiveMembers.addAll(temp); System.out.println("inactive qty: " + inactiveMembers.size()); memberGroups.put("inactive", inactiveMembers); alertMemberGroups.put(alertId, memberGroups); System.out.println("allMembers qty: " + allMembers.size()); System.out.println("memberGroups qty: " + memberGroups.size()); System.out.println("alertMemberGroups qty: " + alertMemberGroups.size()); System.out.println("Exit: memberGroups"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getGroup();", "@Override\n\tpublic void onEnterToChatDetails() {\n\t\tEMGroup group = EMClient.getInstance().groupManager()\n\t\t\t\t.getGroup(toChatUsername);\n\t\tif (group == null) {\n\t\t\tToast.makeText(getActivity(), R.string.gorup_not_found, 0).show();\n\t\t\treturn;\n\t\t}\n\t\tstartActivit...
[ "0.5775467", "0.5651047", "0.5605857", "0.55927336", "0.5576263", "0.552122", "0.54980975", "0.5484789", "0.5484789", "0.54819363", "0.5467676", "0.54629034", "0.5447552", "0.54329", "0.5392934", "0.5378023", "0.5364265", "0.5358577", "0.53477395", "0.53402644", "0.53402644",...
0.553944
5
determine elapsed time between alert start and current system time
private void elapsedTime(HttpServletResponse response, ServletRequest request, Alert a) { // format elapsed time SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm"); SimpleDateFormat dateFormat2 = new SimpleDateFormat("HH:mm"); dateFormat.setTimeZone(TimeZone.getTimeZone("EST")); dateFormat2.setTimeZone(TimeZone.getTimeZone("UTC")); Long alertTime = Long.valueOf(a.gettimeStamp()); String alertElapsedTime = dateFormat.format(new Date(System.currentTimeMillis() - alertTime - 19*3600000)); // for display in the header of the report request.setAttribute("alertElapsedTime", alertElapsedTime); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected double getElapsedTime() {\n\t\treturn Utilities.getTime() - startTime;\n\t}", "public double getElapsedTime(){\n double CurrentTime = System.currentTimeMillis();\n double ElapseTime = (CurrentTime - startTime)/1000;\n return ElapseTime;\n }", "long elapsedTime();", "public ...
[ "0.7057459", "0.6923016", "0.6764819", "0.6759109", "0.6745451", "0.6710679", "0.66997266", "0.6683574", "0.66397727", "0.66372514", "0.65808266", "0.6558569", "0.65228546", "0.6502438", "0.64739525", "0.6464632", "0.64639574", "0.64596534", "0.64151955", "0.63416654", "0.633...
0.70961934
0
tag: prefix sum time: build prefix sum: O(n) query: O(1) space: O(n) /
public List<Long> intervalSum(int[] A, List<Interval> queries) { long[] prefixSum = new long[A.length+1]; prefixSum[0] = 0; for (int i = 1; i < prefixSum.length; i++) { prefixSum[i] = prefixSum[i - 1] + A[i - 1]; } List<Long> res = new ArrayList<>(); for (Interval query : queries) { res.add(prefixSum[query.end + 1] - prefixSum[query.start]); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int sum(String prefix) {\n TrieNode cur = root;\n char[] charArray = prefix.toCharArray();\n for(int i = 0; i < charArray.length; i++) {\n if (!cur.map.containsKey(charArray[i])) {\n return 0;\n } else {\n cur = cur.map.get(charArray[i...
[ "0.68667525", "0.6127376", "0.5984324", "0.5855689", "0.56338716", "0.5622206", "0.5548158", "0.54875", "0.5436885", "0.5403697", "0.5295569", "0.5269276", "0.5193596", "0.5177294", "0.5172107", "0.5103985", "0.51014686", "0.50981915", "0.50979483", "0.50679576", "0.50660366"...
0.0
-1
Creates a new instance of ArrayGetByte
public ArrayGetByte() { super("ArrayGetByte"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "byte[] getBytes();", "byte[] getBytes();", "public native void get(byte[] bytes);", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "public byte[] array()\r\n/* 127: */ {\r\n/* 128:156 */ ensureAccessible();\r\n/* 129:157 */ return this.array;\r\n/* 130: ...
[ "0.6492482", "0.6492482", "0.64360064", "0.62601125", "0.62601125", "0.62097555", "0.61682636", "0.6139731", "0.60449964", "0.5998937", "0.5932887", "0.59130484", "0.585625", "0.58058053", "0.5789107", "0.5782175", "0.5753131", "0.5729556", "0.5725224", "0.5714884", "0.569749...
0.8563414
0
This is called from list, so we need isInComment to be true.
@Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; ViewHolder holder; final BaseFeedData item = objects.get(position); if (view == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.new_feed_item, parent, false); holder = initHolder(view); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } boolean isMoodClicked = item.getIsMood(); populateView(view, context, holder, item, false); // One thing that we don't do in populate view: deleting the object // Set the settings drawer final String rootUrl = context.getResources().getString(R.string.api_test_root_url); final String dotchiId = ((Activity)context).getSharedPreferences("com.dotchi1", Context.MODE_PRIVATE).getString("DOTCHI_ID", "0"); ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_item, settingOptions); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); holder.settingsLayout.setSelection(0); holder.settingsLayout.setAdapter(adapter); holder.settingsLayout.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { // Position is always 0, there's only remove/quit game if (position == 1) { new PostUrlTask() { @Override protected void onPostExecute(String result) { result = processResult(result); try { JSONObject jo = new JSONObject(result).getJSONObject("data"); if ("success".equals(jo.getString("status"))) { Log.d(TAG, "successfully deleted game"); remove(item); } } catch (JSONException e) { e.printStackTrace(); } } }.execute(rootUrl + "/game/quit_game", "dotchi_id", dotchiId, "game_id", String.valueOf(item.getGameId()), "activity_id", String.valueOf(item.getActivityId())); } } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasComment();", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void setItemHavingComment() {\n\t}", "protected boolean isComment () {\r\n int startvalue = index - 1;\r\n if (index + 3 >= length)\r\n return false;\r\n retu...
[ "0.6404772", "0.6365634", "0.62904775", "0.6209662", "0.62061733", "0.6158505", "0.6129825", "0.61272705", "0.6059676", "0.6054815", "0.60429955", "0.59980303", "0.5993382", "0.59322566", "0.5918949", "0.58731264", "0.5856183", "0.5844583", "0.58339137", "0.58312786", "0.5818...
0.0
-1
Position is always 0, there's only remove/quit game
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position == 1) { new PostUrlTask() { @Override protected void onPostExecute(String result) { result = processResult(result); try { JSONObject jo = new JSONObject(result).getJSONObject("data"); if ("success".equals(jo.getString("status"))) { Log.d(TAG, "successfully deleted game"); remove(item); } } catch (JSONException e) { e.printStackTrace(); } } }.execute(rootUrl + "/game/quit_game", "dotchi_id", dotchiId, "game_id", String.valueOf(item.getGameId()), "activity_id", String.valueOf(item.getActivityId())); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void positionCleared();", "@Override\n\tpublic int getPosition() {\n\t\treturn 0;\n\t}", "@Override\n public void doMove() {\n if (((-Transform.getOffsetTranslation().getX() - (Game.getWindowWidth()) < getPosition().getX()\n && (-Transform.getOffsetTranslation().getX() + (Game.getWindo...
[ "0.67451906", "0.6519592", "0.6514493", "0.6510037", "0.6402285", "0.6333388", "0.6325099", "0.6316921", "0.6310227", "0.62425536", "0.6226787", "0.61653644", "0.61173064", "0.61157006", "0.60728955", "0.60717577", "0.60654074", "0.6063236", "0.60529673", "0.60383165", "0.602...
0.0
-1
Start game activity, with clear activity back to main
@Override public void onClick(View v) { Intent intent = new Intent(context, GameActivity.class); // put extras intent.putExtra("game_id", item.getGameId()); intent.putExtra("game_title", item.getGameTitle()); intent.putExtra("dotchi_time", item.getDotchiTime()); intent.putExtra("is_personal", item.getIsPersonal()); intent.putExtra("is_secret", item.getIsSecret()); intent.putExtra("is_official", false); //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); //TODO: make sure this is correct ((Activity) context).startActivity(intent); ((Activity) context).finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startGame(){\n\t\tIntent intent = new Intent(getApplicationContext(), AndroidLauncher.class);\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n\t\tintent.putExtra(Bluetooth.PRIMARY_BT_GAME, String.valueOf(false));\n\t\tintent.putExtra(Bluetooth.SECONDARY_BT_GAME, String.valueOf(true));\n\t\tstar...
[ "0.7488726", "0.744016", "0.7288804", "0.72321165", "0.716208", "0.71611935", "0.7116866", "0.7068332", "0.70541817", "0.70540756", "0.7038794", "0.7002765", "0.7000758", "0.6940426", "0.6932964", "0.6912447", "0.6886722", "0.6861901", "0.6850475", "0.6846591", "0.68227214", ...
0.0
-1
logging of the command
public void logCmds(String[] cmds){ StringBuilder sb = new StringBuilder(); for(int i = 0;i< cmds.length; i++){ sb.append(cmds[i]); sb.append(" "); } log.info("logCmds Commands = "+sb.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void log()\n {\n }", "void log();", "@Override\n public void logs() {\n \n }", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "private void printLogCommandResult(Result result) {\n logger.info(\"Command status: \" + resul...
[ "0.6736094", "0.66500443", "0.6604013", "0.65640855", "0.65141296", "0.6492886", "0.6443714", "0.6394928", "0.63731074", "0.6352753", "0.6349194", "0.63171005", "0.6276056", "0.6267234", "0.6231983", "0.62268406", "0.6201233", "0.61896247", "0.6185321", "0.616509", "0.6161637...
0.6580514
3
Returns the upperleft coordinate of this entity
public Coordinate getCoordinate() { return coordinate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Coords getUpperLeft()\r\n {\r\n return new Coords(x, y);\r\n }", "public Point getUpperLeft() {\n return this.upperLeft;\n }", "public Vector2f getUpperLeftCorner() {\n return upperLeftCorner;\n }", "public Coords getUpperRight()\r\n {\r\n return new Coords(x...
[ "0.8230721", "0.81763434", "0.7702532", "0.76406103", "0.7222366", "0.7161712", "0.715976", "0.71446896", "0.7137547", "0.70807946", "0.70713824", "0.70676947", "0.70587677", "0.70364845", "0.6975371", "0.693694", "0.6818838", "0.6758412", "0.6691013", "0.6690942", "0.6683265...
0.0
-1
Returns center of this entity as coordinate. Which basically means adding half its size to the topleft coordinate.
public Coordinate getCenteredCoordinate() { return coordinate.add(getHalfSize()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Coords getCenter()\r\n {\r\n return new Coords(Math.round(x + width / 2), Math.round(y + height / 2));\r\n }", "public Point getCenter() {\n \treturn new Point(x+width/2,y+height/2);\n }", "public Vector2 getCenter() {\n\t\treturn new Vector2(position.x + size / 4f, position.y + size / 4f...
[ "0.8177152", "0.8111688", "0.80171806", "0.8002597", "0.7775452", "0.77663666", "0.76788133", "0.7641248", "0.76325065", "0.76325065", "0.7623351", "0.76000804", "0.7598365", "0.7570251", "0.7549674", "0.754622", "0.75426906", "0.75272566", "0.7464994", "0.7441649", "0.743987...
0.8249478
0
Returns distance from this entity to other, using centered coordinates for both entities.
public float distance(Entity other) { return getCenteredCoordinate().distance(other.getCenteredCoordinate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenter...
[ "0.7625297", "0.75477356", "0.74226177", "0.7314958", "0.72513515", "0.7223737", "0.71958876", "0.7160025", "0.71178406", "0.7093385", "0.7054302", "0.6976055", "0.69750106", "0.6953972", "0.6922876", "0.6790764", "0.6784104", "0.6764538", "0.6711207", "0.6654345", "0.6629842...
0.83302695
0
Returns distance from this entity to other Coordinate. Uses centered coordinate as start coordinate. Does not influence given otherCoordinate param
public float distanceToFromCentered(Coordinate otherCoordinate) { return getCenteredCoordinate().distance(otherCoordinate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float distanceTo(Coordinate otherCoordinate) {\n return coordinate.distance(otherCoordinate);\n }", "public double distance(final Coordinates other) {\n\t\treturn Math.sqrt(Math.pow((double) x - other.getX(), 2) + Math.pow((double) y - other.getY(), 2));\n\t}", "public double calculateDistance...
[ "0.7718629", "0.7345765", "0.72862613", "0.72455126", "0.7162711", "0.710288", "0.6925038", "0.6904823", "0.6902425", "0.68853885", "0.6861944", "0.68447804", "0.68412435", "0.68350357", "0.6816553", "0.6757328", "0.6581658", "0.6482034", "0.6439528", "0.6335327", "0.6262003"...
0.8087531
0
Returns distance from this entity to other Coordinate. Does not influence given otherCoordinate param
public float distanceTo(Coordinate otherCoordinate) { return coordinate.distance(otherCoordinate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double distance(final Coordinates other) {\n\t\treturn Math.sqrt(Math.pow((double) x - other.getX(), 2) + Math.pow((double) y - other.getY(), 2));\n\t}", "public float distanceToFromCentered(Coordinate otherCoordinate) {\n return getCenteredCoordinate().distance(otherCoordinate);\n }", "public...
[ "0.76052636", "0.7522633", "0.7342577", "0.73365104", "0.724251", "0.70562613", "0.70445764", "0.7043932", "0.70122874", "0.70116556", "0.7007855", "0.69832397", "0.69733137", "0.69227487", "0.6917117", "0.6842081", "0.6795166", "0.66581756", "0.66411144", "0.6640449", "0.659...
0.8331122
0
Returns distance from this entity to other Map coordinate in 'cells'.
public int distanceToInMapCoords(MapCoordinate otherCoordinate) { return coordinate.toMapCoordinate().distanceInMapCoords(otherCoordinate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenter...
[ "0.68765634", "0.6701792", "0.65894777", "0.6576051", "0.64487535", "0.64156145", "0.63299173", "0.6194199", "0.61390996", "0.6134228", "0.61311346", "0.61114705", "0.610429", "0.6104217", "0.6084803", "0.607947", "0.6069697", "0.6057911", "0.5940926", "0.5929342", "0.5897332...
0.62172735
7
Capable of harvesting stuff
public boolean isHarvester() { return entityData.isHarvester; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(priority = 1, groups= {\"regression\",\"smoke\"})\r\n\tpublic void PrintHospitals()\r\n\t{\r\n\t\tlogger= report.createTest(\"Printing Hospitals as per requirement\");\r\n\t\tDisplayHospitalNames hp=Base.nextPage1();\r\n\t\thp.selectLocation();\r\n\t\thp.selectHospital();\r\n\t\thp.applyFilters();\r\n\t\thp....
[ "0.6303562", "0.6086576", "0.5847077", "0.5824426", "0.5788268", "0.5769042", "0.57666117", "0.5750813", "0.5746124", "0.57358557", "0.5715954", "0.57108027", "0.56867695", "0.56672853", "0.5655835", "0.56417114", "0.5638881", "0.5627855", "0.56197864", "0.56119037", "0.56071...
0.0
-1
Capable of dealing with harvesters to return spice
public boolean isRefinery() { return entityData.isRefinery; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized RewardItem[] takeHarvest()\n\t{\n\t\tfinal RewardItem[] harvest = harvestItems;\n\t\t\n\t\tharvestItems = null;\n\t\t\n\t\treturn harvest;\n\t}", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower...
[ "0.57323027", "0.56314987", "0.54494196", "0.54388046", "0.54057187", "0.52033985", "0.51587903", "0.5141814", "0.51239085", "0.49828485", "0.49690583", "0.49329293", "0.49329293", "0.49199226", "0.4907956", "0.49038112", "0.49034393", "0.49011058", "0.48919243", "0.48795098", ...
0.0
-1
by default do nothing
@Override public void enrichRenderQueue(RenderQueue renderQueue) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doNothing(){\n\t}", "public static void doNothing(){\n\t}", "protected void performDefaults() {\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void just() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n public void perish() {\n...
[ "0.742467", "0.7303538", "0.69581616", "0.6861428", "0.6835141", "0.67455244", "0.66661733", "0.6654785", "0.6605334", "0.6570369", "0.6570369", "0.6570369", "0.6570369", "0.65662694", "0.65573937", "0.6546996", "0.6538978", "0.65332085", "0.6522858", "0.647882", "0.647882", ...
0.0
-1
Return the metadata about this entity.
public EntityData getEntityData() { return this.entityData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object getMetadata() {\n return this.metadata;\n }", "public Map<String, Object> getMetadata() {\n return metadata;\n }", "public AbstractMetadata getMetadata() {\n\t\treturn metadata;\n\t}", "public Map<String, String> getMetadata() {\n return metadata;\n }", "...
[ "0.76018864", "0.74018437", "0.73640764", "0.7295439", "0.7295439", "0.72633916", "0.7249235", "0.7229107", "0.7138148", "0.7109847", "0.7027753", "0.7018506", "0.69556105", "0.6909889", "0.6908975", "0.68923974", "0.6879019", "0.6815835", "0.68054277", "0.6794969", "0.678828...
0.64581746
37
coordinate == top left
public Set<Coordinate> getAllSurroundingCellsAsCoordinates() { Set<MapCoordinate> mapCoordinates = getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(1); return mapCoordinates .stream() .map(mapCoordinate -> mapCoordinate.toCoordinate()) .collect( Collectors.toSet() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasPositionX();", "boolean hasPositionX();", "boolean hasPositionX();", "Tile getPosition();", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "@Test\n public void testPositionEquals(){\n assertEquals(Maze.position(0,0), Maze...
[ "0.6742352", "0.6742352", "0.6742352", "0.67021", "0.6661707", "0.6661707", "0.6661707", "0.6661707", "0.6651828", "0.65142566", "0.6499637", "0.64275783", "0.64275783", "0.6409047", "0.63749486", "0.63255876", "0.63101035", "0.63055944", "0.63055944", "0.63055944", "0.628164...
0.0
-1
Goes around entity. Basically as a 'rectangle' around entity. Starting from the highest distance, then recursively repeating logic until distance == 1
public Set<MapCoordinate> getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(MapCoordinate topLeftMapCoordinate, int distance, Set<MapCoordinate> alreadyFound) { int currentX = topLeftMapCoordinate.getXAsInt(); int currentY = topLeftMapCoordinate.getYAsInt(); // first row int topLeftYMinusDistance = currentY - distance; int topLeftXMinusDistance = currentX - distance; int totalWidth = (distance + entityData.getWidthInCells() + distance) - 1; int totalHeight = (distance + entityData.getHeightInCells() + distance) - 1; Set<MapCoordinate> result = new HashSet<>(alreadyFound); // -1, because it is 0 based for (int x = 0; x <= totalWidth; x++) { result.add(MapCoordinate.create(topLeftXMinusDistance + x, topLeftYMinusDistance)); } // then all 'sides' of the structure (left and right) // also start one row 'lower' since we do not want to calculate the top left/right twice (as we did it // in the above loop already) // totalHeight - 2 for same reason, -1 == zero based, -2 to reduce one row for (int y = 1; y <= (totalHeight - 1); y++) { int calculatedY = topLeftYMinusDistance + y; // left side result.add(MapCoordinate.create(topLeftXMinusDistance, calculatedY)); // right side int rightX = topLeftXMinusDistance + totalWidth; result.add(MapCoordinate.create(rightX, calculatedY)); } // bottom row int bottomRowY = topLeftYMinusDistance + totalHeight; for (int x = 0; x <= totalWidth; x++) { result.add(MapCoordinate.create(topLeftXMinusDistance + x, bottomRowY)); } if (distance > 1) { return getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(topLeftMapCoordinate, (distance-1), result); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void chase(int targetX, int targetY, ArrayList<Wall> listOfWalls, ArrayList<Point> intersections) {\n double minDistance = 5000000000.0; //no distance is greater than this 4head\r\n double upDistance = 500000000.0;\r\n double downDistance = 5000000.0;\r\n double leftDistance = 50...
[ "0.6002578", "0.5832803", "0.5802201", "0.57974905", "0.57923645", "0.5574923", "0.5573003", "0.5559136", "0.5540714", "0.5483091", "0.54709136", "0.540307", "0.54023975", "0.5385778", "0.53726685", "0.53415257", "0.5328715", "0.53058773", "0.5304449", "0.52926207", "0.528583...
0.0
-1
Look within this entity, if this entity takes up more than 1 coordinate, return the coordinate that is closest.
public Coordinate getClosestCoordinateTo(Coordinate centeredCoordinate) { List<Coordinate> allCellsAsCoordinates = getAllCellsAsCenteredCoordinates(); if (allCellsAsCoordinates.size() == 0) allCellsAsCoordinates.get(0); Coordinate closest = allCellsAsCoordinates.stream().min((c1, c2) -> Float.compare(c1.distance(centeredCoordinate), c2.distance(centeredCoordinate))).get(); return closest.minHalfTile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Coordinates closestPoint() {\n return closestPoint;\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(c...
[ "0.7475225", "0.6773269", "0.67496043", "0.6722159", "0.6694892", "0.64987177", "0.64919686", "0.64706576", "0.6469728", "0.64264", "0.642319", "0.6402435", "0.63832843", "0.63796437", "0.62647027", "0.6246745", "0.6227999", "0.62272775", "0.62253386", "0.62217736", "0.615433...
0.6133142
22
Look around the entity (surrounding cells) and finds the closets to given parameter
public Coordinate getClosestCoordinateAround(Coordinate centeredCoordinate) { Set<Coordinate> allCellsAsCoordinates = getAllSurroundingCellsAsCoordinates(); Coordinate closest = allCellsAsCoordinates .stream() .min((c1, c2) -> Float.compare(c1.distance(centeredCoordinate), c2.distance(centeredCoordinate)) ) .get(); return closest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Coord> getDependents(int col, int row);", "public abstract Set<Tile> getNeighbors(Tile tile);", "List<Coord> allActiveCells();", "public abstract Cell getOverlappedCell(Rectangle rect);", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "public abstract Regionlike getGridBounds...
[ "0.56116414", "0.55541384", "0.5497728", "0.5418955", "0.5414829", "0.53856903", "0.5296896", "0.5282491", "0.5244512", "0.5207802", "0.5198419", "0.5104399", "0.5074903", "0.50627583", "0.5039885", "0.5016037", "0.49893087", "0.49893087", "0.4987499", "0.49558675", "0.495212...
0.0
-1
This entity is entering another entity (given parameter).
public void enterOtherEntity(Entity whichEntityWillBeEntered) { whichEntityWillBeEntered.containsEntity = this; hasEntered = whichEntityWillBeEntered; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void interact(Entity other) { }", "void selectedEntityChanged(String name);", "public void enter(Object in);", "protected abstract void doEnter(RequestControlContext context) throws FlowExecutionException;", "public void b(EntityPlayer paramahd) {}", "public void setEntity(String parName, Object ...
[ "0.6368704", "0.5825746", "0.5771727", "0.57658595", "0.5727172", "0.5725439", "0.5709049", "0.5704863", "0.5646283", "0.5630171", "0.5601592", "0.55948824", "0.5567953", "0.55425763", "0.55303335", "0.5515726", "0.5506598", "0.5491759", "0.5484909", "0.547553", "0.54578733",...
0.7171992
0
Returns true when: 1) the entity no longer lives 2) the entity no longer serves any purpose If true, then the entity will be removed from the EntityRepository list of entities. (state) This is done in the update() method in the PlayingState class. And will only be done after all entities have had their 'update' cycle.
public abstract boolean isDestroyed();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isDestroyed(){\n\t\treturn entState == EntState.Destroyed;\n\t}", "public void entityRemoved() {}", "public boolean isDestroyed() {\n\t\treturn gone;\n\t}", "public boolean remove() {\n entity.setUserObject(null);\n internalGroup.setUserObject(null);\n EntityEngine entityE...
[ "0.6798223", "0.6367085", "0.6294773", "0.6280658", "0.62429583", "0.6201486", "0.61888725", "0.61799943", "0.6129408", "0.60804427", "0.6036156", "0.6007513", "0.5999509", "0.5997141", "0.59924024", "0.59852505", "0.5957971", "0.5946585", "0.59450835", "0.5933762", "0.593039...
0.5879066
24
Initiate dying of entity.
public abstract void die();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void terminate() {\n this.isDying = true;\n //this.isStaticCollidable = false;\n //this.isDynamicCollidable = false;\n\n this.setProp(ObjectProps.PROP_STATICCOLLIDABLE, false);\n this.setProp(ObjectProps.PROP_DYNAMICCOLLIDABLE, false);\n\n this.action = DYING;\n ...
[ "0.69957674", "0.6963004", "0.6627", "0.6440513", "0.628313", "0.6269665", "0.61868304", "0.61811954", "0.6166924", "0.60933334", "0.6005176", "0.60016626", "0.5987316", "0.5985946", "0.5972226", "0.59660554", "0.59570825", "0.59452844", "0.5944923", "0.5936979", "0.5935338",...
0.0
-1
Add a view variable
public void addViewVariable (String name, Object value) { _viewVariables.put (name, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addViewVariables (Map<String, Object> vars)\n {\n if (vars != null)\n {\n _viewVariables.putAll (vars);\n }\n }", "private void addViews() {\n\t}", "public void addView(IView view)\r\n { this.views.add(view);\r\n }", "public void addVariable(VariableItem...
[ "0.7420617", "0.64470834", "0.6443442", "0.63731027", "0.63731027", "0.6349999", "0.6119472", "0.6102895", "0.6099293", "0.6049874", "0.59918535", "0.5973784", "0.5962991", "0.5931212", "0.5929712", "0.59011596", "0.58105487", "0.57891005", "0.57831335", "0.5774187", "0.56362...
0.83953416
0
Add a set of view variables
public void addViewVariables (Map<String, Object> vars) { if (vars != null) { _viewVariables.putAll (vars); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addViewVariable (String name, Object value)\n {\n _viewVariables.put (name, value);\n }", "public static void addVars(Var[] vars) {\n if (vars != null) {\n for (Var var : vars) {\n addVar(var);\n }\n }\n }", "private void addV...
[ "0.6970643", "0.63483465", "0.63378686", "0.60008144", "0.58576775", "0.57560325", "0.56456745", "0.5614636", "0.5595915", "0.5572142", "0.5497933", "0.5497933", "0.5493879", "0.5468595", "0.5458273", "0.5450099", "0.54198885", "0.54083544", "0.53935", "0.5356205", "0.5352825...
0.81526023
0
Returns the name of the controller
public String getName () { if (__name == null) { __name = getName (getClass ()); } return __name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getControllername() {\n\treturn controllername;\n}", "public Controller getController();", "public String getContainerName() throws ControllerException {\n\t\tif(myImpl == null) {\n\t\t\tthrow new ControllerException(\"Stale proxy.\");\n\t\t}\n\t\treturn myImpl.here().getName();\n\t}", ...
[ "0.8074217", "0.6811531", "0.6693779", "0.6675719", "0.6586781", "0.65203035", "0.64951575", "0.64385533", "0.63797396", "0.6357948", "0.6357948", "0.6343149", "0.6343149", "0.6325544", "0.6296389", "0.62901", "0.6216757", "0.621619", "0.6171685", "0.61612403", "0.61568195", ...
0.0
-1
Returns the computed name of a controller
public static String getName (Class<? extends MailController> clazz) { String fqcn = clazz.getName (); int i = fqcn.lastIndexOf ('.'); String name = i>0 ? fqcn.substring (i+1) : fqcn; String xname = name.endsWith ("MailController") ? name.substring (0, name.length ()-14) : name; return xname.substring (0, 1).toLowerCase () + xname.substring (1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getControllername() {\n\treturn controllername;\n}", "String getController(String clientId);", "public String getContainerName() throws ControllerException {\n\t\tif(myImpl == null) {\n\t\t\tthrow new ControllerException(\"Stale proxy.\");\n\t\t}\n\t\treturn myImpl.here().getName();\n\t...
[ "0.7549221", "0.6509336", "0.6475434", "0.63284796", "0.6177783", "0.6056399", "0.6043674", "0.59760034", "0.59218067", "0.5914358", "0.59033", "0.5873649", "0.5872828", "0.587003", "0.5850051", "0.57486415", "0.57478726", "0.57339513", "0.57334757", "0.57330394", "0.5721761"...
0.65373665
1
cuando pulsa en el mensaje llama a la pantalla de preferencias
@Override public void onClick(View v) { Intent cambioVentana = new Intent(Portada.this, Preferencias.class); startActivity(cambioVentana); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void prosegui(String messaggio);", "private static void imprimirMensajeEnPantalla() {\n\tSystem.out.println(\"########### JUEGO EL AHORCADO ###########\");\n\timprimirAhorcado(intentosRestantes);\n\tSystem.out.println(\"\\nPALABRA ACTUAL: \" + getPalabraActualGuionBajo());\n\tSystem.out.println(\"INTENTOS RESTAN...
[ "0.6523654", "0.64418674", "0.6286197", "0.61567837", "0.6128609", "0.612434", "0.61031806", "0.6075302", "0.6043819", "0.60243374", "0.5975229", "0.5919564", "0.5885543", "0.5854018", "0.5844307", "0.58363044", "0.5833293", "0.5829665", "0.58151734", "0.58020526", "0.5786590...
0.0
-1
cuando pulsa en el mensaje llama a la pantalla de registro
@Override public void onClick(View v) { Intent cambioVentana = new Intent(Portada.this, MainActivity.class); startActivity(cambioVentana); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void recibirMensaje(Mensaje mensaje) {\n mensajes.append(mensaje);\n }", "public String mensagemDeRegistros(){//METODO QUE DIZ INICIO E FIM DOS REGISTROS LISTADOS\r\n\t\treturn dao.getMensagemNavegacao();\r\n\t}", "public void insertaMensaje(InfoMensaje m) throws Exception;", ...
[ "0.6682855", "0.6663609", "0.66056335", "0.6498869", "0.6478999", "0.64027137", "0.6398264", "0.63151044", "0.6301803", "0.6294896", "0.62625235", "0.62203", "0.62138444", "0.6202355", "0.61970353", "0.6187535", "0.6112793", "0.611086", "0.6095829", "0.6091164", "0.60765046",...
0.0
-1
TODO Autogenerated method stub
@Override public String getCurrentFragmentName() { return "IncomeFragment"; }
{ "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
Creates new form BalanceView
public BalanceView(Integer productCode, NomenclatureView parent, SalesView salesView) { initComponents(); Util.initJIF(this, "Баланс", parent, salesView); Util.initJTable(jtBalance); this.productCode = productCode; this.parent = parent; this.salesView = salesView; showTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private View createBalance() {\r\n\t\tTextView balance = new TextView(getContext());\r\n\t\tLayoutParams blp = new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,\r\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1);\r\n\t\tbalance.setGravity(Gravity.RIGHT);\r\n\t\tbalance.setLayoutParams...
[ "0.6266976", "0.61432785", "0.5906653", "0.5849202", "0.58434165", "0.5801917", "0.58004725", "0.57893586", "0.57370275", "0.5723955", "0.5674443", "0.5669425", "0.5654269", "0.5651342", "0.5633548", "0.5619219", "0.55899656", "0.5552815", "0.5538304", "0.551938", "0.5518094"...
0.61067605
2
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jtBalance = new javax.swing.JTable(); jbClose = new javax.swing.JButton(); setClosable(true); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sales.SalesApp.class).getContext().getResourceMap(BalanceView.class); setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N jScrollPane1.setName("jScrollPane1"); // NOI18N jtBalance.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jtBalance.setName("jtBalance"); // NOI18N jScrollPane1.setViewportView(jtBalance); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(sales.SalesApp.class).getContext().getActionMap(BalanceView.class, this); jbClose.setAction(actionMap.get("closeBalance")); // NOI18N jbClose.setText(resourceMap.getString("jbClose.text")); // NOI18N jbClose.setName("jbClose"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 698, Short.MAX_VALUE) .addComponent(jbClose, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE) .addGap(11, 11, 11) .addComponent(jbClose) .addContainerGap()) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73213893", "0.72913563", "0.72913563", "0.72913563", "0.7286415", "0.724936", "0.72132975", "0.72076875", "0.71963966", "0.7190991", "0.7184836", "0.71593595", "0.71489584", "0.709429", "0.7080468", "0.70567", "0.6987573", "0.69780385", "0.69556123", "0.69538146", "0.69455...
0.0
-1
TODO Autogenerated method stub
@Override public void print(int indent) { }
{ "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
Note: File handle is not duplicated when copied.
@Override public DataType copy() throws BugTrap { InputFile file = new InputFile(this.pathName); file.value = this.value; return file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void copyFile(File scrFile, File file) {\n\t\r\n}", "private static void copyFile(File in, File out)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFileChannel inChannel = new\tFileInputStream(in).getChannel();\n\t\t\tFileChannel outChannel = new FileOutputStream(out).getChannel();\n\t\t\tinChannel.transferTo(0, inC...
[ "0.7035647", "0.68499076", "0.661068", "0.6514445", "0.6287944", "0.6259302", "0.6241204", "0.62389064", "0.6224941", "0.62133175", "0.6197989", "0.61510307", "0.6092575", "0.6089311", "0.6064798", "0.60054165", "0.59772134", "0.59280896", "0.59239864", "0.58953816", "0.58927...
0.6141181
12
log the user in the email and password fields are not empty
public void onClick(View view) { Intent intent = new Intent(MainActivity.this, TempActivity.class); startActivity(intent); String mail=email.getText().toString().trim(); String pass=password.getText().toString().trim(); if (mail.isEmpty()|| pass.isEmpty()){ Toast.makeText(getApplicationContext(), "All fields required to log In", Toast.LENGTH_LONG).show(); return; } firebaseAuth.signInWithEmailAndPassword(mail,pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()){ Log.w(TAG,"sign in with email Successful"); Toast.makeText(MainActivity.this,"LogIn successful",Toast.LENGTH_SHORT).show(); FirebaseUser user= firebaseAuth.getCurrentUser(); updateUI(user); startActivity(new Intent(getApplicationContext(),ForgotPassword.class)); } else{ Log.w(TAG,"sign in with email failed", task.getException()); Toast.makeText(MainActivity.this,task.getException().getMessage(),Toast.LENGTH_SHORT).show(); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void login_now(View view) {\n String userMailId = email_id.getText().toString();\n String userPassword = password.getText().toString();\n\n\n if (!userMailId.equals(\"\")) {\n if (!userPassword.equals(\"\")) {\n loginUser(userMailId, userPassword);\n ...
[ "0.7523058", "0.73035365", "0.7242419", "0.71609443", "0.7160214", "0.7150262", "0.71323067", "0.7091309", "0.70590997", "0.7050068", "0.6996504", "0.69816726", "0.696527", "0.6960383", "0.6951554", "0.6945618", "0.6941981", "0.69105446", "0.68977267", "0.68749887", "0.685411...
0.0
-1
Creates new form DayPanel
public YearPanel(CalendarEx calendar) { initComponents(); cal = calendar; year = CalendarEx.getCurrentYear(); ListAppointMents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createSchedulePanel()\n\t{\n\t\t//newWeek=new Week(selectedId);\n\t\t//contentPane.add(newWeek,BorderLayout.SOUTH);\n\t\t//System.out.println(\"first time load:\"+selectedId);\n\t\tschedule=new Schedule(selectedId, isSprinklerSelected);\n\t\tschedulePane=new JPanel();\n\t\tschedulePane.setLayout(new F...
[ "0.66936064", "0.62697476", "0.623609", "0.6114072", "0.6058381", "0.60537416", "0.59500635", "0.5919214", "0.5913309", "0.5882336", "0.5870138", "0.5811937", "0.57959527", "0.57929724", "0.57860774", "0.5782983", "0.57573986", "0.5728721", "0.57231224", "0.57186013", "0.5713...
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { PreviousButton = new javax.swing.JButton(); NextButton = new javax.swing.JButton(); YearLabel = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); PreviousButton.setText("Previous"); PreviousButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { PreviousButtonActionPerformed(evt); } }); NextButton.setText("Next"); NextButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { NextButtonActionPerformed(evt); } }); YearLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); YearLabel.setText("YEAR"); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "", "", "", "" } )); jTable1.setGridColor(new java.awt.Color(4, 2, 2)); jTable1.setRowHeight(125); jScrollPane1.setViewportView(jTable1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(PreviousButton) .addGap(147, 147, 147) .addComponent(YearLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 151, Short.MAX_VALUE) .addComponent(NextButton) .addContainerGap()) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 582, Short.MAX_VALUE) .addContainerGap())) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {NextButton, PreviousButton}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PreviousButton) .addComponent(NextButton) .addComponent(YearLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(334, Short.MAX_VALUE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(48, 48, 48) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE) .addContainerGap())) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73213893", "0.72913563", "0.72913563", "0.72913563", "0.7286415", "0.724936", "0.72132975", "0.72076875", "0.71963966", "0.7190991", "0.7184836", "0.71593595", "0.71489584", "0.709429", "0.7080468", "0.70567", "0.6987573", "0.69780385", "0.69556123", "0.69538146", "0.69455...
0.0
-1
/ parametro integer, dia integer, valor real
public String getInsertSQL() { String fieldList = "parametro, dia, valor"; return String.format("insert into alteracs (%s) values (%d, %d, %s)", fieldList, parametro, dia, String.format("%.3f", valor).replace(',', '.')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void posicionar(int dia) {\n\n anguloConElSol = (anguloInicial + (velocidadEnGrados * dia * direccion));\n this.posicion.fijarPos(anguloConElSol, radio);\n }", "public void fijarFecha(int d, int m, int a)\n {\n // put your code here\n dia.setValor(d);\n mes.setValo...
[ "0.65323484", "0.65265286", "0.64521164", "0.64423555", "0.623898", "0.61888534", "0.6121123", "0.6103608", "0.60599434", "0.60526747", "0.60374844", "0.60172427", "0.6007317", "0.59763634", "0.5960986", "0.59467894", "0.5942934", "0.59257007", "0.58857626", "0.5831313", "0.5...
0.0
-1
Created by dengshaojun on 2017/5/23.
public interface PortalPricesInfoResponsitory extends JpaCustomResponsitory<PortalPricesInfoEntity, Integer> { @Query("select p from PortalPricesInfoEntity p where p.name = ?1") List<PortalPricesInfoEntity> findByName(String name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n p...
[ "0.61948675", "0.61534095", "0.6014605", "0.59445643", "0.5933668", "0.5916184", "0.5911525", "0.5895562", "0.5895562", "0.5872346", "0.58070904", "0.58070904", "0.58042246", "0.5797951", "0.57960606", "0.57960534", "0.5791831", "0.5789088", "0.57868975", "0.5773707", "0.5761...
0.0
-1
Complete the findShortest function below. / For the unweighted graph, : 1. The number of nodes is Nodes. 2. The number of edges is Edges. 3. An edge exists between From[i] to To[i].
static int findShortest(int graphNodes, int[] graphFrom, int[] graphTo, long[] ids, int val) { // build a tree HashMap<Integer, List<Integer>> t = new HashMap<>(); // graphFrom和To,length一样长,是一对 for (int i = 0; i < graphFrom.length; i++) { int from = graphFrom[i]; int to = graphTo[i]; if (!t.containsKey(from)) { t.put(from, new ArrayList<Integer>()); } if (!t.containsKey(to)) { t.put(to, new ArrayList<Integer>()); } List<Integer> l1 = t.get(from); l1.add(to); List<Integer> l2 = t.get(to); l2.add(from); } // find the same colour, i + 1 = 那个node List<Integer> findId = new ArrayList<>(); for (int i = 0; i < ids.length; i++) { // val是要找的colour,ids是colour ids if (val == ids[i]) { findId.add(i + 1); } } if (findId.size() <= 1) { return -1; } // 1 2 3 // 只需要loop 2 int times = findId.size() - 2; // 可能是数字,或者-1 int minLength = helper(t, findId, graphNodes); for (int i = 0; i < times; i++) { int min = helper(t, findId, graphNodes); // 假如minLength是数字,min < minLength && min != -1 // 假如minLength是-1,replace它 boolean number = min < minLength && min != -1; if (minLength == -1 || number) { minLength = min; } } return minLength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfV...
[ "0.6985435", "0.6960937", "0.6951844", "0.6593947", "0.6585355", "0.6564143", "0.6555513", "0.6532652", "0.651445", "0.6482231", "0.64491254", "0.6427263", "0.6405198", "0.63190407", "0.62773687", "0.6257982", "0.6255294", "0.6200746", "0.6131819", "0.6130957", "0.61094266", ...
0.5996619
30
whether the text is null
public static void hasText(String text, String message) { if (StringUtils.isEmpty(text)) { throw new IllegalArgumentException(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEmpty() {\n return (this.text == null);\n }", "boolean hasText();", "boolean hasText();", "boolean hasText();", "boolean hasText();", "public boolean hasTextValue() {\r\n return getTextValue() != null;\r\n // return StringUtils.isNotBlank(getTextValue());\r\n }", "...
[ "0.7677329", "0.7466764", "0.7466764", "0.7466764", "0.7466764", "0.74517286", "0.74180704", "0.7393897", "0.738706", "0.73695004", "0.72623205", "0.72357374", "0.72310257", "0.72264576", "0.7059263", "0.7038784", "0.7021355", "0.6988611", "0.69836724", "0.69537073", "0.68929...
0.0
-1
Get all the habilitations.
@Override @Transactional(readOnly = true) public List<HabilitationDTO> findAll() { log.debug("Request to get all Habilitations"); return habilitationRepository.findAll().stream() .map(habilitationMapper::toDto) .collect(Collectors.toCollection(LinkedList::new)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Habitacion> cargarHabitaciones() {\n HabitacionDAO hdao = new HabitacionDAO();\n return hdao.cargarHabitacion();\n }", "ArrayList<Habit> getHabits();", "ArrayList<Ability> getAbilities() throws RemoteException;", "public List<Habitacion> getAllHabitaciones() throws Exception...
[ "0.6799507", "0.6693009", "0.6285527", "0.61841786", "0.6133641", "0.61082643", "0.6010363", "0.5941071", "0.59163666", "0.58750933", "0.5779553", "0.5771054", "0.57706034", "0.57445574", "0.57074565", "0.57063025", "0.5651705", "0.56235343", "0.5580978", "0.55720216", "0.556...
0.64326596
2
Get one habilitation by id.
@Override @Transactional(readOnly = true) public Optional<HabilitationDTO> findOne(Long id) { log.debug("Request to get Habilitation : {}", id); return habilitationRepository.findById(id) .map(habilitationMapper::toDto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Transactional(readOnly = true) \n public Heater findOne(Long id) {\n log.debug(\"Request to get Heater : {}\", id);\n Heater heater = heaterRepository.findOne(id);\n return heater;\n }", "Chofer findOne(Long id);", "public DisponibilidadEntity find(Long idHabitacion, Long id) {\r\n ...
[ "0.7274971", "0.7192258", "0.7138043", "0.6792837", "0.6666408", "0.6622445", "0.6617898", "0.6614653", "0.6588833", "0.65887237", "0.65607125", "0.6554205", "0.6551454", "0.6546191", "0.6531371", "0.65164393", "0.6513458", "0.65007204", "0.6486164", "0.6477233", "0.6470785",...
0.76100135
0
Delete the habilitation by id.
@Override public void delete(Long id) { log.debug("Request to delete Habilitation : {}", id); habilitationRepository.deleteById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void delete(Long id) {\n log.debug(\"Request to delete Harnais : {}\", id);\n harnaisRepository.deleteById(id);\n }", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Chucdanh : {}\", id);\n chucdanhRepository.deleteById(id);\n }", "public v...
[ "0.779387", "0.7766089", "0.76882434", "0.7662251", "0.7662251", "0.7662251", "0.76260865", "0.75713456", "0.75499034", "0.7541227", "0.7541227", "0.7516322", "0.75065255", "0.75065255", "0.75065255", "0.75065255", "0.75065255", "0.7478029", "0.7459642", "0.74563545", "0.7451...
0.8488879
0
public static final int REQUEST_CODE_SETTING = 0x01;
private PermissionUtil() { throw new IllegalStateException("you can't instantiate PermissionUtil!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRequestCode(String requestCode);", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }", "@SuppressWarnings(\"BooleanMethodIsAlwaysInverted\")\n...
[ "0.62828696", "0.5983696", "0.5933939", "0.58897495", "0.58411103", "0.58368593", "0.57313955", "0.572774", "0.569377", "0.5676463", "0.56757665", "0.56285965", "0.559347", "0.55636156", "0.5562696", "0.5543843", "0.55045563", "0.5494061", "0.54305315", "0.5416633", "0.541084...
0.0
-1
0 homozygote 1/1 1 heterozygosity 1/2 2 homozygote 2/2 3 missing
public int getAdditiveScore(int idx, int i) { int posByte = QCedSnpIndex.get(i) >> shift; int posBit = (QCedSnpIndex.get(i) & 0xf) << 1; int g = (genotypeMat[idx][posByte] >> (posBit)) & 3; return g; // if (g == 1) {// 01 // return 3; // } else if (g == 0) { // return 0; // } else if (g == 2) { // return 1; // } else { // return 2; // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int AmbosHijosR() { //Hecho por mi\n return AmbosHijosR(raiz);\n }", "@Test(timeout = 4000)\n public void test135() throws Throwable {\n ResultMatrixGnuPlot resultMatrixGnuPlot0 = new ResultMatrixGnuPlot();\n int[][] intArray0 = new int[7][8];\n int[] intArray1 = new int[0];\n ...
[ "0.5497144", "0.53778875", "0.5254671", "0.5253548", "0.51861686", "0.5179262", "0.51598704", "0.51448953", "0.5144337", "0.51381004", "0.513591", "0.5130158", "0.5129337", "0.51266533", "0.5126298", "0.51245815", "0.5109322", "0.51086116", "0.50989467", "0.50958043", "0.5095...
0.0
-1
0 homozygote 1/1 1 heterozygosity 1/2 2 homozygote 2/2 3 missing
public int getAdditiveScoreOnFirstAllele(int idx, int i) { int posByte = QCedSnpIndex.get(i) >> shift; int posBit = (QCedSnpIndex.get(i) & 0xf) << 1; int g = (genotypeMat[idx][posByte] >> (posBit)) & 3; return g == ConstValues.MISSING_GENOTYPE ? g : (2 - g); // if (g == 1) {// 01 // return 3; // } else if (g == 0) { // return 0; // } else if (g == 2) { // return 1; // } else { // return 2; // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int AmbosHijosR() { //Hecho por mi\n return AmbosHijosR(raiz);\n }", "@Test(timeout = 4000)\n public void test135() throws Throwable {\n ResultMatrixGnuPlot resultMatrixGnuPlot0 = new ResultMatrixGnuPlot();\n int[][] intArray0 = new int[7][8];\n int[] intArray1 = new int[0];\n ...
[ "0.5497144", "0.53778875", "0.5254671", "0.5253548", "0.51861686", "0.5179262", "0.51598704", "0.51448953", "0.5144337", "0.51381004", "0.513591", "0.5130158", "0.5129337", "0.51266533", "0.5126298", "0.51245815", "0.5109322", "0.51086116", "0.50989467", "0.50958043", "0.5095...
0.0
-1
this only for write back to bed file purpose
public byte getOriginalGenotypeScore(int ind, int i) { int posByte = QCedSnpIndex.get(i) >> shift; int posBit = (QCedSnpIndex.get(i) & 0xf) << 1; int g = (genotypeMat[ind][posByte] >> (posBit)) & 3; switch (g) { case 0: g = 0; break; case 1: g = 2; break; case 2: g = 3; break; default: g = 1; break; // missing } return (byte) g; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void write() {\n\t\t\r\n\t}", "@Override\n public void write() {\n\n }", "public void write() {\n\t\tint xDist, yDist;\r\n\t\ttry {\r\n\t\t\tif (Pipes.getPipes().get(0).getX() - b.getX() < 0) { // check if pipes are behind bird\r\n\t\t\t\txDist = Pipes.getPipes().get...
[ "0.6660972", "0.6646011", "0.645884", "0.6323755", "0.6314124", "0.62266135", "0.61708677", "0.61317205", "0.6129233", "0.6012975", "0.60028976", "0.5985602", "0.5949263", "0.5901349", "0.58882785", "0.5873617", "0.58689237", "0.58661973", "0.58195865", "0.5819445", "0.580211...
0.0
-1
$FF: Couldn't be decompiled
public void installShortcut(long param1) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decomp...
[ "0.88761103", "0.8875886", "0.8832501", "0.8821476", "0.88194513", "0.87842625", "0.87842625", "0.87562454", "0.87253726", "0.8724465", "0.87224555", "0.8722066", "0.8619874", "0.8571958", "0.8504731", "0.843185", "0.84148365", "0.8235883", "0.8002379", "0.77434903", "0.76716...
0.0
-1
mean of two parents
private Individual[] crossOver(Individual father, Individual mother){ Individual[] children = problem.makeChild(mother, father); return children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public double avgMPG() {\n\t\tdouble totalMPG = 0;\n\t\tint size = 0;\n\t\tNode current = head;\n\n\t\twhile(current != null) {\n\t\t\tif (current.getCar() instanceof GasCar) {\n\t\t\t\ttotalMPG = totalMPG + ((GasCar)c...
[ "0.6080881", "0.6019703", "0.5937083", "0.5933365", "0.5927323", "0.59011686", "0.58946717", "0.5830758", "0.57619506", "0.5754247", "0.5741579", "0.57357967", "0.5723022", "0.57197255", "0.5718542", "0.5708798", "0.57060564", "0.5691636", "0.56836", "0.56833017", "0.568084",...
0.0
-1
guassian mutation with mean=0 and variance=0.01
private Object mutation(Individual child){ return problem.improve(child.getId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void uniformMutation(){\n Random random = new Random();\n double newValue = random.nextGaussian()*16.6 + 50.0;\n if(newValue < 0) newValue = 0;\n if(newValue > 100) newValue = 100;\n int gene = random.nextInt(6);\n switch (gene){\n case 0 : this.x1 = new...
[ "0.60844016", "0.6075298", "0.56153154", "0.54879373", "0.5367877", "0.53581", "0.53219724", "0.5304714", "0.529771", "0.52973014", "0.5283201", "0.5282067", "0.52818805", "0.52794003", "0.5271823", "0.5266285", "0.52526075", "0.524194", "0.52361536", "0.5216084", "0.5214133"...
0.0
-1
This function compare this state for Priority Queue
private int compareA(AState s1, AState s2) { if (s1.getPrice() > s2.getPrice()) return 1; if (s1.getPrice()< s2.getPrice()) return -1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean compareTo(SLR1_automat.State state);", "@Override\n\t\tpublic int compareTo(state arg0) {\n\t\t\treturn (this.weight1 * this.weight2) - (arg0.weight1 * arg0.weight2);\n\t\t}", "@Override\n\tpublic int compareTo(State o) {\n\t\t//add something for different lengths?\n\t\t//if (this.state_rep.leng...
[ "0.64735246", "0.6278132", "0.6216211", "0.6201247", "0.61213464", "0.5984829", "0.5953915", "0.58326775", "0.58292633", "0.58072037", "0.58055806", "0.5792903", "0.5778348", "0.57707596", "0.574385", "0.57434595", "0.5723518", "0.5723518", "0.5723518", "0.5722605", "0.567453...
0.54849184
32
This function solve maze
@Override public Solution solve(ISearchable domain) { if(domain==null) return null; Solution s2=domain.checkIfIsSmall(); if(s2!=null){ domain.isClear(); return s2; } Solution sol = new Solution(); temp.add(domain.getStartState()); numOfNude++; domain.isVisit(domain.getStartState()); ArrayList<AState> neighbors=new ArrayList<AState>(); while(!temp.isEmpty()){ AState curr=temp.poll(); if(domain.isEqual(domain.getGoalState(),curr)){ numOfNude++; sol =solutionPath(curr,sol); break; } neighbors=domain.getAllPossibleState(curr); for(int i=0;i<neighbors.size();i++){ if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){ neighbors.get(i).pervState=curr; neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice()); numOfNude++; sol =solutionPath(neighbors.get(i),sol); break; } neighbors.get(i).pervState=curr; neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice()); temp.add(neighbors.get(i)); numOfNude++; } } domain.isClear(); return sol; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void solveMaze() throws MazeException {\n\n long startTime = System.currentTimeMillis();\n List<Maze.Room> solution = path();\n long endTime = System.currentTimeMillis();\n\n double timeToSolve = (endTime - startTime) / 1000.0;\n\n setSolution(Optional.<List<Maze.Room>>of(...
[ "0.75676024", "0.75577486", "0.7468357", "0.7264147", "0.7200091", "0.70005363", "0.69876266", "0.69022113", "0.6861551", "0.6841264", "0.6816822", "0.6793258", "0.67781764", "0.6756311", "0.67176396", "0.6652071", "0.6646512", "0.6572812", "0.6562535", "0.65443593", "0.65420...
0.0
-1
.Ydb.RateLimiter.Resource resource = 1;
boolean hasResource();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.yandex.ydb.rate_limiter.Resource getResource();", "void requestRateLimited();", "com.yandex.ydb.rate_limiter.ResourceOrBuilder getResourceOrBuilder();", "public RateLimiter getRateLimiter() {\n return rateLimiter;\n }", "void rateLimitReset();", "public void setRateLimiter(RateLimiter rateLimiter...
[ "0.7306931", "0.7186138", "0.6339101", "0.62748307", "0.6178448", "0.61648595", "0.6131422", "0.601361", "0.59783816", "0.5852193", "0.5634829", "0.557791", "0.5566713", "0.5537905", "0.5465978", "0.5457141", "0.54394996", "0.542154", "0.5415058", "0.5409703", "0.5317706", ...
0.0
-1
.Ydb.RateLimiter.Resource resource = 1;
com.yandex.ydb.rate_limiter.Resource getResource();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestRateLimited();", "com.yandex.ydb.rate_limiter.ResourceOrBuilder getResourceOrBuilder();", "public RateLimiter getRateLimiter() {\n return rateLimiter;\n }", "void rateLimitReset();", "public void setRateLimiter(RateLimiter rateLimiter) {\n this.rateLimiter = rateLimiter;\n }", "public...
[ "0.7186138", "0.6339101", "0.62748307", "0.6178448", "0.61648595", "0.6131422", "0.601361", "0.59783816", "0.5852193", "0.5634829", "0.557791", "0.5566713", "0.5537905", "0.5465978", "0.5457141", "0.54394996", "0.542154", "0.5415058", "0.5409703", "0.5317706", "0.52604973", ...
0.7306931
0
.Ydb.RateLimiter.Resource resource = 1;
com.yandex.ydb.rate_limiter.ResourceOrBuilder getResourceOrBuilder();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.yandex.ydb.rate_limiter.Resource getResource();", "void requestRateLimited();", "public RateLimiter getRateLimiter() {\n return rateLimiter;\n }", "void rateLimitReset();", "public void setRateLimiter(RateLimiter rateLimiter) {\n this.rateLimiter = rateLimiter;\n }", "public RateLimiter getRa...
[ "0.7306931", "0.7186138", "0.62748307", "0.6178448", "0.61648595", "0.6131422", "0.601361", "0.59783816", "0.5852193", "0.5634829", "0.557791", "0.5566713", "0.5537905", "0.5465978", "0.5457141", "0.54394996", "0.542154", "0.5415058", "0.5409703", "0.5317706", "0.52604973", ...
0.6339101
2
Checks whether the given word must be ignored even it is misspelled.
public boolean ignoreWord(String word) { // By default we ignore all keywords that are defined in the syntax return org.emftext.sdk.concretesyntax.resource.cs.grammar.CsGrammarInformationProvider.INSTANCE.getKeywords().contains(word); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isWord2ignore(String word);", "public boolean isExcludedWord() {\n return StringUtils.startsWith(word, \"-\");\n }", "boolean isNotKeyWord(String word);", "private boolean isWordValid(String word){\n\t\tif(word.isEmpty())\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public static...
[ "0.80250156", "0.7743486", "0.74888474", "0.70556384", "0.694655", "0.6793337", "0.677175", "0.675355", "0.6717961", "0.669225", "0.66827494", "0.668218", "0.66638196", "0.6597138", "0.6560164", "0.64994377", "0.6473111", "0.64545673", "0.63650954", "0.6332608", "0.63202375",...
0.8059274
0
Make tester for this Challenge
public static void main(String[] args) { FunctionReturnTester<int[][]> tester = new FunctionReturnTester<int[][]>(TwoDArrayConverterTest::approved, "Test", "to2DArray", int[][].class, int[].class); tester.noArgsConstructor(); if (!tester.didForm()) { tester.printResults(); return; } // Use arrays's deep equals method tester.setEqualityTester(Arrays::deepEquals); // Test Cases tester.addArgs(() -> new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); tester.addArgs(() -> new int[] { 11, -2, 3 }); tester.addArgs(() -> new int[] {}); tester.addArgs(() -> new int[] { 0, 11, 77, -14, 8, 8 }); tester.setMethodInvoker((obj, arg) -> { int[] in1 = (int[]) arg[0]; return tester.getMethod().invoke(obj, in1); }); tester.setInputToStringConverter(arg -> { int[] in1 = (int[]) arg[0]; return Arrays.toString(in1); }); tester.setOutputToStringConverter(Arrays::deepToString); // Run test cases tester.runTests(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void run()\n {\n String[] testInput = FileIO.readAsStrings(\"2020/src/day17/Day17TestInput.txt\");\n String[] realInput = FileIO.readAsStrings(\"2020/src/day17/Day17Input.txt\");\n\n Test.assertEqual(\"Day 17 - Part A - Test input\", partA(testInput), 112);\n Test.assertEqual(\"Day 17 - ...
[ "0.6742199", "0.66205925", "0.6553648", "0.65206856", "0.64893496", "0.64335537", "0.6427293", "0.6426434", "0.6362407", "0.6325749", "0.62589604", "0.62425786", "0.62324053", "0.6230682", "0.6226107", "0.62224704", "0.62196916", "0.6214411", "0.6194248", "0.6190362", "0.6178...
0.0
-1
Get the next permutation of the termIndices.
public ArrayList<Integer> getNext() { // run thru our list of permutations do { returnIndex++; if (returnIndex == permutations.size()) { // we reached end of current permutations-list, // so we have to expand our termIndices-list, // re-generate our permutations-list and // reset out returnIndex termIndices.add(termIndices.size()); permute(""); returnIndex = 0; } } while (permHistory.contains(permutations.get(returnIndex))); permHistory.add(permutations.get(returnIndex)); return permutations.get(returnIndex); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<E> getNextArray()\r\n/* */ {\r\n/* */ List<E> permutationResult;\r\n/* */ \r\n/* */ \r\n/* */ List<E> permutationResult;\r\n/* */ \r\n/* 123 */ if (this.permOrder.hasNextPermutaions()) {\r\n/* 124 */ this.currPermutationArray = this.permOrder.nextPerm...
[ "0.5732586", "0.55818135", "0.5521519", "0.5460665", "0.5416322", "0.5311936", "0.5301708", "0.52927816", "0.5285118", "0.5257374", "0.5252624", "0.5241662", "0.52273315", "0.51715195", "0.51599014", "0.5144101", "0.51145273", "0.5113198", "0.5058868", "0.4962154", "0.4905434...
0.69569904
0
Uruchamiasz odczytanie wszystkich danych z bazy
static public void czytaj(String host){ try { czytaj(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("http://"+host+"/xml.php")); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void zmniejszBieg();", "public void zapisUrok() {\r\n\r\n\t\taktualnyZostatok = getZostatok() * urokovaSadzba / 100;\r\n\t\tsetVklad(aktualnyZostatok);\r\n\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic String lireFichierReverse() throws IOException {\n\t\treturn null;\n\t}"...
[ "0.6097671", "0.55514354", "0.5542978", "0.53780806", "0.5356914", "0.53028744", "0.5294545", "0.5268252", "0.5267903", "0.5255862", "0.52265936", "0.52152944", "0.5213505", "0.518385", "0.5143653", "0.51298624", "0.5128712", "0.5100543", "0.5093037", "0.5080243", "0.5031123"...
0.0
-1
Zapisuje zmiany na serwerze
static public void zapisz(String host){ String daneWysyłane="oddaj="; Wyp[] wyporzyczeniaDoZmiany=new Wyp[wyporzyczenia.size()]; for(int i=0;i<wyporzyczenia.size();i++){ Wyp el=wyporzyczenia.elements().nextElement(); if(el.zmieniony){ wyporzyczeniaDoZmiany[i]=el; daneWysyłane+=el.id+"/"+el.czasKoniec+";"; } } daneWysyłane+="&dodaj="; Wyp[] wyporzyczeniaDoDodania=new Wyp[wyporzyczenia.size()]; for(int i=0;i<wyporzyczenia.size();i++){ Wyp el=wyporzyczenia.elements().nextElement(); if(el.dodany){ wyporzyczeniaDoDodania[i]=el; daneWysyłane+=el.laptop.id+"/"+el.kto.id+"/"+el.czasStart()+"/"+el.czasKoniec()+";"; } } URL u = null; try { u = new URL("http://"+host+"/zapisz.php"); HttpURLConnection con = (HttpURLConnection) u.openConnection(); //add reuqest header con.setRequestMethod("POST"); con.setRequestProperty("User-Agent", "Android"); con.setRequestProperty("Accept-Language", "en-US,en;q=0.5"); // Send post request con.setDoOutput(true); DataOutputStream wr = new DataOutputStream(con.getOutputStream()); wr.writeBytes(daneWysyłane); wr.flush(); wr.close(); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "public void serialize() {\n\t\t\n\t}", "java.lang.String getSer();", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void inizializza() {\n\n ...
[ "0.6604178", "0.6586322", "0.63794816", "0.60599744", "0.5983859", "0.593544", "0.5929439", "0.5826601", "0.5823169", "0.5799365", "0.57949233", "0.5787375", "0.5734257", "0.56745327", "0.5629808", "0.5623862", "0.55817294", "0.5581236", "0.5574402", "0.55528426", "0.55367017...
0.55051315
24