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
Cell constructor through the coordinates
public Cell(int posX, int posY) { this.posX = posX; this.posY = posY; this.level = 0; this.currWorker = null; this.dome = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Cell(){}", "public Cell(int col, int row){ // constructor\n this.col = col;\n this.row = row;\n }", "public Coordinate() { row = col = -1; }", "public Cell(int row, int column){\r\n this.row = row;\r\n this.column = column;\r\n }", "public Cell()\n\t{\n\t}", "publ...
[ "0.7869783", "0.7742171", "0.7597431", "0.75911087", "0.7590211", "0.75331336", "0.7447232", "0.7420904", "0.74019074", "0.73133564", "0.71379", "0.70763725", "0.7076116", "0.7025073", "0.70188856", "0.6949683", "0.6916312", "0.6863941", "0.6821713", "0.68214554", "0.67762583...
0.69477654
16
add block level in a cell: it increments previous level existing in the cell
public void buildInCell() { this.level++; if (this.level == 4) { this.setFreeSpace(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void incrementLevel()\r\n {\r\n counts.addFirst( counts.removeFirst() + 1 );\r\n }", "public void changeLVL(int index){\n level +=index;\n changeLvL=true;\n }", "public void addLevel()\r\n {\r\n tables.addFirst( new HashMap<String,T>() );\r\n counts.addFirs...
[ "0.6676774", "0.6338545", "0.63133335", "0.6236465", "0.60777956", "0.60587335", "0.5996705", "0.59908766", "0.59689504", "0.59299165", "0.5892432", "0.5851462", "0.58231765", "0.5781896", "0.574824", "0.57089776", "0.57083315", "0.5685739", "0.56260455", "0.56089085", "0.560...
0.6595286
1
add dome in this cell
public void buildDome() { if (this.getLevel() == 3) { buildInCell(); } else { this.dome = true; this.setFreeSpace(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCell(TCell cell) {\n\tcell.Owner = this;\n\tcolorize(cell);\n\tCells.add(cell);\n }", "void piede() {\n try {\n\n Cell c;\n c = new Cell();\n set2(c);\n c.setColspan(4);\n datatable.addCell(c);\n c = new Cell(new Phrase(\"...
[ "0.6435759", "0.6327013", "0.62194836", "0.6179261", "0.5864257", "0.58203596", "0.58186305", "0.5806365", "0.5790173", "0.57239056", "0.5662209", "0.5563294", "0.55057", "0.5497894", "0.54852986", "0.54511845", "0.5449962", "0.5397301", "0.53568923", "0.5337944", "0.5320599"...
0.5767411
9
It deletes worker pointer from a cell
public void deleteCurrWorker() { this.currWorker = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteWerker(Worker w)\n {\n if(aantalWerkers > 0)\n {\n for(int i=0; i<5;i++)\n {\n if(workers[i] == w)\n {\n workers[i] = null;\n }\n }\n w.setInStructure(false);\n ...
[ "0.6613292", "0.65527654", "0.6460969", "0.6284435", "0.6188678", "0.6178649", "0.60101795", "0.60099816", "0.60080105", "0.59915686", "0.59841794", "0.59659076", "0.5961008", "0.59582853", "0.59528875", "0.58943623", "0.5888712", "0.5878553", "0.58653504", "0.5834684", "0.58...
0.70538604
0
The initialisation method for the UniRanker Class. Generates all the universities and courses from the stored csv file, and ranks all the courses by subject.
private static void init(String[] subjectsSupported) { generateUnis(); generateCourses(); rankCourses(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void generateUnis() {\r\n\t\tString[] lines = readFile(\"resources/unidata.csv\");\r\n\t\tint numOfUnis = lines.length + 1;\r\n\t\tfor (String line : lines) {\r\n\t\t\tString[] attributes = line.split(\",\");\r\n\t\t\tUniversity temp = new University();\r\n\t\t\ttemp.name = attributes[0];\r\n\t\t\tt...
[ "0.65844667", "0.57760435", "0.5754835", "0.5636304", "0.55789965", "0.5498095", "0.54975057", "0.5496811", "0.54867864", "0.5469335", "0.5402328", "0.53308153", "0.5317362", "0.5280143", "0.52755016", "0.52532786", "0.51881033", "0.51835203", "0.5168515", "0.5168185", "0.516...
0.6081473
1
Ranks the universities based on the category of data.
private static void doubleRanker(int i, LinkedList<Course> subjectCourses) { TreeMap<Double, Course> map = new TreeMap<Double, Course>(Collections.reverseOrder()); for (Course c : subjectCourses) { switch (i) { case 2: map.put(c.uni.studentSatisfaction, c); break; case 4: map.put(1 - c.uni.costOfLiving, c); // In reverse order as lower is better. break; case 5: map.put(c.uni.studentFacultyRatio, c); break; case 7: map.put(c.uni.internationalStudentsRatio, c); break; case 8: map.put(c.uni.graduateProspects, c); break; } } Set<Entry<Double, Course>> doubleSet = map.entrySet(); Iterator<Entry<Double, Course>> doubleIt = doubleSet.iterator(); int counter = 1; while (doubleIt.hasNext()) { Map.Entry<Double, Course> me = (Map.Entry<Double, Course>) doubleIt.next(); LinkedList<RankedCourse> ranked = rankedCourses.get(subjectCourses.getFirst().subject); RankedCourse rc = new RankedCourse(); for (RankedCourse course : ranked) { if (course.courseName.equals(me.getValue().courseName) && course.uni.equals(me.getValue().uni)) { rc = course; break; } } switch (i) { case 2: rc.studentFacultyRatioRank = counter; case 4: rc.costOfLivingRank = counter; break; case 5: rc.studentFacultyRatioRank = counter; break; case 7: rc.internationalStudentsRatioRank = counter; break; case 8: rc.graduateProspectsRank = counter; break; } counter++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUniversityRank(int universityRank)\r\n\t{\r\n\t\tthis.universityRank = universityRank;\r\n\t}", "private void categorizeData(){\n\t\tfor(String s :userData.keySet()){\n\t\t\tTransactionData trans = userData.get(s);\n\t\t\tif(trans.getCategory() == 'I'){\n\t\t\t\tignorableTransactions.add(trans);\n...
[ "0.5656855", "0.5483477", "0.54358095", "0.5188172", "0.5172999", "0.516673", "0.5123499", "0.49789113", "0.4967153", "0.49543518", "0.4886381", "0.4878406", "0.48604447", "0.48529813", "0.4833261", "0.48302326", "0.48235705", "0.47764617", "0.47618717", "0.47360945", "0.4714...
0.0
-1
Ranks the universities based on the category of data.
private static void intRanker(int i, LinkedList<Course> subjectCourses) { TreeMap<Integer, Course> map = new TreeMap<Integer, Course>(Collections.reverseOrder()); for (Course c : subjectCourses) { switch (i) { case 1: map.put(1 - c.subjectRank, c); // In reverse order as lower is better. break; case 3: map.put(1 - c.uni.nationwideRanking, c); break; case 6: map.put(c.uni.researchOutput, c); break; } } Set<Entry<Integer, Course>> integerSet = map.entrySet(); Iterator<Entry<Integer, Course>> integerIt = integerSet.iterator(); int counter = 1; while (integerIt.hasNext()) { Map.Entry<Integer, Course> me = (Map.Entry<Integer, Course>) integerIt.next(); LinkedList<RankedCourse> ranked = rankedCourses.get(subjectCourses.getFirst().subject); RankedCourse rc = new RankedCourse(); for (RankedCourse course : ranked) { if (course.courseName.equals(me.getValue().courseName) && course.uni.equals(me.getValue().uni)) { rc = course; break; } } switch (i) { case 1: rc.subjectRank = counter; break; case 3: rc.nationwideRank = counter; break; case 6: rc.researchOutputRank = counter; break; } counter++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUniversityRank(int universityRank)\r\n\t{\r\n\t\tthis.universityRank = universityRank;\r\n\t}", "private void categorizeData(){\n\t\tfor(String s :userData.keySet()){\n\t\t\tTransactionData trans = userData.get(s);\n\t\t\tif(trans.getCategory() == 'I'){\n\t\t\t\tignorableTransactions.add(trans);\n...
[ "0.5655871", "0.5483953", "0.5436565", "0.51895726", "0.5173504", "0.51673764", "0.5125036", "0.49789196", "0.49661744", "0.4953923", "0.48865503", "0.4878356", "0.48615137", "0.4854001", "0.48335284", "0.48295835", "0.4825123", "0.47771195", "0.47632653", "0.47362906", "0.47...
0.0
-1
Manager for ranking of courses in all major categories.
private static void rankCourses() { for (String subject : courses.keySet()) { LinkedList<Course> subjectCourses = courses.get(subject); for (int i = 1; i <= 8; i++) { switch (i) { case 1: // Subject rank intRanker(1, subjectCourses); break; case 2: // Student satisfaction intRanker(2, subjectCourses); break; case 3: // Nationwide ranking doubleRanker(3, subjectCourses); break; case 4: // Cost of living doubleRanker(4, subjectCourses); break; case 5: // Student to faculty ratio doubleRanker(5, subjectCourses); break; case 6: // Research Output intRanker(6, subjectCourses); break; case 7: // International students doubleRanker(7, subjectCourses); break; case 8: // Graduate prospects doubleRanker(8, subjectCourses); break; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void intRanker(int i, LinkedList<Course> subjectCourses) {\r\n\t\tTreeMap<Integer, Course> map = new TreeMap<Integer, Course>(Collections.reverseOrder());\r\n\t\tfor (Course c : subjectCourses) {\r\n\t\t\tswitch (i) {\r\n\t\t\tcase 1:\r\n\t\t\t\tmap.put(1 - c.subjectRank, c); // In reverse order as ...
[ "0.60274416", "0.5525151", "0.5355004", "0.53278834", "0.52902013", "0.5245836", "0.5165962", "0.5119808", "0.50949526", "0.5090696", "0.50482726", "0.5044352", "0.49528036", "0.4908258", "0.48873043", "0.48860174", "0.48727712", "0.48430642", "0.4840326", "0.48357394", "0.48...
0.7122095
0
Generates all universities from stored csv file of university data.
private static void generateUnis() { String[] lines = readFile("resources/unidata.csv"); int numOfUnis = lines.length + 1; for (String line : lines) { String[] attributes = line.split(","); University temp = new University(); temp.name = attributes[0]; temp.type = attributes[1]; temp.isRussellGroup = Boolean.parseBoolean(attributes[2]); temp.studentSatisfaction = Double.parseDouble(attributes[3]); temp.nationwideRanking = numOfUnis - Integer.parseInt(attributes[4]); temp.costOfLiving = Double.parseDouble(attributes[5]); temp.studentFacultyRatio = Double.parseDouble(attributes[6]); temp.researchOutput = (int) Double.parseDouble(attributes[7]); // THIS LINE IS INCORRECT temp.internationalStudentsRatio = Double.parseDouble(attributes[8]); temp.graduateProspects = Double.parseDouble(attributes[9]); /* * Structure of CSV file containing general university data: NAME, TYPE (City or * Campus), RUSSELL GROUP, STUDENT SATISFACTION, NATIONWIDE RANKING (Overall), * COST OF LIVING (According to appropriate cost of living index), STUDENT * FACULTY RATIO, RESEARCH OUTPUT, INTERNATIONAL STUDENT RATIO and GRADUATE * PROSPECTS (How many graduates in full-time employment or education after an * appropriate period). */ unis.put(temp.name, temp); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getUniversities() {\n ProgressDialog dialog = new ProgressDialog(this, \"Caricamento...\");\n application.databaseCall(\"universities.php\", UNIVERSITY_SELECTION_TAG, dialog);\n }", "@Override\n\tpublic List<UniversityDTO> getUniversities() throws DatabaseException {\n\t\t\n\t\t con...
[ "0.63182676", "0.6289652", "0.59353334", "0.5896875", "0.57570666", "0.57507634", "0.56465024", "0.5605378", "0.556696", "0.55512464", "0.5442466", "0.54093313", "0.5386163", "0.5355474", "0.5331569", "0.5267452", "0.5240653", "0.52235836", "0.5195761", "0.51915073", "0.51786...
0.78599155
0
TODO Autogenerated method stub
@Override public void onClick(View v) { Intent intent = new Intent(context, CustomerDueDetails.class); intent.putExtra("shopper_id", ""+list.get(position).get_shopper_id()); intent.putExtra("name", ""+list.get(position).get_shopper_name()); intent.putExtra("amount", ""+list.get(position).get_outstanding_amount()); intent.putExtra("order_id", ""+list.get(position).getOrder_id()); intent.putExtra("strdt", txt_str_date.getText().toString()); intent.putExtra("enddt", txt_str_end.getText().toString()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0...
0.0
-1
suppress this because redefining a variable is necessary
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") @ParameterizedTest @CsvSource({ "RIGHT, 1, 0", "LEFT, -1, 0", "UP, 0, 1", "DOWN, 0, -1", }) void moveSnakeTest(Direction dir, int dx, int dy) { this.snakeBody = new SnakeBody(Sizes.DEFAULT_MINIMUM_MAP_TILES, Sizes.DEFAULT_MINIMUM_MAP_TILES); assertEquals(Direction.RIGHT, snakeBody.getCurrDir()); snakeBody.moveSnake(dir); Coordinate newHead = new Coordinate( (Sizes.DEFAULT_MINIMUM_MAP_TILES / 2) + dx, (Sizes.DEFAULT_MINIMUM_MAP_TILES / 2) + dy); assertEquals(snakeBody.getHeadCoord(), newHead); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setOriginalVariable(GlobalVariable var) {\n originalVariable = var;\n }", "public void reassignIfNeeded() {\n\t}", "private void assignment() {\n\n\t\t\t}", "@Deprecated\n private void assertNotDefined(String name) {\n if (values.containsKey(name))\n throw new RedefineVariableE...
[ "0.64121914", "0.6389749", "0.6376436", "0.60451156", "0.6010251", "0.5983671", "0.59600806", "0.58666366", "0.58517", "0.58351374", "0.5711556", "0.570671", "0.56355906", "0.5623032", "0.5592867", "0.5586479", "0.5584833", "0.5545953", "0.5544569", "0.55324346", "0.55312", ...
0.0
-1
suppress this because redefining a variable is necessary
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") @ParameterizedTest @CsvSource({ "RIGHT, 1, 0", "LEFT, -1, 0", "UP, 0, 1", "DOWN, 0, -1" }) //DONT ANNOTATE WITH @Test void update3BodyPartsPositionTest(Direction dir, int dx, int dy) { int x = 26; int y = 25; BodyPart zeroHead = new BodyPart(x, y); System.out.println("zero " + zeroHead.getCoordinate().toString()); x -= dx; y -= dy; BodyPart one = new BodyPart(x, y); System.out.println("one " + one.getCoordinate().toString()); x -= dx; y -= dy; BodyPart two = new BodyPart(x, y); System.out.println("two " + two.getCoordinate().toString()); LinkedList<BodyPart> linkedList = new LinkedList<>(); linkedList.add(zeroHead); linkedList.add(one); linkedList.add(two); snakeBody.setBodyParts(linkedList); //snakeBody.moveSnake(Direction.UP); Direction temp = dir; snakeBody.setCurrDir(temp); snakeBody.updateBodyPartsPosition(snakeBody.getHeadCoord()); LinkedList<BodyPart> allBP = snakeBody.getBodyParts(); assertEquals(allBP.get(1).getCoordinate(), allBP.get(0).getCoordinate()); assertEquals(new Coordinate(allBP.get(1).getCoordinate().getCoordinateX() - dx, allBP.get(1).getCoordinate().getCoordinateY() - dy), allBP.get(2).getCoordinate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setOriginalVariable(GlobalVariable var) {\n originalVariable = var;\n }", "public void reassignIfNeeded() {\n\t}", "private void assignment() {\n\n\t\t\t}", "@Deprecated\n private void assertNotDefined(String name) {\n if (values.containsKey(name))\n throw new RedefineVariableE...
[ "0.6413542", "0.63903654", "0.6376055", "0.60459304", "0.6010754", "0.5984296", "0.59606034", "0.58661383", "0.58518505", "0.5835901", "0.5711625", "0.5706797", "0.56355864", "0.5624255", "0.5592627", "0.5585899", "0.55847824", "0.5546238", "0.5544824", "0.55315983", "0.55314...
0.0
-1
String url = " String url = " String url = " /String url = " String params = "" + "" + "" + "1348831860" + "" + "" + "1234567890123456" + ""; String[] rss = NetworkUtil.query4Stream(url, params, "POST", "UTF8", 5000, null); System.out.println(rss[1]);
public static void main(String[] args){ String path = FileLogic.createDateSplitDirYYYYMMDDHH("d:/test"); NetworkUtil.downloadImage("http://www.51homevip.com/portal/web/images/home-top.png", path + "/gg.png"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static InputStream postQuery(String url) throws IOException {\n\t\tURL u = new URL(SERVICE_LOCATION);\n\n\t\tString encodedUrl = URLEncoder.encode(url, \"UTF-8\");\n\n\t\tInputStream input = doPOST(u, encodedUrl);\n\n\t\treturn input;\n\t}", "private String getURL(String feedUrl) {\n\tStringBuilder sb = ...
[ "0.56321317", "0.5584563", "0.55820847", "0.5520022", "0.5475498", "0.54449904", "0.5411296", "0.5375458", "0.5293793", "0.52894187", "0.52533287", "0.52515364", "0.5243214", "0.5236199", "0.5232499", "0.52184933", "0.52098113", "0.5195915", "0.51939034", "0.5189013", "0.5181...
0.0
-1
Constructor default join type
public OwJoinedTable(OwTableReference tableReference1_p, OwTableReference tableReference2_p, OwJoinSpecification joinSpecification_p) { this(tableReference1_p, DEFAULT_JOIN_TYPE, tableReference2_p, joinSpecification_p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Join createJoin();", "public Joins()\n {\n joins = new ArrayList<Join>();\n }", "abstract protected Object joinClause(Object o1, Object o2);", "JoinCondition createJoinCondition();", "public boolean isJoin()\r\n { return type == JOIN; }", "FromTableJoin createFromTableJoin();", "private Str...
[ "0.73581296", "0.6641393", "0.59737265", "0.58038455", "0.5748439", "0.5715224", "0.55923045", "0.55438167", "0.55385196", "0.54944915", "0.5469369", "0.5466776", "0.5429615", "0.5397894", "0.53788745", "0.5342651", "0.5317834", "0.52280736", "0.52275014", "0.5222268", "0.518...
0.5090748
27
replace name, access and super type
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, Constants.ACC_PUBLIC, className, (String)null, this.superType.getInternalName(), interfaces); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void visit(int version, int access, String name, String signature,\n String superName, String[] interfaces) {\n //if (cv != null) {\n //cv.visit(version, access, name, signature, superName, interfaces);\n className = name;\n super.visit(version, access, n...
[ "0.6287457", "0.6189851", "0.61547697", "0.5872287", "0.5805963", "0.5705461", "0.56949764", "0.56166375", "0.5607676", "0.5554277", "0.55068207", "0.5449052", "0.5424247", "0.5417242", "0.5414977", "0.5388299", "0.538427", "0.5364111", "0.5358757", "0.534997", "0.5332266", ...
0.62261635
1
consider adding size(); constructor
public MyStack(){ a = new String[10]; top = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int size( )\n {\n // Implemented by student.\n }", "@Override\n public int size() { return size; }", "public int size ()\r\n {\r\n }", "public int size() { return this.size; }", "public int size() { return size; }", "public int size() { return size; }", "public int getSize(){re...
[ "0.76585495", "0.7646229", "0.7605871", "0.75840247", "0.75794756", "0.75794756", "0.74643004", "0.7461015", "0.74567896", "0.74567896", "0.74567896", "0.74567896", "0.74567896", "0.74567896", "0.744774", "0.7416825", "0.73956126", "0.73654073", "0.73654073", "0.7351049", "0....
0.0
-1
Alle Apartment har en apartment type, og tre rom i seg.
public Apartment(char apartmentType, Room room1, Room room2, Room room3) { this.apartmentType = apartmentType; this.room1 = room1; this.room2 = room2; this.room3 = room3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n\t\t\n\t\tApartment apartment1=new Apartment(1,true,2,10,4,\"high entrance\",\"Izmir-Bornova-Kazimdirik Mh.\");\n\t\t\n\t\tApartment apartment2=new Apartment();\n\t\tapartment2.id=2;\n\t\tapartment2.isFurnished=false;\n\t\tapartment2.buildingAge=4;\n\t\tapartment2.number...
[ "0.6408663", "0.5980147", "0.5845401", "0.57807136", "0.57678896", "0.5642803", "0.55204976", "0.5424594", "0.5375393", "0.5292039", "0.5287311", "0.5282524", "0.5235635", "0.52188617", "0.51784426", "0.5157947", "0.5157779", "0.51399773", "0.5139672", "0.5128106", "0.5124059...
0.6780593
0
BigDecimal myZero = BigDecimal.ZERO; myZero = myZero.setScale(10); if (myZero.equals(right) || BigDecimal.ZERO.equals(right) ) / Comparison It is important to never use the .equals() method to compare BigDecimals. That is because this equals function will compare the scale. If the scale is different, .equals() will return false, even if they are the same number mathematically. signum? on big decimal
@Override public BigDecimal operate(BigDecimal left, BigDecimal right) { if (right.signum() == 0) { throw new DivideByZeroException(); } BigDecimal result = left.divide(right,10, BigDecimal.ROUND_HALF_DOWN); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static BigDecimal roundDecimalValue(BigDecimal dec, int precision, boolean isHalfToEven)\n {\n if(isHalfToEven){\n return dec.setScale(precision, RoundingMode.HALF_EVEN);\n }\n else {\n int sgn = dec.signum();\n if (sgn < 0)\n return d...
[ "0.57760066", "0.574486", "0.5729946", "0.56784505", "0.5672218", "0.5662461", "0.5538125", "0.5497672", "0.5482851", "0.54783356", "0.5423759", "0.5418543", "0.541711", "0.5416248", "0.53237295", "0.5300009", "0.5293067", "0.5268016", "0.5261454", "0.5239714", "0.5236495", ...
0.5944496
0
Handles request for yflow path swapping.
public void handleRequest(@NonNull String key, @NonNull CommandContext commandContext, @NonNull YFlowPathSwapRequest request) throws DuplicateKeyException { String yFlowId = request.getYFlowId(); log.debug("Handling y-flow path swap request with key {} and yFlowId {}", key, yFlowId); if (fsmRegister.hasRegisteredFsmWithKey(key)) { throw new DuplicateKeyException(key, "There's another active FSM with the same key"); } if (fsmRegister.hasRegisteredFsmWithFlowId(yFlowId)) { sendErrorResponseToNorthbound(ErrorType.ALREADY_EXISTS, "Could not swap y-flow paths", format("Y-flow %s is already in progress now", yFlowId), commandContext); return; } YFlowPathSwapFsm fsm = fsmFactory.newInstance(commandContext, yFlowId, eventListeners); fsmRegister.registerFsm(key, fsm); YFlowPathSwapContext context = YFlowPathSwapContext.builder().build(); fsm.start(context); fsmExecutor.fire(fsm, Event.NEXT, context); removeIfFinished(fsm, key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestMapChange(String path);", "protected String processPath(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException\n { //20030305AH - Store result of processPath() in request attribute so can use it later for\n //looking up stuff - such a...
[ "0.5280813", "0.5249504", "0.5197915", "0.51716256", "0.5158334", "0.5130922", "0.51029384", "0.50980866", "0.5091888", "0.5056005", "0.5024534", "0.4971316", "0.4953376", "0.489825", "0.48723242", "0.4866231", "0.4828901", "0.48214757", "0.48128533", "0.47977445", "0.4791135...
0.7052746
0
Handles async response from worker.
public void handleAsyncResponse(@NonNull String key, @NonNull SpeakerResponse speakerResponse) throws UnknownKeyException { log.debug("Received flow command response {}", speakerResponse); YFlowPathSwapFsm fsm = fsmRegister.getFsmByKey(key) .orElseThrow(() -> new UnknownKeyException(key)); if (speakerResponse instanceof SpeakerFlowSegmentResponse) { SpeakerFlowSegmentResponse response = (SpeakerFlowSegmentResponse) speakerResponse; String flowId = response.getMetadata().getFlowId(); if (fsm.getSwappingSubFlows().contains(flowId)) { flowPathSwapService.handleAsyncResponseByFlowId(flowId, response); } } else if (speakerResponse instanceof SpeakerCommandResponse) { SpeakerCommandResponse response = (SpeakerCommandResponse) speakerResponse; YFlowPathSwapContext context = YFlowPathSwapContext.builder() .speakerResponse(response) .build(); fsmExecutor.fire(fsm, Event.RESPONSE_RECEIVED, context); } else { log.debug("Received unexpected speaker response: {}", speakerResponse); } // After handling an event by FlowPathSwap service, we should propagate execution to the FSM. if (!fsm.isTerminated()) { fsmExecutor.fire(fsm, Event.NEXT); } removeIfFinished(fsm, key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "@Override\n public void processResult(HttpResponseMessage response) {\n }", "public abstract HTTPResponse finish();", "public interface AsyncResponse...
[ "0.6547069", "0.6354635", "0.61831576", "0.6149675", "0.61426663", "0.6102206", "0.6088247", "0.60829324", "0.60429996", "0.6014236", "0.60058695", "0.5985627", "0.5963394", "0.59385496", "0.59241724", "0.59047836", "0.59034944", "0.59034944", "0.5889034", "0.5885533", "0.587...
0.0
-1
Created by peerapong on 8/19/16.
@Singleton @Component(modules = {VehicleModule.class}) public interface VehicleComponent { Vehicle provideVehicle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpubl...
[ "0.6419887", "0.6259378", "0.61967456", "0.61777467", "0.6154935", "0.6128686", "0.6128686", "0.6117036", "0.60314053", "0.5974033", "0.5959093", "0.59523636", "0.59285223", "0.59198403", "0.59198403", "0.59198403", "0.59198403", "0.59198403", "0.5919151", "0.59131825", "0.59...
0.0
-1
Spring Data repository for the EventLogging entity.
@SuppressWarnings("unused") @Repository public interface EventLoggingRepository extends JpaRepository<EventLogging, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface EventRepository extends CrudRepository<EventModel, String> {\n\t\n}", "@Repository\npublic interface LogEntryRepository extends JpaRepository<LogEntry, Long> {\n /**\n * Find all bans.\n *\n * @param roomId the room id\n * @return the list\n */\n @Transactional\n @Qu...
[ "0.6691686", "0.65886253", "0.65730745", "0.625655", "0.62274384", "0.61398983", "0.61222464", "0.6094153", "0.6087512", "0.60395247", "0.5993194", "0.5950223", "0.5917234", "0.5850321", "0.5843508", "0.5811617", "0.5802824", "0.57999855", "0.57813483", "0.5757523", "0.571537...
0.7252163
0
TODO Autogenerated method stub
@Override public void onInit() throws Exception { }
{ "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 void onStartTrading() throws Exception { }
{ "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 void onStopTrading(boolean isException) throws Exception { }
{ "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 void onXMinBar(Bar bar) throws Exception { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0...
0.0
-1
TODO Autogenerated method stub
@Override public void onTrade(Trade trade) throws Exception { }
{ "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 void onStopOrder(StopOrder StopOrder) throws Exception { }
{ "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
krahason elementet e vektorit me nje vlere te caktuar
private boolean contains(int[] piket,int vlera){ for(int i=0; i<piket.length; i++){ if(piket[i]==vlera) return true; //eshte metode booleane spese kthen true ose false ne menyre qe te plotesohet if me lart } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n ...
[ "0.65622216", "0.60307074", "0.5975613", "0.5971603", "0.59430337", "0.5929201", "0.5896329", "0.58396626", "0.581264", "0.5792087", "0.5784599", "0.57727396", "0.5751276", "0.57440335", "0.57366794", "0.57359093", "0.5718389", "0.5716595", "0.5704505", "0.56770945", "0.56622...
0.0
-1
Create the GUI allowing configure the clock of router and IP.
public InterfaceClock(Project project,Router router,ArrayList<AvailableClock> clock_list,HermesGInterface g) { super("Select the clock of the router " + router.getAddress() + " and its ip"); this.project = project; this.r = router; this.clocks = clock_list; hermesg = g; initilize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void $$$setupUI$$$() {\n container = new JPanel();\n container.setLayout(new FormLayout(\"fill:335px:noGrow,left:4dlu:noGrow,fill:334px:noGrow\", \"center:d:grow\"));\n container.setBorder(BorderFactory.createTitledBorder(null, \"港机数据采集服务配置\", TitledBorder.CENTER, TitledBorder.DEFAULT_...
[ "0.65238494", "0.65042144", "0.6419864", "0.64000624", "0.63599426", "0.63364875", "0.6296948", "0.62819076", "0.62735516", "0.6246544", "0.6235637", "0.62351537", "0.623129", "0.6183027", "0.61206955", "0.6115551", "0.61042875", "0.6104246", "0.61023724", "0.60993326", "0.60...
0.596668
40
Initialize the variables class.
private void initilize() { dimXNet = project.getNoC().getNumRotX(); dimYNet = project.getNoC().getNumRotY(); addProperties(); addComponents(); setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "protected void initVars() {}", "private void init() {\n\t\t\n\t\ttry{\t\t\t\n\t\t\tinfos = new HashMap<String, VariableInfo>();\n\t\t\t\n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\t\n\t\t\t\tif(this.problem.getNbrNeighbors(var) != 0){ ...
[ "0.81841284", "0.8027036", "0.73510545", "0.7078012", "0.7066843", "0.69663316", "0.66642785", "0.6652517", "0.66436464", "0.66372794", "0.6618524", "0.6618156", "0.6588266", "0.6576474", "0.6531503", "0.65267175", "0.6514999", "0.6488994", "0.647876", "0.6476659", "0.6466852...
0.0
-1
add the interface properties.
private void addProperties() { getContentPane().setLayout(null); Dimension resolucao=Toolkit.getDefaultToolkit().getScreenSize(); setSize(370,177); setLocation((resolucao.width-260)/2,(resolucao.height-380)/2); setResizable(false); addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){dispose();}}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void addProperty(IProperty property) {\n\t\t\n\t}", "public void addInterface(String interf) {\n m_classBuilder.addInterface(interf);\n }", "@Override\n public void addConfigurationProperties(Properties properties) {\n }", "@Override public void addImpliedProperties(UpodPr...
[ "0.6650811", "0.61899376", "0.60733753", "0.6004574", "0.60013086", "0.5965772", "0.5950865", "0.58732146", "0.57373345", "0.56887084", "0.56581795", "0.56465465", "0.5624443", "0.5609929", "0.56069386", "0.5562379", "0.55613154", "0.5527865", "0.5449682", "0.5442558", "0.543...
0.0
-1
add components to interface.
private void addComponents() { int x = 10; int y = 10; int stepY = 25; addFrequencyRouter(x,y); y = y + stepY; addFrequencyIpInput(x,y); y = y + stepY; addFrequencyIpOutput(x,y); y = y + stepY; addOk(x+80,y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addComponents();", "public void addComponents(Component... components);", "public void addComponents(final Component... components) {\r\n\t\t_hSplit.addComponents(components);\r\n\t}", "private void addComponents() {\n LOOGER.info(\"Get add Components Entry\");\n // Adding loadButton to fi...
[ "0.8110308", "0.76291", "0.7528954", "0.7423338", "0.73023736", "0.7270124", "0.71944183", "0.7136177", "0.707631", "0.7072569", "0.70177376", "0.69543636", "0.6924913", "0.69210726", "0.689107", "0.6870213", "0.6865313", "0.68324924", "0.67927223", "0.678168", "0.67276645", ...
0.7077851
8
Execute an action associated to the selected event
public void actionPerformed(ActionEvent e) { if(e.getSource() == ok) { // Router Clock Clock c = new Clock(); String saidaf,saida,clock_unit; double clk; int total=0,x; saida = new String((String)routerclock.getSelectedItem()); int cont=0,inter=0; saidaf = new String(); /* Bloco que le o o label do clock */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } c.setLabelClockRouter(saidaf); //System.out.println("label_router : " + saidaf); saidaf=""; cont++; /* Bloco que le o clock do roteador */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clk = Double.parseDouble(saidaf); // //System.out.println("clock_router : " + clk); cont++; saidaf=""; /* Bloco que le a unidade do clock do roteador */ while(cont < saida.length()) { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clock_unit = saidaf; // //System.out.println("clock_unit_router : " + clock_unit); c.setClockRouter(clk,clock_unit); c.setNumberRouter(r.getAddressX(),r.getAddressY()); // Ip Clock Input cont=0; saidaf=""; saida = new String((String)ipinputclock.getSelectedItem()); /* Bloco que le o o label do clock */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } c.setLabelClockIpInput(saidaf); //System.out.println("label_ip : " + saidaf); saidaf=""; cont++; /* Bloco que le o clock do roteador */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clk = Double.parseDouble(saidaf); // //System.out.println("clock_ip : " + clk); cont++; saidaf=""; /* Bloco que le a unidade do clock do roteador */ while(cont < saida.length()) { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clock_unit = saidaf; // //System.out.println("clock_unit : " + clock_unit); c.setClockIpInput(clk,clock_unit); c.setNumberRouter(r.getAddressX(),r.getAddressY()); // Ip Clock Output cont=0; saidaf=""; saida = new String((String)ipoutputclock.getSelectedItem()); /* Bloco que le o o label do clock */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } c.setLabelClockIpOutput(saidaf); //System.out.println("label_ip : " + saidaf); saidaf=""; cont++; /* Bloco que le o clock do roteador */ while(saida.charAt(cont) != ' ') { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clk = Double.parseDouble(saidaf); // //System.out.println("clock_ip : " + clk); cont++; saidaf=""; /* Bloco que le a unidade do clock do roteador */ while(cont < saida.length()) { saidaf = ""+saidaf+ saida.charAt(cont); cont++; } clock_unit = saidaf; // //System.out.println("clock_unit : " + clock_unit); c.setClockIpOutput(clk,clock_unit); c.setNumberRouter(r.getAddressX(),r.getAddressY()); for(int i=0;i<project.getNoC().getNumRotX()*project.getNoC().getNumRotY();i++) { if(project.getNoC().getClock().get(i).getNumberRouter().equals(r.getAddress())) { project.getNoC().getClock().set(i,c); } } hermesg.getNoCPanel().setEnabled(true); super.dispose(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void actionPerformed(ActionEvent e) {\n String command = e.getActionCommand();\n \n if (command.equals(\"execute\")) {\n try {\n execute();\n } catch (PropertyVetoException pve) {}\n } else {\n if (Trace.isTracing(Trace.MASK_APPLICATION))\n {\n ...
[ "0.71473014", "0.68913484", "0.6760697", "0.6717449", "0.6676978", "0.66656727", "0.6651873", "0.663388", "0.6629821", "0.6620106", "0.6614216", "0.6600685", "0.6598808", "0.6555304", "0.65447706", "0.65293396", "0.64744854", "0.64707816", "0.64678067", "0.6424664", "0.642466...
0.0
-1
Creates a reader instance which takes input from standard input keyboard
public static void main(String[] args) { Scanner reader = new Scanner(System.in); System.out.print("Enter a number: "); // nextInt() reads the next integer from the keyboard int number = reader.nextInt(); // println() prints the following line to the output screen System.out.println("You entered: " + number); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public InputReader() {\n reader = new Scanner(System.in);\n }", "public MyInputStream()\n {\n in = new BufferedReader\n (new InputStreamReader(System.in));\n }", "protected String getInputFromConsole() throws IOException\n {\n BufferedReader consoleInput = new Buffere...
[ "0.74308187", "0.6844883", "0.67080444", "0.6546453", "0.6546097", "0.65342623", "0.6524131", "0.64588153", "0.64371544", "0.64371544", "0.63574016", "0.6327245", "0.63263494", "0.62647897", "0.6253431", "0.62340516", "0.6216287", "0.6197286", "0.61657983", "0.6095301", "0.60...
0.0
-1
get the current hibernate session
@Override public List<Customer> getCustomers() { Session currentSession = sessionFactory.getCurrentSession(); // create a query Query<Customer> theQuery = currentSession.createQuery("from Customer order by lastName", Customer.class); // execute query and get result list List<Customer> customers = theQuery.getResultList(); return customers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Session getCurrentSession() {\n return sessionFactory.getCurrentSession();\n }", "private Session getSession() {\n\t\treturn factory.getCurrentSession();\n\t}", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "public Session getSession() {\n\...
[ "0.8397036", "0.838411", "0.83546054", "0.8334034", "0.829496", "0.82910323", "0.8247196", "0.8247196", "0.8163814", "0.81386876", "0.80909634", "0.8082804", "0.8076242", "0.8043501", "0.8043501", "0.80346507", "0.8012839", "0.8012839", "0.79940957", "0.7962831", "0.79547894"...
0.0
-1
Moves the player, if possible, from one room to another This method performs the action of the command for Player in Game This abstract method from Command is contained in each command extension
public void action() { if (!hasSecondWord()) { // there is no second word // if there is no second word, we don't know where to go... System.out.println("Go where? Please be more specific"); return; } String direction = getSecondWord(); //second word found // Possible room Room nextRoom = player.getCurrentRoom().getExit(direction); if (nextRoom == null) { System.out.println("There is no door in that direction"); } else { if (!nextRoom.isLocked()) { enterRoom(nextRoom); } //unlock room should now be another action instead // else if (nextRoom.isUnlocked(null)) { // enterRoom(nextRoom); // } else { System.out.println("This door is locked!"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void move() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.resetGameMessage();\n gameMessage.notify(gameMessage);\n\n\n if( liteGame.isWinner() ) endOfTheGame = true;\n }", "public void act() \n {\n moveTowardsPlayer(...
[ "0.6710881", "0.66559064", "0.662138", "0.6583274", "0.6578514", "0.6530007", "0.6512083", "0.6470967", "0.6444951", "0.6441976", "0.6433729", "0.6423612", "0.64228475", "0.64224553", "0.63640183", "0.63633835", "0.633946", "0.6311787", "0.6257096", "0.6232525", "0.62216365",...
0.6031041
37
Actions performed once player enters a room Checks to see if room isDark, if not the locationInfo is given.
private void enterRoom(Room newRoomEntered) { player.setCurrentRoom(newRoomEntered); if(player.getCurrentRoom().isDark()){//check to see if room is dark System.out.println("The room is pitchblack and you are unable to see anything"); System.out.println(); } else { System.out.println(player.getCurrentRoom().printLocationInfo()); System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void enter(Player player, Room room) {\n if (player.moveTo(room)) {\n System.out.println(\"You just entered \" + player.getLocation());\n }\n else {\n System.out.println(\"That way appears to be blocked.\");\n }\n }", "public abstract void onLand(Player player);", "public void loo...
[ "0.54722655", "0.54149866", "0.5367598", "0.5362816", "0.5274758", "0.52023405", "0.5150897", "0.5098817", "0.5089663", "0.50815654", "0.5073581", "0.5065766", "0.50547683", "0.5045185", "0.502564", "0.4994937", "0.49795112", "0.49671194", "0.49535602", "0.49534446", "0.49519...
0.6866914
0
Store a new JavaClass instance into this Repository.
@Override public void storeClass(final JavaClass clazz) { loadedClasses.put(clazz.getClassName(), new SoftReference<>(clazz)); clazz.setRepository(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void xsetJavaClass(org.apache.xmlbeans.XmlNMTOKEN javaClass)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlNMTOKEN target = null;\r\n target = (org.apache.xmlbeans.XmlNMTOKEN)get_store().fin...
[ "0.5540583", "0.5440507", "0.5373568", "0.5334273", "0.5213051", "0.5175371", "0.5152612", "0.5133079", "0.5096263", "0.5019781", "0.4957583", "0.4899467", "0.48508787", "0.48234954", "0.48226088", "0.4810686", "0.47966823", "0.4793967", "0.47812063", "0.47684368", "0.4767443...
0.69368434
0
Remove class from repository
@Override public void removeClass(final JavaClass clazz) { loadedClasses.remove(clazz.getClassName()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void remove(Class<?> entity, Object paramObject);", "void removeClass(final String name);", "@Override\n public void removeFromDb() {\n }", "boolean removeClass(String name);", "void deleteRepository(URL repositoryUrl);", "@Test\n public void testRemove() {\n System.out.pr...
[ "0.66936475", "0.6563551", "0.6431668", "0.62847763", "0.6219511", "0.61955726", "0.6134763", "0.6085767", "0.60728353", "0.60047615", "0.5959503", "0.5940043", "0.5875885", "0.5875537", "0.5863742", "0.5829367", "0.57211566", "0.57126826", "0.5698784", "0.5694819", "0.569272...
0.61414355
6
Find an already defined (cached) JavaClass object by name.
@Override public JavaClass findClass(final String className) { final SoftReference<JavaClass> ref = loadedClasses.get(className); if (ref == null) { return null; } return ref.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Class findClass(String name) {\n Class c = ( Class ) cache.get( name ) ;\n\n if ( c != null ) {\n return c ;\n }\n\n // Break the name into path names\n String p = parseClassName( name ) ;\n File path = null ;\n\n // Search the current user defined...
[ "0.7944996", "0.74737924", "0.73220694", "0.70661193", "0.7060124", "0.69716877", "0.6865962", "0.6803289", "0.6758706", "0.6757612", "0.67323047", "0.6697353", "0.66383773", "0.6603096", "0.6561058", "0.6478019", "0.6465454", "0.64646655", "0.6461601", "0.63494575", "0.63341...
0.73532635
2
Finds a JavaClass object by name. If it is already in this Repository, the Repository version is returned.
@Override public JavaClass loadClass(String className) throws ClassNotFoundException { if ((className == null) || className.isEmpty()) { throw new IllegalArgumentException("Invalid class name " + className); } className = className.replace('/', '.'); // Just in case, canonical form final JavaClass clazz = findClass(className); if (clazz != null) { return clazz; } IOException e = new IOException("Couldn't find: " + className + ".class"); throw new ClassNotFoundException("Exception while looking for class " + className + ": " + e, e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FindResult findClass(String className);", "@Override\n public JavaClass findClass(final String className) {\n final SoftReference<JavaClass> ref = loadedClasses.get(className);\n if (ref == null) {\n return null;\n}\n return ref.get();\n }", "public RubyClass getCla...
[ "0.649329", "0.6391761", "0.6384544", "0.63427263", "0.62708104", "0.6232031", "0.61672395", "0.61422944", "0.6066092", "0.59723437", "0.5972246", "0.59629655", "0.5943792", "0.5903133", "0.5896146", "0.588223", "0.57979363", "0.5624481", "0.5621866", "0.5597663", "0.55844223...
0.0
-1
Find the JavaClass object for a runtime Class object. If a class with the same name is already in this Repository, the Repository version is returned. Otherwise, getResourceAsStream() is called on the Class object to find the class's representation. If the representation is found, it is added to the Repository.
@Override public JavaClass loadClass(final Class<?> clazz) throws ClassNotFoundException { final String className = clazz.getName(); final JavaClass repositoryClass = findClass(className); if (repositoryClass != null) { return repositoryClass; } String name = className; final int i = name.lastIndexOf('.'); if (i > 0) { name = name.substring(i + 1); } JavaClass cls = null; try (InputStream clsStream = clazz.getResourceAsStream(name + ".class")) { return cls = loadClass(clsStream, className); } catch (final IOException e) { return cls; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public JavaClass findClass(final String className) {\n final SoftReference<JavaClass> ref = loadedClasses.get(className);\n if (ref == null) {\n return null;\n}\n return ref.get();\n }", "public Class<?> findClass(String name) throws ClassNotFoundException\n\t{\n...
[ "0.60956013", "0.58198756", "0.5802649", "0.5775736", "0.5775231", "0.56472003", "0.56025475", "0.5511694", "0.5487917", "0.5483884", "0.5423529", "0.5371015", "0.53592956", "0.5320111", "0.52872044", "0.52697116", "0.52591956", "0.5228723", "0.5223387", "0.52198017", "0.5201...
0.64441264
0
Clear all entries from cache.
@Override public void clear() { loadedClasses.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n cache.clear();\n }", "public void clearCache();", "public void clear() {\n this.cache.clear();\n }", "void clearCache();", "void clearCache();", "public static void clearCache() {\n cacheKeys.clear();\n cacheValues.clear();\n }", "public static voi...
[ "0.8388986", "0.8244677", "0.8232753", "0.8200961", "0.8200961", "0.8161878", "0.815123", "0.81192136", "0.8071736", "0.7995738", "0.7982605", "0.78698874", "0.7773567", "0.7727999", "0.7712063", "0.77042925", "0.77042925", "0.77042925", "0.77042925", "0.77042925", "0.7704292...
0.0
-1
1.Description: Restart job when previous job is abandoned 2.Biz Logic: 3.Author : LGCNS
@RequestMapping(value="/job/restartJob", produces = MediaType.APPLICATION_JSON_VALUE) public Map<String, Object> reStartJob(@RequestBody Map<String, Object> paramMap) throws Exception { Map<String, Object> msgMap = null; Map<String, Object> resultMap = new HashMap<String, Object>(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("jobName :: {} :: Job Id :: {}" + paramMap.get("jobName"), paramMap.get("jobId")); } /** Check jobId, jobName from parameter **/ String jobName = paramMap.get("jobName") != null ? String.valueOf(paramMap.get("jobName")) : null; Long jobId = paramMap.get("jobId") != null ? Long.parseLong(String.valueOf(paramMap.get("jobId"))) : 0L; /** Check Input Parameter **/ if (NullUtil.isNull(jobName) || jobId <= 0) { msgMap = MessageUtil.getErrorMessage("There are no job Id or job Name in input parameter"); LOGGER.error("{}", resultMap); return resultMap; } /** Call job restart service **/ msgMap = jobControlSvi.restartJob(paramMap); resultMap.put(BaseConstants.DEFAULT_MESSAGE_NAME, msgMap); return resultMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void processRestart(){\n destroyWorkerQueue();\n initWorkerQueue();\n }", "boolean cancelJob(String jobId) throws Exception;", "public void resumeJob(String jobId);", "private void completeAbandonedJob(Integer id) {\r\n\t\tabandonedJobs++;\r\n\t\tBatchJobInstance batchJobInstance = ba...
[ "0.6575266", "0.606891", "0.60662574", "0.60051024", "0.59933925", "0.59653", "0.5920901", "0.59203446", "0.59104985", "0.58926547", "0.58394367", "0.57980245", "0.57698673", "0.57695824", "0.57337254", "0.5728472", "0.5703392", "0.5672362", "0.56658316", "0.5655897", "0.5634...
0.57652396
14
1.Description: Stop job if the job is running 2.Biz Logic: 3.Author : LGCNS
@RequestMapping(value="/job/stopJob", produces = MediaType.APPLICATION_JSON_VALUE) public Map<String, Object> stopJob(@RequestBody Map<String, Object> paramMap) throws Exception { Map<String, Object> resultMap = new HashMap<String, Object>(); /** Check jobId, jobName from parameter **/ String jobName = paramMap.get("jobName") != null ? String.valueOf(paramMap.get("jobName")) : null; Long jobId = paramMap.get("jobId") != null ? Long.parseLong(String.valueOf(paramMap.get("jobId"))) : 0L; /** Check Input Parameter **/ if (NullUtil.isNull(jobName) || jobId <= 0) { resultMap = MessageUtil.getErrorMessage("There are no job Id or job Name in input parameter"); LOGGER.error("{}", resultMap); return resultMap; } /** Call job stop service **/ Map<String, Object> msgMap = jobControlSvi.stopJob(paramMap); resultMap.put(BaseConstants.DEFAULT_MESSAGE_NAME, msgMap); return resultMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stop() {\n \t\t\tif (isJobRunning) cancel();\n \t\t}", "@Override\n public boolean onStopJob(JobParameters job) {\n return true;\n }", "@Override\n public boolean onStopJob(JobParameters params) {\n return false;\n }", "@Override\n public boolean onStopJob(JobParameters...
[ "0.78315914", "0.7397729", "0.7269999", "0.7071115", "0.6904629", "0.6867225", "0.67703974", "0.67323387", "0.66354024", "0.6432146", "0.6429245", "0.6345587", "0.63280696", "0.6310462", "0.62779903", "0.6275741", "0.6210583", "0.62019074", "0.61981875", "0.6178286", "0.61635...
0.607522
30
1.Description: Abandon job 2.Biz Logic: 3.Author : LGCNS
@RequestMapping(value="/job/abandonJob", produces = MediaType.APPLICATION_JSON_VALUE) public Map<String, Object> abandonJob(@RequestBody Map<String, Object> paramMap) throws Exception { Map<String, Object> resultMap = new HashMap<String, Object>(); Map<String, Object> msgMap = null; /** Check jobId, jobName from parameter **/ String jobName = paramMap.get("jobName") != null ? String.valueOf(paramMap.get("jobName")) : null; Long jobId = paramMap.get("jobId") != null ? Long.parseLong(String.valueOf(paramMap.get("jobId"))) : 0L; /** Check Input Parameter **/ if (NullUtil.isNull(jobName) || jobId <= 0) { msgMap = MessageUtil.getErrorMessage("There are no job Id or job Name in input parameter"); LOGGER.error("{}", resultMap); resultMap.put(BaseConstants.DEFAULT_MESSAGE_NAME, msgMap); return resultMap; } /** Call job abandon service **/ msgMap = jobControlSvi.abendonJob(paramMap); resultMap.put(BaseConstants.DEFAULT_MESSAGE_NAME, msgMap); return resultMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void cancel() {\n this.executionState = JobExecutionState.CANCELLED;\n this.finished = Instant.now();\n }", "void cancel()\n {\n cancelled = true;\n subjobComplete = true;\n result = null;\n }", "boolean cancelJob(String jobId) throws Exception;", "vo...
[ "0.67740107", "0.6761903", "0.6590383", "0.6587997", "0.64780086", "0.6428614", "0.6423359", "0.6361917", "0.635972", "0.6335554", "0.6335554", "0.6335554", "0.6335554", "0.6335554", "0.6335554", "0.63347656", "0.6332719", "0.62964207", "0.6280135", "0.6266157", "0.6266157", ...
0.63493806
9
build WalManager for lsmEngine
public LSMEngineBuilder<T> buildWalManager(WALManager walManager) { lsmEngine.setWalManager(walManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public LSMEngineBuilder<T> buildLSMManagers(String packageName, WALManager walManager) {\n try {\n ApplicationContext property =\n ApplicationContextGenerator.GeneratePropertyWithAnnotation(packageName);\n buildLSMManagers(property, walManager);\n } catch (Exception e) {\n logger.erro...
[ "0.5951258", "0.57870984", "0.56993246", "0.5608138", "0.5537123", "0.5388355", "0.53378916", "0.5248516", "0.5218922", "0.5193822", "0.51300466", "0.51232177", "0.50763154", "0.50754374", "0.50719064", "0.5034922", "0.5027665", "0.5026051", "0.5023516", "0.4991935", "0.49845...
0.64788437
0
build InsertionManager for lsmEngine
public <R extends IInsertionRequest> LSMEngineBuilder<T> buildInsertionManager( LevelProcessorChain<T, R, InsertRequestContext> levelProcessChain) { InsertionManager<T, R> insertionManager = new InsertionManager<>(lsmEngine.getWalManager()); insertionManager.setLevelProcessorsChain(levelProcessChain); buildInsertionManager(insertionManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IInsertionRequest> LSMEngineBuilder<T> buildInsertionManager(\n InsertionManager<T, R> insertionManager) {\n lsmEngine.setInsertionManager(insertionManager);\n return this;\n }", "public LSMEngine<T> build() {\n return lsmEngine;\n }", "ImplementationManager createManager();",...
[ "0.6944725", "0.56634575", "0.5584613", "0.51998156", "0.51997936", "0.5158339", "0.5113606", "0.5083592", "0.5016889", "0.5016889", "0.5005549", "0.49848914", "0.49748683", "0.4973747", "0.49071497", "0.48838767", "0.48408318", "0.4821163", "0.4815989", "0.48070756", "0.4801...
0.61462164
1
build InsertionManager for lsmEngine
public <R extends IInsertionRequest> LSMEngineBuilder<T> buildInsertionManager( InsertionManager<T, R> insertionManager) { lsmEngine.setInsertionManager(insertionManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IInsertionRequest> LSMEngineBuilder<T> buildInsertionManager(\n LevelProcessorChain<T, R, InsertRequestContext> levelProcessChain) {\n InsertionManager<T, R> insertionManager = new InsertionManager<>(lsmEngine.getWalManager());\n insertionManager.setLevelProcessorsChain(levelProcessCha...
[ "0.6145228", "0.5664951", "0.55841464", "0.51995546", "0.5199383", "0.5157945", "0.5114132", "0.50838023", "0.50182563", "0.50182563", "0.50051254", "0.4986448", "0.49760306", "0.49751934", "0.49065998", "0.48828202", "0.4841622", "0.48217833", "0.48171994", "0.4806318", "0.4...
0.69431514
0
build DeletionManager for lsmEngine
public <R extends IDeletionRequest> LSMEngineBuilder<T> buildDeletionManager( LevelProcessorChain<T, R, DeleteRequestContext> levelProcessChain) { DeletionManager<T, R> deletionManager = new DeletionManager<>(lsmEngine.getWalManager()); deletionManager.setLevelProcessorsChain(levelProcessChain); buildDeletionManager(deletionManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IDeletionRequest> LSMEngineBuilder<T> buildDeletionManager(\n DeletionManager<T, R> deletionManager) {\n lsmEngine.setDeletionManager(deletionManager);\n return this;\n }", "public void EliminarManager() {\n\n\t\tsendSelect(DELETE_SQL_MANAGER);\n\n\t}", "@Override\n\tpublic void d...
[ "0.6697359", "0.57320434", "0.555115", "0.5247156", "0.5207023", "0.5089545", "0.5046223", "0.5036565", "0.49898183", "0.49497876", "0.49362615", "0.49362615", "0.49057415", "0.48895523", "0.4860385", "0.48575404", "0.48517317", "0.4851389", "0.48513287", "0.4846864", "0.4841...
0.6423897
1
build DeletionManager for lsmEngine
public <R extends IDeletionRequest> LSMEngineBuilder<T> buildDeletionManager( DeletionManager<T, R> deletionManager) { lsmEngine.setDeletionManager(deletionManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IDeletionRequest> LSMEngineBuilder<T> buildDeletionManager(\n LevelProcessorChain<T, R, DeleteRequestContext> levelProcessChain) {\n DeletionManager<T, R> deletionManager = new DeletionManager<>(lsmEngine.getWalManager());\n deletionManager.setLevelProcessorsChain(levelProcessChain);\n...
[ "0.642262", "0.57291704", "0.55499756", "0.52459496", "0.52046555", "0.5086945", "0.50471205", "0.5035348", "0.49875", "0.49496543", "0.49339128", "0.49339128", "0.4903273", "0.4888723", "0.48585877", "0.48542583", "0.48519582", "0.4851373", "0.48485982", "0.48472452", "0.484...
0.6696617
0
build QueryManager for lsmEngine
public <R extends IQueryRequest> LSMEngineBuilder<T> buildQueryManager( LevelProcessorChain<T, R, QueryRequestContext> levelProcessChain) { QueryManager<T, R> queryManager = new QueryManager<>(); queryManager.setLevelProcessorsChain(levelProcessChain); buildQueryManager(queryManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IQueryRequest> LSMEngineBuilder<T> buildQueryManager(\n QueryManager<T, R> queryManager) {\n lsmEngine.setQueryManager(queryManager);\n return this;\n }", "private RunQueriesEx setupQueries() {\n RunQueriesEx queries = new RunQueriesEx();\n \n //for each column ...
[ "0.691607", "0.59432787", "0.582269", "0.5772451", "0.57504475", "0.5724639", "0.569235", "0.5660655", "0.5647562", "0.56225216", "0.5614944", "0.5553533", "0.5519577", "0.5518117", "0.548699", "0.5472197", "0.54486465", "0.5440374", "0.5423225", "0.54207623", "0.5404304", ...
0.64588296
1
build QueryManager for lsmEngine
public <R extends IQueryRequest> LSMEngineBuilder<T> buildQueryManager( QueryManager<T, R> queryManager) { lsmEngine.setQueryManager(queryManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <R extends IQueryRequest> LSMEngineBuilder<T> buildQueryManager(\n LevelProcessorChain<T, R, QueryRequestContext> levelProcessChain) {\n QueryManager<T, R> queryManager = new QueryManager<>();\n queryManager.setLevelProcessorsChain(levelProcessChain);\n buildQueryManager(queryManager);\n re...
[ "0.645971", "0.5947771", "0.58259547", "0.57751405", "0.57528704", "0.57295525", "0.56963253", "0.56647736", "0.56505835", "0.5624607", "0.56170386", "0.5555922", "0.5523821", "0.5521257", "0.54863876", "0.54759234", "0.5449405", "0.5444679", "0.5427366", "0.54210794", "0.540...
0.6916504
0
build RecoverManager for lsmEngine
public LSMEngineBuilder<T> buildRecoverManager() { RecoverManager<LSMEngine<T>> recoverManager = new RecoverManager<>(lsmEngine.getWalManager()); lsmEngine.setRecoverManager(recoverManager); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void prepareStoreMirror() {\n /*\n r0 = sStoreMirrorDir;\n if (r0 == 0) goto L_0x0005;\n L_0x0004:\n return;\n L_0x0005:\n r0 = com.duokan.reader.ReaderEnv.get();\n r1 = com.duokan.reader.ReaderEnv.PrivatePref.STORE;\n r2 = \"mirror_version\";\n ...
[ "0.5119246", "0.51053715", "0.5039238", "0.5033897", "0.4947291", "0.4931412", "0.48490036", "0.48467612", "0.4817161", "0.47190925", "0.46779945", "0.46641904", "0.46078354", "0.45907772", "0.45712882", "0.4554951", "0.45501715", "0.4538359", "0.45364758", "0.45241082", "0.4...
0.66853726
0
build root memory node for lsmEngine
public LSMEngineBuilder<T> buildRootMemNode(T rootMemNode) { lsmEngine.setRootMemNode(rootMemNode); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private HPTNode<K, V> buildRoot() {\n HPTNode<K, V> node = new HPTNode<K, V>(keyIdSequence++, null);\n node.children = reallocate(ROOT_CAPACITY);\n return node;\n }", "public LSMEngine<T> build() {\n return lsmEngine;\n }", "private void createRootNode()\r\n {\r\n root = new Node(\"root\", nu...
[ "0.64538425", "0.5858385", "0.5768591", "0.5745341", "0.5532199", "0.5514919", "0.5352658", "0.529592", "0.52653635", "0.5231414", "0.51731473", "0.5158743", "0.51416737", "0.5131002", "0.5117008", "0.51115173", "0.5102479", "0.50631696", "0.50566345", "0.5034759", "0.5023973...
0.7257652
0
build level processors from ApplicationContext object
private LSMEngineBuilder<T> buildLevelProcessors(ApplicationContext applicationContext) { LevelProcessorChain<T, IInsertionRequest, InsertRequestContext> insertionLevelProcessChain = generateLevelProcessorsChain(applicationContext.getInsertionLevelProcessClass()); LevelProcessorChain<T, IDeletionRequest, DeleteRequestContext> deletionLevelProcessChain = generateLevelProcessorsChain(applicationContext.getDeletionLevelProcessClass()); LevelProcessorChain<T, IQueryRequest, QueryRequestContext> queryLevelProcessChain = generateLevelProcessorsChain(applicationContext.getQueryLevelProcessClass()); return buildQueryManager(queryLevelProcessChain) .buildInsertionManager(insertionLevelProcessChain) .buildDeletionManager(deletionLevelProcessChain); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private LSMEngineBuilder<T> buildLevelProcessors(String packageName) {\n try {\n ApplicationContext property =\n ApplicationContextGenerator.GeneratePropertyWithAnnotation(packageName);\n buildLevelProcessors(property);\n } catch (Exception e) {\n logger.error(e.getMessage());\n }\...
[ "0.6616682", "0.58954126", "0.5557518", "0.5098962", "0.5081747", "0.50663006", "0.50641227", "0.5038936", "0.50225085", "0.50062245", "0.49299172", "0.49110544", "0.48925278", "0.48435682", "0.48399216", "0.4806345", "0.4805799", "0.47737217", "0.47337803", "0.47098848", "0....
0.7574037
0
Scan the classes of the package and build level processors based on the class annotations
private LSMEngineBuilder<T> buildLevelProcessors(String packageName) { try { ApplicationContext property = ApplicationContextGenerator.GeneratePropertyWithAnnotation(packageName); buildLevelProcessors(property); } catch (Exception e) { logger.error(e.getMessage()); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllCla...
[ "0.6739729", "0.6649452", "0.6557237", "0.6554823", "0.65374625", "0.64378273", "0.6339039", "0.63258916", "0.629722", "0.6292303", "0.6087058", "0.60701895", "0.6063367", "0.6004702", "0.5914939", "0.5895156", "0.58286995", "0.5751835", "0.5747269", "0.5741667", "0.57281274"...
0.5149329
65
build all LSM managers
public LSMEngineBuilder<T> buildLSMManagers( ApplicationContext applicationContext, WALManager walManager) { try { buildWalManager(walManager).buildLevelProcessors(applicationContext).buildRecoverManager(); } catch (Exception e) { logger.error(e.getMessage()); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void registerManagers() {\n registerProviders();\n\n // Cast Managers\n if (worldGuardManager.isEnabled()) castManagers.add(worldGuardManager);\n if (preciousStonesManager.isEnabled()) castManagers.add(preciousStonesManager);\n if (redProtectManager != null && redProtectM...
[ "0.6275923", "0.59398025", "0.5730071", "0.5562661", "0.55462986", "0.5522445", "0.55157334", "0.54370695", "0.54142034", "0.54091644", "0.5393289", "0.53636074", "0.5363431", "0.53527576", "0.5316097", "0.5299886", "0.5253107", "0.52174234", "0.52114093", "0.5210096", "0.520...
0.55598634
4
Scan the classes of the package and build all LSM managers based on the class annotations
public LSMEngineBuilder<T> buildLSMManagers(String packageName, WALManager walManager) { try { ApplicationContext property = ApplicationContextGenerator.GeneratePropertyWithAnnotation(packageName); buildLSMManagers(property, walManager); } catch (Exception e) { logger.error(e.getMessage()); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllCla...
[ "0.7452836", "0.67762566", "0.66727877", "0.6667155", "0.6529302", "0.64481086", "0.62938184", "0.5963636", "0.59091264", "0.5895804", "0.5864465", "0.57508177", "0.5738672", "0.5733751", "0.5620459", "0.56057405", "0.5599513", "0.556531", "0.556511", "0.55602866", "0.5550825...
0.4955459
63
Get the built lsmEngine
public LSMEngine<T> build() { return lsmEngine; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Engine getEngine(){\n Engine engine = null;\n try {\n engine = mapper.readValue(new File(Constants.ENGINE_FILE_PATH), Engine.class);\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n return engine;\n }", "private TracingEngine getEn...
[ "0.6421494", "0.63402116", "0.5961244", "0.5836788", "0.581268", "0.58105034", "0.5737963", "0.5720729", "0.57174695", "0.54588026", "0.5253237", "0.52394736", "0.5207137", "0.52060866", "0.5200341", "0.5115114", "0.507465", "0.50648564", "0.50648564", "0.5057413", "0.5046432...
0.7712788
0
generate level processors Chain
private <R extends IRequest, C extends RequestContext> LevelProcessorChain<T, R, C> generateLevelProcessorsChain( List<String> levelProcessorClassNames) { LevelProcessorChain<T, R, C> levelProcessChain = new LevelProcessorChain<>(); try { if (levelProcessorClassNames.size() > 0) { ILevelProcessor iLevelProcess = levelProcessChain.nextLevel(generateLevelProcessor(levelProcessorClassNames.get(0))); for (int i = 1; i < levelProcessorClassNames.size(); i++) { iLevelProcess = iLevelProcess.nextLevel(generateLevelProcessor(levelProcessorClassNames.get(i))); } } } catch (Exception e) { logger.error(e.getMessage()); } return levelProcessChain; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private LSMEngineBuilder<T> buildLevelProcessors(ApplicationContext applicationContext) {\n LevelProcessorChain<T, IInsertionRequest, InsertRequestContext> insertionLevelProcessChain =\n generateLevelProcessorsChain(applicationContext.getInsertionLevelProcessClass());\n LevelProcessorChain<T, IDeletio...
[ "0.60959756", "0.58797693", "0.5556454", "0.55005836", "0.53808", "0.5222075", "0.51869136", "0.512589", "0.50544494", "0.5052647", "0.5049017", "0.5046192", "0.49900085", "0.49687603", "0.49580973", "0.49412686", "0.49237165", "0.49236664", "0.4921934", "0.48864883", "0.4874...
0.70537406
0
write you code here
@Override public void componentResized(ComponentEvent e) { isOpen = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void generateCode()\n {\n \n }", "public void logic(){\r\n\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "CD withCode();", "public void gan...
[ "0.64156544", "0.61896", "0.6031118", "0.60109067", "0.59593844", "0.59297514", "0.5832755", "0.5828144", "0.5822204", "0.58167315", "0.58164877", "0.580399", "0.57964724", "0.57910484", "0.5786943", "0.5770641", "0.5762687", "0.5758873", "0.57435006", "0.57415676", "0.572842...
0.0
-1
TODO Autogenerated method stub
private void setExtendedState(int maximizedBoth) { }
{ "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
Default empty Stay constructor
public Stay() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Bishop()\n {\n super();\n }", "defaultConstructor(){}", "private NoOpCompactor(SegmentStorageSystem storage) {\n super(storage);\n }", "private Default()\n {}", "private StoneContract() {\n }", "void DefaultConstructor(){}", "private StickFactory() {\n\t}", "public Sta...
[ "0.6210719", "0.616539", "0.6116942", "0.60644615", "0.60187846", "0.60141", "0.60086554", "0.59491134", "0.5921354", "0.5888839", "0.5862844", "0.5841257", "0.5793347", "0.57575387", "0.57460797", "0.57369936", "0.5695514", "0.569452", "0.56919926", "0.569163", "0.5691314", ...
0.76833284
0
Create an opened stay with a pet in a home
public Stay(Date startedAt, Pet pet, Home home) { if(home.accept(pet)) { this.startedAt = startedAt; this.finishedAt = null; this.pet = pet; this.home = home; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stayDoor() {\n if (stage != Stage.DOOR_CHOSEN) {\n throw new RuntimeException(\"Invalid Stage\");\n }\n\n stage = Stage.END;\n for (Door door : doors) {\n if (door.getState() == State.CLOSED) {\n door.open();\n }\n continue;\n }\n total_stayed++;\n if (ch...
[ "0.56825244", "0.5545181", "0.5489284", "0.54843456", "0.5466283", "0.5459752", "0.54453087", "0.5438273", "0.5424132", "0.54189974", "0.5406597", "0.53759754", "0.5362037", "0.5342596", "0.5342392", "0.5336867", "0.5311904", "0.52914864", "0.5272548", "0.52591616", "0.525333...
0.6160024
0
Returns value of startedAt
public Date getStartedAt() { return startedAt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Long getStartAt();", "public double getStart();", "public int getStart() {\r\n return start;\r\n }", "public double getStart() {\n return start;\n }", "public int getStart() {\n return start;\n }", "public int getStart() {\n return this.start;\n }", "public int g...
[ "0.7841568", "0.7151616", "0.70923656", "0.7091503", "0.70574176", "0.7055173", "0.70472944", "0.7000059", "0.6977222", "0.69772124", "0.6914047", "0.6910077", "0.6903171", "0.6839724", "0.6822647", "0.679698", "0.67717344", "0.67412674", "0.67386794", "0.67294", "0.6709834",...
0.7270494
1
Sets new value of startedAt
public void setStartedAt(Date startedAt) { this.startedAt = startedAt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setStartAt(final Long startAt);", "public void setStartedDate(Date value) {\n this.startedDate = value;\n }", "public void setStart(long start) { this.start = start; }", "public void setDateStart (Timestamp DateStart);", "public void setStartTime(java.util.Date value) {\n __getInternalInt...
[ "0.77643394", "0.6899126", "0.6889762", "0.68855727", "0.6741887", "0.6741887", "0.67394537", "0.6718965", "0.6697431", "0.667827", "0.667827", "0.6609055", "0.6597824", "0.6508624", "0.64522463", "0.64476615", "0.6438307", "0.6420486", "0.6413129", "0.6381769", "0.63526654",...
0.7457686
1
Returns value of finishedAt
public Date getFinishedAt() { return finishedAt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "Instant getEnd();", "public synchronized boolean getFinished(){\n return finished;\n }", "public boolean getFinished() {\n return finished;\n }", "public boolean getFinished() {\n\t\treturn finished;...
[ "0.6418939", "0.63735145", "0.62687", "0.6266087", "0.62532854", "0.6174909", "0.61634463", "0.61142665", "0.6112528", "0.60810846", "0.60781825", "0.6064793", "0.6059655", "0.60299176", "0.5996933", "0.5987348", "0.59469277", "0.59224594", "0.5892451", "0.58855766", "0.58842...
0.7086253
0
Sets new value of finishedAt
public void setFinisheddAt(Date finishedAt) { this.finishedAt = finishedAt; //this.home.removeStay(this); //this.pet.removeStay(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void setFinished(boolean finished) {\n this.finished = finished;\n }", "public void setFinished(Boolean finished) {\n this.finished = finished;\n }", "public void markAsDone() {\n this.isDone = true;\n this.completed = \"1\";\n }", "public void markFinished(int ...
[ "0.6415622", "0.63148814", "0.60674125", "0.5971303", "0.59541655", "0.5942098", "0.5935741", "0.59104145", "0.5907117", "0.5907117", "0.5907117", "0.58926624", "0.5890464", "0.58722126", "0.58587736", "0.5853909", "0.5853909", "0.5853909", "0.5836777", "0.5835374", "0.583298...
0.66737354
0
Created by CHE01006 on 4/8/2017.
public interface Car { String draw(); void noOfSeats(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Overri...
[ "0.5918289", "0.5873483", "0.58441687", "0.57418877", "0.57140785", "0.57124895", "0.5673042", "0.5673042", "0.55937004", "0.5555667", "0.5552431", "0.5547081", "0.55143404", "0.5514124", "0.5512775", "0.55072165", "0.54997647", "0.5479961", "0.54748636", "0.54670507", "0.545...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { List list = new List(); list.addEl(1); list.addEl(2); // list.addEl(3); list.printList(); list.delEl(2); list.printList(); }
{ "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
Deserializes ESRI shape as described in into JTS Geometry object.
public static Geometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); int geometryType = input.readByte(); if (geometryType != GeometryUtils.GeometryTypeName.GEOMETRY_COLLECTION.code()) { return readGeometry(input); } if (input.available() == 0) { return GEOMETRY_FACTORY.createGeometryCollection(); } // GeometryCollection: geometry-type|len-of-shape1|bytes-of-shape1|len-of-shape2|bytes-of-shape2... List<Geometry> geometries = new ArrayList<>(); while (input.available() > 0) { int length = input.readInt(); geometries.add(readGeometry(input.readSlice(length).getInput())); } return GEOMETRY_FACTORY.createGeometryCollection(geometries.toArray(new Geometry[0])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract Geometry decode(Object o);", "Shape newShape(GraphicalObject g) throws RemoteException;", "@Override\n public Geometry deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)\n throws JsonParseException {\n JsonObject jsonObject = (JsonObject) json;\n String...
[ "0.6529173", "0.5709379", "0.5597154", "0.5557569", "0.54365504", "0.52818376", "0.5229007", "0.5202383", "0.5199678", "0.51525277", "0.5073859", "0.50387204", "0.5010875", "0.4975205", "0.49716747", "0.48982108", "0.48732677", "0.48657238", "0.48643473", "0.48570195", "0.485...
0.6235713
1
CREATE AN INTERACTIVE PROGRAM TO ASK USER STARTING CHARACTER AND ENDING CHARACTER THEN PRINT EVERYTHING IN BETWEEN IT COULD BE STARTING CHARACTER IS AFTER ENDING CHARACTER FOR EXAMPLE USER CAN ENTER Z A , or A K Can we ask user character ? NO!!!! Ask user for String and pick first character by charAt(0)
public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Please write a word: "); String word = scan.next(); char firstLetter = word.charAt(0); char lastLetter = word.charAt(word.length()-1); System.out.print("The letters between the first and last character that you entered are: \n"); if (firstLetter<lastLetter) for (char x = firstLetter; x <= lastLetter ; ++x) { System.out.print(x + "," ); } else if (firstLetter>lastLetter) for (char i = firstLetter ; i >= lastLetter ; --i) { System.out.print(i + ","); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t String word = scan.nextLine();\r\n\t\tint a = word.length();\r\n\t\tint lastCar= a-1; // last index number\r\n\t\t\r\n\t\tchar FirstLetter = word.charAt(0); // first character 0\r\n\t\t\r\n\t\tchar LastLetter = wo...
[ "0.645773", "0.6442404", "0.64344454", "0.6418629", "0.6395689", "0.63189226", "0.62932944", "0.6291516", "0.6280108", "0.6259152", "0.6252149", "0.61962193", "0.6189778", "0.61726165", "0.61690223", "0.6118238", "0.60922754", "0.6070671", "0.603943", "0.60363865", "0.6028791...
0.6482683
0
Created by Administrator on 2015/12/14.
public interface HttpCallBackListener { void onFinish(String response); void Error(Exception e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@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\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Overr...
[ "0.6258207", "0.61420584", "0.6096002", "0.60908514", "0.6042792", "0.604081", "0.60046947", "0.59762836", "0.5922772", "0.5908323", "0.5908323", "0.58816123", "0.58726716", "0.58726716", "0.5861334", "0.5854604", "0.58499676", "0.5831551", "0.58261794", "0.58221793", "0.5775...
0.0
-1
Get e.g: Yesterday, Today, Tomorrow OR date in given format
public static String getDayOnly(Date _DateTime, String _DefaultFormat) { StringBuffer res = new StringBuffer(); if (DateUtils.isToday(_DateTime.getTime())) res.append("Today"); else if (DateUtils.isToday(_DateTime.getTime() - ONE_DAY)) res.append("Tomorrow"); else if (DateUtils.isToday(_DateTime.getTime() + ONE_DAY)) res.append("Yesterday"); else res.append(getFormattedDate(_DateTime, _DefaultFormat)); return res != null ? res.toString() : ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getStartDateYYYYMMDD();", "java.lang.String getDatesEmployedText();", "private String getDateString(Calendar cal) {\n Calendar current = Calendar.getInstance();\n String date = \"\";\n if (cal.get(Calendar.DAY_OF_YEAR) == current.get(Calendar.DAY_OF_YEAR)) {\n d...
[ "0.59389454", "0.59160185", "0.5891804", "0.5885038", "0.57359815", "0.5728237", "0.5700247", "0.5696409", "0.5685456", "0.5685456", "0.5671619", "0.5660897", "0.5645732", "0.5587533", "0.5567934", "0.5565187", "0.55124235", "0.54804844", "0.547564", "0.5462714", "0.54271173"...
0.52997404
29
Get only single unit estimated time e.g: 1 year ago | 2 weeks ago | 5 months ago.
public static String getEstimatedTimeElapsed(Date _DateTime) { String strJustNow, strSecsSingle, strSecsMultiple, strMinSingle, strMinMultiple, strHourSingle, strHourMultiple, strDaySingle, strDayMultiple, strDayYesterday, strDayTomorrow, strWeekSingle, strWeekMultiple, strMonthSingle, strMonthMultiple, strYearSingle, strYearMultiple, titlePast, titleFuture; if (!AppConfig.getInstance().isEnglishMode) { //Arabic mode strJustNow = "الآن"; strSecsSingle = "ثانيا"; strSecsMultiple = "ثواني"; strMinSingle = "دقيقة"; strMinMultiple = "الدقائق"; strHourSingle = "ساعة"; strHourMultiple = "ساعات"; strDaySingle = "يوم"; strDayMultiple = "أيام"; strDayYesterday = "في الامس"; strDayTomorrow = "غدا"; strWeekSingle = "أسبوع"; strWeekMultiple = "أسابيع"; strMonthSingle = "شهر"; strMonthMultiple = "الشهور"; strYearSingle = "سنة"; strYearMultiple = "سنوات"; titlePast = " منذ"; titleFuture = " متبق"; } else { //Default mode strJustNow = "Just now"; strSecsSingle = "sec"; strSecsMultiple = "secs"; strMinSingle = "min"; strMinMultiple = "mins"; strHourSingle = "hr"; strHourMultiple = "hrs"; strDaySingle = "day"; strDayMultiple = "days"; strDayYesterday = "Yesterday"; strDayTomorrow = "Tomorrow"; strWeekSingle = "week"; strWeekMultiple = "weeks"; strMonthSingle = "month"; strMonthMultiple = "months"; strYearSingle = "year"; strYearMultiple = "years"; titlePast = " ago"; titleFuture = " remaining"; } long secsPrevious = _DateTime.getTime() / 1000; long secsNow = System.currentTimeMillis() / 1000; // Calculate difference in milliseconds long diff = secsNow - secsPrevious; boolean isPastTime = diff > 0; diff = Math.abs(diff); // Calculate difference in seconds long diffSeconds = diff; // Calculate difference in minutes long diffMinutes = diff / (60); // Calculate difference in hours long diffHours = diff / (60 * 60); // Calculate difference in days long diffDays = diff / (60 * 60 * 24); // Calculate difference in weeks long diffWeeks = diff / (60 * 60 * 24 * 7); // Calculate difference in months long diffMonths = diff / (60 * 60 * 24 * 30); // Calculate difference in years long diffYears = diff / (60 * 60 * 24 * 365); String timeElapsed = ""; String tempTitle = isPastTime ? titlePast : titleFuture; if (diffYears > 0) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffYears + "") + " " + (diffYears > 1 ? strYearMultiple : strYearSingle) + tempTitle; } else if (diffMonths > 0) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffMonths + "") + " " + (diffMonths > 1 ? strMonthMultiple : strMonthSingle) + tempTitle; } else if (diffWeeks > 0) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffWeeks + "") + " " + (diffWeeks > 1 ? strWeekMultiple : strWeekSingle) + tempTitle; } else if (diffDays > 0) { if (diffDays == 1) { timeElapsed = isPastTime ? strDayYesterday : strDayTomorrow; } else { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffDays + "") + " " + strDayMultiple + tempTitle; } } else if (diffHours > 0) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffHours + "") + " " + (diffHours > 1 ? strHourMultiple : strHourSingle) + tempTitle; } else if (diffMinutes > 0) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffMinutes + "") + " " + (diffMinutes > 1 ? strMinMultiple : strMinSingle) + tempTitle; } else if (diffSeconds > 10) { timeElapsed = AppConfig.getInstance().numberToCurrLang(diffSeconds + "") + " " + (diffSeconds > 1 ? strSecsMultiple : strSecsSingle) + tempTitle; } else {//diff few Seconds timeElapsed = strJustNow; } return timeElapsed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ChronoUnit getUnit();", "public String estimatedTime() {\n int m = (int)(getFreeBytes()/500000000);\n return (m <= 1) ? \"a minute\" : m+\" minutes\";\n }", "public String getEstimatedRemainingTime() {\n long d = executable.getParent().getEstimatedDuration();\n if(d<0) ...
[ "0.6331769", "0.6147215", "0.6046739", "0.5982659", "0.59412336", "0.5865201", "0.5825151", "0.57316774", "0.5675098", "0.5639834", "0.5610094", "0.55583", "0.55466133", "0.55399483", "0.5538149", "0.55287856", "0.5488365", "0.547032", "0.5468832", "0.5467253", "0.54582256", ...
0.61267465
2
Get e.g: 3 days, 10 hours, 1 minute and 4 seconds ago OR date in given format
public static String getTimeDuration(Date _DateTime, String _DefaultFormat, boolean isSingleUnit) { boolean oneUnitPicked = false; //TimeZone Offset Calendar rightNow = Calendar.getInstance(); long offset = 0;//rightNow.get(Calendar.ZONE_OFFSET) +rightNow.get(Calendar.DST_OFFSET); long currTimeStamp = System.currentTimeMillis() - offset; long duration = currTimeStamp - _DateTime.getTime(); StringBuffer res = new StringBuffer(); long temp = 0; if ((duration) >= NOW && duration < (ONE_DAY * 6)) { temp = duration / ONE_DAY; if (temp > 0) { duration -= temp * ONE_DAY; res.append(temp).append(" day").append(temp > 1 ? "s" : ""); res.append((duration >= ONE_MINUTE && !isSingleUnit) ? ", " : ""); oneUnitPicked = isSingleUnit ? true : false; } temp = duration / ONE_HOUR; if (temp > 0 && !oneUnitPicked) { duration -= temp * ONE_HOUR; res.append(temp).append(" hour").append(temp > 1 ? "s" : ""); res.append((duration >= ONE_MINUTE && !isSingleUnit) ? ", " : ""); oneUnitPicked = isSingleUnit ? true : false; } temp = duration / ONE_MINUTE; if (temp > 0 && !oneUnitPicked) { duration -= temp * ONE_MINUTE; res.append(temp).append(" minute").append(temp > 1 ? "s" : ""); res.append((duration >= ONE_SECOND && !isSingleUnit) ? " and " : ""); oneUnitPicked = isSingleUnit ? true : false; } temp = duration / ONE_SECOND; if (temp > 0 && !oneUnitPicked) { res.append(temp).append(" second").append(temp > 1 ? "s" : ""); } else if (temp == 0 && !oneUnitPicked) { res.append("a moment"); } res.append(" ago"); return res.toString(); } else { //Ahead of time res.append(getFormattedDate(_DateTime, _DefaultFormat)); return res.toString(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getElapsedTimeFromNow(Date date) {\n long duration = new Date().getTime() - date.getTime();\n\n long diffInMinutes = TimeUnit.MILLISECONDS.toMinutes(duration);\n long diffInHours = TimeUnit.MILLISECONDS.toHours(duration);\n long diffInDays = TimeUnit.MILLISECONDS.t...
[ "0.6543063", "0.6264994", "0.6065021", "0.596462", "0.5829921", "0.5800291", "0.55761623", "0.5563361", "0.5555359", "0.5542284", "0.55300903", "0.5349147", "0.53456086", "0.5323054", "0.5319073", "0.52666515", "0.5212218", "0.5204371", "0.5202385", "0.51691043", "0.51652795"...
0.51947415
19
converts time (in milliseconds) to humanreadable format " days, hours, minutes and (z) seconds"
public static String millisToLongDHMS(Date _DateTime, String _DefualtFormat) { long currTimeStamp = System.currentTimeMillis(); long duration = _DateTime.getTime() - currTimeStamp; StringBuffer res = new StringBuffer(); long temp = 0; if (duration >= NOW) { temp = duration / ONE_DAY; if (temp > 0) { duration -= temp * ONE_DAY; res.append(temp).append(" day").append(temp > 1 ? "s" : "") .append(duration >= ONE_MINUTE ? ", " : ""); } temp = duration / ONE_HOUR; if (temp > 0) { duration -= temp * ONE_HOUR; res.append(temp).append(" hour").append(temp > 1 ? "s" : "") .append(duration >= ONE_MINUTE ? ", " : ""); } temp = duration / ONE_MINUTE; if (temp > 0) { duration -= temp * ONE_MINUTE; res.append(temp).append(" minute").append(temp > 1 ? "s" : ""); } if (!res.toString().equals("") && duration >= ONE_SECOND) { res.append(" and "); } temp = duration / ONE_SECOND; if (temp > 0) { res.append(temp).append(" second").append(temp > 1 ? "s" : ""); } return res.toString(); } else if (duration < ONE_SECOND) { return _DefualtFormat; } else { return "a moment ago";//"0 second"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String displayTime(long milliseconds) {\n String displayTime = \"\";\n double seconds = milliseconds / 1000.0;\n int minute = (int) (seconds / 60);\n double second = seconds % 60;\n displayTime = String.format(\"%02d:%06.3f\", minute, second);\n\n return disp...
[ "0.7067919", "0.70056474", "0.6994394", "0.69776064", "0.6967398", "0.6917681", "0.6878295", "0.6838786", "0.6838706", "0.68175936", "0.6803378", "0.67950124", "0.67668587", "0.6754173", "0.67403615", "0.6735499", "0.6719835", "0.6696185", "0.66758835", "0.6629755", "0.650856...
0.0
-1
Date de hoje sem tempo
public static void main(String[] args) { LocalDate hoje = LocalDate.now(); System.out.println(hoje); //Criando nova data LocalDate olimpiadas = LocalDate.of(2016, Month.JUNE, 5); System.out.println(olimpiadas); //Calculando diferenca de anos int anos = olimpiadas.getYear() - hoje.getYear(); System.out.println(anos); //Demonstracao de imutabilidade olimpiadas.plusYears(4); System.out.println(olimpiadas); LocalDate proximasOlimpiadas = olimpiadas.plusYears(4); System.out.println(proximasOlimpiadas); //Periodo entre data de inicio e fim Period periodo = Period.between(hoje, olimpiadas); System.out.println(periodo); //Formata data DateTimeFormatter formataData = DateTimeFormatter.ofPattern("dd/MM/yyyy"); System.out.println(proximasOlimpiadas.format(formataData)); //Craindo data e hora LocalDateTime agora = LocalDateTime.now(); System.out.println(agora); //Formatando data e hora //Obs.: O formatado de data e hora nao pode ser usado para formata data. DateTimeFormatter formataDataComHoras = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm"); System.out.println(agora.format(formataDataComHoras )); LocalTime intervalo = LocalTime.of(15, 30); System.out.println(intervalo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "private String getDate()\r\n\t{\r\n\t\tC...
[ "0.70086324", "0.6883957", "0.6843835", "0.6811038", "0.67845094", "0.6684066", "0.6682804", "0.66794586", "0.66553724", "0.6644827", "0.6614291", "0.6614291", "0.6614291", "0.65732884", "0.6565999", "0.6555444", "0.6554273", "0.6553324", "0.65077746", "0.6496417", "0.6485179...
0.0
-1
/ 4455261600273262 Visa 4766112373743631 Visa 5159484379360088 Master Card 5501985571257620 Master Card 372750828187351 American Express
@Override public boolean valida() { mediatorCredito m = new mediatorCredito(); try{ BigInteger dit = new BigInteger(JOptionPane.showInputDialog(null,"Digite su número de " + "tarjeta de crédito","")); String pag = JOptionPane.showInputDialog(null,"Ingrese su medio de pago: (Visa, master Card" + ", American Express)",""); if(m.verificarForm(dit, pag)==false){ JOptionPane.showMessageDialog(null,"ups, el medio de pago o la tarjeta de crédito no es válido" ,"Error",0); } return m.verificarForm(dit, pag); }catch(Exception e){ JOptionPane.showMessageDialog(null,"Acción cancelada","Advertencia",2); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "C15430g mo56154a();", "private static byte[] m24635a(Context context, String str) {\n String f = C6014b.m23956f();\n String string = Secure.getString(context.getContentResolver(), \"android_id\");\n String substring = str.substring(0, Math.min(8, str.length() - 1));\n StringBuilder sb...
[ "0.5606459", "0.56052494", "0.5473896", "0.5453405", "0.54326624", "0.5429619", "0.5399117", "0.5368145", "0.5338187", "0.5333042", "0.5330637", "0.5329139", "0.53291327", "0.53178746", "0.5309476", "0.5293441", "0.52905905", "0.528474", "0.52757573", "0.5274979", "0.5274708"...
0.0
-1
Create a minimal graph with the default configuration
public static void main(String[] args) { Graph g = new GraphBuilder().build(); //Connect the graph g.connect(isConnected -> { //Display that the graph database is connected! System.out.println("Connected : " + isConnected); long timepoint_0 = 0; //the timestamp is a long and represents the time concept Node sensor0 = g.newNode(0, timepoint_0); //the second param is the time sensor0.set("id", Type.STRING, "4494F"); sensor0.set("name", Type.STRING, "sensor0"); sensor0.set("value", Type.DOUBLE, 0.5); //set the value of the sensor long timepoint_1 = 100; sensor0.travelInTime(timepoint_1, (Node sensor0T1) -> { sensor0T1.set("value", Type.DOUBLE, 21.3); //update the value of the time now //Display the value at time 0 System.out.println("T0:" + sensor0.toString()); //print T0:{"world":0,"time":0,"id":1,"id":"4494F","name":"sensor0","value":0.5} //Display the value at time now System.out.println("T1:" + sensor0T1.toString()); //print T1:{"world":0,"time":100,"id":1,"id":"4494F","name":"sensor0","value":21.3} long timepoint_2= 50; sensor0.travelInTime(timepoint_2, (Node sensor0T2) ->{ System.out.println("T2:" + sensor0T2.toString()); //prints T2:{"world":0,"time":50,"id":1,"id":"4494F","name":"sensor0","value":0.5} }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Graph<Node, DefaultEdge> initialiseSpaceGraph() {\n Graph<Node, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class);\n g = addNodes(g);\n g = addEdges(g);\n return g;\n }", "public Graph() {\r\n\t\tinit();\r\n\t}", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\"...
[ "0.737686", "0.7011131", "0.67392135", "0.6730455", "0.6658999", "0.66539127", "0.65266967", "0.6486463", "0.6455278", "0.6437089", "0.6391055", "0.6338116", "0.63276166", "0.6319339", "0.6314862", "0.6310117", "0.629887", "0.62927645", "0.6265427", "0.6265343", "0.6259609", ...
0.0
-1
String msg1 = "get(long) failed.";
@Test public final void testGetLong() { String msg2 = "get(long) illegal arguments check failed."; boolean[] a1_a = new boolean[1023]; boolean[] a1_1_a = new boolean[320]; boolean[] a1_2_a = new boolean[621]; boolean[] a1_3_a = new boolean[82]; boolean[] a2_a = new boolean[2048]; boolean[] a2_1_a = new boolean[641]; boolean[] a2_2_a = new boolean[490]; boolean[] a2_3_a = new boolean[690]; boolean[] a2_4_a = new boolean[317]; for (int i = 0; i < a1_a.length; i++) { a1_a[i] = (i % 17 == 0); } { int c = 17, i = 0, s; for (s = i; (i - s) < a1_1_a.length; i++) { a1_1_a[i - s] = (i % c == 0); } for (s = i; (i - s) < a1_2_a.length; i++) { a1_2_a[i - s] = (i % c == 0); } for (s = i; (i - s) < a1_3_a.length; i++) { a1_3_a[i - s] = (i % c == 0); } } for (int i = 0; i < a2_a.length; i++) { a2_a[i] = (i % 19 == 0); } { int c = 19, i = 0, s; for (s = i; (i - s) < a2_1_a.length; i++) { a2_1_a[i - s] = (i % c == 0); } for (s = i; (i - s) < a2_2_a.length; i++) { a2_2_a[i - s] = (i % c == 0); } for (s = i; (i - s) < a2_3_a.length; i++) { a2_3_a[i - s] = (i % c == 0); } for (s = i; (i - s) < a2_4_a.length; i++) { a2_4_a[i - s] = (i % c == 0); } } MemoryBitList a1_1 = new MemoryBitList(a1_1_a); MemoryBitList a1_2 = new MemoryBitList(a1_2_a); MemoryBitList a1_3 = new MemoryBitList(a1_3_a); SequenceBitList a1 = new SequenceBitList(); a1.add(new SimpleRange(a1_1, 0, a1_1.length())); a1.add(new SimpleRange(a1_2, 0, a1_2.length())); a1.add(new SimpleRange(a1_3, 0, a1_3.length())); MemoryBitList a2_1 = new MemoryBitList(a2_1_a); MemoryBitList a2_2 = new MemoryBitList(a2_2_a); MemoryBitList a2_3 = new MemoryBitList(a2_3_a); MemoryBitList a2_4 = new MemoryBitList(a2_4_a); SequenceBitList a2 = new SequenceBitList(); a2.add(new SimpleRange(a2_1, 0, a2_1.length())); a2.add(new SimpleRange(a2_2, 0, a2_2.length())); a2.add(new SimpleRange(a2_3, 0, a2_3.length())); a2.add(new SimpleRange(a2_4, 0, a2_4.length())); LargeBitListTest.testGetLongInner(a1, 0, a1_a); LargeBitListTest.testGetLongInner(a2, 0, a2_a); try { a1.get(a1_a.length); fail(msg2); } catch (IndexOutOfBoundsException ex) { //OK } try { a1.get(-1); fail(msg2); } catch (IndexOutOfBoundsException ex) { //OK } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getUnknown2();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "ja...
[ "0.63377", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6171068", "0.6158076", "0.6153303", "0.6109856", "0....
0.0
-1
Constructor. Initialize socket and file
public OutputFileTransfer(Socket socket, File file) { this.socket = socket; this.file = file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public fileServer() {\n }", "public TestCaseSocket() {\n\t}", "public Mocket()\n throws IOException\n {\n init (null);\n }", "protected ServerSession(final Socket socket, final String filePath) throws IOException {\r\n\t\tsuper(filePath);\r\n\t\tSystem.out.printf(\"Serving files out of ...
[ "0.6935238", "0.6751965", "0.6735925", "0.6699294", "0.6540334", "0.6529965", "0.6506958", "0.6478936", "0.6475349", "0.64547473", "0.64509475", "0.6450094", "0.64418554", "0.64127254", "0.638093", "0.63736206", "0.6345127", "0.63423187", "0.6321977", "0.6309639", "0.62716836...
0.65483546
4
This method sends file object that contains information about sending data.
public void sendFileInfo(OutputStream outStream, File file) { try { ObjectOutputStream objOut = new ObjectOutputStream(outStream); objOut.writeObject(file); objOut.flush(); } catch (IOException e) { throw new RuntimeException("Can't send file", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendFileContents() {\n\t\t// mostramos un log\n\t\tthis.getLogger().debug(\"Sending file (\" + this.getFile().getName() + \": \" + this.getFile().length() + \" bytes)..\");\n\t\t// iniciamos una bandera\n\t\tint bytesRead = 0;\n\t\ttry {\n\t\t\t// abrimos el fichero\n\t\t\tfinal FileInputStream inFile...
[ "0.74889624", "0.73030704", "0.6981207", "0.6939952", "0.68943626", "0.6842085", "0.68238556", "0.682013", "0.6786539", "0.65551126", "0.6516379", "0.6508259", "0.6454971", "0.6420172", "0.63919365", "0.6361465", "0.63140553", "0.6166683", "0.61529785", "0.6145482", "0.613630...
0.63878
15
Um pra um Sem Chave Estrangeira
public boolean existeListaCategoriaLoja_Possui() { return listacategoriaLojaPossui!= null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}", "public int jogadorAtual() {\n return vez;\n }", "public void hora()\n {\n horaTotal = HoraSalida - HoraLlegada;\n\n }", "public DayOfWeek primeiroDiaSemanaAno(int ...
[ "0.6676253", "0.6454343", "0.6194205", "0.6070118", "0.60521495", "0.6044155", "0.5982128", "0.59792775", "0.5947682", "0.5947572", "0.5933003", "0.59214526", "0.5851596", "0.5847497", "0.58135015", "0.5812611", "0.58013153", "0.5788944", "0.57727", "0.57724166", "0.57669604"...
0.0
-1
TODO Autogenerated method stub
@Override public String foodName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
If sign in fails, display a message to the user. If sign in succeeds the auth state listener will be notified and logic to handle the signed in user can be handled in the listener.
@Override public void onComplete(@NonNull Task<AuthResult> task) { <<<<<<< HEAD:Increment-3/Source/ufo/app/src/main/java/com/example/rust/ufo/LoginActivity.java progressBar.setVisibility(View.GONE); ======= // progressBar.setVisibility(View.GONE); >>>>>>> 5d99259722ed85eb1569d51feee4d1cb7fa6cf5b:Increment - 2/Source/ufo/app/src/main/java/com/example/rust/ufo/LoginActivity.java if (!task.isSuccessful()) { // there was an error if (password.length() < 6) { Password.setError(getString(R.string.minimum_password)); } else { <<<<<<< HEAD:Increment-3/Source/ufo/app/src/main/java/com/example/rust/ufo/LoginActivity.java //Log.w(TAG, "signInWithEmailAndPassword", task.getException()); ======= // Log.w(TAG, "signInWithEmailAndPassword", task.getException()); >>>>>>> 5d99259722ed85eb1569d51feee4d1cb7fa6cf5b:Increment - 2/Source/ufo/app/src/main/java/com/example/rust/ufo/LoginActivity.java Toast.makeText(LoginActivity.this, getString(R.string.auth_failed), Toast.LENGTH_LONG).show(); } } else { Intent intent = new Intent(LoginActivity.this, HomepageActivity.class); startActivity(intent); finish(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleSignInResult(GoogleSignInResult result) {\n if (result.isSuccess()) {\n // Signed in successfully, show authenticated UI.\n GoogleSignInAccount acct = result.getSignInAccount();\n// mStatusTextView.setText(getString(R.string.signed_in_fmt, acct.getDisplayN...
[ "0.72032535", "0.7016239", "0.7005896", "0.6990961", "0.69405305", "0.6915852", "0.6841412", "0.6803573", "0.6788327", "0.67010736", "0.66398394", "0.6556806", "0.65196633", "0.6457884", "0.6453988", "0.64529425", "0.6404992", "0.637629", "0.6371218", "0.6364685", "0.6359339"...
0.0
-1
Called when submit button is clicked
void submitScore(View view){ calculateScore(); calculateRating(); displayMessage(); sendMail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbtnSubmit_click(e);\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() == submit) {\n int score = answerCheck();\n try {\n Submit submitButton = new Submit(u...
[ "0.79526126", "0.76400995", "0.7509606", "0.7448749", "0.72709715", "0.7242681", "0.70422304", "0.70274925", "0.70155567", "0.6999863", "0.6963435", "0.6922909", "0.68819106", "0.6834754", "0.67873657", "0.6768584", "0.6746616", "0.67332715", "0.6694187", "0.6654655", "0.6621...
0.593531
71
Calculates the score based on given answers
void calculateScore(){ playerScore = 0; for(int i = 1; i<=10; i++) { scoreQuestion(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double scoreAnswer(Question question, Answer answer);", "private int computeScore() {\n int score = 0;\n for (int i = 0; i < MainActivity.DEFAULT_SIZE; i++) {\n TextView answerView = (TextView) findViewById(MainActivity.NAME_VIEWS[i]);\n String answer = answerView.getText().to...
[ "0.8336629", "0.7440958", "0.7207757", "0.71951413", "0.71143013", "0.6975082", "0.6958351", "0.69311947", "0.68912417", "0.6825937", "0.677449", "0.6753844", "0.67354673", "0.67160606", "0.6706627", "0.6695139", "0.66912043", "0.6666831", "0.6666831", "0.65821064", "0.656693...
0.6510422
25
Adds points to the score according to the question
void scoreQuestion(int questionNumber){ switch(questionNumber){ case 1: RadioButton radioButtonQ1 = (RadioButton) findViewById(R.id.soccer_question_1_correct_answer); if (radioButtonQ1.isChecked()){ playerScore += 10; } break; case 2: CheckBox checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_wrong_answer_1); if(checkBoxQ2.isChecked()){ return; } checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_wrong_answer_2); if(checkBoxQ2.isChecked()){ return; } checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_correct_answer_1); if(checkBoxQ2.isChecked()){ playerScore += 5; } checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_correct_answer_2); if(checkBoxQ2.isChecked()){ playerScore += 5; } break; case 3: RadioButton radioButtonQ3 = (RadioButton) findViewById(R.id.soccer_question_3_correct_answer); if (radioButtonQ3.isChecked()){ playerScore += 10; } break; case 4: RadioButton radioButtonQ4 = (RadioButton) findViewById(R.id.basketball_question_1_correct_answer); if (radioButtonQ4.isChecked()){ playerScore += 10; } break; case 5: RadioButton radioButtonQ5 = (RadioButton) findViewById(R.id.basketball_question_2_correct_answer); if (radioButtonQ5.isChecked()){ playerScore += 10; } break; case 6: EditText editTextQ6 = (EditText) findViewById(R.id.basketball_question_3); String answerQ6 = getString(R.string.basketball_question_3_correct_answer); if(answerQ6.equalsIgnoreCase(editTextQ6.getText().toString())){ playerScore += 10; } break; case 7: RadioButton radioButtonQ7 = (RadioButton) findViewById(R.id.volleyball_question_1_correct_answer); if (radioButtonQ7.isChecked()){ playerScore += 10; } break; case 8: RadioButton radioButtonQ8 = (RadioButton) findViewById(R.id.volleyball_question_2_correct_answer); if (radioButtonQ8.isChecked()){ playerScore += 10; } break; case 9: RadioButton radioButtonQ9 = (RadioButton) findViewById(R.id.tenis_question_1_correct_answer); if (radioButtonQ9.isChecked()){ playerScore += 10; } break; case 10: EditText editTextQ10 = (EditText) findViewById(R.id.boxe_question_1); String answerQ10 = getString(R.string.boxe_question_1_correct_answer); if(answerQ10.equalsIgnoreCase(editTextQ10.getText().toString())){ playerScore += 10; } break; default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addPointsToScore(int points) {\n score += points;\n }", "public void addPoints(int earnedPoints) {score = score + earnedPoints;}", "public void addScore(int pointsToAdd) {\n\t\tthis.score = this.score + pointsToAdd;\n\t}", "public void addToScore(int points) {\n\t\tassert points >= 0 : \"Canno...
[ "0.7958602", "0.7603148", "0.74956125", "0.7469904", "0.72933054", "0.7245118", "0.71035874", "0.7048451", "0.69141924", "0.6891388", "0.6890784", "0.6864097", "0.6690937", "0.66784865", "0.65346146", "0.6522497", "0.651277", "0.6473234", "0.6472926", "0.64725125", "0.6466774...
0.0
-1
Calculates the player's rating based on his score
void calculateRating(){ if(playerScore <= 30){ playerRating = getString(R.string.rating_message_bad); } else if(playerScore <= 70){ playerRating = getString(R.string.rating_message_regular); } else if(playerScore <= 90){ playerRating = getString(R.string.rating_message_good); } else{ playerRating = getString(R.string.rating_message_excelent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n ...
[ "0.72962254", "0.72815394", "0.72382206", "0.7168407", "0.71429825", "0.713198", "0.7123696", "0.7123696", "0.7004839", "0.6928285", "0.6891396", "0.68811053", "0.6857999", "0.6818963", "0.68122953", "0.680476", "0.6795715", "0.679465", "0.6753524", "0.67447436", "0.6741653",...
0.70692104
8
Displays toast message with player score
void displayMessage(){ Toast toast = Toast.makeText(this, getString(R.string.congratz_message, String.valueOf(playerScore)), Toast.LENGTH_SHORT); toast.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showScore()\n {\n showText(\"Score:\" + score,550,50);\n }", "private void showGameScore() {\n System.out.println(messageProvider.provideMessage(\"score\"));\n System.out.println(settings.getPlayers().get(0).getScore()\n + \" vs \" + settings.getPlayers().get...
[ "0.78066677", "0.7760361", "0.76317316", "0.7386848", "0.7261608", "0.7170019", "0.7102636", "0.70107424", "0.69483614", "0.6923698", "0.68769747", "0.686996", "0.6800432", "0.66976273", "0.66616434", "0.6638702", "0.66324407", "0.662235", "0.6602306", "0.65795404", "0.657899...
0.82943255
0
Sends to the user an email with the score
void sendMail(){ String mailBody = getString(R.string.congratz_message, String.valueOf(playerScore)); mailBody += " " + playerRating; Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setData(Uri.parse("mailto:")); //only email apps should handle this intent.putExtra(Intent.EXTRA_SUBJECT, "Sports Trivia score for " + getPlayerName()); intent.putExtra(intent.EXTRA_TEXT, mailBody); if(intent.resolveActivity(getPackageManager())!=null){ startActivity(intent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void emailResult(View view) {\n // Getting username only\n Intent myIntent = getIntent();\n String nameOfUser = myIntent.getStringExtra(\"EditTextValue\");\n\n String result = \"Name: \" + nameOfUser;\n result += \"\\nMy score: \" + score;\n\n // Create a new intent...
[ "0.69876236", "0.69192886", "0.67025477", "0.65258145", "0.6455456", "0.64469445", "0.6332501", "0.62518877", "0.61826015", "0.60547334", "0.6011297", "0.5983927", "0.5894572", "0.58681285", "0.57958174", "0.57936114", "0.57903844", "0.5769307", "0.57560766", "0.5744913", "0....
0.6942195
1
Get method to retrieve player's name
String getPlayerName() { EditText editText = (EditText) findViewById(R.id.name_edit_text_view); return editText.getText().toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getPlayerName();", "String getName(){\n\t\treturn playerName;\n\t}", "String getName() {\n return getStringStat(playerName);\n }", "public String getName(){\r\n\t\treturn playerName;\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn this.playerName;\r\n\t}", "public String getPlayerName()...
[ "0.90515167", "0.8562612", "0.85044795", "0.8438221", "0.8385187", "0.83554405", "0.83062893", "0.82505846", "0.8175001", "0.81686723", "0.81558955", "0.8147216", "0.8130665", "0.8130665", "0.8096241", "0.809396", "0.80423254", "0.80407405", "0.80392104", "0.8013742", "0.7998...
0.7675035
32
Get method to retrieve player's email
String getPlayerMail() { EditText editText = (EditText) findViewById(R.id.mail_edit_text_view); return editText.getText().toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPlayerEmail () {\n\t\treturn this.playerEmail;\n\t}", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "String getEmail();", "String getEma...
[ "0.82309675", "0.7550269", "0.7550269", "0.7550269", "0.7550269", "0.7550269", "0.7550269", "0.7547644", "0.7547644", "0.7547644", "0.7547644", "0.7547644", "0.74212307", "0.714654", "0.7133517", "0.69843835", "0.69614697", "0.6900815", "0.68528354", "0.68489856", "0.68406713...
0.7209055
13
Looks for the element matching this elements name inside one of the messages passed
public Element switchMessages(Collection<? extends Message<?, ?, ?>> messages) { for (Message<?, ?, ?> currentMessage : messages) { // System.out.println("SwitchMessages" + currentMessage.getMessageName()); Element el = currentMessage.getElement(this.getElementPath()); if (el != null && currentMessage.isValidElement(this, el)) { return el; } } return this.getNonMappingElement(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final WebElement findElementWithAnyMessage(final By by, final List<String> messages) {\n\t\treturn new WebDriverWait(this.webDriver, Environment.TIMEOUT).\n\t\t\t\twithMessage(\"Couldn't find element by \\\"\" + by + \"\\\" with any text from \" + messages).\n\t\t\t\tuntil(ExpectedConditions.refreshed(\n...
[ "0.5976603", "0.5681527", "0.5665498", "0.55974513", "0.54216254", "0.5348988", "0.5339362", "0.5324635", "0.53098714", "0.52564305", "0.52548736", "0.5241162", "0.5223718", "0.5218053", "0.517179", "0.5169295", "0.5163711", "0.5154455", "0.5102572", "0.5091957", "0.50840783"...
0.5872384
1
This method returns a properly formatted string that describes the range and inclusive/exclusive properties of each end of the range.
protected static String expectedRangeString(Object minValue, boolean minInclusive, Object maxValue, boolean maxInclusive) { // A means for a return value String retVal; // Start with the proper symbol for the lower bound if (minInclusive) { retVal = "["; } else { retVal = "("; } // Add in the minimum and maximum values retVal += minValue + " .. " + maxValue; // End with the proper symbol for the upper bound if (maxInclusive) { retVal += "]"; } else { retVal += ")"; } // Return the formatted string return retVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public String toString() {\r\n return \"Range [\" + \"min=\" + min + \", max=\" + max + \"]\";\r\n }", "public String toString() {\n/* 387 */ if (this.toString == null) {\n/* 388 */ StrBuilder buf = new StrBuilder(32);\n/* 389 */ buf.append(\"Range[\");\n/* 390 */ ...
[ "0.7664766", "0.72698426", "0.7088121", "0.68540996", "0.67664695", "0.67334455", "0.6688355", "0.6634123", "0.6577633", "0.65614617", "0.654762", "0.6536205", "0.65159225", "0.6456573", "0.6452096", "0.64350295", "0.62426776", "0.62124383", "0.61903226", "0.6188934", "0.6165...
0.7426886
1
leftchild and rightchild of each node Constructor for a BST node.
public BSTNode(K key) { this.key = key; this.left = null; this.right = null; this.height = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BST() {\n // DO NOT IMPLEMENT THIS CONSTRUCTOR!\n }", "public BST() {\n }", "public BST() {\n\n }", "public BST(){\n\t\tthis.root = null;\n\t}", "public BST() {\n this.root = null;\n }", "public BinaryTree()\n {\n //this is the constructor for the BinaryTree obj...
[ "0.727203", "0.7028261", "0.69819146", "0.68267286", "0.6796751", "0.677132", "0.6743007", "0.6713276", "0.66624033", "0.6622121", "0.6605595", "0.65442574", "0.64565396", "0.64208245", "0.6411176", "0.6402214", "0.6392068", "0.63665605", "0.636576", "0.63369155", "0.6332813"...
0.63156766
24
height is counted from root to leafs, as from 0 to n
public int getHeight() { return this.height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int height() { return height(root); }", "private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}", "@Override\n\tpublic int height() {\n\t\tif (this.valCount == 0) { // if empty leaf\n\t\t\treturn 0;\n\t\t}\n\t\tint max = 1; ...
[ "0.7525726", "0.74520606", "0.7431352", "0.7426645", "0.7394544", "0.7391345", "0.73817813", "0.7335594", "0.73254395", "0.7320978", "0.72216785", "0.72193825", "0.7213121", "0.7212342", "0.7211385", "0.720773", "0.72052747", "0.7138011", "0.71229994", "0.7116797", "0.7102494...
0.0
-1