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
Constructor for Tool object, creates a Tool object Tool(String name, String id, String address) Creates a Tool object.
public Tool(String name, String id, String address, boolean isHome) { this.name = name; this.id = id; this.address = address; this.isHome = isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tool(String name, String id, String address) {\n this.name = name;\n this.id = id;\n this.address = address;\n this.isHome = false;\n }", "public Tool(ToolType type, String brand) {\n this.type = type;\n this.brand = brand;\n }", "public Tool(ToolType type...
[ "0.87245524", "0.68196845", "0.67322236", "0.66434664", "0.6410892", "0.6295353", "0.62906104", "0.6250516", "0.61368597", "0.60325086", "0.60082203", "0.59568864", "0.58454007", "0.56759095", "0.5656111", "0.5649883", "0.5647584", "0.56289405", "0.55551225", "0.5485484", "0....
0.7898373
1
Gets the name of the calling Tool object.
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public String getToolname() {\r\n return toolname;\r\n }", "String getExternalToolName();", "public String getTool() {\n\t\treturn tool;\n\t}", "String getCaller();", "private String getCallerInfo() {\n Optional<StackWa...
[ "0.78951424", "0.753847", "0.74989617", "0.6997794", "0.6948702", "0.67201436", "0.6561952", "0.65463775", "0.64122534", "0.6404652", "0.6339101", "0.63288796", "0.6327682", "0.63194656", "0.6314043", "0.6308235", "0.6244645", "0.6222359", "0.6200541", "0.6193324", "0.6186116...
0.0
-1
Sets the name of the calling Tool object.
public void setName(String name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "@Override\n\tpublic void setToolName(String typeName) throws PropertyVetoException {\n\t\tname = typeName;\n\t}", "public void setName(String name) ...
[ "0.73928803", "0.71717966", "0.7070622", "0.67208326", "0.6718637", "0.6604227", "0.6544306", "0.65293574", "0.64088035", "0.63936824", "0.6315861", "0.6314227", "0.6309426", "0.6290062", "0.62643445", "0.6263724", "0.626106", "0.626106", "0.626106", "0.626106", "0.62588906",...
0.0
-1
Gets the ID of the calling Tool object.
public String getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final int getToolID() {\n return toolID;\n }", "String getProgramId();", "public String getTool() {\n\t\treturn tool;\n\t}", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "public String ...
[ "0.767498", "0.633196", "0.6328105", "0.63269615", "0.62327206", "0.6222711", "0.62016404", "0.6191895", "0.6098798", "0.6076181", "0.6072372", "0.6039357", "0.603297", "0.60210764", "0.60051614", "0.59993446", "0.5961314", "0.5948712", "0.5946208", "0.5928065", "0.5906753", ...
0.0
-1
Sets the ID of the calling Tool object.
public void setId(String id) { this.id = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setID(Object caller, int id)\n\t{\n\t\tif (caller instanceof DriverManager)\n\t\t{\n\t\t\tdriverID = id;\n\t\t}\n\t}", "public final int getToolID() {\n return toolID;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public void setID(int id);", "public...
[ "0.6827995", "0.62704396", "0.61221355", "0.6063555", "0.6041825", "0.6041825", "0.60391223", "0.6021619", "0.6012623", "0.5999103", "0.59721303", "0.5960448", "0.5918304", "0.59094936", "0.5904986", "0.59022516", "0.5898416", "0.58854395", "0.5879141", "0.58588415", "0.58573...
0.0
-1
Gets the toolbox address of the calling Tool object.
public String getAddress() { return address; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getExternalToolName();", "public String getTool() {\n\t\treturn tool;\n\t}", "public String getToolname() {\r\n return toolname;\r\n }", "public Tool getTool() {\n\treturn tool;\n }", "public Tool tool() {\n return fTool;\n }", "public final int getToolID() {\n return...
[ "0.6714884", "0.64851874", "0.62841415", "0.6148418", "0.61391187", "0.60540426", "0.5964819", "0.5953296", "0.5900413", "0.5831096", "0.58214307", "0.57788056", "0.56255984", "0.5620427", "0.5579802", "0.55636257", "0.5520274", "0.5485335", "0.5471184", "0.54625076", "0.5426...
0.0
-1
Sets the toolbox address of the calling Tool object.
public void setAddress(String address) { this.address = address; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTool(Tool t) {\n\ttool = t;\n }", "public void setExternalAddress(String address);", "public void setInternalAddress(String address);", "public void setAddress(java.lang.String param) {\r\n localAddressTracker = param != null;\r\n\r\n this.localAddress = param;\r\n ...
[ "0.6032431", "0.5937987", "0.5749941", "0.57326555", "0.5581112", "0.55326545", "0.5521428", "0.5489796", "0.54414356", "0.5328564", "0.53196", "0.5319188", "0.5318942", "0.5318942", "0.5318942", "0.52982616", "0.52928174", "0.5282918", "0.5282918", "0.5282918", "0.5282918", ...
0.0
-1
Gets the isHome status of the calling Tool object.
public boolean getIsHome() { return isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isHome() {\n return getHomePackageNames().contains(\n mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName());\n }", "public Boolean isInCurrentHome() throws CallError, InterruptedException {\n return (Boolean)service.call(\"isInCurrentHome\").get()...
[ "0.74085104", "0.7353796", "0.64917713", "0.6377354", "0.6289554", "0.62747914", "0.62076336", "0.61250126", "0.60639656", "0.60412747", "0.6016993", "0.5931957", "0.5924294", "0.59205073", "0.5918548", "0.5892069", "0.587571", "0.58752036", "0.58673364", "0.5867266", "0.5817...
0.75826496
0
Sets the status of whether the tool is inside its assigned toolbox of the calling Tool object.
public void setIsHome(boolean isHome) { this.isHome = isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setToolStatus(ToolStatus toolStatus) {\n this.toolStatus = toolStatus;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public void setTool(Tool t) {\n\ttool = t;\n }", "public ToolStatus getToolStatus() { return toolStatus;\n }", "public void ass...
[ "0.65698856", "0.62035424", "0.6010128", "0.5903436", "0.5750689", "0.5608171", "0.5598315", "0.5596144", "0.5593652", "0.555964", "0.54366666", "0.5397872", "0.5373154", "0.5367052", "0.53474426", "0.5310991", "0.52596813", "0.5222443", "0.521712", "0.5213102", "0.5194611", ...
0.0
-1
Separates the string by the first instance of the given character.
private static String[] partition(String str, char character) { int index = str.indexOf(character); String[] pair = new String[2]; if (index > -1) { // Gets rid of a space in the end of the first partition. pair[0] = str.substring(0, index).trim(); pair[1] = str.substring(index + 1).trim(); } else { // If there exists no '/' in the string, set the tail of the pair as an empty string. pair[0] = str; pair[1] = ""; } return pair; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static char first(String s) {\n return s.charAt(0);\n }", "public static char first(String s) {\n\treturn s.charAt(0);\n\t}", "public static String beforeFirst(final String s, final char c)\n\t{\n\t\tif (s == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tfinal int index = s.indexOf(c);\n\n\t\ti...
[ "0.67090774", "0.66526306", "0.6366479", "0.60483193", "0.60140955", "0.5920976", "0.57708305", "0.57346493", "0.5675045", "0.56656945", "0.5627731", "0.56152236", "0.55707914", "0.5519343", "0.54938644", "0.54419255", "0.54362994", "0.5375448", "0.5367981", "0.5317564", "0.5...
0.611027
3
Partitions the string into 2, seperated by the first '/'.
public static String[] slashPartition(String str) { return partition(str, '/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String[] partition(String str, char character) {\n int index = str.indexOf(character);\n\n String[] pair = new String[2];\n\n if (index > -1) {\n // Gets rid of a space in the end of the first partition.\n pair[0] = str.substring(0, index).trim();\n ...
[ "0.67879504", "0.6406187", "0.594003", "0.57572854", "0.5681553", "0.55932873", "0.5491975", "0.54808974", "0.54406106", "0.5431049", "0.5405538", "0.5387782", "0.5372398", "0.5351486", "0.5346287", "0.5331758", "0.5304434", "0.5254239", "0.5243943", "0.51949257", "0.51701087...
0.668161
1
Returns the first word and everything after the first ' ' of the String.
public static String[] wordSeparator(String input) { return partition(input, ' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String firstWord(String userMessage) {\n if (userMessage.contains(\" \"))\n return userMessage.substring(0, userMessage.indexOf(\" \"));\n return userMessage;\n }", "public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\two...
[ "0.70881677", "0.6151715", "0.6095337", "0.6086085", "0.6029805", "0.60193706", "0.5932983", "0.5926542", "0.59107417", "0.58838755", "0.5882156", "0.58720815", "0.58637035", "0.58517706", "0.5827723", "0.5818877", "0.5797424", "0.57929313", "0.57852286", "0.5781225", "0.5751...
0.0
-1
Returns everything after the first instance of a period.
public static String everythingAfterDot(String str) { int index = str.indexOf('.'); if (index > -1) { return str.substring(index + 1).trim(); } else { return str; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Period getNextPeriod() throws PeriodNotFoundException;", "public org.drip.analytics.cashflow.CompositePeriod firstPeriod()\n\t{\n\t\treturn periods().get (0);\n\t}", "public org.drip.analytics.cashflow.CompositePeriod lastPeriod()\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsC...
[ "0.6578036", "0.6543789", "0.59326994", "0.5924293", "0.5820947", "0.57277346", "0.56833744", "0.56588954", "0.5638413", "0.5606383", "0.558221", "0.5575395", "0.55479985", "0.55277663", "0.55214655", "0.54929084", "0.54613304", "0.54536986", "0.54536986", "0.5416479", "0.540...
0.0
-1
Converts the input string from 24hour time to 12hour time representation.
private static String convertTime(String timeString) { try { int timeIn24hRepresentation = Integer.parseInt(timeString); int hours = timeIn24hRepresentation / 100; int minutes = timeIn24hRepresentation % 100; boolean isOutOfBounds = hours < 0 || hours > 24 || minutes < 0 || minutes > 60; boolean cannotConvertToTime = timeString.length() != 4; if (isOutOfBounds || cannotConvertToTime) { return timeString; } else { return convertTimeToStringRepresentation(hours, minutes); } } catch (NumberFormatException e) { return timeString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String timeConversion(String s) {\n if(s.indexOf('P') >= 0 && s.substring(0, 2).equals(\"12\")){\n }\n else if(s.indexOf('P') >= 0){\n Integer n = Integer.parseInt(s.substring(0, 2));\n s = removeHour(s);\n n += 12;\n String hour = Integer.toS...
[ "0.73401636", "0.7046488", "0.6805074", "0.6731536", "0.66776335", "0.6666095", "0.665531", "0.6651135", "0.6636756", "0.6465022", "0.62368315", "0.60621023", "0.6045909", "0.5939168", "0.57889456", "0.5773447", "0.57701993", "0.5607969", "0.55086017", "0.5484195", "0.5483082...
0.62820464
10
Converts the inputString into DD MMM YYYY format, or 12hour time representation if applicable.
public static String convertDateAndTime(String inputString) { String trimmedInputString = inputString.trim(); if (trimmedInputString.length() < 10) { return convertTime(inputString); } else { String dateString = trimmedInputString.substring(0, 10).trim(); String timeString = trimmedInputString.substring(10).trim(); try { String date = LocalDate.parse(dateString).format(DateTimeFormatter.ofPattern("d MMM yyyy")); if (timeString.length() == 4) { return date + " " + convertTime(timeString); } return date + timeString; } catch (DateTimeParseException e) { return inputString; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String convertDate(String input) {\n String res = \"\";\n\n String[] s = input.split(\" \");\n\n res += s[2] + \"-\";\n switch (s[1]) {\n case \"January\":\n res += \"01\";\n break;\n case \"February\":\n ...
[ "0.68444556", "0.6744341", "0.6692371", "0.66062033", "0.6541916", "0.651194", "0.62109613", "0.6210488", "0.6097323", "0.6016005", "0.5871649", "0.5848959", "0.58139694", "0.5775481", "0.5682097", "0.5664201", "0.565421", "0.5644746", "0.56277204", "0.5627475", "0.5620134", ...
0.7301813
0
Compares two string by their ASCII values, and returns either 0, 1, or 1.
public static int compareString(String firstString, String secondString) { if (isEmptyString(firstString) || isEmptyString(secondString)) { if (isEmptyString(firstString) && isEmptyString(secondString)) { return 0; } else if (isEmptyString(firstString)) { return 1; } else if (isEmptyString(secondString)) { return -1; } } char charOfFirst = firstString.charAt(0); char charOfSecond = secondString.charAt(0); int result = compareChar(charOfFirst, charOfSecond); if (result == 0) { return compareString(firstString.substring(1), secondString.substring(1)); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the f...
[ "0.70637155", "0.6983216", "0.6943817", "0.68078923", "0.6762574", "0.6738679", "0.6650553", "0.6648068", "0.66438615", "0.65790194", "0.6558607", "0.6524934", "0.6408694", "0.64045876", "0.63873196", "0.6372934", "0.6367376", "0.6296292", "0.6272736", "0.627199", "0.6269141"...
0.6786173
4
Compares two characters by their ASCII values, and returns either 0, 1 or 1.
public static int compareChar(char firstChar, char secondChar) { return Character.compare(secondChar, firstChar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int diff(char a, char b) {\n return (a == b ? 0 : 1);\n }", "private static int alphaNumericCompare( String s1, String s2 )\n\t{\n\t\tString[] words1 = splitIntoAlphasAndNums( s1 );\n\t\tString[] words2 = splitIntoAlphasAndNums( s2 );\n\t\tfor ( int j = 0; j < Math.min( words1.length, words2.length );...
[ "0.7013739", "0.6802726", "0.6648712", "0.6580633", "0.6507326", "0.6490616", "0.6482074", "0.6449149", "0.64477396", "0.6447352", "0.64140326", "0.6377382", "0.63710177", "0.63432574", "0.63425493", "0.63376385", "0.63369936", "0.62964803", "0.6295281", "0.6290428", "0.62704...
0.69269437
1
TODO Autogenerated method stub
public List<Usuario> getUsuarios() { return getUsuarioDAO().listarTodos(); }
{ "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
public void addUsuario(Usuario usuario) { }
{ "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
public void updateUsuario(Usuario usuario) { }
{ "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
public void deleteUsuario(Usuario usuario) { }
{ "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
public Boolean verificarUsuario(int id, String password) { 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
/a cat Main class constructor
public Cat(final String name){ super(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Main() {\r\n\t}", "public Main() {\n\t\tsuper();\n\t}", "public Main() {\r\n }", "public Main() {\r\n }", "public Main() {}", "private Main() {\n\n super();\n }", "public Main() {\n }", "public Main() {\n }", "public Main() {\n }", "private Main ()\n {\n su...
[ "0.77789074", "0.7682776", "0.7648717", "0.7648717", "0.7593279", "0.75718004", "0.7565792", "0.75654995", "0.75654995", "0.7550237", "0.74117565", "0.7390179", "0.7370868", "0.7294764", "0.7266308", "0.7248286", "0.71934193", "0.71009004", "0.70782083", "0.7074966", "0.70453...
0.62759906
82
Class constructor with no parameters
public Cat(){ super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "void DefaultConstructor(){}", "private Instantiation(){}", "public Constructor(){\n\t\t\n\t}", "Reproducible newInstance();", "private SingleObject(){}", "public Method() {\n ...
[ "0.79663783", "0.76110965", "0.7569161", "0.75166535", "0.7199728", "0.7143023", "0.711625", "0.70975965", "0.70728356", "0.7071158", "0.70085084", "0.6993913", "0.69661903", "0.6903352", "0.686188", "0.6851326", "0.6821186", "0.68019694", "0.67955595", "0.67636293", "0.67617...
0.0
-1
/ Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
public static int getMaxProfit(int[] values) { // We are allowed to compute only one transaction. So we will find min // and max value and will return the differrence. if (values == null || values.length <= 1) return 0; int min = values[0]; int profit = 0; for (int i = 1; i < values.length; i++) { profit = Math.max(profit, values[i] - min); min = Math.min(min, values[i]); } return profit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int maxProfit(int[] prices) {\n int N = prices.length;\n int res = 0; // min, buy and sell on the same day\n for (int i = 0; i < N; i++) {\n for (int j = i; j < N; j++) {\n res = Math.max(res, prices[j] - prices[i]);\n }\n }\n return r...
[ "0.8101878", "0.79293525", "0.78784347", "0.7843724", "0.78413844", "0.78395283", "0.7803638", "0.78001654", "0.7789381", "0.7751813", "0.7711552", "0.76502365", "0.75593555", "0.7549037", "0.7547693", "0.7544801", "0.753796", "0.7530283", "0.7517044", "0.7513256", "0.7498185...
0.69179916
46
Affiche la moyenne des distances des tournees qui passent par tous les points de la liste nbTournees sont generees pour calculer la moyenne
private static void calculDistanceTournees(List<Point> points, int nbTournees) { long time = System.currentTimeMillis(); double distance = 0; Random rand = new Random(0); for(int i=0; i<nbTournees; i++) { distance += calculDistanceTourneeAlea(points, rand); } long deltaTime = System.currentTimeMillis() - time; System.out.println("Calcul de la moyenne des distances pour "+nbTournees+ " tournees"); System.out.println("La moyenne vaut : "+distance/nbTournees); System.out.println("La moyenne est calculee en "+deltaTime+" ms"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n ...
[ "0.64764315", "0.6202107", "0.5982875", "0.5962642", "0.59379345", "0.5909574", "0.59079564", "0.5906635", "0.58929926", "0.58635724", "0.58282524", "0.5791848", "0.57838285", "0.5762473", "0.5737058", "0.5703453", "0.56958383", "0.5659932", "0.565797", "0.5649974", "0.564099...
0.8064112
0
Calcul la distance d'une tournee qui passe par tous les points de la liste Au prealable la liste est melangee aleatoirement
private static double calculDistanceTourneeAlea(List<Point> points, Random rand) { double distance = 0; Collections.shuffle(points, rand); Point courant = points.get(0); Point suivant; for(int i=1; i<points.size(); i++) { suivant = points.get(i); distance += courant.getDistance(suivant); courant = suivant; } suivant = points.get(0); distance += courant.getDistance(suivant); return distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void calculDistanceTournees(List<Point> points, int nbTournees) {\n long time = System.currentTimeMillis();\n double distance = 0;\n Random rand = new Random(0);\n for(int i=0; i<nbTournees; i++) {\n distance += calculDistanceTourneeAlea(points, rand);\n ...
[ "0.71367085", "0.71249956", "0.70009536", "0.69611025", "0.6931163", "0.6829798", "0.65194714", "0.6295145", "0.62745595", "0.6257012", "0.6248518", "0.62428164", "0.61695194", "0.6152057", "0.6143431", "0.6098522", "0.6027017", "0.6022844", "0.60227317", "0.601737", "0.60013...
0.7327822
0
Affiche le nombre de routes qui partent du premier point de la liste
private static void nbRoutesPremierPoint(List<Point> points) { if(points == null || points.isEmpty()) { System.out.println("Aucun point dans l'ensemble des points ..."); return; } Iterator<Point> iter = points.iterator(); Point p1 = iter.next(); System.out.println("Il y a "+p1.getNbRoutes()+" routes qui partent du point p1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNombreLiaison()\t{\r\n \treturn this.routes.size();\r\n }", "private int countPossibleRoutes(){\n\tint totPossRoutes =0;\n\tfor(int i=0;i<ConditionTree.length;i++){\n\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\ttotPossRoutes++;\n\t\t}\n\t}\n\t\n\treturn totPossRoutes;\n}", "public int ...
[ "0.7344507", "0.67442375", "0.66906637", "0.6282351", "0.61354613", "0.6132629", "0.61264163", "0.6064359", "0.60592264", "0.60445994", "0.59669465", "0.59381", "0.59231687", "0.59070367", "0.5900045", "0.5887882", "0.58210456", "0.58112574", "0.5801249", "0.579351", "0.57735...
0.7710266
0
Cette methode ajoute pour chaque point les routes vers chaque autre point. L'ajout est repete trois fois afin de verifier que la methode d'ajout des routes est correcte ! Une seule route doit etre ajoutee et non trois !
private static void ajouterRoutes(List<Point> points) { long time = System.currentTimeMillis(); Set<Point> ensPoints = new HashSet<>(points); for(Point p : points) { p.ajouterRoutes(ensPoints); // Supposons que l'on essaye d'ajouter plusieurs fois les memes destinations ... p.ajouterRoutes(ensPoints); p.ajouterRoutes(ensPoints); } long deltaTime = System.currentTimeMillis() - time; System.out.println("Les routes sont ajoutées en "+deltaTime+" ms"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);", "public void testRoute() {\r\n\t\tLog.i(\"JUNIT\", \"Routing test started\");\r\n\t\t// create route with known points\r\n\t\tRoute pr = new Route(new GeoLocation(49.904005, 10.859725),\r\n\t\t\t\tnew GeoLocation(49...
[ "0.68826705", "0.6369164", "0.6199664", "0.6196404", "0.6190221", "0.6070374", "0.60549235", "0.6013442", "0.5960286", "0.59343046", "0.5926548", "0.5884793", "0.58726937", "0.5853024", "0.5834168", "0.5735438", "0.57295525", "0.57169324", "0.5697557", "0.56940484", "0.568751...
0.6960296
0
Cette methode utilise un generateur de nombre aleatoires afin de renvoyer une liste de points avec des coordooonees aleatoires
private static List<Point> genererPointsAlea(int nbPoints) { /*List<Point> points = new ArrayList<>(); Random rand = new Random(0); for(int i=0; i<nbPoints; i++) { Point p = new Point(rand.nextDouble(), rand.nextDouble()); points.add(p); } return points;*/ return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\...
[ "0.70022607", "0.69950384", "0.6504586", "0.64958274", "0.64830446", "0.6469819", "0.6384429", "0.6367746", "0.63373554", "0.6225452", "0.6142129", "0.6108222", "0.60028994", "0.600129", "0.5973662", "0.59525365", "0.59383833", "0.592476", "0.5909428", "0.5896805", "0.5872921...
0.7162975
0
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { metGet(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro...
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", ...
0.68195957
16
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { metPost(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n ...
[ "0.7327792", "0.71364146", "0.71150917", "0.7103484", "0.7098967", "0.7022197", "0.7014374", "0.6963617", "0.6887727", "0.67830557", "0.6772561", "0.67459744", "0.65569043", "0.655617", "0.65236866", "0.6523533", "0.6523533", "0.6523533", "0.652217", "0.65187013", "0.65143514...
0.6666483
12
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short d...
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", ...
0.0
-1
DAAP 3/julio/2015 Para reporte orden de compra.
public String toString2() { return calle.isEmpty() ? "" : (calle + " " + numeroExterior + " " + (numeroInterior.isEmpty() ? "" : " " + numeroInterior) + (referencia.isEmpty() ? "" : "" + referencia + " ") + (colonia.isEmpty() ? "" : colonia)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void crearReporte() {\n medirTiempoDeEnvio();\n SimpleDateFormat variableFecha = new SimpleDateFormat(\"dd-MM-yyyy\");\n Calendar cal = Calendar.getInstance();\n String dia = String.valueOf(cal.get(cal.DATE));\n String mes = String.valueOf(cal.get(cal.MONTH) + 1);\n ...
[ "0.68394077", "0.6728751", "0.65475637", "0.65373737", "0.65326035", "0.6495582", "0.6469892", "0.64481646", "0.63730335", "0.63693154", "0.63594484", "0.6297568", "0.6290384", "0.62874556", "0.6283648", "0.62746304", "0.6265272", "0.62611413", "0.62550646", "0.6232968", "0.6...
0.0
-1
Created by intel i3 on 3/14/2017.
public interface IRegisterPresenter { public void requestRegister(RegisterBody registerBody); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo6081a() {\n }", "public void mo38117a() {\n }", "public void mo4359a() {\n ...
[ "0.60055053", "0.5823534", "0.57855767", "0.5754048", "0.5748715", "0.57441056", "0.5714471", "0.569432", "0.56753546", "0.56753546", "0.5634899", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.5619613", "0.56108767", "0.5...
0.0
-1
Created by yy111026 on 2017/2/7.
public interface ICodeWriter { boolean write(String code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Over...
[ "0.58538514", "0.57800186", "0.57428384", "0.5693515", "0.5633346", "0.5631937", "0.5631937", "0.5579036", "0.5578189", "0.5571889", "0.55356514", "0.5487927", "0.5481954", "0.5481395", "0.5462429", "0.5462193", "0.54466045", "0.5445839", "0.544211", "0.54402137", "0.5437942"...
0.0
-1
Create the location request to start receiving updates
private void getLocation() { LocationRequest mLocationRequestHighAccuracy = new LocationRequest(); mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL); mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { stopSelf(); return; } else mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() { @Override public void onLocationResult(LocationResult locationResult) { Log.d(TAG, "onLocationResult: got location result."); Location location = locationResult.getLastLocation(); if (location != null) { db.getReference("Users").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { user=snapshot.getValue(User.class); } @Override public void onCancelled(@NonNull DatabaseError error) { } }); LocationModel geoPoint = new LocationModel(location.getLatitude(), location.getLongitude()); UserLocation userLocation = new UserLocation(geoPoint, user); saveUserLocation(userLocation); } /*if (location != null) { DocumentReference u = db.collection("Users").document(FirebaseAuth.getInstance().getCurrentUser().getUid()); u.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if (task.isSuccessful()) { user = task.getResult().toObject(User.class); } } }); GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude()); UserLocation userLocation = new UserLocation(geoPoint, null, user); saveUserLocation(userLocation); }*/ } }, Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void createLocationRequest() {\n System.out.println(\"In CREATE LOCATION REQUEST\");\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(60 * 1000);\n mLocationRequest.setFastestInterval(5 * 1000);\n mLocationRequest.setPriority(LocationRequest.PR...
[ "0.7807477", "0.7758711", "0.7650004", "0.75696146", "0.751144", "0.73866934", "0.7262146", "0.722402", "0.72024965", "0.72024965", "0.7199066", "0.7041655", "0.6972455", "0.6858887", "0.68506616", "0.6836776", "0.68347365", "0.6737932", "0.6736338", "0.6722951", "0.67022216"...
0.0
-1
The interface used to communicate with the parent activity
public interface Callbacks { // Through this method is the activity notified of a selected list item void onAnimalSelected(Animal animal); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface SupportParentable {\n Intent getSupportParentActivityIntent();\n }", "public interface C0869a {\n Intent getSupportParentActivityIntent();\n }", "public interface OnNewIntent {\n void onNewIntent(ZHIntent zHIntent);\n}", "public interface ActivityInterface {\n publi...
[ "0.69960654", "0.6754166", "0.6560104", "0.63722235", "0.63602775", "0.63410056", "0.6304983", "0.6277444", "0.6255922", "0.62456197", "0.62399226", "0.6187052", "0.61849195", "0.6182348", "0.617242", "0.6168373", "0.61649024", "0.612474", "0.6099223", "0.6094941", "0.6082917...
0.5774885
69
Through this method is the activity notified of a selected list item
void onAnimalSelected(Animal animal);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSelectedItem(int position) {\n\t\t\t\t\n\t\t\t\tviewInfo.intentUri = customDialog.mAppList.get(position).intentUri;\n\t\t\t\t\n\t\t\t\tviewInfo.icon = customDialog.mAppList.get(position).icon;\n\t\t\t\tviewInfo.label = customDialog.mAppList.get(position).label;\n\t\t\t\t\n\t\t\t\tmUiManager.addItemTo...
[ "0.7466268", "0.7101397", "0.7098625", "0.70372033", "0.7032316", "0.7032316", "0.7021653", "0.6976917", "0.6944782", "0.6935799", "0.6924011", "0.6915264", "0.69148546", "0.69135386", "0.69091874", "0.6894523", "0.6886321", "0.6872687", "0.6872687", "0.68624246", "0.685497",...
0.0
-1
Filter the animals according to the supplied key, shared by the lexicon menu activity
public void updateUI() { List<Animal> animals; String searchQuery = LexiconPreferences.getSearchQuery(getActivity()); // Check if there's a search query present if (searchQuery != null) { ArrayList<String> whereArgs = new ArrayList<>(); whereArgs.add(LexiconPreferences.getFilterValue(getActivity())); animals = mAnimalManager.searchAnimals( mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())), whereArgs, searchQuery ); } else { animals = mAnimalManager.getAnimals( mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())), new String[]{LexiconPreferences.getFilterValue(getActivity())} ); } if (animals.size() > 0) { // If the fragment is already running, update the data in case something changed (some animal) if (mAnimalAdapter == null) { mAnimalAdapter = new AnimalAdapter(animals); mAnimalRecyclerView.setAdapter(mAnimalAdapter); } else { mAnimalAdapter.setAnimals(animals); mAnimalAdapter.notifyDataSetChanged(); } } else { RelativeLayout emptyList = (RelativeLayout) mView.findViewById(R.id.list_empty); emptyList.setVisibility(View.VISIBLE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void filterItems()\n {\n System.out.println(\"filtered items (name containing 's'):\");\n Set<ClothingItem> items = ctrl.filterItemsByName(\"s\");\n items.stream().forEach(System.out::println);\n }", "public boolean isMatchFilterKey(String key) {\n boolean match = false;...
[ "0.5693252", "0.5643201", "0.56060153", "0.5439196", "0.53535974", "0.5290784", "0.52361387", "0.52336246", "0.51788455", "0.51716673", "0.51428276", "0.51242876", "0.51148367", "0.5107099", "0.51038843", "0.5084255", "0.50840145", "0.5081014", "0.50787413", "0.50534254", "0....
0.0
-1
Wait for the view being rendered so that its dimensions are known and Picasso can use them to resize the image
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { ImageLoader.getInstance(getActivity()).loadImage( mAnimal.getImage(), mImageImageView ); // Remove the listener mImageImageView.removeOnLayoutChangeListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleSizeChange(Object observable) {\n imageView.fitToSize(getWidth(), getHeight());\n placeHolder.setGlyphSize(Math.min(getWidth(), getHeight()) * 0.6);\n }", "@Override\n public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {\n if(bitmap.ge...
[ "0.65739214", "0.64689654", "0.64437383", "0.6399398", "0.63004464", "0.6062135", "0.6022678", "0.6009603", "0.60051167", "0.59875023", "0.58600324", "0.5841984", "0.5832919", "0.57927155", "0.5784294", "0.5759561", "0.5747895", "0.57163113", "0.56912845", "0.56584936", "0.56...
0.0
-1
Set data to application context
public void setupContext(ServletContext context) { Map<String, Object> map = new HashMap<String, Object>(); map.put("CURRENT_THEME", Constants.CURRENT_THEME); map.put("LOGGED_USER", Constants.LOGGED_USER); map.put("YES", Constants.YES); map.put("NO", Constants.NO); map.put("ACTION", Constants.ACTION); map.put("ACTION_ADD", Constants.ACTION_ADD); map.put("SECURE_FIELD", Constants.SECURE_FIELD); map.put("DEBUG_MODE", Constants.isDebugMode()); map.put("SHOW_FLAT_COMMISSIONS", "false"); context.setAttribute("Constants", map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setContext(Map<String, Object> context);", "void setAppCtx(ApplicationContext appCtx);", "public void setUserContext(UserContext userContext);", "private void setUserData(){\n }", "public void setContext(Context context) {\n this.contextMain = context;\n }", "@Override\n\tpublic void se...
[ "0.675036", "0.6457679", "0.6425149", "0.6288981", "0.6246408", "0.6245115", "0.62099725", "0.6178935", "0.61604255", "0.613073", "0.61275", "0.61271", "0.61029387", "0.6063543", "0.6038909", "0.6030269", "0.60225147", "0.6002457", "0.5995526", "0.5986865", "0.5986865", "0....
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_chat2, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Override the Fragment.onAttach() method to instantiate the NoticeDialogListener
@Override public void onAttach(final Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the NoticeDialogListener so we can send events to the // host mListener = (NoticeDialogListener) activity; } catch (final ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onAttach(Context context){\n super.onAttach(context);\n Activity activity = (Activity) context;\n if (context instanceof Activity){\n activity = (Activity) context;\n }\n\n try{\n listener = (StationFragmentListener) activity;\n ...
[ "0.78009003", "0.7167224", "0.71536154", "0.7130251", "0.70350647", "0.70094967", "0.68853986", "0.6862401", "0.68517256", "0.6624119", "0.6545264", "0.65181243", "0.64765465", "0.6421755", "0.64032584", "0.6286565", "0.62842494", "0.62456185", "0.6241208", "0.62272", "0.6225...
0.6996569
6
As Tab implicitly destroys this, and the embedder is allowed to destroy this, allow destroy() to be called multiple times.
@Override public void destroy() { if (mNativeFaviconCallbackProxy == 0) { return; } mTab.removeFaviconCallbackProxy(this); try { mClient.onDestroyed(); } catch (RemoteException e) { throw new AndroidRuntimeException(e); } FaviconCallbackProxyJni.get().deleteFaviconCallbackProxy(mNativeFaviconCallbackProxy); mNativeFaviconCallbackProxy = 0; mClient = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void destroy() {\n }", "@Override\r\n\t\tpublic void destroy() {\n\t\t\t\r\n\t\t}", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n ...
[ "0.6888513", "0.67959994", "0.678001", "0.6769299", "0.6769299", "0.6769299", "0.6769299", "0.6769299", "0.6755097", "0.6755097", "0.6753193", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "...
0.0
-1
Sorts a list using Bubble Sort. What Bubble Sort does is that for every pair of elements in the list, if the first is greater than the second, it swaps them. Since in every iteration the greatest element of the list ends up in the last position the outer loop shrinks the range of indexes that need to be checked by one each iteration.
public static <T extends Comparable<? super T>> void bubbleSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = size - 1; i >= 0; i--){ for(int j = 0; j < i; j++){ if(list.get(j).compareTo(list.get(j + 1)) > 0){ swap(list, j, j + 1); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tst...
[ "0.806171", "0.79305696", "0.7777937", "0.75938386", "0.75158423", "0.7346814", "0.7328804", "0.7313081", "0.7254229", "0.7249269", "0.72053415", "0.719981", "0.71247286", "0.7111351", "0.7108883", "0.7105088", "0.7084769", "0.70533586", "0.7047797", "0.7047245", "0.70456547"...
0.75396204
4
Sorts a list using Insertion Sort. What insertion sort does is that it separates the list in two parts, the sorted part and the unsorted part. In every iteration it augments the sorted part by one, the new item in the sorted part is then swapped backwards until there are no more greater elements than it, assuring that the sorted part remains sorted. That is done until the sorted part size is the same as the list's size.
public static <T extends Comparable<? super T>> void insertionSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = 0; i < size; i++){ int sortedSideIndex = i; while(sortedSideIndex > 0 && list.get(sortedSideIndex - 1).compareTo(list.get(sortedSideIndex)) > 0){ swap(list, sortedSideIndex, sortedSideIndex - 1); sortedSideIndex--; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertionSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n\n int current = 0;\n int len = list.size();\n for (int n = 1; n < len; n++) {\n current = list.get(n);\n i...
[ "0.7810198", "0.7736323", "0.759363", "0.7489948", "0.74524397", "0.745081", "0.7372652", "0.7296179", "0.72716326", "0.72670645", "0.7229206", "0.71393", "0.7137543", "0.71320546", "0.7117249", "0.7107512", "0.7100454", "0.701271", "0.6997408", "0.6981523", "0.6967522", "0...
0.77399415
1
Sorts a list using Selection Sort. Selection Sort has two cycles. The outer one iterates over the whole list. Inside it, the current index is stored as the lowest one, then it iterates over the elements after that one, if a lower element is found, its index is then stored as the lowest one. After it gets the index of the lowest item, it then gets swapped with the one in the current index of the outer loop. When the two loops are finished, the list is sorted.
public static <T extends Comparable<? super T>> void selectionSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = 0; i < size; i++){ int lowestIndex = i; for(int j = i; j < size; j++){ if(list.get(lowestIndex).compareTo(list.get(j)) > 0){ lowestIndex = j; } } if(lowestIndex != i){ swap(list, i, lowestIndex); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void selectionSort() {\n int nextMin;\n\n for (int i = 0; i < IntList.length - 1; i++) {\n nextMin = i;\n for (int j = i + 1; j < IntList.length; j++) {\n if (IntList[j] < IntList[nextMin])\n nextMin = j;\n }\n if (n...
[ "0.7975867", "0.7555647", "0.75013226", "0.7328977", "0.7224258", "0.7172128", "0.7084391", "0.7060816", "0.70022374", "0.69581306", "0.69371444", "0.6911653", "0.6907416", "0.6861859", "0.68606734", "0.6855765", "0.68410677", "0.68237066", "0.67939556", "0.67855763", "0.6774...
0.7511797
2
Calls the recursive Quicksort with the default parameters needed
public static <T extends Comparable<? super T>> void quickSort(List<T> list){ if(list.size() > 1) quickSort(list, 0, list.size() - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the...
[ "0.6995139", "0.6880269", "0.6776992", "0.6743407", "0.67421347", "0.6726314", "0.66673005", "0.6665514", "0.6663525", "0.6631636", "0.65927076", "0.65833086", "0.65783674", "0.65737987", "0.65480644", "0.654393", "0.6524867", "0.65197724", "0.64984787", "0.6471656", "0.64670...
0.0
-1
Sorts a list using Quicksort. What Quicksort does is, first to check if the sublist has more than one element, if it has only one, that part is considered sorted. The chosen pivot is the last element in the list. If it has more than one element, it sets two ints, i and j to be equal to the first index of the sublist and the last one respectively. Then it goes into a loop that iterates while i is less or equal to j. In the loop, first it augments i by one until it reaches the index of an element that is greater than the pivot, then it decrements j until it reaches an element lesser than the pivot, after that it checks if i is not equal to j, if the condition is true, the elements in i and j are swapped and i is augmented if its different to the beginIndex variable (because without that check, i never reaches the value of the element in beginIndex if it needs to be swapped), j is decremented if its different to the finishIndex variable. Finally, when i is greater than j, if i is lesser than the last element index, it swaps the element in the finishIndex with the element in i and calls itself recursively with changed values.
private static <T extends Comparable<? super T>> void quickSort(List<T> list, int beginIndex, int finishIndex){ if(beginIndex + 1 <= finishIndex){ int i = beginIndex; int j = finishIndex; while(i <= j){ while(list.get(i).compareTo(list.get(finishIndex)) < 0 && i < finishIndex){ i++; } while(list.get(j).compareTo(list.get(finishIndex)) >= 0 && j > beginIndex){ j--; } if(i <= j) { if(i != j) swap(list, i, j); if(i != beginIndex) i++; if(j != finishIndex) j--; } } if(i < finishIndex) swap(list, i, finishIndex); quickSort(list, beginIndex, i - 1); quickSort(list, i + 1, finishIndex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i ...
[ "0.7283001", "0.70876795", "0.7071906", "0.705921", "0.6897115", "0.68930733", "0.68885237", "0.686257", "0.68429804", "0.6835734", "0.6825981", "0.68020505", "0.6792441", "0.67855954", "0.6782032", "0.67726976", "0.6726483", "0.6721188", "0.66978675", "0.66392666", "0.663412...
0.7619916
0
Calls the private mergeSort method with the default parameters needed.
public static <T extends Comparable<? super T>> void mergeSort(List<T> list){ if(list.size() > 1){ mergeSort(list, 0, (list.size()/2), list.size() - 1, (T[])new Comparable[list.size()]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private PerfectMergeSort() {}", "public MergeSort(){\r\n \r\n }", "private Mergesort() {\r\n }", "public void mergeSort() {\n this.array = mergeSort(array);\n }", "public void mergeSort(){\r\n mergeSort(mArray, new int[mArray.length], 0 , mArray.length - 1);\r\n }", "@Test(time...
[ "0.7228038", "0.6719791", "0.6644334", "0.6613423", "0.6597394", "0.6586384", "0.6522727", "0.64714915", "0.6469497", "0.6417973", "0.64107084", "0.6400262", "0.63879675", "0.6352518", "0.62890685", "0.62865174", "0.6268996", "0.62451345", "0.62441677", "0.6214703", "0.620624...
0.5776177
64
Makes the recursive Merge Sort calls and the Merge method call. First it check if the sublists that need to be ordered are of size 1. If they are, they are then merged, if they are not, it calls itself recursively. After the recursion, when its sublists are ordered, it merges them if the beginning index is lesser then the finish one, since sublists don't need to be ordered if they are of size 0.
private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){ if(begin + 1 == finish) merge(list, begin, mid, mid + 1, finish, auxiliaryArray); else{ if(begin < finish){ mergeSort(list, begin, (mid + begin)/2, mid, auxiliaryArray); mergeSort(list, mid + 1, (finish + mid)/2, finish, auxiliaryArray); merge(list, begin, mid, mid + 1, finish, auxiliaryArray); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void mergeSort(ArrayList<Integer> inputList) {\n recursiveCallCounter++;\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter);\n\n if (inputList.size() < 2) {\n System.out.println(\"\\nCurrent list length < 2\");\n System.out.print...
[ "0.7206505", "0.66950655", "0.65173924", "0.6474508", "0.6449039", "0.6432452", "0.6361544", "0.6347528", "0.63315487", "0.6300061", "0.6287681", "0.62818867", "0.6207635", "0.6206394", "0.6172332", "0.6159802", "0.61416197", "0.6121641", "0.6102874", "0.6091779", "0.60324866...
0.63904464
6
Private method used to merge two parts of a given list. For it to work, both sublists must be sorted. First it creates indexes to navigate through the sublists and one to navigate through the auxiliary array of Comparable objects. Then, it goes into a loop that iterates until one of the sublists is completely inside the auxiliary array. The loop check which of the current elements in the sublists is lesser and adds it to the auxiliary array so the elements inside it are in order. After that it adds any element that was left outside the array. Finally, it changes the values of the elements in the list so that it matches the order of the ones in the auxiliary array.
private static <T extends Comparable<? super T>> void merge(List<T> list, int firstBegin, int firstFinish, int secondBegin, int secondFinish, T[] auxiliaryArray){ int firstIndex = firstBegin; int secondIndex = secondBegin; int auxiliaryIndex = 0; while(firstIndex <= firstFinish && secondIndex <= secondFinish){ if(list.get(firstIndex).compareTo(list.get(secondIndex)) <= 0){ auxiliaryArray[auxiliaryIndex] = list.get(firstIndex); firstIndex++; }else{ auxiliaryArray[auxiliaryIndex] = list.get(secondIndex); secondIndex++; } auxiliaryIndex++; } while(firstIndex <= firstFinish){ auxiliaryArray[auxiliaryIndex] = list.get(firstIndex); firstIndex++; auxiliaryIndex++; } while(secondIndex <= secondFinish){ auxiliaryArray[auxiliaryIndex] = list.get(secondIndex); secondIndex++; auxiliaryIndex++; } auxiliaryIndex = 0; for(int i = firstBegin; i <= secondFinish; i++){ list.set(i, auxiliaryArray[auxiliaryIndex]); auxiliaryIndex++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){\n if(begin + 1 == finish)\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n else{\n if(begin < finish){\n mergeSort(list,...
[ "0.68264425", "0.6767184", "0.6742535", "0.66359454", "0.66306657", "0.6548423", "0.64574635", "0.6377535", "0.6352814", "0.63273096", "0.62961495", "0.62897664", "0.62764484", "0.6268267", "0.6261277", "0.62481475", "0.6244175", "0.6242339", "0.6242143", "0.62305975", "0.621...
0.7306727
0
Swaps the elements in the x and y indexes in the list passed as a parameter
private static <T> void swap(List<T> list, int x, int y){ T temp = list.get(x); list.set(x, list.get(y)); list.set(y, temp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void swap(List<Integer> list, int i, int j){\n int temp = list.get(i);\n list.set(i,list.get(j));\n list.set(j, temp);\n }", "public void swapAdjacentElements(int[] values)\n {\n // your work here\n\n\n\n\n }", "private static void swap(Integer[] a, int x, int y)...
[ "0.6982257", "0.68490106", "0.6783818", "0.67692024", "0.67533284", "0.6723598", "0.6686065", "0.6681535", "0.6513651", "0.6412165", "0.6399929", "0.6389672", "0.63894945", "0.63894945", "0.63833207", "0.63717014", "0.6364414", "0.636061", "0.6352174", "0.6336906", "0.6334852...
0.75193214
0
An ARD broker connection in the Instance state.
public interface ARDInstance extends Closeable { public InstanceMap getMap(); /** * Provide a subscriber interface that gets notified when the broker receives marker changes. * * @param subscriber */ public void setSubscriber(ARDInstanceSubscriber subscriber); /** * Notify the instance on ARDd that the device has moved. * * @param geoCoord The new location * @throws ARDInstanceException */ public void move(GeoCoordFine geoCoord) throws ARDInstanceException; public void close() throws IOException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void connectionEstablished() {}", "public void connect() {}", "@Override\n public boolean isConnectable() {\n return true;\n }", "@Override public String brokerAddress() { return brokerAddress; }", "private void connectToABBOE() throws IOException, IllegalArgumentsException {\n ...
[ "0.60451156", "0.5995148", "0.58643895", "0.5861701", "0.5846698", "0.5827355", "0.58213174", "0.5760253", "0.57388073", "0.57388073", "0.57180035", "0.56915045", "0.56915045", "0.56915045", "0.5658507", "0.56575453", "0.5652639", "0.5645539", "0.56217146", "0.560984", "0.560...
0.5398236
60
Provide a subscriber interface that gets notified when the broker receives marker changes.
public void setSubscriber(ARDInstanceSubscriber subscriber);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface StationMarkerListener {\n void onNewMarkers(List<StationMarker> markers);\n}", "public interface Listener{\n\t\tpublic void notify(Map<String,Serializable> datas);\n\t}", "public interface ReceiverObserver {\n\n void update(DataNotification notification);\n}", "public interface OnMyMar...
[ "0.71029466", "0.65054566", "0.6322934", "0.62900865", "0.62900597", "0.62044275", "0.6185504", "0.6147839", "0.61286306", "0.6122212", "0.60772157", "0.6062797", "0.6049129", "0.6022186", "0.6006001", "0.59923124", "0.5920763", "0.58915186", "0.5889504", "0.58022475", "0.579...
0.0
-1
Notify the instance on ARDd that the device has moved.
public void move(GeoCoordFine geoCoord) throws ARDInstanceException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onMovement() {\n showToast(\"设备移动\");\n LogUtil.e(\"move\");\n }", "protected void onMove() {\r\n }", "@Override\n\tpublic void move(Direction d) {\n\t\t\n\t}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Driving a airplane!\");\...
[ "0.6376211", "0.6100403", "0.60284567", "0.59576106", "0.5900015", "0.5894795", "0.58103377", "0.5745", "0.57341427", "0.5697587", "0.56833345", "0.56770486", "0.56414837", "0.5636741", "0.5632117", "0.5630843", "0.56220543", "0.56204593", "0.55409044", "0.55394554", "0.55381...
0.541421
41
This Interface wich has metods for work with JobSeekers on the Dao layer
public interface IDAOJobSeeker { /** * method which adds new {@link Profile} for {@link User} by incoming params * * @return {@link List} {@link Object} */ List<Object> addNewProfile(String... profileParams) throws DaoException; /** * method which removes {@link Profile} by {@link User#userId} * * @return {@link User} */ User removeProfileByUserId(int userId) throws DaoException; /** * method which update {@link Profile} by incoming profile params * * @return {@link Profile} */ Profile updateOldProfileByParams(String... profileParams) throws DaoException; /** * method which adds new {@link Resume} for {@link User} by incoming params * * @return {@link User} */ User addNewResumeByParams(String... resumeParams) throws DaoException; /** * method which delete {@link Resume} for {@link User} by {@link Resume#idUser} * * @return {@link User} */ User deleteResumeByIdUser(int idUserResume) throws DaoException; /** * method which searches {@link Vacancy} incoming by params * * @return {@link List} {@link Vacancy} */ List<Vacancy> searchVacancyByParam(String... params) throws DaoException; /** * method which searches {@link RespondVacancy} by incoming by * {@link User#userId} * * @return {@link List} {@link String} */ List<String> searchRespondVacancyByUserId(int userId) throws DaoException; /** * method which gets count all rows for tables by tableName and fild avaliable * * @return int value */ int getCountAllRowsForTable(String tableName) throws DaoException; /** * method which update {@link Vacancy} when {@link User} respond and add in * table by {@link User#userId} and {@link Vacancy#idvacancy} * * @return int value */ boolean updateVacancyWhenRespondAndAddInTable(int userId, int vacancyId) throws DaoException; /** * method which update {@link Vacancy} when {@link User} respond and delete from * table by {@link User#userId} and {@link Vacancy#idvacancy} * * @return int value */ boolean updateVacancyWhenRespondAndDeleteInTable(int userId, int vacancyId) throws DaoException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface JobMapper {\n int addJob (Jobs job);\n List<Jobs> listJob();\n int deleteJob(int jid);\n int updateJob(Jobs job);\n List<Jobs> findByName(String jname);\n Jobs selectJob(int jid);\n //出手之后兼职state的变化\n int updateJobByState(Jobs job);\n int findByState(int jobid);\n Lis...
[ "0.6550543", "0.64056754", "0.638222", "0.6264372", "0.6190887", "0.6180711", "0.6125415", "0.5972237", "0.5960622", "0.5933715", "0.5932625", "0.5914006", "0.5903251", "0.58961546", "0.5871407", "0.5845651", "0.5838413", "0.5815475", "0.58123755", "0.58038205", "0.58020455",...
0.7140357
0
method which gets count all rows for tables by tableName and fild avaliable
int getCountAllRowsForTable(String tableName) throws DaoException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getRowCount(String table) {\n return getIntFromQuery(\"SELECT COUNT(*) from \" + table, null);\n }", "int getTablesCount();", "private static int getTableCount(ISession session, String tableName) {\n int result = -1;\n ResultSet rs = null;\n try {\n String ...
[ "0.7671549", "0.76430076", "0.7530218", "0.74304396", "0.7396591", "0.7358546", "0.719564", "0.70868874", "0.69678926", "0.69536346", "0.6926337", "0.68926144", "0.68755895", "0.6847196", "0.6832651", "0.6831768", "0.67870486", "0.67870486", "0.67870486", "0.6779048", "0.6738...
0.86447835
0
Used to send reply back to client using routing hint and client socket stored in clientMap
private static void sendBytesToClient(String routingHint, byte[] bytes) throws IOException { Socket clientSocket = clientMap.get(routingHint); DataOutputStream outputStream = new DataOutputStream(clientSocket.getOutputStream()); outputStream.writeInt(bytes.length); outputStream.write(bytes); outputStream.flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void reply(Server server);", "private void sendReply(Gossip_message reply, DataOutputStream clientStream) {\n\t\ttry {\n\t\t\tSystem.out.println(\"Invio risposta: \"+reply.getJsonString());\n\t\t\tclientStream.writeUTF(reply.getJsonString());\n\t\t} catch (IOException e) {}\n\t}", "private void handleClient() ...
[ "0.6287095", "0.61883944", "0.58681005", "0.5756466", "0.5642758", "0.55003303", "0.5425889", "0.54197204", "0.54157615", "0.539301", "0.5386787", "0.5378284", "0.5373648", "0.5364226", "0.53583616", "0.5349015", "0.5313908", "0.5293643", "0.52928853", "0.52621347", "0.524789...
0.57160765
4
No arg constructor, denne constructor giver Media objectet et assetID og en dato for skabelsen af objectet.
public Media() { assetId = MediaID.generate(); created = Date.from(Instant.now()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Media() {\n\t}", "private Asset() {\r\n super(IAsset.TYPE_ID);\r\n }", "public HrCmsMedia() {\n this(\"hr_cms_media\", null);\n }", "public NewDigitalMediaObject() {\n this(DSL.name(\"new_digital_media_object\"), null);\n }", "private Media(Element media)\n\t\t{\n\t\t\tthis.m...
[ "0.7379787", "0.7005752", "0.6968712", "0.6592795", "0.6580441", "0.6433927", "0.6393248", "0.6319817", "0.6262723", "0.6232049", "0.6226993", "0.6172566", "0.614932", "0.60988504", "0.6083939", "0.6056625", "0.60528105", "0.6044647", "0.6015797", "0.59960544", "0.5971162", ...
0.7920322
0
Override object classens to string metode, med selv lavet metode.
@Override public String toString() { return "Media{" + "assetId=" + assetId + ", name='" + name + '\'' + ", created=" + created + ", fileName='" + fileName + '\'' + '}'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void setObject(String object) {\n }", "public InterrogationMeteoString() {\r\n\t\tthis(null, null, null, null, null);\r\n\t}", "@Override\n public void handleString(String s) {\n\n }", "@Override\n public Object construct(Object... args) {\n CharSequence s...
[ "0.6622901", "0.6202737", "0.5799406", "0.5796371", "0.5720083", "0.5718506", "0.5700383", "0.5679417", "0.56333494", "0.5617577", "0.5617577", "0.558096", "0.5560422", "0.55130714", "0.5501015", "0.5474555", "0.5423731", "0.541809", "0.5416613", "0.54032755", "0.5391152", ...
0.0
-1
Created by Admin on 201699.
public interface OnLoadDataListener<T> { void onSuccess(T obj); void onFailure(String msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo552...
[ "0.60707754", "0.60124326", "0.5994787", "0.5899942", "0.5883198", "0.58431774", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.57569003", "0.573543", "0.5720198", "0.5691369", "0.56516707", "0.56516707", "0.5647968", "0.56430256...
0.0
-1
TODO Autogenerated method stub
@Override protected void onListItemClick(ListView l, View v, int position, long id) { File file = new File(path.get(position)); if (file.isDirectory()) { if(file.canRead()){ getDir(path.get(position)); }else{ new AlertDialog.Builder(this) .setIcon(R.drawable.ic_launcher) .setTitle("[" + file.getName() + "] folder can't be read!") .setPositiveButton("OK", null).show(); } }else { /*new AlertDialog.Builder(this) .setIcon(R.drawable.ic_launcher) .setTitle("[" + file.getName() + "]") .setPositiveButton("OK", null).show(); */ counter ++; Mat image = Highgui.imread(file.getAbsolutePath()); this.refSetImages.add(image); Mat descriptors1 = new Mat(); MatOfKeyPoint keypoints1 = new MatOfKeyPoint(); detector.detect(image, keypoints1); descriptor.compute(image, keypoints1, descriptors1); keypoints.add(keypoints1); descriptors.add(descriptors1); if(counter ==1 ){ PreferenceManager.getInstance().setPassFilePath(file.getName()); PreferenceManager.getInstance().setPassMat(image); PreferenceManager.getInstance().setPassDescriptors(descriptors1); PreferenceManager.getInstance().setPassKeypoints(keypoints1); } else if(counter == 2){ PreferenceManager.getInstance().setPassFilePath1(file.getName()); PreferenceManager.getInstance().setPassMat1(image); PreferenceManager.getInstance().setPassDescriptors1(descriptors1); PreferenceManager.getInstance().setPassKeypoints1(keypoints1); } else if(counter == 3){ PreferenceManager.getInstance().setPassFilePath2(file.getName()); PreferenceManager.getInstance().setPassMat2(image); PreferenceManager.getInstance().setPassDescriptors2(descriptors1); PreferenceManager.getInstance().setPassKeypoints2(keypoints1); PutTheReferenceSetInPreferences put = new PutTheReferenceSetInPreferences(); put.execute(); } } }
{ "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
param 0 which is come from requestData
@Override protected String doInBackground(String... params) { String content = HttpManager.getData(params[0],params[1],params[2]); return content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestData();", "public T getRequestData();", "private void onRequestData(int tag) {\n \ttry {\n \t data = request.request();\n \t} catch(MatjiException e) {\n \t lastOccuredException = e;\n \t}\n }", "@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\n\t}", "private void on...
[ "0.635393", "0.63140625", "0.62747914", "0.62675774", "0.62371486", "0.6049323", "0.6000523", "0.5946017", "0.59371096", "0.5923521", "0.5890787", "0.58122736", "0.57939637", "0.5778041", "0.57381713", "0.5699614", "0.5699614", "0.5699614", "0.5699614", "0.56875896", "0.56852...
0.0
-1
content of dobackground pass to the dopostexcute
@Override protected void onPostExecute(String result) { myTasksList.remove(this); if (myTasksList.size()==0){ progressBar.setVisibility(View.INVISIBLE); } if (result==null){ Toast.makeText(Login.this,"Sorry Username or password doesnot match",Toast.LENGTH_LONG).show(); return; } //list of object from content //from json updateDisplay(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void enterBackground();", "public void afterBackground(OUT out) {\n\n }", "private void backgroundExecution() {\n // This moves the time consuming operation to a child thread.\n Thread thread=new Thread(null, doBackgroundThreadProcessing, \"Background\");\n thread.start();\n }...
[ "0.7111375", "0.67072487", "0.62702256", "0.62490106", "0.6175428", "0.60353327", "0.6016679", "0.60026246", "0.59887743", "0.58195907", "0.5681197", "0.56440127", "0.56204414", "0.5489005", "0.5480766", "0.5471633", "0.5446574", "0.54459715", "0.5435274", "0.5425006", "0.541...
0.0
-1
Created by Administrator on 2017/5/25.
public interface IAwardPresenter { void setBgaAdpaterAndClick(Context context,int pagepn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Ov...
[ "0.6291351", "0.61143273", "0.58851165", "0.58840513", "0.5849571", "0.5833249", "0.5821043", "0.5759452", "0.5758597", "0.5744525", "0.5744525", "0.57264096", "0.5725081", "0.5725081", "0.57208633", "0.5675805", "0.56750727", "0.5670423", "0.5668386", "0.5660013", "0.5659535...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.7904066", "0.7804976", "0.7766218", "0.7726716", "0.7631313", "0.76221544", "0.7584775", "0.7530617", "0.74878734", "0.7457033", "0.7457033", "0.74380976", "0.7421477", "0.7402898", "0.7391322", "0.7386477", "0.73788774", "0.7370012", "0.7362617", "0.73555875", "0.73451835...
0.0
-1
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int getid = item.getItemId(); if (getid == R.id.nav_home) { Intent intent1 = new Intent(this, MenuActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent1.putExtra("ID_DATA", bundleData); startActivity(intent1); Toast.makeText(this, "home", Toast.LENGTH_SHORT).show(); } else if (getid == R.id.nav_check) { Intent intent2 = new Intent(this, checkActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent2.putExtra("ID_DATA", bundleData); startActivity(intent2); Toast.makeText(this, "check", Toast.LENGTH_SHORT).show(); } else if (getid == R.id.nav_checkList) { Intent intent3 = new Intent(this, st_CheckListActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent3.putExtra("ID_DATA", bundleData); startActivity(intent3); Toast.makeText(this, "nav_checkList", Toast.LENGTH_SHORT).show(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tr...
[ "0.7882029", "0.7235578", "0.6987005", "0.69458413", "0.6917864", "0.6917864", "0.6883472", "0.6875181", "0.68681556", "0.6766498", "0.67418456", "0.67207", "0.6716157", "0.6713947", "0.6698189", "0.66980195", "0.66793925", "0.66624063", "0.66595167", "0.6646381", "0.6641224"...
0.0
-1
Represents an individual SQL datasource, created by the library.
public interface Sql extends Terminable { /** * Gets the Hikari instance backing the datasource * * @return the hikari instance */ @Nonnull HikariDataSource getHikari(); /** * Gets a connection from the datasource. * * <p>The connection should be returned once it has been used.</p> * * @return a connection */ @Nonnull Connection getConnection() throws SQLException; /** * Gets a {@link SqlStream} instance for this {@link Sql}. * * @return a instance of the stream library for this connection. */ @Nonnull SqlStream stream(); /** * Executes a database statement with no preparation. * * <p>This will be executed on an asynchronous thread.</p> * * @param statement the statement to be executed * @return a Promise of an asynchronous database execution * @see #execute(String) to perform this action synchronously */ @Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement) { return Schedulers.async().run(() -> this.execute(statement)); } /** * Executes a database statement with no preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * @param statement the statement to be executed * @see #executeAsync(String) to perform the same action asynchronously */ default void execute(@Language("MySQL") @Nonnull String statement) { this.execute(statement, stmt -> {}); } /** * Executes a database statement with preparation. * * <p>This will be executed on an asynchronous thread.</p> * * @param statement the statement to be executed * @param preparer the preparation used for this statement * @return a Promise of an asynchronous database execution * @see #executeAsync(String, SqlConsumer) to perform this action synchronously */ @Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) { return Schedulers.async().run(() -> this.execute(statement, preparer)); } /** * Executes a database statement with preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * @param statement the statement to be executed * @param preparer the preparation used for this statement * @see #executeAsync(String, SqlConsumer) to perform this action asynchronously */ void execute(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer); /** * Executes a database query with no preparation. * * <p>This will be executed on an asynchronous thread.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param handler the handler for the data returned by the query * @param <R> the returned type * @return a Promise of an asynchronous database query * @see #query(String, SqlFunction) to perform this query synchronously */ default <R> Promise<Optional<R>> queryAsync(@Language("MySQL") @Nonnull String query, @Nonnull SqlFunction<ResultSet, R> handler) { return Schedulers.async().supply(() -> this.query(query, handler)); } /** * Executes a database query with no preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param handler the handler for the data returned by the query * @param <R> the returned type * @return the results of the database query * @see #queryAsync(String, SqlFunction) to perform this query asynchronously */ default <R> Optional<R> query(@Language("MySQL") @Nonnull String query, @Nonnull SqlFunction<ResultSet, R> handler) { return this.query(query, stmt -> {}, handler); } /** * Executes a database query with preparation. * * <p>This will be executed on an asynchronous thread.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param preparer the preparation used for this statement * @param handler the handler for the data returned by the query * @param <R> the returned type * @return a Promise of an asynchronous database query * @see #query(String, SqlFunction) to perform this query synchronously */ default <R> Promise<Optional<R>> queryAsync(@Language("MySQL") @Nonnull String query, @Nonnull SqlConsumer<PreparedStatement> preparer, @Nonnull SqlFunction<ResultSet, R> handler) { return Schedulers.async().supply(() -> this.query(query, preparer, handler)); } /** * Executes a database query with preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param preparer the preparation used for this statement * @param handler the handler for the data returned by the query * @param <R> the returned type * @return the results of the database query * @see #queryAsync(String, SqlFunction) to perform this query asynchronously */ <R> Optional<R> query(@Language("MySQL") @Nonnull String query, @Nonnull SqlConsumer<PreparedStatement> preparer, @Nonnull SqlFunction<ResultSet, R> handler); /** * Executes a batched database execution. * * <p>This will be executed on an asynchronous thread.</p> * * <p>Note that proper implementations of this method should determine * if the provided {@link BatchBuilder} is actually worth of being a * batched statement. For instance, a BatchBuilder with only one * handler can safely be referred to {@link #executeAsync(String, SqlConsumer)}</p> * * @param builder the builder to be used. * @return a Promise of an asynchronous batched database execution * @see #executeBatch(BatchBuilder) to perform this action synchronously */ default Promise<Void> executeBatchAsync(@Nonnull BatchBuilder builder) { return Schedulers.async().run(() -> this.executeBatch(builder)); } /** * Executes a batched database execution. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>Note that proper implementations of this method should determine * if the provided {@link BatchBuilder} is actually worth of being a * batched statement. For instance, a BatchBuilder with only one * handler can safely be referred to {@link #execute(String, SqlConsumer)}</p> * * @param builder the builder to be used. * @see #executeBatchAsync(BatchBuilder) to perform this action asynchronously */ void executeBatch(@Nonnull BatchBuilder builder); /** * Gets a {@link BatchBuilder} for the provided statement. * * @param statement the statement to prepare for batching. * @return a BatchBuilder */ BatchBuilder batch(@Language("MySQL") @Nonnull String statement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDatasource()\r\n\t{\r\n\t\treturn _dataSource;\r\n\t}", "protected abstract String getDatasourceName();", "public DataSource getDatasource() {\n return datasource;\n }", "public void setDatasource(DataSource datasource) {\n this.datasource = datasource;\n }", "public St...
[ "0.67589706", "0.66981256", "0.6506671", "0.64805526", "0.63838446", "0.6368361", "0.63654923", "0.6311554", "0.62660617", "0.6191819", "0.6165955", "0.61528814", "0.6138633", "0.61375433", "0.61221355", "0.6110213", "0.6109384", "0.60990703", "0.608725", "0.60788363", "0.604...
0.0
-1
Gets the Hikari instance backing the datasource
@Nonnull HikariDataSource getHikari();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Connection getHikariConnection() {\n ConnectionPool connectionPool = new ConnectionPool();\n connectionPool.getResource();\n connectionPool.getConfig();\n try {\n return dataSource.getConnection();\n } catch (SQLException exception) {\n excepti...
[ "0.8010664", "0.66041243", "0.6461621", "0.6443032", "0.6439417", "0.6307465", "0.6306158", "0.6262977", "0.61677676", "0.6021021", "0.58476275", "0.58409375", "0.57778037", "0.5678278", "0.5667149", "0.564689", "0.56366676", "0.56280386", "0.5611191", "0.5569303", "0.5531311...
0.8476138
0
Gets a connection from the datasource. The connection should be returned once it has been used.
@Nonnull Connection getConnection() throws SQLException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "private synchronized Connection getConnection() throws SQLException {\n return datasource....
[ "0.8099758", "0.7863434", "0.7770543", "0.7745346", "0.76382536", "0.75903976", "0.75170267", "0.7468186", "0.74631286", "0.74435204", "0.73703825", "0.7340839", "0.73180073", "0.72770137", "0.7271528", "0.7230587", "0.72124654", "0.71825767", "0.7171418", "0.7159717", "0.714...
0.67050344
76
Executes a database statement with no preparation. This will be executed on an asynchronous thread.
@Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement) { return Schedulers.async().run(() -> this.execute(statement)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DBCursor execute();", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) {\n return Schedulers.async().run(() -> this.execute(statement, preparer));\n }", "private void executeQuery() {\n }", "public...
[ "0.6336187", "0.6241967", "0.6177818", "0.61180425", "0.60848653", "0.6041111", "0.6033396", "0.60024965", "0.59401983", "0.5886985", "0.5879832", "0.5841366", "0.5813763", "0.5812017", "0.5800251", "0.575419", "0.575329", "0.5750248", "0.5740996", "0.57149786", "0.5700528", ...
0.6814547
0
Executes a database statement with no preparation. This will be executed on whichever thread it's called from.
default void execute(@Language("MySQL") @Nonnull String statement) { this.execute(statement, stmt -> {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DBCursor execute();", "public void prepareExecuteNoSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteNoSelect();\n }", "public void execute() throws SQLException {\n\t\tif (this.ds == null)...
[ "0.63538224", "0.6266484", "0.62355345", "0.6188492", "0.6165908", "0.61642873", "0.6046777", "0.5992281", "0.59618574", "0.59596956", "0.5950604", "0.5901076", "0.5856395", "0.58480567", "0.5839253", "0.5828735", "0.58275634", "0.5781085", "0.5779042", "0.57701564", "0.57686...
0.5892974
12
Executes a database statement with preparation. This will be executed on an asynchronous thread.
@Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) { return Schedulers.async().run(() -> this.execute(statement, preparer)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n...
[ "0.63772297", "0.6136827", "0.603592", "0.59520507", "0.59483355", "0.5905285", "0.5880579", "0.58676404", "0.58454466", "0.5818644", "0.5666565", "0.56395674", "0.5608095", "0.5568182", "0.5548164", "0.55312496", "0.5528476", "0.5522674", "0.55141383", "0.54966813", "0.54844...
0.64991415
0
Executes a database statement with preparation. This will be executed on whichever thread it's called from.
void execute(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n...
[ "0.6443434", "0.6140801", "0.612386", "0.6055407", "0.59995645", "0.59091574", "0.58953637", "0.5895115", "0.5893136", "0.58891183", "0.5861905", "0.58594704", "0.5843973", "0.5824171", "0.58034223", "0.5789722", "0.577119", "0.57204205", "0.56904614", "0.56816334", "0.566953...
0.58259594
13
Created by gorkemgok on 21/05/16.
public interface BackTestService { BackTestResult doSimulationBackTest (String code, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; BackTestResult doBackTest(String code, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; BackTestResult doBackTest(SignalGenerator signalGenerator, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; boolean doBackTestAndSave(SignalGenerator signalGenerator, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException;; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public fina...
[ "0.60570574", "0.60255027", "0.59288657", "0.58927214", "0.58647037", "0.58647037", "0.58416694", "0.5821806", "0.5788463", "0.5786141", "0.5783129", "0.5771687", "0.57629", "0.5743055", "0.57429874", "0.57315326", "0.57315326", "0.57315326", "0.57315326", "0.57315326", "0.57...
0.0
-1
adds another message to the send queue for sending when channel is ready, notifies parent torrent if there are enqueued blocks that could be unlocked, first message is at index [0] See class implementation comments for queuebuffer processing details.
protected void enqueue(StdPeerMessage message) { // if (DEBUG) { // if (message.type == StdPeerMessage.REQUEST) { // System.out.println(System.nanoTime() + " [stdpc] enqueue: req " + message.index + " " + (message.begin >> 14)); // } else { // System.out.println("[stdpc] enqueue: " + message.type); // } // } if (message.type == StdPeerMessage.CHOKE) { // remove reply messages with piece (block) data // from the send queue (due to spec) for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.PIECE) { sendQueue.remove(i); TorrentStorage.Block block = (TorrentStorage.Block) message.params; block.release(); pmCache.release(pm); } } // set choke status choke = true; // send choke asap sendQueue.add(0, message); } else if (message.type == StdPeerMessage.CANCEL) { // remove the linked request if it's still in the queue for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if ((pm.type == StdPeerMessage.REQUEST) && (pm.index == message.index) && (pm.begin == message.begin) && (pm.length == message.length)) // this check is redundant as length is fixed { sendQueue.remove(i); pmCache.release(pm); // don't really enqueue CANCEL as the linked request // has been found and removed pmCache.release(message); return; } } // send asap sendQueue.add(0, message); } else { if (message.type == StdPeerMessage.INTERESTED) { interested = true; } else if (message.type == StdPeerMessage.NOT_INTERESTED) { interested = false; } else if (message.type == StdPeerMessage.UNCHOKE) { choke = false; } // enqueue message sendQueue.add(message); } // sendQueue.forEach(pm -> System.out.println(" -x> " + System.identityHashCode(pm) + pm.type + " ," + pm.index +"," + pm.begin +"," + pm.length) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeNextMessageInQueue() {\n // This should not happen in practice since this method is private and should only be called\n // for a non-empty queue.\n if (mMessageQueue.isEmpty()) {\n Log.e(TAG, \"Call to write next message in queue, but the message queue is empty.\")...
[ "0.6628951", "0.6176206", "0.6124395", "0.6059437", "0.6057704", "0.5958921", "0.5946561", "0.5914167", "0.58844894", "0.5864838", "0.58373576", "0.58129585", "0.574333", "0.57304054", "0.56753904", "0.5638795", "0.5608065", "0.5601403", "0.5600865", "0.5585989", "0.5583834",...
0.64876014
1
NOTE: method is for internal use and debug only, doesn't use any synchronization
int getActiveBlockRequestsNumber() { return blockRequests.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte...
[ "0.55562544", "0.5524281", "0.5422254", "0.5408466", "0.53997767", "0.53997767", "0.5378079", "0.5330925", "0.5330925", "0.53158784", "0.5268941", "0.5230672", "0.5230672", "0.52290064", "0.52268237", "0.5221294", "0.52173245", "0.5188653", "0.51828784", "0.5172161", "0.51593...
0.0
-1
NOTE: method is for internal use and debug only, doesn't use any synchronization
int getEnqueuedBlockRequestsNumber() { int count = 0; for (StdPeerMessage pm : sendQueue) { if (pm.type == StdPeerMessage.REQUEST) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte...
[ "0.55547273", "0.5521987", "0.5422122", "0.540735", "0.53982013", "0.53982013", "0.5376895", "0.53289247", "0.53289247", "0.5315107", "0.52663845", "0.5229126", "0.5229126", "0.52274525", "0.52255684", "0.52196586", "0.5215247", "0.5187267", "0.5181621", "0.5170449", "0.51570...
0.0
-1
integration method for parent torrent, allows to make back call with parameters of blocks that should be downloaded by this connection NOTE: not very OOP, but remove extra objects' creation CALLED by parent TORRENT only
@Override void enqueueBlockRequest(int index, int position, int length) { enqueue(pmCache.request(index, position, length)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);", "@Override\n public void downloadBlockChain() {\n startBlockChainDownload(fastcoinWalletDownloadListener);\n }", "public interface BlockDownloader {\n\n /**\n * send the request and check that we received the correc...
[ "0.6128051", "0.60799235", "0.5859956", "0.57879424", "0.5720575", "0.5484154", "0.5424303", "0.53937846", "0.53516495", "0.5329091", "0.53173816", "0.53146386", "0.53041977", "0.52944255", "0.5265086", "0.5258553", "0.52406883", "0.52375907", "0.52247465", "0.5223008", "0.52...
0.0
-1
integration method for parent torrent, allows to make back calls with data loaded from a storage and ready to be sent to a peer CALLED by parent torrent only
@Override void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params) { // if (DEBUG) System.out.println("[stdpc] enqueuePiece:" + index + "," + position + "," + length + " buf:" + buffer.remaining()); // sendQueue.forEach(pm -> // System.out.println(" -s> " + System.identityHashCode(pm) + " " +pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length) // ); // peerBlockRequests.forEach(pm -> { // System.out.println(" -p> " + pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length); // }); boolean found = false; // check for the active linked peer request and remove it for (int i = 0; i < peerBlockRequests.size(); i++) { StdPeerMessage pm = peerBlockRequests.get(i); if ((pm.index == index) && (pm.begin == position) && (pm.length == length)) { peerBlockRequests.remove(i); pmCache.release(pm); found = true; break; } } if (!found && DEBUG) { if (DEBUG) System.out.println("[stdpc] pBR not found"); } enqueue(pmCache.piece(index, position, length, buffer, params)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Transport {\n\n /**\n * This method returns id of the current transport\n * @return\n */\n String id();\n\n /**\n * This methos returns Id of the upstream node\n * @return\n */\n String getUpstreamId();\n\n /**\n * This method returns random\n *\n ...
[ "0.57097095", "0.5509383", "0.5482557", "0.54482615", "0.54289705", "0.5399499", "0.5377815", "0.5369875", "0.5320341", "0.52942365", "0.5281177", "0.52790475", "0.52763224", "0.52184266", "0.5214351", "0.5188049", "0.5169527", "0.51552474", "0.5155052", "0.514456", "0.514310...
0.0
-1
checks collection of block requests being active for timeout and cancels them to allow Torrent to resend them later, must be called periodically
protected void cancelTimedOutBlockRequests() { long now = System.currentTimeMillis(); for (int i = blockRequests.size() - 1; 0 <= i; i--) { StdPeerMessage pm = blockRequests.get(i); if (pm.timestamp + DOWNLOAD_QUEUE_REQUESTS_TIMEOUT < now) { System.out.println("-Xo " + pm.index + " " + (pm.begin >> 14)); blockRequests.remove(i); torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkRequests()\n\t{\n\t\t// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second\n\t\t// now as the existing 0.1 second is crazy given we're checking for events that occur\n\t\t// at 60+ second intervals\n\n\t\tif ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ){\n...
[ "0.67068845", "0.664599", "0.63177395", "0.6123126", "0.5913352", "0.5763617", "0.5737318", "0.5723898", "0.57087123", "0.5703962", "0.5681989", "0.56729704", "0.563065", "0.5614026", "0.5582999", "0.55037576", "0.5497935", "0.54781383", "0.5451209", "0.54431397", "0.54346097...
0.7972276
0
reset error flag if we reuse the connection
@Override protected void connectionEstablished() { peer.resetConnectionClosed(); // send our handshake directly as it doesn't fit into peer message // and there is always space in send buffer on new connection //enqueue(pmCache.handshake(torrent.getTorrentId(), torrent.getClientId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void error() {\n this.error = true;\n this.clients[0].error();\n this.clients[1].error();\n }", "@Override\n \tpublic void reconnectionFailed(Exception arg0) {\n \t}", "public void resetConnection() {\n\t\ttry {\n\t\t\tconnection.close();\n\t\t\tDriverManager.registerDriver (new...
[ "0.6903906", "0.6502599", "0.6393532", "0.63781613", "0.6205838", "0.61189324", "0.6099259", "0.5991837", "0.5948254", "0.58768636", "0.5820772", "0.58097684", "0.57958144", "0.5785618", "0.5785375", "0.5740341", "0.5683237", "0.5673974", "0.56631565", "0.5660167", "0.5654276...
0.0
-1
the 1st message must be bitfield, but only in case if we have at least one block
@Override protected void handshakeCompleted() { if (0 < torrent.pieces.cardinality()) { enqueue(pmCache.bitfield((int)torrent.metainfo.pieces, torrent.pieces)); } /* todo if (client.node != null) { pc.enqueue(StdPeerMessage.port(client.node.port)); } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isThisType(byte[] block) {\n return block.length >= 8 && block[0] == 0 && block[1] == 0 &&\n block[2] == -1 && block[3] == -1 && block[4] == 105 &&\n block[5] == 109 && block[6] == 112 && block[7] == 114;\n }", "public MessageBitSection next();", "@Test\n void testFirstBlock...
[ "0.5915237", "0.57834727", "0.5782373", "0.57256585", "0.5718095", "0.5716901", "0.57113737", "0.5670141", "0.5670141", "0.5645189", "0.56437665", "0.5640291", "0.5629207", "0.5601698", "0.5577658", "0.5565123", "0.55538213", "0.547194", "0.54683846", "0.5415004", "0.54126793...
0.0
-1
notify parent torrent to cancel requests that are enqueued and that have been already sent to the remote peer
@Override protected void connectionClosed(Peer.CloseReason reason) { Stream.concat(sendQueue.stream(), blockRequests.stream()) .filter(pm -> pm.type == StdPeerMessage.REQUEST) .forEach(pm -> { torrent.cancelBlockRequest(pm.index, pm.begin); }); // release messages sendQueue.forEach( pmCache::release); sendQueue.clear(); // and active requests blockRequests.forEach( pmCache::release); blockRequests.clear(); // peerRequests peerBlockRequests.forEach( pmCache::release); peerBlockRequests.clear(); peer.setConnectionClosed(reason); // incoming connections could be not linked yet if (torrent != null) { torrent.onPeerDisconnect(this); } // todo: release caches via connectionFactory }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void sendCancel(Status reason);", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer...
[ "0.6575069", "0.6381271", "0.6377557", "0.63530564", "0.6211348", "0.6128806", "0.6060893", "0.6015263", "0.5996009", "0.59657454", "0.5950067", "0.59305996", "0.5915255", "0.5857902", "0.58420086", "0.5830937", "0.5816812", "0.57988787", "0.5788697", "0.5783756", "0.57610714...
0.55535775
53
called on KEEP ALIVE messages
void onKeepAlive() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendKeepAlive() {\n\t\tlong now = new java.util.Date().getTime() / 1000;\n\t\tif (now - lastKeepAlive > properties.getInt(\"keepAliveInterval\")) {\n\t\t\tfsmTeacher.handleAction(\"tap%\" + properties.get(\"keepAliveX\") + \"#\" + properties.get(\"keepAliveY\"));\n\t\t\tlastKeepAlive = now;\n\t\t\tSys...
[ "0.67906904", "0.62909734", "0.60885125", "0.6027786", "0.59991956", "0.5981873", "0.593522", "0.5915601", "0.5817259", "0.57589895", "0.5734483", "0.5721786", "0.57187575", "0.567467", "0.5662714", "0.56500465", "0.56443757", "0.563675", "0.5624003", "0.5622359", "0.56213754...
0.68736553
0
called on "request" message receive, simply notifies parent torrent to find data and enqueue it for sending
void onRequest(int index, int begin, int length) { if (DEBUG) System.out.println("[stdpc] onRequest:" + index + "," + begin + "," + length); // sendQueue.forEach(pm -> System.out.println("[stdpc] onRequest -b>" + System.identityHashCode(pm) + // " " +pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length) ); // validate common block parameters boolean correct = torrent.validateBlock(index, begin, length); if (!correct) { // just ignore such requests statistics.blocksRequestedIncorrect++; return; } // this could be moved to send(), but doesn't really matter statistics.blocksSent++; // track active requests StdPeerMessage pm = pmCache.request(index, begin, length); peerBlockRequests.add(pm); // notify torrent to read and enqueue block torrent.onRequest(this, index, begin, length); // sendQueue.forEach(x -> System.out.println("[stdpc] onRequest -a<" + System.identityHashCode(x) + // " " +x.type + " ," + x.index +"," + x.begin + "," + x.length) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// ...
[ "0.63914895", "0.62539506", "0.6002979", "0.58689535", "0.5827305", "0.57492316", "0.57449186", "0.57287896", "0.5727841", "0.56802833", "0.56395286", "0.555093", "0.55145234", "0.55025417", "0.54914415", "0.544639", "0.544174", "0.5432624", "0.5430453", "0.5399774", "0.53528...
0.6180755
2
called on "choke" and "unchoke" messages receive, notifies parent torrent about cancelled requests if enqueued or already sent at the moment and message is "choke"
void onChoke(boolean state) { peerChoke = state; //if (DEBUG) System.out.println(peer.address + " onChoke: " + state); if (peerChoke) { // remove all enqueued requests as they will be dropped by the remote peer for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.REQUEST) { sendQueue.remove(i); // notify torrent about cancelled request torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } } // it's possible that we have requests that were already sent to external peer, // notify torrent - they are cancelled too [who knows, maybe data will arrive] for (int i = 0; i < blockRequests.size(); i++) { StdPeerMessage pm = blockRequests.get(i); torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } blockRequests.clear(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void msgAtCook() {\n\t\t\n\t}", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message...
[ "0.622774", "0.6220891", "0.6100461", "0.5562551", "0.55527556", "0.55431896", "0.54606205", "0.5453156", "0.53058493", "0.5244387", "0.52004415", "0.5192758", "0.510799", "0.50959396", "0.5057214", "0.5054918", "0.504568", "0.5040048", "0.50270283", "0.5021875", "0.50200784"...
0.70227873
0
called on "cancel" message receive, removes correspondent enqueued message from the send queue if exists and notifies parent torrent to unlock the linked block of data (if buffered somehow)
void onCancel(int index, int begin, int length) { // validate common block parameters boolean correct = torrent.validateBlock(index, begin, length); if (!correct) { close(Peer.CloseReason.PROTOCOL_ERROR); return; } // check if are processing this request right now for (int i = 0; i < peerBlockRequests.size(); i++) { StdPeerMessage pm = peerBlockRequests.get(i); if ((pm.index == index) && (pm.begin == begin) && (pm.length == length)) { peerBlockRequests.remove(i); pmCache.release(pm); break; } } // check if response has been enqueued, // could be skipped if found in pBR for (int i = 0; i < sendQueue.size(); i++) { StdPeerMessage pm = sendQueue.get(i); if ((pm.type == StdPeerMessage.PIECE) && (pm.index == index) && (pm.begin == begin) && (pm.length == length)) { sendQueue.remove(i); // let storage to unlock block of data // and return it into cache of blocks TorrentStorage.Block block = (TorrentStorage.Block) pm.params; block.release(); pmCache.release(pm); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// ...
[ "0.6308832", "0.61708236", "0.6015521", "0.5877095", "0.5874131", "0.58591956", "0.5842569", "0.5821285", "0.579841", "0.5770106", "0.57081276", "0.56721467", "0.567101", "0.56706077", "0.56434065", "0.56193537", "0.5560698", "0.5554416", "0.55373776", "0.5489388", "0.5489282...
0.6147407
2
called on "interested" and "not_interested" messages receive, notifies parent torrent to unlock blocks of data enqueued for sending (if buffered somehow)
void onInterested(boolean state) { peerInterested = state; if (!peerInterested) { // remove all piece if enqueued, // most likely will not happen for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.PIECE) { sendQueue.remove(i); TorrentStorage.Block block = (TorrentStorage.Block) pm.params; block.release(); pmCache.release(pm); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void notifyBlockComplete(MessageSnapshot snapshot);", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "public void bufferedAmountChange() {\n // Webrtc.org fires the bufferedAmountChange event ...
[ "0.6145992", "0.5997915", "0.5944188", "0.5824153", "0.56173486", "0.56109035", "0.5610606", "0.5528223", "0.5521151", "0.54673123", "0.5466463", "0.5464651", "0.5456202", "0.54548746", "0.5431519", "0.53670305", "0.536347", "0.53591603", "0.53545535", "0.5354191", "0.5322094...
0.6573353
0
called on "have" message receive, marks correspondent piece as available on peer side
void onHave(int index) { // in correct piece we must have correct block #0 boolean correct = torrent.validateBlock(index, 0, 0); if (!correct) { close(Peer.CloseReason.PROTOCOL_ERROR); return; } peerPieces.set(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onInterested(boolean state)\n {\n peerInterested = state;\n\n if (!peerInterested) {\n // remove all piece if enqueued,\n // most likely will not happen\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\...
[ "0.6780596", "0.63494164", "0.613559", "0.6089853", "0.608944", "0.6060763", "0.60579294", "0.6053493", "0.59437156", "0.5901296", "0.5886159", "0.5873734", "0.5811176", "0.5806421", "0.5764521", "0.5754297", "0.5736688", "0.5717238", "0.56821346", "0.56518567", "0.5642432", ...
0.6056814
7
called on "BITFIELD" message receive, marks correspondent pieces as available on peer side
void onBitField(BitSet mask) { // BITFIELD only allowed once if (bitfieldReceived) { if (DEBUG) System.out.println(peer.address + " second bitfield message received, dropping the connection"); close(Peer.CloseReason.PROTOCOL_ERROR); return; } peerPieces.clear(); peerPieces.or(mask); // update linked peer with completion status if (peerPieces.cardinality() == torrent.getMetainfo().pieces) { peer.setCompleted(true); } bitfieldReceived = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendBitfield() throws IOException{\r\n\t\tbyte[]bitfield=new byte[this.torrentClient.getNumberOfPieces()];\r\n\t\tFragmentsInformation fi=this.torrentClient.getFragmentsInformation();\r\n\t\t//IF the fragment information is null or the current fragment is -1 it means that I have all the pieces\r\n\t\t...
[ "0.6653257", "0.59555525", "0.5892576", "0.5857535", "0.58436155", "0.58299524", "0.5637486", "0.5557491", "0.5484611", "0.5246936", "0.5228213", "0.5213086", "0.52128536", "0.52044016", "0.51783067", "0.5101388", "0.50985545", "0.50548315", "0.5040257", "0.5040173", "0.50349...
0.6835894
0
dumps active connections of the torrent to stdout
@Override protected void dump(Formatter formatter) { PeerConnectionStatistics s = rawStatistics; double drate = s.download.average(4); drate /= 1024*1024; double urate = s.upload.average(4); urate /= 1024*1024; formatter.format("%24s %2S%2S %1c%1c %1c%1c %5.1f %3d %6d | %5.1f %2d %6d %5d %s\n", peer.address, connected ? "+" : "-", handshaked ? "+" : "-", choke ? 'c' : '-', interested ? 'i' : '-', peerChoke ? 'c' : '-', peerInterested ? 'i' : '-', drate, blockRequests.size(), statistics.blocksReceived, urate, 0, statistics.blocksSent, getPeerCompletionPercent(), StdPeerProtocol.extractClientNameFromId(peer.peerId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void viewConnections(){\n\t\tfor(int i=0; i<Server.clients.size();i++){\n\t\t\tServerThread cliente = Server.clients.get(i);\n\t\t\tlogger.logdate(cliente.getConnection().getInetAddress().getHostName());\n\t\t}\n\t}", "public void getConnections() throws IOException {\n\t\tString fileName = \"\";\n...
[ "0.5652704", "0.54389685", "0.529712", "0.5282848", "0.5080682", "0.5075995", "0.50708663", "0.5044533", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.49673006", "0.49630198", "0.49619353", "0.49331883", "0.49...
0.48441774
27
Loads the widget prefs from the shared preferences
public boolean load(Context context, int widgetId) { String key; SharedPreferences prefs; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); mTargetPath = prefs.getString(key, ""); key = WIDGET_READ_ONLY + String.valueOf(widgetId); mReadOnly = prefs.getBoolean(key, false); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); return prefs.getBoolean(key, false); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadPreferences() {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n boolean lm = sp.getBoolean(getString(R.string.live_match), true);\n boolean ls = sp.getBoolean(getString(R.string.live_score), true);\n\n if(lm) live_match.se...
[ "0.73684007", "0.736817", "0.7061827", "0.6961029", "0.67498016", "0.67213595", "0.6573086", "0.6548011", "0.65413", "0.6437378", "0.64280754", "0.6420338", "0.64113796", "0.6399795", "0.6368771", "0.6329206", "0.6327203", "0.6315409", "0.630822", "0.62860703", "0.625388", ...
0.55711865
93
Store this widget prefs in the shared preferences
public void store(Context context, int widgetId) { String key; SharedPreferences prefs; Editor edit; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { edit = prefs.edit(); if (edit != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); edit.putString(key, mTargetPath); key = WIDGET_READ_ONLY + String.valueOf(widgetId); edit.putBoolean(key, mReadOnly); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); edit.putBoolean(key, true); edit.commit(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "private void savePrefsData() {\n SharedPreferen...
[ "0.7046309", "0.6699881", "0.6678338", "0.6532266", "0.6484428", "0.6481784", "0.64730346", "0.6437935", "0.6415522", "0.63909644", "0.63857883", "0.63854", "0.6359252", "0.6353194", "0.6350589", "0.6341851", "0.6300409", "0.62966967", "0.6291701", "0.62570256", "0.62474173",...
0.62134635
24
Delete the data associated with a widget ID
public static void delete(Context context, int widgetId) { String key; SharedPreferences prefs; Editor edit; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { edit = prefs.edit(); if (edit != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); edit.remove(key); key = WIDGET_READ_ONLY + String.valueOf(widgetId); edit.remove(key); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); edit.remove(key); edit.commit(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteEditorData(int id){\n dbConnection();\n try{\n stmt = con.prepareStatement(\"DELETE FROM editorData WHERE id = ?\");\n stmt.setInt(1,id);\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n f...
[ "0.6557464", "0.62091684", "0.6180335", "0.618006", "0.6171357", "0.6119557", "0.60859126", "0.6059947", "0.60588664", "0.6054447", "0.6050553", "0.6050553", "0.6050553", "0.6050553", "0.6050553", "0.6050272", "0.6015805", "0.59959954", "0.5993022", "0.59801847", "0.5974339",...
0.7347986
0
/ it's not necessary that Neo4j community edition is in operation
@Test void sampleTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$._links.some").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String args[]) {\r\n\r\n// A driver is used to connect to a Neo4j server. It provides sessions that are used to execute statements and retrieve results.\r\n// If no port is provided in the URL, the default port 7687 is used\r\n\r\n Driver driver = GraphDatabase.driver(\...
[ "0.601263", "0.60071635", "0.58686864", "0.57507795", "0.5747997", "0.5721635", "0.5698241", "0.5682744", "0.5636338", "0.5632008", "0.5568618", "0.5523904", "0.54954326", "0.54770124", "0.54557323", "0.54355127", "0.5423265", "0.5412831", "0.5406452", "0.53863895", "0.538549...
0.0
-1
/ it's necessary that Neo4j community edition is correctly installed and in operation
@Test void existTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/some")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$._embedded.some").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\tpublic void setUp() throws Exception {\n\t\tClass.forName(\"org.neo4j.jdbc.Driver\");\n\t\t\n\t\t// Connect\n\t\tProperties info = new Properties();\n\t\tinfo.put(\"user\", \"neo4j\");\n\t\tinfo.put(\"password\", \"123\");\n//\t\tfinal String connectionStr = \"jdbc:neo4j://192.168.1.22:7474/\";\n\t\tfin...
[ "0.6494707", "0.6229821", "0.6130768", "0.57852215", "0.56801534", "0.5679467", "0.55506104", "0.5464223", "0.54079473", "0.5375849", "0.53356475", "0.5289153", "0.5282553", "0.5253495", "0.52218306", "0.52176136", "0.52135825", "0.5211182", "0.5190236", "0.51570696", "0.5141...
0.0
-1
from here on, it's necessary that Neo4j community edition is correctly installed, in operation and with some stored data
@Test void retrieveExistTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/some/0")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$.code").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\tpublic void setUp() throws Exception {\n\t\tClass.forName(\"org.neo4j.jdbc.Driver\");\n\t\t\n\t\t// Connect\n\t\tProperties info = new Properties();\n\t\tinfo.put(\"user\", \"neo4j\");\n\t\tinfo.put(\"password\", \"123\");\n//\t\tfinal String connectionStr = \"jdbc:neo4j://192.168.1.22:7474/\";\n\t\tfin...
[ "0.60584706", "0.6036614", "0.59780973", "0.5773362", "0.5682861", "0.5584441", "0.55396503", "0.54791075", "0.5443738", "0.54383373", "0.5416355", "0.5410186", "0.5400271", "0.5385222", "0.53244805", "0.52997", "0.5290814", "0.5240903", "0.52181554", "0.52128536", "0.5207200...
0.0
-1