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
Constructs an CalculatorException with no detail message.
public CalculatorOperandException() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CalculatorOperandException(String message) {\n\t\tsuper(message);\n\t}", "public ArithmeticaException (String message) {\n super(message);\n }", "public CalcLayoutException(String message) {\n super(message);\n }", "public negativeNumberException() {\r\n\t \t \r\n\t }", ...
[ "0.6978673", "0.6510127", "0.6461127", "0.64264697", "0.6417619", "0.6389104", "0.63050425", "0.6273044", "0.62705755", "0.62149733", "0.61894447", "0.61644876", "0.6114933", "0.60821605", "0.6082081", "0.6064062", "0.6057127", "0.60465753", "0.599302", "0.59856963", "0.59809...
0.78679216
0
Constructs an CalculatorException with the specified detail message.
public CalculatorOperandException(String message) { super(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CalculatorOperandException() {\n\t}", "public ArithmeticaException (String message) {\n super(message);\n }", "public CalcLayoutException(String message) {\n super(message);\n }", "public CalcLayoutException(String message) {\n\t\tsuper(message);\n\t}", "public OperatorException(...
[ "0.7032471", "0.66580975", "0.66472864", "0.6530536", "0.64959866", "0.6403699", "0.6336265", "0.6225703", "0.6196085", "0.61947185", "0.61113375", "0.6104229", "0.60930604", "0.6044162", "0.60124016", "0.5983326", "0.5980588", "0.5937598", "0.592096", "0.58829397", "0.588192...
0.7128329
0
Below is the intermediate operation which will be performed when the elements of stream will be consumed.
private static void predicate(List<Product> productsList) { Stream<Product> peek = productsList.stream().peek(System.out::println); //consume boolean allMatch = peek.allMatch(x -> x.price > 24000); System.out.println("All items price is more than 24000?: " + allMatch); //consume boolean anyMatch = productsList.stream().anyMatch(x -> x.price < 25000); System.out.println("Any item is less than 25000?: " + anyMatch); //process Stream<Product> filteredStream = productsList.stream().filter(p -> p.price > 28000); filteredStream.forEach(z -> { System.out.println("Item: " + z.name + " Price: " + z.price); }); //productsList.stream(). }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Stream<E> streamBlockwise();", "@Test\r\n void limitMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().limit(2);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));...
[ "0.61782956", "0.6110588", "0.58758533", "0.579057", "0.5693825", "0.56257135", "0.5582076", "0.54878294", "0.5462625", "0.5436184", "0.5430455", "0.5404146", "0.5395112", "0.5393365", "0.53891236", "0.5380227", "0.53688437", "0.53593373", "0.53497887", "0.53474087", "0.53324...
0.0
-1
get all possible extensions to the given stem. the resulting linestrings only exclude the extension, not the stem portion. Implementation note: this function calls "getAllExtendedLines", which returns linestrings with stem+extension. Then this function trims off the stems.
private List<LineString> getAllLineExtensions(LineString stem, boolean validOnly, int maxExtensionLen) throws IOException { List<LineString> stemsPlusExtensions = getAllExtendedLines(stem, validOnly, maxExtensionLen); List<LineString> onlyExtensions = new ArrayList<LineString>(); for(LineString s : stemsPlusExtensions) { LineString ext = SpatialUtils.slice(s, stem.getNumPoints()-1, s.getNumPoints()-1); onlyExtensions.add(ext); } return onlyExtensions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<LineString> getAllExtendedLines(LineString stem, boolean validOnly, int maxExtensionLen) throws IOException {\n\t\t\n\t\tif (maxExtensionLen < 1) {\n\t\t\tthrow new IllegalArgumentException(\"'maxExtensionLen' must be >= 1\");\n\t\t}\n\t\t\n\t\tList<Coordinate> stemCoords = SpatialUtils.toCoordinateLi...
[ "0.7607046", "0.56794125", "0.55987823", "0.54873407", "0.5482406", "0.5450278", "0.5430399", "0.5384712", "0.5337951", "0.5335414", "0.5322008", "0.529269", "0.5251611", "0.52449596", "0.5187463", "0.5172639", "0.5145883", "0.5130552", "0.51204616", "0.50968736", "0.5085541"...
0.76617306
0
get all possible lines which start with the given stem and are extended by up to 'maxExtensionLen'. (the results are linestrings which include the stem and the extension). Implementation note: although we're really more interested in linestrings representing extensions only (not stem+extension), it's necessary to include the stem during the processing so we can confirm there are no selfintersections. The stems can be trimmed off by a separate function if necessary. see "getAllLineExtensions"
private List<LineString> getAllExtendedLines(LineString stem, boolean validOnly, int maxExtensionLen) throws IOException { if (maxExtensionLen < 1) { throw new IllegalArgumentException("'maxExtensionLen' must be >= 1"); } List<Coordinate> stemCoords = SpatialUtils.toCoordinateList(stem.getCoordinates()); Coordinate leadingCoord = stem.getCoordinateN(stem.getNumPoints()-1); List<Coordinate> nextCoordsToConsider = getTinEdges().getConnectedCoordinates(leadingCoord); nextCoordsToConsider.sort(elevationComparator); List<LineString> allExtensions = new ArrayList<LineString>(); for (Coordinate ext : nextCoordsToConsider) { boolean isValid = LineGrowthHelpers.isCoordValidInRidge(ext, stemCoords, getWater()); if (!isValid) { continue; } LineString extendedStem = LineGrowthHelpers.extend(stem, ext); if (maxExtensionLen > 1) { List<LineString> extensions = getAllExtendedLines(extendedStem, validOnly, maxExtensionLen-1); allExtensions.addAll(extensions); } if (!allExtensions.contains(extendedStem)) { allExtensions.add(extendedStem); } } return allExtensions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<LineString> getAllLineExtensions(LineString stem, boolean validOnly, int maxExtensionLen) throws IOException {\n\t\tList<LineString> stemsPlusExtensions = getAllExtendedLines(stem, validOnly, maxExtensionLen);\n\t\tList<LineString> onlyExtensions = new ArrayList<LineString>();\n\t\tfor(LineString s : ...
[ "0.75750965", "0.51584977", "0.45908096", "0.42339367", "0.42296097", "0.42176497", "0.42063114", "0.42043936", "0.41722348", "0.4160709", "0.41372326", "0.4110594", "0.40752208", "0.40658617", "0.40612695", "0.4021977", "0.4017807", "0.40118387", "0.39997667", "0.39521864", ...
0.7841683
0
this implementation is fairly good, but it performs awkardly when it encounters sliver triangles. if the TIN is delanuay conforming then this is a good choice, otherwise, "pickBestGrowthPossibility2" may be preferable.
private LineString pickBestGrowthPossibility1(List<LineString> lookAheads) { if (lookAheads == null || lookAheads.size() == 0) { return null; } //sort by: //1. is moving away? //2. number of coordinates in line //3. average elevation of line final AvgElevationSectionFitness sectionFitness = new AvgElevationSectionFitness(getTinEdges()); Comparator<LineString> lookAheadComparator = new Comparator<LineString>() { public int compare(LineString s1, LineString s2) { boolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { if (s1.getNumPoints() == s2.getNumPoints()) { try { double fit1 = sectionFitness.fitness(s1); double fit2 = sectionFitness.fitness(s2); return fit1 > fit2 ? -1 : fit1 < fit2 ? 1 : 0; } catch(IOException e) { return 0; } } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } }; lookAheads.sort(lookAheadComparator); return lookAheads.get(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(new FileReader(\"talent.in\"));// new InputStreamReader(System.in)); //\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"talent.out\")));\n int N = sc.nextInt();\n int minWeight =...
[ "0.60156196", "0.55150545", "0.53627145", "0.52435464", "0.52123904", "0.5212013", "0.5149559", "0.5125668", "0.51227474", "0.5114112", "0.50861454", "0.50823295", "0.50687355", "0.5067054", "0.50599784", "0.50477356", "0.5034888", "0.5010211", "0.50057715", "0.5004319", "0.4...
0.52485615
3
this implementation is less susceptible to getting channeled along long edges of sliver triangles, (as compared to pickBestGrowthPossibility1) which means this is a reasonable choice when triangles aren't delaunay confirming
private LineString pickBestGrowthPossibility2(List<LineString> lookAheads) { if (lookAheads == null || lookAheads.size() == 0) { return null; } //sort by: //1. is moving away? //2. number of coordinates in line //3. slope Comparator<LineString> lookAheadComparator = new Comparator<LineString>() { public int compare(LineString s1, LineString s2) { boolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { //both moving away, or neither moving away. look to second criteria if (s1.getNumPoints() == s2.getNumPoints()) { double slope1 = SpatialUtils.getSlope(s1); double slope2 = SpatialUtils.getSlope(s2); return slope1 > slope2 ? -1 : slope1 < slope2 ? 1 : 0; } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } }; lookAheads.sort(lookAheadComparator); return lookAheads.get(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void boxOfMortys() {\n Triple pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, col1, col2, col3, col4;\n\n pos1 = new Triple(-10, -10, 0);\n pos2 = new Triple(110, -10, 0);\n pos3 = new Triple(110, -10, 120);\n pos4 = new Triple(-10, -10, 120);\n pos5 = new Triple(-10, 110, 0);\n pos6...
[ "0.60737157", "0.587927", "0.5851647", "0.5784069", "0.5562067", "0.55165464", "0.55127966", "0.5508576", "0.5470204", "0.5453297", "0.54381996", "0.54334086", "0.5430018", "0.5427362", "0.54261446", "0.54228544", "0.54176605", "0.54103196", "0.5379762", "0.5339451", "0.53293...
0.5227518
32
this implementation is less susceptible to getting channeled along long edges of sliver triangles, (as compared to pickBestGrowthPossibility1) which means this is a reasonable choice when triangles aren't delaunay confirming The drawback is that sometimes pathing goes downhill in some nonintuitive ways.
private LineString pickBestGrowthPossibility3(final LineString stem, List<LineString> lookAheads) { if (lookAheads == null || lookAheads.size() == 0) { return null; } //sort by: //1. is moving away? //2. number of coordinates in line //3. average elevation rise (above the lowest coord) divided by length of line // e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average //Z above the lowest coord will be 7.6m. that value will be divided by the line length final AvgElevationSectionFitness avgElevationFitness = new AvgElevationSectionFitness(getTinEdges()); Comparator<LineString> lookAheadComparator = new Comparator<LineString>() { public int compare(LineString s1, LineString s2) { //is end of extension moving away boolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { //is start of extension moving away boolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1)); boolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1)); if (a1 != a2) { return a1 ? -1 : 1; } else { if (s1.getNumPoints() == s2.getNumPoints()) { try { double fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength(); double fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength(); if (fit1<0) { fit1 = 1/fit1; } if (fit2<0) { fit2 = 1/fit2; } return fit1 > fit2 ? -1 : fit1 < fit2 ? 1 : 0; } catch(IOException e) { return 0; } } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } } }; lookAheads.sort(lookAheadComparator); return lookAheads.get(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\...
[ "0.62295973", "0.5896911", "0.5882001", "0.58641106", "0.5850729", "0.58351153", "0.58254445", "0.58142114", "0.5712226", "0.56727374", "0.56637263", "0.5644908", "0.5589445", "0.55579877", "0.5557913", "0.55562216", "0.5532336", "0.55282056", "0.5526981", "0.5510287", "0.550...
0.5379464
35
is end of extension moving away
public int compare(LineString s1, LineString s2) { boolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { //is start of extension moving away boolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1)); boolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1)); if (a1 != a2) { return a1 ? -1 : 1; } else { if (s1.getNumPoints() == s2.getNumPoints()) { try { double fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength(); double fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength(); if (fit1<0) { fit1 = 1/fit1; } if (fit2<0) { fit2 = 1/fit2; } return fit1 > fit2 ? -1 : fit1 < fit2 ? 1 : 0; } catch(IOException e) { return 0; } } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isEnding() {\n return false;\n }", "public abstract boolean shouldEnd();", "boolean isFinished() {\n return includedInLastStep() && (end == elementList.size() - 1);\n }", "protected abstract boolean end();", "protected void end() {\n \t// theres nothin...
[ "0.7022071", "0.67105764", "0.6572898", "0.6546768", "0.65434724", "0.64330715", "0.6425598", "0.64239657", "0.639815", "0.636449", "0.63488054", "0.6339896", "0.6339209", "0.6339209", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.6338...
0.0
-1
this implementation attempts to work well with nondelaunay triangles (as in 3), but reduce the occasional, nonintuitive downhill pathing.
public List<LineString> sortExtensionsByPreference(final LineString stem, List<LineString> lookAheads) { if (lookAheads == null || lookAheads.size() == 0) { return null; } //sort by: //1. is moving away? //2. number of coordinates in line //3. line ends higher than it starts? (prefer those that do) //4. average elevation rise (above the lowest coord) divided by length of line // e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average //Z above the lowest coord will be 7.6m. that value will be divided by the line length. may be negative if line moves downward Comparator<LineString> lookAheadComparator = new Comparator<LineString>() { public int compare(LineString s1, LineString s2) { //is end of extension moving away boolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { //is start of extension moving away boolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1)); boolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1)); if (a1 != a2) { return a1 ? -1 : 1; } else { //prefer lines that end higher than they start boolean endsHigher1 = s1.getCoordinateN(0).getZ() <= s1.getCoordinateN(s1.getNumPoints()-1).getZ(); boolean endsHigher2 = s2.getCoordinateN(0).getZ() <= s2.getCoordinateN(s2.getNumPoints()-1).getZ(); if (endsHigher1 != endsHigher2) { return endsHigher1 ? -1 : 1; } else { if (s1.getNumPoints() == s2.getNumPoints()) { double slope1 = (SpatialUtils.getAverageElevation(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength(); double slope2 = (SpatialUtils.getAverageElevation(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength(); return slope1 > slope2 ? -1 : slope1 < slope2 ? 1 : 0; } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } } } }; lookAheads.sort(lookAheadComparator); return lookAheads; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void doubleTriangle(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n\n List<Node> intoBArrows = graph.getNodesInTo(B, Endpoint.ARROW);\n List<Node> intoBCircles = graph.getNodesInTo(B, Endpoint.CIRCLE);\n\n //possible A's and ...
[ "0.6168751", "0.5900609", "0.58688146", "0.57938606", "0.5729221", "0.5701041", "0.561529", "0.5528322", "0.5458875", "0.5456339", "0.5449018", "0.5420729", "0.5419114", "0.5416414", "0.5413308", "0.54026425", "0.5391491", "0.5386646", "0.5362706", "0.53389484", "0.5327322", ...
0.0
-1
is end of extension moving away
public int compare(LineString s1, LineString s2) { boolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1)); boolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1)); if (m1 != m2) { return m1 ? -1 : 1; } else { //is start of extension moving away boolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1)); boolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1)); if (a1 != a2) { return a1 ? -1 : 1; } else { //prefer lines that end higher than they start boolean endsHigher1 = s1.getCoordinateN(0).getZ() <= s1.getCoordinateN(s1.getNumPoints()-1).getZ(); boolean endsHigher2 = s2.getCoordinateN(0).getZ() <= s2.getCoordinateN(s2.getNumPoints()-1).getZ(); if (endsHigher1 != endsHigher2) { return endsHigher1 ? -1 : 1; } else { if (s1.getNumPoints() == s2.getNumPoints()) { double slope1 = (SpatialUtils.getAverageElevation(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength(); double slope2 = (SpatialUtils.getAverageElevation(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength(); return slope1 > slope2 ? -1 : slope1 < slope2 ? 1 : 0; } else { return s1.getNumPoints() > s2.getNumPoints() ? -1 : s1.getNumPoints() < s2.getNumPoints() ? 1 : 0; } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isEnding() {\n return false;\n }", "public abstract boolean shouldEnd();", "boolean isFinished() {\n return includedInLastStep() && (end == elementList.size() - 1);\n }", "protected abstract boolean end();", "protected void end() {\n \t// theres nothin...
[ "0.7022071", "0.67105764", "0.6572898", "0.6546768", "0.65434724", "0.64330715", "0.6425598", "0.64239657", "0.639815", "0.636449", "0.63488054", "0.6339896", "0.6339209", "0.6339209", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.63385296", "0.6338...
0.0
-1
Setup Step 1: Start the Mopub test app on an Android mobile device.
@Before public void setUp() throws MalformedURLException { DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability("devicename","MyTestDevice"); //It works with java-client-4.0.0.jar :) drive = new AndroidDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap); //Reset the cache! drive.resetApp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@BeforeTest\n\t\tpublic void setUp() throws MalformedURLException {\n\t\t\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t // Set android deviceName desired capability. Set your device name.\n\t\t\t capabilities.setCapability(\"deviceName\", \"Custom Phone - 4.2.2 API 17 - 768*1280\");\n\...
[ "0.68930566", "0.68191457", "0.6802359", "0.67328537", "0.66225064", "0.6577914", "0.65602034", "0.6556193", "0.65304667", "0.65021884", "0.6497542", "0.64237446", "0.640329", "0.64008224", "0.63663507", "0.6306445", "0.62701166", "0.62646675", "0.6233429", "0.62169784", "0.6...
0.5929585
37
Breakdown Step 7: Close the Mopub test app when the script is finished.
@After public void tearDown() { drive.quit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@AfterTest\n\tpublic void afterTest() {\n\t\tiDriver.quit();\n\t\tSystem.out.println(\"=====================VEGASF_419_END=====================\");\n\t}", "@AfterTest\npublic void end()\n{\n\tlogin.s.quit();\n}", "@AfterMethod\r\n\tpublic void closeapp()\r\n\t{\n\t\tdriver.quit();\r\n\t}", "@After\n\tpublic ...
[ "0.7115578", "0.7027275", "0.69424695", "0.68811214", "0.6723723", "0.67216396", "0.67216396", "0.67216396", "0.6708943", "0.6666642", "0.66601217", "0.6557573", "0.6521116", "0.6519947", "0.6511869", "0.64574957", "0.64257455", "0.6416033", "0.6415136", "0.6414377", "0.63975...
0.0
-1
Instantiates a new syntax error.
public SyntaxError(String msg, IGeneralToken pos) { if (pos != null && pos.getPos() != null) { this.pos = new TokenPosition(pos.getPos().col, pos.getPos().line, -1, -1); } else { this.pos = null; } if (pos != null && pos.getTag() == JavaToken.TAG) { this.msg = msg + " " + ((JavaToken)pos).type.name; } else { this.msg = msg; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SyntaxException() {\n\t\tsuper();\n\t}", "public SyntaxException(String errorMessage) {\n\t\tsuper(errorMessage);\n\t}", "public SyntaxMatchingException() {\n super();\n }", "public SyntaxError(String msg, TokenPosition pos) {\n this.pos = pos;\n this.msg = msg;\n }", "public Token(...
[ "0.73570174", "0.69511837", "0.6850084", "0.674413", "0.6604205", "0.65400136", "0.64195335", "0.635288", "0.63328797", "0.62056285", "0.61780775", "0.60764986", "0.6009077", "0.5989454", "0.59721744", "0.5955323", "0.58094066", "0.5775092", "0.5736897", "0.57093406", "0.5705...
0.60672486
12
Instantiates a new syntax error.
public SyntaxError(String msg, TokenPosition pos) { this.pos = pos; this.msg = msg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SyntaxException() {\n\t\tsuper();\n\t}", "public SyntaxException(String errorMessage) {\n\t\tsuper(errorMessage);\n\t}", "public SyntaxMatchingException() {\n super();\n }", "public Token(String lexeme, int lineNum, int colNum){\r\n this.kind = \"ERROR\";\r\n this.lexem...
[ "0.73570174", "0.69511837", "0.6850084", "0.6604205", "0.65400136", "0.64195335", "0.635288", "0.63328797", "0.62056285", "0.61780775", "0.60764986", "0.60672486", "0.6009077", "0.5989454", "0.59721744", "0.5955323", "0.58094066", "0.5775092", "0.5736897", "0.57093406", "0.57...
0.674413
3
TODO Autogenerated method stub
public CollectionResource createCollection(String arg0) throws NotAuthorizedException, ConflictException { 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
TODO Autogenerated method stub
public void copyTo(CollectionResource arg0, String arg1) { }
{ "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 delete() throws NotAuthorizedException, ConflictException, BadRequestException { }
{ "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 Long getContentLength() { 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
TODO Autogenerated method stub
public String getContentType(String arg0) { 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
TODO Autogenerated method stub
public Long getMaxAgeSeconds(Auth arg0) { 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
TODO Autogenerated method stub
public void moveTo(CollectionResource arg0, String arg1) throws ConflictException { }
{ "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
Constructs a new Holder with null instance.
public Holder() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Holder(/* @Nullable */ final T value) {\n this.value = value;\n }", "public static <T> HolderConsumer<T> holder() {\n return new HolderConsumer<>();\n }", "public Entry()\n {\n this(null, null, true);\n }", "public Cache() {\n this(null...
[ "0.6763611", "0.63257396", "0.60542744", "0.6024542", "0.5905495", "0.5893932", "0.58690447", "0.58690447", "0.581345", "0.5799791", "0.57768255", "0.57570976", "0.5713824", "0.57006544", "0.569824", "0.5657438", "0.5636665", "0.5611863", "0.5602901", "0.5593957", "0.55799973...
0.77591926
0
Constructs a new Holder.
public Holder(/* @Nullable */ final T value) { this.value = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Holder() {\n }", "public static <T> HolderConsumer<T> holder() {\n return new HolderConsumer<>();\n }", "public WeakKeyFactory(Class<?> holder) {\n this(holder, true);\n }", "public HolderKey(final ServiceHolder<T> serviceHolder) {\n this.serviceReference = serviceHolder.getRef...
[ "0.8494098", "0.6848576", "0.6712951", "0.60601276", "0.599574", "0.59612906", "0.5951846", "0.5948986", "0.5893839", "0.57912916", "0.57408345", "0.56266105", "0.5596667", "0.55933326", "0.5556377", "0.5552414", "0.553506", "0.55195946", "0.55170214", "0.55143505", "0.550059...
0.6725046
2
Get the instance reference.
public /* @Nullable */ T getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object getLocalReference()\n {\n return m_localInstance;\n }", "public T getInstance() {\n return instance;\n }", "@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}", "public String getWfInstanceRef() {\n\t\treturn wfInstanceRef;\n\t}", "public ObjectReference getObject()...
[ "0.73363435", "0.723051", "0.70700914", "0.69601494", "0.69529027", "0.69063777", "0.68887156", "0.68604517", "0.68364334", "0.6823283", "0.6792198", "0.67463976", "0.67325294", "0.6716404", "0.6707171", "0.66667074", "0.6663312", "0.6608124", "0.6599826", "0.64892876", "0.64...
0.0
-1
Set the instance reference.
public void setValue(/* @Nullable */ final T value) { this.value = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setReference(Reference ref)\n {\n this.ref = ref;\n }", "public void set(final Object ref) {\n synchronized (lock) {\n if (set) { throw new IllegalStateException(\"Reference has already been set\"); }\n\n if ((!allowsNull()) && (ref == null)) { throw new IllegalArgumentException...
[ "0.7502606", "0.7363787", "0.7332544", "0.67724574", "0.6622407", "0.66207814", "0.66059726", "0.6509806", "0.6496769", "0.6460589", "0.6342449", "0.6316669", "0.6290195", "0.62110275", "0.6193299", "0.6153017", "0.61433077", "0.6033881", "0.6016848", "0.601643", "0.5998118",...
0.0
-1
Converts the given expression to camelcase, using the delimiters defined by regexp.
public static String toCamelCase(String s, String regexp, boolean startLower) { StringBuilder b = new StringBuilder(s.length()); Matcher m = Pattern.compile(regexp).matcher(s); int end = 0; while (m.find()) { int start = m.start(); if (start > end) { int i; if (startLower && b.length() == 0) i = end; else { i = end + 1; b.append(Character.toUpperCase(s.charAt(end))); } while (i < start) b.append(Character.toLowerCase(s.charAt(i++))); } end = m.end(); } return b.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String camel(final String value) {\r\n\t\tif (!isBlank(value)) {\r\n\t\t\treturn value.substring(0, 1).toLowerCase() + value.substring(1);\r\n\t\t} else {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}", "public static String camelify(String name) {\n int dash = name.indexOf('-');\n return dash < 0? ...
[ "0.5351315", "0.5175661", "0.51200604", "0.5083986", "0.5052148", "0.5036551", "0.50061214", "0.49584645", "0.49217352", "0.4912386", "0.48984948", "0.48775893", "0.48606688", "0.48505807", "0.48340517", "0.48316512", "0.4826484", "0.48141584", "0.47634506", "0.47574565", "0....
0.6709212
0
Converts the camelcase to a separated string
public static String deCamelCase(String s, String newDelim) { StringBuilder b = new StringBuilder(s.length() + newDelim.length() *4); // estimating the expected capacity for (int i = 0, n = s.length(); i < n; i++) { char ch = s.charAt(i); if (i > 0 && ch == Character.toUpperCase(ch)) b.append(newDelim); b.append(Character.toLowerCase(ch)); } return b.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String splitCamelCase(String s) {\n return s.replaceAll(\n String.format(\"%s|%s|%s\",\n \"(?<=[A-Z])(?=[A-Z][a-z])\",\n \"(?<=[^A-Z])(?=[A-Z])\",\n \"(?<=[A-Za-z])(?=[^A-Za-z])\"),\n \" \").replaceAll(\"[-_]\", \"\").r...
[ "0.678791", "0.6771212", "0.66915625", "0.6630669", "0.64131314", "0.6328165", "0.6293924", "0.62601733", "0.622321", "0.621088", "0.61723006", "0.6145704", "0.60994816", "0.60507876", "0.5988418", "0.5970626", "0.59590226", "0.5947676", "0.5942245", "0.5902205", "0.5885668",...
0.5787363
28
Returns true if the string is null, or empty.
public static boolean isEmpty(String s) { return s == null || s.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean stringNullOrEmpty ( String string ) {\r\n if ( string == null ) return true;\r\n if ( string.isEmpty() ) return true;\r\n return false;\r\n }", "static boolean isNullOrEmpty(String string) {\n return string == null || string.isEmpty();\n }", "public boolean isNullOrEmpty(Str...
[ "0.83056426", "0.8298565", "0.8142769", "0.8134443", "0.8026411", "0.8003871", "0.79953516", "0.7988292", "0.7914341", "0.7912252", "0.788418", "0.7875562", "0.7873637", "0.7863936", "0.78567576", "0.782719", "0.78255063", "0.78169763", "0.78166515", "0.7815624", "0.78061354"...
0.7731201
29
Returns the name of the setter generated from the property name.
public static String setterName(String name) { return genMethodName(name, "set", null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getSetterName(String propertyName){\r\n\t\treturn \"set\" + propertyName.substring(0, 1).toUpperCase() + \r\n\t\t\tpropertyName.substring(1);\r\n\t}", "private String getSetMethodName() {\n assert name != null;\n return \"set\" + upperFirstChar(name);\n }", "public String ...
[ "0.8144129", "0.70413524", "0.6571518", "0.6562965", "0.65296113", "0.6491183", "0.6464932", "0.6344711", "0.63420767", "0.62966955", "0.62637997", "0.62293637", "0.62144774", "0.6172418", "0.61000836", "0.6056093", "0.60199577", "0.60110384", "0.59152025", "0.58725053", "0.5...
0.7571108
1
Returns the name of the getter generated from the property name.
public static String getterName(String name, boolean isBoolean) { return genMethodName(name, isBoolean ? "is" : "get", null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getPropertyName();", "PropertyName getName();", "public String getPropertyName();", "public static String getGetterName(String propertyName, boolean isBool){\r\n\t\tif(isBool){\r\n\t\t\treturn \"is\" + propertyName.substring(0, 1).toUpperCase() + \r\n\t\t\t\tpropertyName.substring(1);\r\n\t\t} else {\...
[ "0.7540927", "0.74989766", "0.7261937", "0.71888405", "0.7140044", "0.6945385", "0.67593455", "0.67174447", "0.67111915", "0.67004764", "0.6691556", "0.6670244", "0.6668795", "0.6597247", "0.6584103", "0.6580487", "0.65253013", "0.64823097", "0.641549", "0.64043975", "0.63962...
0.66150415
13
Generates a method name from a property name.
public static String genMethodName(String name, String prefix, String suffix) { StringBuilder b = new StringBuilder(); if (prefix != null) b.append(prefix); int l = name.length(); int start = 0; while (true) { int index = name.indexOf('_', start); int end = index == -1 ? l : index; if (end > start) { if (b.length() > 0) b.append(Character.toUpperCase(name.charAt(start++))); if (end > start) b.append(name, start, end); } if (index == -1) break; else start = index + 1; } if (suffix != null) b.append(suffix); return b.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String propertyToMethodName(final String property, final String modifier) {\n \n String charToUpper = property.substring(0,1);\n String methodName = property.replaceFirst(charToUpper, charToUpper.toUpperCase());\n methodName = modifier + methodName;\n return methodName;\n ...
[ "0.7431032", "0.70653564", "0.694308", "0.60801953", "0.60618347", "0.6038992", "0.59222484", "0.58959174", "0.5876732", "0.58402896", "0.58402896", "0.58402896", "0.58402896", "0.5821649", "0.5759295", "0.57468194", "0.57097065", "0.5571809", "0.5570862", "0.5570862", "0.556...
0.5878008
8
Encodes the given number into text id
public static String idToString(int id) { return Integer.toString(id, Character.MAX_RADIX); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getIdNumber();", "int toIdentifier() {\n return 1000 * y + x;\n }", "private void serializeInteger(final int number, final StringBuffer buffer)\n {\n buffer.append(\"i:\");\n buffer.append(number);\n buffer.append(';');\n }", "public static String generateID(int num){\n ...
[ "0.62738", "0.6209225", "0.6138089", "0.61248237", "0.6049358", "0.5869331", "0.5842832", "0.57555026", "0.5749066", "0.574619", "0.5739596", "0.57041496", "0.57038707", "0.5669785", "0.5669567", "0.56582433", "0.5632591", "0.56249845", "0.5616738", "0.5613706", "0.5606599", ...
0.0
-1
Decodes the given text id into number
public static int parseId(String id) { try { return Integer.parseInt(id, Character.MAX_RADIX); } catch (NumberFormatException e) { throw e; // just to put a break point } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int decodeInt();", "private int getNumberFromString(String text){\n\t\t\n\t\tint result = 0;\n\t\t\n\t\tfor(int i=text.length() - 1, j=0; i >= 0 ; i--, j++){\n\t\t\t\n\t\t\tresult += (Character.getNumericValue(text.charAt(i))) * Math.pow(10, j);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public final static int ...
[ "0.719827", "0.63826334", "0.60723335", "0.59892124", "0.5925066", "0.592011", "0.5919166", "0.5866477", "0.58591217", "0.5855832", "0.58402634", "0.5781743", "0.5772636", "0.57668144", "0.5725636", "0.57076126", "0.56655747", "0.5638061", "0.5573994", "0.5563928", "0.5471769...
0.59090954
7
how do you time a process
public static void main(String[] args) { long/* integer of higher order; more info than an int*/ currentTime = System.currentTimeMillis(); String[] someString = new String[1000]; standardPopulate(someString); print(someString); initializingArraysExamples(); long endTime = System.currentTimeMillis(); System.out.println("The process took " + (endTime-currentTime) + " ms."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void arrivingProcess(process theProcess, int time);", "public long startTime();", "int getCPU_time();", "public void Times() \n {\n if(status.getStatus_NUM() == 1 || status.getStatus_NUM() == 2 || status.getStatus_NUM() == 3)\n { //Waiting Time\n startWaitingTime = Syste...
[ "0.7307951", "0.68830127", "0.6698863", "0.65770745", "0.6576052", "0.6332276", "0.62941515", "0.61883837", "0.61488336", "0.6082583", "0.60717577", "0.60538983", "0.601119", "0.6003757", "0.6003757", "0.5960257", "0.59129024", "0.59086925", "0.58764476", "0.5859801", "0.5846...
0.0
-1
int i =0; // for each doesn't work
private static void standardPopulate(String[] s) { for(/*int i = 0; i<s.length;i++*//* String z: s*/ int i = 0;i<s.length;i++){ //s[i] = "String #"+(i+1); /*i++; z = "String #"+(i+1); */ String string= "String #"+(i+1); s[i] = string; // setting position i into string } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int i() {\n \treturn i; \n }", "void mo88773a(int i);", "private static void iterator() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void iterateCount() {\n\t\t\r\n\t}", "private void tempVariableExample() {\r\n\tfor(int i =0; i < age; i++)\r\n\t{\r\n\t\t//print i\r\n\t}\r\n\r\n\r\n}", "public in...
[ "0.6538454", "0.6310845", "0.62286353", "0.62061125", "0.62005264", "0.61740893", "0.61421937", "0.6135338", "0.6134342", "0.61269885", "0.611882", "0.6101392", "0.60836583", "0.60558456", "0.60550797", "0.6024661", "0.6021075", "0.6010068", "0.59834576", "0.59707063", "0.596...
0.0
-1
primitive type[] = are "already" in the system, start as zero. object[] = unless initialized, will start as null. different types of array of common supertype
public static void initializingArraysExamples(){ // if you want to put different primitive types into an array, you must use their wrapper class. // the different way to initiate array boolean[] boos1 = new boolean[3]; boolean[] boos2 = { false,false,false}; // this can only be done at the declaration //because it sets size and content //this does not work //boos3 = {false,true,true}; this doesn't work because u have boolean declared up there while the bottom only initializes it boos3 = new boolean[3]; //this is all that will work /** 2 ways to iterate through an array STANDARD FOR LOOP THE INDEX IS IMPORTANT TO KEEP CHECK OF YOU NEED TO CUSTOMIZE THE ORDER */ for(int i = 0; i<boos1.length;i++){ // System.out.println(boos1[i]); //everything in a boolean is set to false prior; if int will be 0 } /** FOR EACH LOOOP -the index is no important * - you don't need to customize * - automatically assigns a "handle" aka identifier */ for(boolean b: boos1){ // is the same as top + boolean b = boos1[i] // System.out.println(b); } //OBJECT ARRAYS String[] someStrings1 = new String[3]; String[] someStrings2 = {"a","b","c"}; // someStrings1[0] = "a"; // someStrings1[1] = "b"; // someStrings1[2] = "c"; //but this is repetitive /* for(int i = 0; i<someStrings1.length;i++){ someStrings1[i] = "a new string"; // (when String s: someStrings1) you would had thought that this will make //someStrings1 all be called a new string. //doesn't work if you make s = someStrings[i] because it is a local variable } // a loop to print it for(String s: someStrings1){ System.out.println(s); } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void arrays_hierarchy_may_lead_to_unsafety() {\n\r\n Object[] objectArray = new Long[1];\r\n objectArray[0] = \"boom\"; // Throws ArrayStoreException\r\n\r\n // Generic Collections are invariant (don't preserve inheritance):\r\n // i.e. if Child extends Parent, then List<Child> isn't a ...
[ "0.6610455", "0.64415747", "0.6379556", "0.6346503", "0.6329603", "0.626587", "0.6182164", "0.6129627", "0.61291873", "0.6102204", "0.60933673", "0.6079161", "0.60655797", "0.5966508", "0.5946328", "0.59349304", "0.5922012", "0.5895015", "0.58903277", "0.5889042", "0.5886434"...
0.0
-1
parseFile method which parses the .csv file for content.
public static List<String[]> parseFile(String filePath, String headstandards) throws MalformedParametersException, FileNotFoundException { int numberOfParams = headstandards.split(",").length; List<String[]> toReturn = new LinkedList<>(); File file; BufferedReader br; try { file = new File(filePath); br = new BufferedReader(new FileReader(file)); String firstLine = br.readLine(); if (!(firstLine.equals(headstandards))) { throw new MalformedParametersException( "first line doesn't match header standards"); } String line = br.readLine(); while (line != null) { String[] parsed = line.split(","); if (parsed.length != numberOfParams) { throw new MalformedParametersException("CSV data is malformed"); } else { toReturn.add(parsed); } line = br.readLine(); } } catch (IOException e) { throw new FileNotFoundException("couldn't open file"); } try { br.close(); } catch (IOException e) { throw new FileNotFoundException("trouble closing reader"); } return toReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList<CSVRecord> processCsvData(String csvFile) {\n ArrayList<CSVRecord> records = new ArrayList<>();\n\n File csvData = new File(\"src/main/resources/csv/\" + csvFile + \".csv\");\n\n try {\n CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), CSVForma...
[ "0.6969545", "0.6749552", "0.6689664", "0.6600133", "0.647084", "0.63944227", "0.6356914", "0.62472355", "0.62228954", "0.6184425", "0.615441", "0.61376774", "0.605631", "0.60482556", "0.60252815", "0.60054946", "0.5994367", "0.59701437", "0.59176564", "0.5900389", "0.5897763...
0.0
-1
String dir1 = "repo2"; Sail sail = new NativeStore(new File(dir1));
private static void deleteTest() throws SailException{ String dir2 = "repo-temp"; Sail sail2 = new NativeStore(new File(dir2)); sail2 = new IndexingSail(sail2, IndexManager.getInstance()); // sail.initialize(); sail2.initialize(); // ValueFactory factory = sail2.getValueFactory(); // CloseableIteration<? extends Statement, SailException> statements = sail2 // .getConnection().getStatements(null, null, null, false); SailConnection connection = sail2.getConnection(); int cachesize = 1000; int cached = 0; long count = 0; connection.removeStatements(null, null, null, null); // connection.commit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static Repository getRepositoryFromArguments(String[] args)\n {\n File dataDir = new File(args[args.length - 2]);\n \n Repository rep = new SailRepository(new NativeStore(dataDir));\n \n try\n {\n rep.initialize();\n }\n catch (Reposit...
[ "0.69623536", "0.65711045", "0.64212847", "0.61223733", "0.6004916", "0.5766758", "0.57082325", "0.5501674", "0.540778", "0.5382354", "0.5323166", "0.52584046", "0.5226247", "0.5181988", "0.51721835", "0.5172178", "0.51616263", "0.5115001", "0.51114863", "0.5097545", "0.50934...
0.0
-1
Try out serialization/deSerialization of this class.
public static void main(String[] args) throws JAXBException { User u = new User("a", "b"); System.out.printf("name:%s password:%s\n", u.name, u.password); String xml = serialization.Serializer.serialize(u); System.out.println(xml); u = serialization.Serializer.deSerialize(xml, User.class); System.out.printf("name:%s password:%s\n", u.name, u.password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serialize() {\n FileOutputStream fileOutput = null;\n ObjectOutputStream outStream = null;\n // attempts to write the object to a file\n try {\n clearFile();\n fileOutput = new FileOutputStream(data);\n outStream = new ObjectOutputStream(file...
[ "0.69802594", "0.6828158", "0.66714525", "0.66225815", "0.6592921", "0.6565374", "0.64125293", "0.6205123", "0.61065423", "0.60670346", "0.60442865", "0.60085714", "0.5985462", "0.590451", "0.5900892", "0.5887378", "0.58851314", "0.5856942", "0.58551186", "0.58156484", "0.580...
0.0
-1
Constructs a User with blank data.
public User() { this("", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\...
[ "0.7903378", "0.7792742", "0.7718488", "0.7695179", "0.75585485", "0.75572854", "0.7550921", "0.75449234", "0.748878", "0.74699", "0.74699", "0.74699", "0.7446833", "0.7446833", "0.7446833", "0.74289984", "0.7391708", "0.7391708", "0.7391708", "0.7384425", "0.7379796", "0.7...
0.79568803
0
Constructs a User by defining all its data.
public User(String name, String password) { this.name = name; this.password = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User()\n\t{\n\n\t}", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, tr...
[ "0.75076205", "0.7485769", "0.7439666", "0.7401212", "0.7401212", "0.7401212", "0.73611736", "0.7360312", "0.7360269", "0.73384756", "0.7337593", "0.7323596", "0.728326", "0.7281718", "0.7274273", "0.72605264", "0.72589797", "0.72589797", "0.72589797", "0.7257779", "0.7253864...
0.0
-1
start the timer as soon as possible and report the metric event before we write response to client
@Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE + 10000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void start() {timer.start();}", "public void startTimer(){\n timerStarted = System.currentTimeMillis();\n }", "public void startTimer() {\n mStatusChecker.run();\n }", "private void startTime()\n {\n timer.start();\n }", "public void startFirstSampleTimer() {\n ...
[ "0.6649435", "0.64617777", "0.6437473", "0.63520104", "0.62983525", "0.62740785", "0.6228708", "0.6224891", "0.62140346", "0.6172313", "0.61516076", "0.6142308", "0.61328954", "0.6083695", "0.60803723", "0.606869", "0.606265", "0.6051945", "0.602379", "0.59865826", "0.5960539...
0.0
-1
TODO Autogenerated method stub
private static void bfs(int y, int x) { Queue<Dot> q = new LinkedList<Dot>(); int wolf = 0, sheep = 0; q.add(new Dot(x,y)); //방문해야 할 점을 큐에 넣어주기 if(input[y][x] == 'v') { wolf++; }else if(input[y][x] == 'o') { sheep++; } while(!q.isEmpty()) { Dot d = q.poll(); for(int i=0; i<4;i++) { int hx = d.x + dx[i]; int hy = d.y + dy[i]; if(hx < 0 || hy < 0 || hx > M || hy > N) { continue; } if(visit[hy][hx] || input[hy][hx] == '#') { //방문안함 continue; } q.add(new Dot(hx,hy)); visit[hy][hx] = true; if(input[hy][hx] == 'v') { wolf++; }else if(input[hy][hx] == 'o') { sheep++; } } } if(wolf >= sheep) { //늑대가 많거나 같으면 ans_wolf += wolf; }else { //양이 더 많으면 양의 승. s ans_sheep += sheep; } }
{ "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
sort numbers in ascending order. return sorted numbers. note: this method to sort regular array list is faster then others (even faster then merge sort) however, it uses more memory, because, by splitting the original list, we are creating two new lists, which allocating the memory. implementation: 1. get first number as a pivot (index 0) 2. split other elements to two sublists: 2.1 less or equal than pivot 2.2 greater than pivot 3. sort sort sublists by calling to 'sort numbers' function recursively. 4. combine sorted lists with pivot and return: [less than pivot] + pivot + [greater than pivot]
public static List<Integer> sortNumbers(List<Integer> unsortedList) { // naive sort if (unsortedList == null || unsortedList.size() <= 1) { return unsortedList; } int pivot = unsortedList.get(0); List<Integer> lessThanPivot = new ArrayList<>(); List<Integer> greaterThanPivot = new ArrayList<>(); unsortedList.subList(1, unsortedList.size()).forEach(number -> { if (number <= pivot) { lessThanPivot.add(number); } else { greaterThanPivot.add(number); } }); System.out.printf("%15s %1s %-15s%n", lessThanPivot, pivot, greaterThanPivot); List<Integer> sortedNumbers = new ArrayList<>(sortNumbers(lessThanPivot)); sortedNumbers.add(pivot); sortedNumbers.addAll(sortNumbers(greaterThanPivot)); return sortedNumbers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Integer> sort(List<Integer> input) {\n\t\tif (input.size() < 2)\n\t\t\treturn input;\n\n\t\tint pivot = input.get((input.size() - 1) / 2);\n\t\tList<Integer> less = input.stream().filter(x -> x < pivot).collect(Collectors.toList());\n\t\tList<Integer> greater = input.stream().filter(x -> x > piv...
[ "0.73721147", "0.65691465", "0.6527346", "0.644865", "0.64442915", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", "0.6437561", ...
0.7386027
0
ExecutionSummary executionSummary = testViaExcel("unitTest_base_part1.xlsx", "function_date");
@Test public void baseCommandTests_part1() throws Exception { ExecutionSummary executionSummary = testViaExcel("unitTest_base_part1.xlsx"); assertPassFail(executionSummary, "base_showcase", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "function_projectfile", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "function_array", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "function_count", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "function_date", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "actual_in_output", TestOutcomeStats.allPassed()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startTest() throws Throwable\n {\n ExcelFileUtil excel= new ExcelFileUtil();\n // iterate all row in masterTestCases sheet\n\n for(int i=1;i<=excel.rowCount(\"MasterTestCases\");i++)\n {\n String ModuleStatus=\"\";\n if(excel.getData(\"MasterTestCase...
[ "0.68680125", "0.68119764", "0.6390191", "0.6347062", "0.61712676", "0.61333823", "0.60854506", "0.6083666", "0.6081357", "0.6076325", "0.6059594", "0.6038038", "0.60239655", "0.6020951", "0.59966004", "0.59801906", "0.5975192", "0.59745044", "0.5969658", "0.5967093", "0.5962...
0.70116967
0
ExecutionSummary executionSummary = testViaExcel("unitTest_base_part2.xlsx", "flow_controls");
@Test public void baseCommandTests_part2() throws Exception { ExecutionSummary executionSummary = testViaExcel("unitTest_base_part2.xlsx"); assertPassFail(executionSummary, "crypto", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "macro-test", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "repeat-test", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "expression-test", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "multi-scenario2", TestOutcomeStats.allPassed()); assertPassFail(executionSummary, "flow_controls", new TestOutcomeStats(2, 14)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void baseCommandTests_part1() throws Exception {\n ExecutionSummary executionSummary = testViaExcel(\"unitTest_base_part1.xlsx\");\n assertPassFail(executionSummary, \"base_showcase\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"function_projectfile\",...
[ "0.74492884", "0.7062436", "0.694612", "0.6517798", "0.645428", "0.6435577", "0.63789505", "0.6351784", "0.6301464", "0.6297041", "0.6291103", "0.6214604", "0.6212538", "0.6199288", "0.6196658", "0.6196658", "0.61770207", "0.61564356", "0.6154084", "0.61171997", "0.6090017", ...
0.7153763
1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String firstline = scanner.nextLine(); String[] strings = firstline.split(" "); Map<String, Integer> pNs = new HashMap<String, Integer>(); Map<String, Integer> mNs = new HashMap<String, Integer>(); Map<String, Integer> nNs = new HashMap<String, Integer>(); for(int i=0;i<3;i++) { for(int index=0;index<Integer.parseInt(strings[i]);index++) { String[] scan = scanner.nextLine().split(" "); if (i==0) { if(Integer.parseInt(scan[1]) >= 200) { pNs.put(scan[0], Integer.parseInt(scan[1])); } }else if(i==1) { if (pNs.containsKey(scan[0])) { mNs.put(scan[0], Integer.parseInt(scan[1])); } }else if(i==2) { if (pNs.containsKey(scan[0])) { nNs.put(scan[0], Integer.parseInt(scan[1])); } } } } Map<String, Integer> endNs = new HashMap<>(); for(String name:pNs.keySet()) { int ms,ns,ends; if (mNs.containsKey(name)) { ms=mNs.get(name); }else { ms = -1; mNs.put(name, ms); } if (nNs.containsKey(name)) { ns=nNs.get(name); }else { ns = -1; nNs.put(name, ns); } if (ms > ns) { ends = (int) Math.round(ms*0.4+ns*0.6); }else { ends = ns; } if (ends > 59) { endNs.put(name, ends); } } List<Map.Entry<String,Integer>> list = new ArrayList<Map.Entry<String,Integer>>(endNs.entrySet()); Collections.sort(list,new Comparator<Map.Entry<String,Integer>>() { public int compare(Entry<String,Integer> o1,Entry<String,Integer> o2) { if(o1.getValue().equals(o2.getValue())){ return o1.getKey().compareTo(o2.getKey()); }else{ return -(o1.getValue().compareTo(o2.getValue())); } } }); for(int i=0;i<list.size();i++) { System.out.println(list.get(i).getKey()+" "+pNs.get(list.get(i).getKey())+" "+mNs.get(list.get(i).getKey())+" "+nNs.get(list.get(i).getKey())+" "+list.get(i).getValue()); } }
{ "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
Vista de mostrar diagrama individual
@GetMapping("/{id}") public String show(@PathVariable Long id,Model model) { if(diagramaService.exists(id)) { //Declaracion de la lista de elementos del diagrama bpmn Diagrama diagrama = diagramaService.find(id).get(); ArrayList<diagramaDao> elementosa=new ArrayList<>(); if(diagrama.getConfirmado()==null || diagrama.getConfirmado()==false) { //Declaración de string para nombres de lineas; String carrilPadrE=""; //Leer informacion del archivo xml y traerla (pool y tasks) DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); Document doc= builder.parse(diagrama.getPathArchivo()); NodeList elementos = doc.getElementsByTagName("elements"); for (int i = 0; i < elementos.getLength(); i++) { Node nodo = elementos.item(i); if(nodo.getNodeType()==Node.ELEMENT_NODE) { Element element= (Element) nodo; String type =element.getAttribute("xmi:type"); if(type.endsWith("Lane") || type.endsWith("Task")) { diagramaDao elementoDia= new diagramaDao(); elementoDia.setNombre(element.getAttribute("name")); if(type.endsWith("Task")) { elementoDia.setLineaPadre(carrilPadrE); }else { carrilPadrE= elementoDia.getNombre(); } elementosa.add(elementoDia); } } } } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }else { Set<Pool> carriles = diagrama.getPools(); for (Pool pool : carriles) { diagramaDao elementoDia= new diagramaDao(); elementoDia.setNombre(pool.getNombre()); elementosa.add(elementoDia); Set<Tarea> tareas= pool.getTareas(); //System.out.println("Carril: "+ pool.getId()+ " " + pool.getNombre()); for (Tarea tarea : tareas) { //System.out.println("tarea: "+tarea.getId()+ " " +tarea.getNombre()); diagramaDao elementoDia2= new diagramaDao(); elementoDia2.setLineaPadre(elementoDia.getNombre()); elementoDia2.setNombre(tarea.getNombre()); elementoDia2.setId(tarea.getId()); elementoDia2.setDescripcion(tarea.getDescripcion()); elementosa.add(elementoDia2); } } } /* for (diagramaDao diagramaDao : elementosa) { System.out.println(diagramaDao.getNombre()); System.out.println(diagramaDao.getLineaPadre()); }*/ model.addAttribute("elementos",elementosa); model.addAttribute("diagrama", diagrama); return "/diagrama/show"; }else { return "redirect:/diagramas"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "PiviDiagram createPiviDiagram();", "public void voroDiagram() {\n\t\tPowerDiagram diagram = new PowerDiagram();\n\t\tdiagram.setSites(sites);\n\t\tdiagram.setClipPoly(clipPolygon);\n\t\tdiagram.computeDiagram();\n\t}", "private void visualizaPersonajes() {\r\n\r\n\t\t// Recogemos nuestro personaje y comprobamo...
[ "0.70740646", "0.6525963", "0.64601594", "0.6348478", "0.6348478", "0.6259318", "0.62318933", "0.6196219", "0.61606145", "0.608122", "0.59889984", "0.5963484", "0.59427595", "0.5923831", "0.5908177", "0.5887581", "0.58016366", "0.5785368", "0.57827896", "0.5762913", "0.575807...
0.5741742
23
Eliminar diagrama (BDD y carpeta diagramas)
@GetMapping("/eliminar/{id}") public String delete(@PathVariable Long id, Model model) { if (diagramaService.exists(id)) { File file = new File(diagramaService.find(id).get().getPathArchivo()); boolean val = file.delete(); //No se si validaran esto asi que lo dejo asi if(val){ //si no hay ningun error al borrar el archivo, borramos de la base de datos diagramaService.delete(id); } else { //Error al eliminar archivo } } return "redirect:/diagramas"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void svuotaCaselle() {\n for (CasellaGraphic casella : listaCaselle) {\n casella.getPedine().getChildren().clear();\n }\n }", "public void actualizar() {\n\t\tthis.removeAll();\n\t\tDiagramaControl diagrama = (DiagramaControl) this.proyecto.getDiagramaActual();\n\t\tdiagrama.di...
[ "0.63937694", "0.6289757", "0.6133319", "0.6096141", "0.6087716", "0.6073829", "0.60197145", "0.59525186", "0.59367466", "0.585685", "0.5854309", "0.5799417", "0.57888645", "0.5773943", "0.57619715", "0.5740255", "0.5736561", "0.57304007", "0.56611055", "0.565994", "0.5652224...
0.55412257
34
This method is activated as 'input command' It is called whenever user clicks the input button or presses the enter key
private void clickEnter(){ String commandInput = textInput.getText(); String feedback; if (commandIsClear(commandInput)) { usedCommands.addFirst(commandInput); clearLinkedDisplay(); } else { if (commandInput.trim().isEmpty()) { feedback = "Empty command"; } else { try { usedCommands.addFirst(commandInput); Parser parser = new Parser(commandInput); Task currentTask = parser.parseInput(); if (currentTask.getOpCode() == OPCODE.EXIT) { Window frame = findWindow(widgetPanel); frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING)); frame.dispose(); } if (currentTask.getOpCode() == OPCODE.HELP) { feedback = currentTask.getHelpMessage(); } else { feedback = GUIAbstract.getLogic().executeTask(currentTask); } } catch (Exception e) { feedback = e.getMessage(); } } linkedDisplay.displayFeedback(feedback); for (TasksWidget widget : linkedOptionalDisplays) { widget.doActionOnClick(); } } clearTextInput(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "public String enterPressed();", "@Override\n\tpublic void handleInput() {\n\t\...
[ "0.7325737", "0.7315677", "0.7258387", "0.72402686", "0.70388395", "0.69300866", "0.68931425", "0.689271", "0.6854405", "0.68518275", "0.6823754", "0.6823685", "0.68169856", "0.6807722", "0.6786454", "0.67761105", "0.6767529", "0.6765427", "0.6762634", "0.67601895", "0.675928...
0.7453601
0
pressUp and pressDown must check if the opposite key was pressed because the pointer must move twice if so
private void pressUpFromCLI() { upLastPressed = true; if (commandIterator.hasNext()) { textInput.setText(commandIterator.next()); } if (downLastPressed) { textInput.setText(commandIterator.next()); downLastPressed = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void keyReleased() {\n if (key == 'z' || key == 'Z') shoot = false;\n if (keyCode == UP) up = false;\n if (keyCode == DOWN) down = false;\n if (keyCode == LEFT) left = false;\n if (keyCode == RIGHT) right = false;\n}", "public void keyPressed() {\n if (keyCode == UP) mouseRect += 4;\n if ...
[ "0.743199", "0.73900473", "0.7367043", "0.73487556", "0.7076745", "0.7038053", "0.7029095", "0.7029095", "0.70237446", "0.7001363", "0.6986754", "0.6963739", "0.69130695", "0.69048166", "0.68902683", "0.68823814", "0.68487227", "0.6823087", "0.68187237", "0.6796704", "0.67918...
0.6999064
10
Clears the user command prompt
private void clearTextInput() { textInput.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearPrompt()\n\t{\n\t\tpromptTarget = \"\";\n\t\tpromptType = \"\";\n\t\ttempPrompt = \"\";\n\t\tshowPrompt = true;\n\t}", "private void clearCommandPromptScreen() {\r\n //------------------------------------------------------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {...
[ "0.8098506", "0.77983046", "0.7572186", "0.75519896", "0.7466529", "0.740982", "0.7329262", "0.71974266", "0.7192048", "0.71508497", "0.7132539", "0.7124981", "0.7124391", "0.71124244", "0.7040494", "0.70333564", "0.6986695", "0.69342536", "0.6896165", "0.6891098", "0.6833883...
0.60243404
53
Clears the main display area
private void clearLinkedDisplay() { linkedDisplay.setText(linkedDisplay.getDefaultMessage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }", "void clear() {\n\t\tthis.theScreen.setColor(Preferences.COLOR_BACKGROUND);\n\t\tthis.theScreen.fillRect(0...
[ "0.7924392", "0.78645843", "0.77960306", "0.77728486", "0.7622991", "0.74625313", "0.7355891", "0.73490185", "0.7226303", "0.7216895", "0.7198826", "0.717079", "0.71659327", "0.7075123", "0.7073903", "0.7057095", "0.7013422", "0.70104414", "0.7001704", "0.69901836", "0.698886...
0.0
-1
Override the default (deprecated) method to show the custom progressbar
@Override public void setSupportProgressBarIndeterminateVisibility(boolean visible) { getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void showProgress() {\n\n }", "@Override\n public void showProgressBar() {\n MainActivity.sInstance.showProgressBar();\n }", "@Override\n public void showProgressSync() {\n }", "void showProgress();", "void onShowProgress();", "@Override\n\tpublic void showProg...
[ "0.79869246", "0.75956976", "0.75834996", "0.7456739", "0.72181827", "0.701599", "0.68797266", "0.6786913", "0.6784366", "0.67675394", "0.6712905", "0.6671827", "0.6656714", "0.6640104", "0.65632737", "0.6557295", "0.65227175", "0.65227175", "0.6520254", "0.6516686", "0.65140...
0.0
-1
Check the internet connection and if there's none shows a dialog with an error
protected boolean checkInternetConnection() { if (!Utils.hasInternetConnection(getApplicationContext())) { final AlertDialog.Builder adBuilder = createAlertDialog(R.string.dialog_title_no_internet, R.string.dialog_message_no_internet); adBuilder.setPositiveButton(R.string.dialog_btn_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); adBuilder.show(); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean checkNetworkAndShowDialog(Context context) {\r\n if (!checkNetConnection(context)) {\r\n //Logger.showShortMessage(context, context.getString(R.string.check_internet));\r\n return false;\r\n }\r\n return true;\r\n }", "public void ShowNoInternet...
[ "0.76360303", "0.74807256", "0.7414898", "0.7402633", "0.73426074", "0.7270383", "0.7220527", "0.7219851", "0.7167897", "0.7101918", "0.70646966", "0.70173496", "0.70114124", "0.699327", "0.6898709", "0.68905485", "0.6838606", "0.68324894", "0.6827309", "0.6827309", "0.675489...
0.7537103
1
Add a message to the log
protected void log(final String message) { Log.v(BuildConfig.TAG, message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void addToLog(String message) {\n\t\ttry {\n\t\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yy HH:mm:ss:SS\");\n\t\t\tDate dateobj = new Date();\n\t\t\tlog.write(df.format(dateobj) + \": \" + message + \"\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error With the Log File\")...
[ "0.7645228", "0.754861", "0.74250674", "0.7374441", "0.71980435", "0.71571046", "0.71470374", "0.71352214", "0.7118899", "0.7115026", "0.6974289", "0.6909507", "0.6906958", "0.6888933", "0.6886348", "0.6881234", "0.6878488", "0.6864364", "0.68472135", "0.68394536", "0.6828055...
0.6173011
96
Show a message to the user using a SnackBar
protected void showMessage(@StringRes final int resourceId) { showMessage(getString(resourceId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showSnackBar(String message) {\n }", "private void snackBar(String msg) {\n MySnackBar.createSnackBar(Objects.requireNonNull(getContext()), Objects.requireNonNull(getView()), msg);\n }", "private void showSnackBar(String message) {\n if(getActivity()!=null) {\n Snack...
[ "0.8756019", "0.7930977", "0.7818654", "0.77608824", "0.7588402", "0.7447814", "0.7383014", "0.7357489", "0.7298985", "0.7220818", "0.7208873", "0.71714854", "0.71400166", "0.7130897", "0.7097329", "0.70698786", "0.7061691", "0.7028652", "0.7014047", "0.7012842", "0.70123833"...
0.0
-1
Show a message to the user using a SnackBar
protected void showMessage(@NonNull final String message) { SnackbarManager.show(Snackbar.with(this).text(message).colorResource(R.color.blende_red).swipeToDismiss(true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showSnackBar(String message) {\n }", "private void snackBar(String msg) {\n MySnackBar.createSnackBar(Objects.requireNonNull(getContext()), Objects.requireNonNull(getView()), msg);\n }", "private void showSnackBar(String message) {\n if(getActivity()!=null) {\n Snack...
[ "0.8756019", "0.7930977", "0.7818654", "0.77608824", "0.7447814", "0.7383014", "0.7357489", "0.7298985", "0.7220818", "0.7208873", "0.71714854", "0.71400166", "0.7130897", "0.7097329", "0.70698786", "0.7061691", "0.7028652", "0.7014047", "0.7012842", "0.70123833", "0.7010515"...
0.7588402
4
Shows a Blendle themed Toast to the user
protected void showThemedToast(@StringRes final int resourceId, final int length) { Toast hint = Toast.makeText(getApplicationContext(), resourceId, length); final View hintView = hint.getView(); hintView.setBackgroundColor(getResources().getColor(R.color.blende_red)); if (hintView instanceof TextView) { ((TextView) hintView).setTextColor(getResources().getColor(android.R.color.white)); } hint.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void createToast(String slogan, float duration) {\n\t\tif (Gdx.app.getType() == ApplicationType.Android) {\n\t\t\tgGame.iFunctions.createToast(slogan, duration);\n\t\t} else\n\t\tsuper.createToast(slogan, duration);\n\t}", "protected void toastshow() {\n \n\t\tToast toast=new Toast(get...
[ "0.74993944", "0.72370034", "0.7187146", "0.7091351", "0.70732486", "0.70609576", "0.70609576", "0.7023413", "0.7023194", "0.7016792", "0.7016578", "0.7016578", "0.69897753", "0.69897753", "0.6979235", "0.69209206", "0.68969524", "0.68918246", "0.68838483", "0.6880348", "0.68...
0.69748914
15
Creates an alertdialog to show to the user.
protected AlertDialog.Builder createAlertDialog(@StringRes final int titleId, @StringRes final int messageId) { AlertDialog.Builder adBuilder = new AlertDialog.Builder(this); return adBuilder.setTitle(titleId).setMessage(messageId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }", "private void showAlert() {\n ...
[ "0.71900904", "0.7181066", "0.7166043", "0.71103096", "0.7096281", "0.7048456", "0.68873084", "0.67404747", "0.6714677", "0.6712051", "0.6689856", "0.66820985", "0.66465867", "0.6644598", "0.66355073", "0.6626135", "0.66163594", "0.6599503", "0.65867203", "0.65857893", "0.657...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scan =new Scanner(System.in); int size,i=0,temp=0; System.out.println("Enter terms"); size=scan.nextInt(); System.out.println("Enter input value"); String inputValue[] = new String[size]; for(i=0;i<size;i++){ inputValue[i] = scan.next(); } System.out.println("Duplicate value"); for( i=0;i<inputValue.length;i++){ for(int j=i+1;j<inputValue.length;j++){ if(inputValue[i].equals(inputValue[j])) { String value=inputValue[j]; System.out.println("Duplicate Array is "+value+", position"+i+","+j); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Gets the current trans unit page.
public TransUnitPage getCurrentTransUnitPage() { return page; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getCurrentPage(){\n\t\treturn sCurrentPage;\n\t}", "public Page getCurrentPageObject() {\n return getPageObject(this.currentIndex.viewIndex);\n }", "int getCurrentPage();", "public CharSequence getCurrentPage() {\n return pages.get(currentIndex);\n }", "public Integer ge...
[ "0.6609955", "0.63209045", "0.62996376", "0.62902665", "0.624646", "0.6236618", "0.62331533", "0.6180152", "0.6180152", "0.61734277", "0.6154279", "0.6129079", "0.61243224", "0.6095223", "0.6066186", "0.6043847", "0.6024865", "0.6007549", "0.5971857", "0.5971244", "0.5942323"...
0.8629201
0
Private constructor to avoid an instantiation of this utility class.
private ColorUtil() { // do nothing }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private Util() { }", "private Utils() {\n\t}", "private Utils() {\n\t}", "private Topography()\n\t{\n\t\tthrow new Il...
[ "0.8137667", "0.8017103", "0.8008533", "0.7884353", "0.7884353", "0.7875816", "0.7827995", "0.7801193", "0.7801193", "0.7801193", "0.7801193", "0.77816486", "0.772862", "0.772862", "0.7727037", "0.76538986", "0.76230717", "0.76230717", "0.76230717", "0.76230717", "0.76230717"...
0.0
-1
Returns color from a string. Several colors are supported, those are white, lightgray, gray, darkgray, black, red, pink, orange, yellow, green, magenta, cyan and blue. A string with RRGGBB is also supported.
static Color getColor(String colorString) { if (ArgumentCheckUtil.isNullOrEmptyString(colorString)) { return Color.LIGHT_GRAY; } else if (colorString.toLowerCase().equals("white")) { return Color.WHITE; } else if (colorString.toLowerCase().equals("lightgray")) { return Color.LIGHT_GRAY; } else if (colorString.toLowerCase().equals("gray")) { return Color.GRAY; } else if (colorString.toLowerCase().equals("darkgray")) { return Color.DARK_GRAY; } else if (colorString.toLowerCase().equals("black")) { return Color.BLACK; } else if (colorString.toLowerCase().equals("red")) { return Color.RED; } else if (colorString.toLowerCase().equals("pink")) { return Color.PINK; } else if (colorString.toLowerCase().equals("orange")) { return Color.ORANGE; } else if (colorString.toLowerCase().equals("yellow")) { return Color.YELLOW; } else if (colorString.toLowerCase().equals("green")) { return Color.GREEN; } else if (colorString.toLowerCase().equals("magenta")) { return Color.MAGENTA; } else if (colorString.toLowerCase().equals("cyan")) { return Color.CYAN; } else if (colorString.toLowerCase().equals("blue")) { return Color.BLUE; } else if (colorString.toLowerCase().equals("light_gray")) { return Color.LIGHT_GRAY; } else if (colorString.toLowerCase().equals("dark_gray")) { return Color.DARK_GRAY; } else if (colorString.startsWith("#") && colorString.length() == 7) { // for #RRGGBB format try { return new Color(Integer.parseInt(colorString.substring(1, 3), 16), Integer.parseInt(colorString .substring(3, 5), 16), Integer.parseInt(colorString.substring(5), 16)); } catch (NumberFormatException e) { return Color.LIGHT_GRAY; } } else { return Color.LIGHT_GRAY; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.awt.Color colorFromString(String s) {\n if (s.contains(\"RGB\")) {\n String[] parts = s.split(\"\\\\(|\\\\)\");\n String[] parameter = parts[2].split(\",\");\n int r = Integer.parseInt(parameter[0]);\n int g = Integer.parseInt(parameter[1]);\n ...
[ "0.79698914", "0.7892501", "0.7699993", "0.7561294", "0.75012934", "0.7283158", "0.72456187", "0.7203656", "0.71960473", "0.7190203", "0.7125065", "0.70574045", "0.67503726", "0.67180073", "0.6716562", "0.6692746", "0.6692554", "0.66733706", "0.66303974", "0.6591145", "0.6568...
0.80477965
0
Interface for a cluster controller a mechanism whereby a single instance of a service (the 'master') is used to process messages. Non master nodes monitor the state of the master and exactly one can take over if necessary.
public interface ClusterControl extends ClusterMetrics { /** * Used by the master to determine if he is still the master. * Updates the cluster status last processed timestamp. Cancels * any usurp actions. * @param heartBeat true if this message is a heartbeat */ public boolean verifyStatus(boolean heartbeat); /** * Used to send a heartbeat message when no traffic detected. * Should be configured to send a special message to the main * cluster thread so the lastProcessed timestamp will be * updated. */ public void sendHeartbeat(); /** * Called when the monitor detects the main thread is not * processing; stop the soInbound adapter so another instance * can take over. */ public void stopInbound(); /** * Called when a usurper successfully takes over the master * role; start the soInbound adapter. */ public void startInbound(); /** * Pause the application/instance - if this is a single-source * application, all instances will be paused; otherwise just * this instance will be paused. */ public String pause(); /** * Resume the application/instance - if this is a single-source * application, normal master election will occur (if the previous * master is available, it will most likely resume that role); * otherwise, just this instance is resumed. */ public String resume(); /** * Pause all (non-single-source) application instances. For single- * source applications, use {@link #pause()}. * @return */ public String pauseAll(); /** * Resume all (non-single-source) application instances. For single- * source applications, use {@link #resume()}. * @return */ public String resumeAll(); /** * Monitor the state of the master. */ public void doMonitor(); /** * @return the application id. */ public String getApplicationId(); /** * @return a string representing the current status of the application */ public String obtainApplicationStatus(); /** * */ public int getMessageCount(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ClusterDefinitionService {\n\n /**\n * Returns the local controller node.\n * @return local controller node\n */\n ControllerNode localNode();\n\n /**\n * Returns the set of seed nodes that should be used for discovering other members\n * of the cluster.\n * @retur...
[ "0.66244286", "0.6347714", "0.63165116", "0.61155623", "0.60566187", "0.58222604", "0.57735425", "0.5701916", "0.56923765", "0.566314", "0.5584166", "0.54876906", "0.54872227", "0.54800034", "0.5456547", "0.5453526", "0.5449104", "0.5441117", "0.54025096", "0.5402374", "0.537...
0.7793395
0
Used by the master to determine if he is still the master. Updates the cluster status last processed timestamp. Cancels any usurp actions.
public boolean verifyStatus(boolean heartbeat);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void checkUpdate() {\n \t\t// only update from remote server every so often.\n \t\tif ( ( System.currentTimeMillis() - lastUpdated ) > refreshInterval ) return;\n \t\t\n \t\tClusterTask task = getSessionUpdateTask();\n \t\tObject o = CacheFactory.doSynchronousClusterTask( task, this.nodeId );\n \t\tthis....
[ "0.60654706", "0.60533446", "0.57259643", "0.5622008", "0.5502846", "0.5501848", "0.54206204", "0.5335551", "0.5286632", "0.52827054", "0.52767164", "0.525915", "0.52428186", "0.5193278", "0.5182747", "0.517755", "0.5153349", "0.5148393", "0.5101224", "0.50974345", "0.5094788...
0.0
-1
Used to send a heartbeat message when no traffic detected. Should be configured to send a special message to the main cluster thread so the lastProcessed timestamp will be updated.
public void sendHeartbeat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void triggerHeartBeat() {\n\t\tif (this.postman==null) return;\n\t\tthis.postman.sendHeartBeatAt = 0;\n\t}", "@Override\n public void run() {\n final long currentTimeMillis = System.currentTimeMillis();\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(heartbeat + \" HeartbeatProcessor ....
[ "0.64622986", "0.6401591", "0.6365209", "0.63148254", "0.6311821", "0.6305367", "0.62715656", "0.62049323", "0.6144067", "0.6116391", "0.61087847", "0.6105845", "0.6074294", "0.60664505", "0.6053446", "0.6014992", "0.5940942", "0.5924858", "0.58979297", "0.5888666", "0.588231...
0.7086613
0
Called when the monitor detects the main thread is not processing; stop the soInbound adapter so another instance can take over.
public void stopInbound();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void stop()\r\n/* 78: */ {\r\n/* 79:203 */ if (!this.monitorActive) {\r\n/* 80:204 */ return;\r\n/* 81: */ }\r\n/* 82:206 */ this.monitorActive = false;\r\n/* 83:207 */ resetAccounting(milliSecondFromNano());\r\n/* 84:208 */ if (this.trafficShapingHandle...
[ "0.62751704", "0.6252368", "0.62365806", "0.6108402", "0.60745823", "0.6023197", "0.6001188", "0.59999174", "0.5980883", "0.59692323", "0.5924951", "0.59125245", "0.5904312", "0.5900232", "0.58981633", "0.58931464", "0.58843845", "0.58607006", "0.5855349", "0.5847096", "0.584...
0.69429797
0
Called when a usurper successfully takes over the master role; start the soInbound adapter.
public void startInbound();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}", "public void StartReplicationMgr()\n\t{\n\t\tif( hostIP.equals(m_oElection.GetLeaderIP()))\n\t\t{\n\t\t\tm_oSDFSMaster.StartReplicationMgr();\n\t\t}\n\t}", "protected void doStartup()\...
[ "0.5532652", "0.5494592", "0.5441771", "0.53814924", "0.53802216", "0.537849", "0.5366544", "0.5359707", "0.53458816", "0.5336648", "0.5333843", "0.5332228", "0.5325719", "0.5321645", "0.5311891", "0.5304873", "0.5296451", "0.528546", "0.527962", "0.52165633", "0.5205571", ...
0.6896237
0
Pause the application/instance if this is a singlesource application, all instances will be paused; otherwise just this instance will be paused.
public String pause();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void pauseApp() {\n\t\t\r\n\t}", "public void pauseApp() {\n theIsRunning = false;\n }", "protected void pauseApp() {\n\r\n\t}", "public void pauseApp() {\n\t\t//do nothing\n\t}", "public void pause() {\n\t\tsynchronized(this) {\n\t\t\tpaused = true;\n\t\t}\n\t}", "public void pauseAp...
[ "0.6939376", "0.6852848", "0.68242997", "0.68159276", "0.68090254", "0.6797534", "0.67270416", "0.66021365", "0.6581589", "0.6581589", "0.6581589", "0.6475692", "0.6475692", "0.6463813", "0.641961", "0.6370296", "0.636473", "0.63060856", "0.62630445", "0.6235475", "0.61911637...
0.0
-1
Resume the application/instance if this is a singlesource application, normal master election will occur (if the previous master is available, it will most likely resume that role); otherwise, just this instance is resumed.
public String resume();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runResumeWorkflow() {\n\t\tassert (status == WorkflowStatus.READY\n\t\t\t\t|| status == WorkflowStatus.FINISHED || status == WorkflowStatus.ERROR);\n\n\t\tsetStatus(WorkflowStatus.INITIALIZING);\n\t}", "void requestResume() {\n log(\"Resuming\");\n waitDependencies();\n setStop(f...
[ "0.7149267", "0.6698952", "0.6658302", "0.66189593", "0.66060424", "0.65506184", "0.6530407", "0.650165", "0.6488334", "0.647528", "0.6462807", "0.64298743", "0.64167607", "0.64142185", "0.64132833", "0.63896745", "0.63750035", "0.6369456", "0.63665223", "0.6361623", "0.63530...
0.0
-1
Monitor the state of the master.
public void doMonitor();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void monitor() {\n monitoringActor.tell(new Monitor(), ActorRef.noSender());\n }", "public boolean isMaster();", "public void run() {\n while (true) {\n try {\n // Poll server for snapshots and update client\n GameSnapshot snapshot = this.server...
[ "0.6770693", "0.6075587", "0.5986883", "0.59234816", "0.59117174", "0.58634", "0.58634", "0.584935", "0.5833645", "0.5811498", "0.57545996", "0.5672215", "0.56445503", "0.5603829", "0.55780023", "0.5563421", "0.5515255", "0.5513323", "0.5469554", "0.5435133", "0.54311514", ...
0.614497
1
nothing to tear down; no management context created
@AfterMethod public void tearDown(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void teardown() {\n }", "@Override\n public void cleanup() {\n \n }", "@Override\n public void cleanup() {\n \n }", "@Override\r\n\tpublic void cleanup() {\n\t\t\r\n\t}", "protected void cleaningUp() {\n\t}", "@Override\n\...
[ "0.72593206", "0.723476", "0.723476", "0.7124985", "0.7120332", "0.7082984", "0.7074048", "0.7044527", "0.70165366", "0.70149857", "0.6955769", "0.6955769", "0.6946986", "0.6946986", "0.6946986", "0.694027", "0.6919492", "0.6902337", "0.6889251", "0.6840948", "0.6811649", "...
0.0
-1
This is our own custom constructor (it doesn't mirror a superclass constructor). The context is used to inflate the layout file, and the list is the data we want to populate into the lists.
public TownAdapter(Activity context, ArrayList<Town> towns) { // Here, we initialize the ArrayAdapter's internal storage for the context and the list. // the second argument is used when the ArrayAdapter is populating a single TextView. // Because this is a custom adapter for four TextViews the adapter is not // going to use this second argument, so it can be any value. Here, we used 0. super(context, 0, towns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PassengerAdapter(Context context, List<PassengerDataVo> list) {\n\t\tarrayList = list;\n\t\tthis.context = context;\n\t\tinflater = LayoutInflater.from(context);\n\t}", "public ItemListAdapter(Context inContext) {\n context = inContext;\n }", "public PersonneAdapter(Context context, List<Perso...
[ "0.7474032", "0.72893035", "0.7201069", "0.71708065", "0.71655124", "0.7105056", "0.7064278", "0.70173615", "0.70156157", "0.70026815", "0.69985646", "0.69711506", "0.694748", "0.6929129", "0.6914981", "0.69131243", "0.68996274", "0.6893989", "0.686842", "0.68361104", "0.6816...
0.6447135
63
Provides a view for an AdapterView (ListView, GridView, etc.)
@Override public View getView(int position, View convertView, ViewGroup parent) { // Check if the existing view is being reused, otherwise inflate the view View listItemView = convertView; if(listItemView == null) { listItemView = LayoutInflater.from(getContext()).inflate( R.layout.town_list_item, parent, false); } // Get the {@Link Town} object located at this position in the list Town currentTown = getItem(position); TextView townNameTextView = (TextView) listItemView.findViewById(R.id.town_name); townNameTextView.setText(currentTown.getTownName()); TextView establishedTextView = (TextView) listItemView.findViewById(R.id.town_est_date); establishedTextView.setText(currentTown.getEstDate()); TextView populationTextView = (TextView) listItemView.findViewById(R.id.town_population); populationTextView.setText(currentTown.getPopulation()); TextView townBlurbTextView = (TextView) listItemView.findViewById(R.id.town_blurb); townBlurbTextView.setText(currentTown.getTownBlurb()); // Return the whole list item layout (containing 4 TextViews) // so that it can be shown in the ListView return listItemView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public View getView() { return view; }", "@Override\n public View getView()\n {\n return view;\n }", "@Override\n public View getView(LayoutInflater inflater, View convertView) {\n return getViewItem(inflater, convertView);\n }", "@Override\n public View getView() {\n r...
[ "0.7156826", "0.7130499", "0.7109641", "0.69379836", "0.6912278", "0.6905601", "0.6727164", "0.6715931", "0.6703116", "0.66985863", "0.66848433", "0.6651084", "0.6624867", "0.6622616", "0.6622616", "0.6617467", "0.66094905", "0.6600301", "0.65976864", "0.65966547", "0.6585918...
0.0
-1
Edit Panel on the right The constructor, arrange the main window into the border layout. It binds itself to the controller and panels to the main window. It calls creates a default blank state.
public MainWindow(String title, Controller ctr) { super(title); cv = new Canvas(ctr); JScrollPane jspMiddle = new JScrollPane(cv); jspMiddle.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); jspMiddle.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); ep = new EditPanel(ctr); tp = new ThumbnailPanel(ctr); JScrollPane jspLeft = new JScrollPane(tp); jspLeft.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); add(new ToolBar(ctr), BorderLayout.PAGE_START); add(jspLeft, BorderLayout.LINE_START); add(jspMiddle, BorderLayout.CENTER); add(ep, BorderLayout.LINE_END); setJMenuBar(new MenuBar(ctr)); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setExtendedState(JFrame.MAXIMIZED_BOTH); setLocationRelativeTo(null); // center the window setVisible(true); // create the default state State st = new State(System.currentTimeMillis()); ctr.appendState(st); ctr.setFocusedID(st.getID()); getThumbnailPanel().display(); addWindowListener(new WindowAdapter() { // prompt before exit @Override public void windowClosing(WindowEvent e) { super.windowClosing(e); ctr.onExitClicked(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\r\n\t\tthis.panel.setLayout(new BoxLayout(this.panel, BoxLayout.PAGE_AXIS));\r\n\t\tthis.labelTitle = new JLabel(\"Edit your weapons\");\r\n\t\tthis.labelTitle.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n\t\tthis.initFilter();\r\n\t\tthis.initList();\r\n\t\tthis.list.setSelectedIndex(0);\r\...
[ "0.6863418", "0.6814436", "0.67298555", "0.6699525", "0.6690491", "0.6675782", "0.6659531", "0.6642618", "0.65498203", "0.6481474", "0.64788187", "0.64749956", "0.6439754", "0.6438198", "0.6435366", "0.6429211", "0.641688", "0.6410847", "0.641059", "0.63904643", "0.6382331", ...
0.6884136
0
Get the Edit panel
public EditPanel getEditPanel() { return ep; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getEditLinkPanel() {\n\t\ttry{\n\t\t\tEditLinkPanel editLinkPanel = new EditLinkPanel(newsItem, feedNewsPresenter);\n\t\t\toptionPanel.add(editLinkPanel);\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public BaseEditorPanel getEditorPanel ()\n {\n retur...
[ "0.78980273", "0.76837087", "0.72355527", "0.7234131", "0.6832882", "0.6831195", "0.67721254", "0.67659664", "0.6732279", "0.6704622", "0.66740173", "0.6548827", "0.65301675", "0.652775", "0.6514907", "0.6503329", "0.6494658", "0.64807725", "0.6464822", "0.6454278", "0.641671...
0.86281484
0
use either list or a temp variable
void doMerge() { int[] temp = new int[arr.length + brr.length]; int count = 0; for (int i = 0; i < arr.length; i++) { temp[i] = arr[i]; count++; } for (int i = 0; i < brr.length; i++) { temp[count++] = brr[i]; } for (int i = 0; i < temp.length; i++) { System.out.println( temp[i] ); } String a[] = {"A", "E", "I"}; String b[] = {"O", "U"}; List<String> list = new ArrayList( Arrays.asList( a ) ); list.addAll( Arrays.asList( b ) ); Object[] c = list.toArray(); System.out.println( Arrays.toString( c ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void q2(){\n\t\tArrayList<Integer>myList=new ArrayList<>();\n\t\t\n\t}", "public void m(List<?> list) {\n\t}", "private List<EffectInfoModel> m19296a(List<TemplateInfo> list, List<TemplateInfo> list2, Set<Long> set) {\n ArrayList arrayList = new ArrayList();\n int count = this.bOt.getCount...
[ "0.5689259", "0.5448352", "0.54347223", "0.53008366", "0.5214768", "0.52076465", "0.5183195", "0.5168481", "0.5166408", "0.51037157", "0.50976616", "0.50976557", "0.5090439", "0.50737745", "0.5065121", "0.50108063", "0.50042075", "0.5003811", "0.49966878", "0.49956268", "0.49...
0.0
-1
/1.Use temporary array & iterate it from last element 2.Dont Change array but swap first element with last element & second element with last but 1...
public void reverseArray(int[] arr1) { int k = arr1.length; int arr2[] = new int[arr1.length]; for (int i = 0; i < arr1.length; i++) { arr2[k - 1] = arr1[i]; k = k - 1; } System.out.println( "After Reversing Elemenst" ); dispArray( arr2 ); // Swap int temp; for (int i = 0; i < arr1.length / 2; i++) { temp = arr1[i]; arr1[i] = arr1[arr1.length - i - 1]; arr1[arr1.length - i - 1] = temp; } dispArray( arr1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int[] ArraySwapper(int[] arr) {\n\t\tint size=Array.getLength(arr),temp;\n\t\tfor(int i=0;i<size/2;i++) {\n\t\t\ttemp =arr[i];\n\t\t\tarr[i]=arr[size-i-1];\n\t\t\tarr[size-i-1]=temp;\n\t\t}\n\t\treturn arr;\n\t\t\n\t}", "public static void main(String[] args) {\nint arr[]= {1,2,3,4,5};\r\nint i;\r...
[ "0.7241381", "0.7228466", "0.68038076", "0.6704399", "0.6701932", "0.6637654", "0.6615355", "0.6607681", "0.6594403", "0.6583075", "0.65819836", "0.6522412", "0.6477924", "0.6476259", "0.64042646", "0.64018637", "0.6384928", "0.63795364", "0.6351295", "0.6313436", "0.630492",...
0.5775318
74
Loads the Properties in the following order (if a property entry ia already loaded, it will be overridden with the new value). 1.) Default Properties (resource path) Minimal needed properties for the gdk 2.) Overwrite Properties (resource path) Usually projects that make use of the gdk library will define these properties. 3.) Overwrite Properties (system property path) Whenever the project needs to run as a jar file with an external properties file, it's required to pass the SYSTEM_PROPERTY key with the path to the properties file as value. (e.g. DpropFile=/app.properties) 4.) System Properties Projects that use the gdk library could be deployed to several environments that require different property values. The easiest way at this point is to just redefine those properties as system properties.
public static Properties load() throws IOException { Properties properties = new Properties(); try (InputStream defaultProperties = PropertiesLoader.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_PATH)) { properties.load(defaultProperties); } try (InputStream overwriteProperties = PropertiesLoader.class.getClassLoader().getResourceAsStream(OVERWRITE_PROPERTIES_PATH)) { if (overwriteProperties != null) { properties.load(overwriteProperties); } } String systemPropertiesPath = System.getProperty(SYSTEM_PROPERTY); if (systemPropertiesPath != null) { try (InputStream overwriteProperties = new FileInputStream(systemPropertiesPath)) { properties.load(overwriteProperties); } } properties.putAll(System.getProperties()); return properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void loadProperties() {\n properties = new Properties();\n try {\n File f = new File(\"system.properties\");\n if (!(f.exists())) {\n OutputStream out = new FileOutputStream(f);\n }\n InputStream is = new FileInputStream(f);\n ...
[ "0.72994465", "0.726672", "0.7210117", "0.7110225", "0.6843746", "0.6836639", "0.682678", "0.67430437", "0.6682499", "0.6543658", "0.65000695", "0.64752007", "0.64689475", "0.64202076", "0.6415431", "0.6411149", "0.6400106", "0.63926584", "0.6364635", "0.63592476", "0.6352457...
0.67969096
7
1. Brute Force Starting from each node in the graph, we treat it as a root to build a tree. Furthermore, we would like to know the distance between this root node and the rest of the nodes. The maximum of the distance would be the height of this tree. (559 Maximum Depth of Nary Tree) Then according to the definition of Minimum Height Tree (MHT), we simply filter out the roots that have the minimal height among all the trees. However, this solution is not efficient, whose time complexity would be O(N^2) where N is the number of nodes in the tree. As one can imagine, it will result in Time Limit Exceeded exception in the online judge. 2. Topological Sort (Sort of) Reference: ? why is it topologicalsortlike generates the order of objects based on their dependencies. (1) A tree is an undirected graph in which any two vertices are connected by exactly one path. (2) Any connected graph who has n nodes with n1 edges is a tree. (3) The degree of a vertex of a graph is the number of edges incident to the vertex. (4) A leaf is a vertex of degree 1. An internal vertex is a vertex of degree at least 2. (5) A path graph is a tree with two or more vertices that is not branched at all. (6) A tree is called a rooted tree if one vertex has been designated the root. (7) The height of a rooted tree is the number of edges on the longest downward path between root and a leaf. Calling iterator() is constant time. It is a method call that returns an Iterator instance on the collection you are calling on. For the treealike graph, the number of centroids is no more than 2. 1. If the nodes form a chain, it is intuitive to see that the above statement holds, which can be broken into the following two cases: a) If the number of nodes is even, then there would be two centroids. b) If the number of nodes is odd, then there would be only one centroid. 2. Other cases: not a chain, proof by contradiction: Suppose that we have 3 centroids in the graph, if we remove all the noncentroid nodes in the graph, then the 3 centroids nodes must form a triangle shape Because these centroids are equally important to each other, and they should equally close to each other as well. If any of the edges that is missing from the triangle, then the 3 centroids would be reduced down to a single centroid. However, the triangle shape forms a cycle which is contradicted to the condition that there is no cycle in our treealike graph. Any node that has already been a leaf cannot be the root of a MHT, because its adjacent nonleaf node will always be a better candidate. Time: graph construction: O(|V| 1) get initial leaves: O(|V|) trimming almost all edges and nodes: O(V + V 1) Total: O(V) Space: adjacency list: O(V + V 1) Leaves: worst case: one centroid, rest are leaves, O(V 1) total: O(V)
public List<Integer> findMinHeightTrees(int n, int[][] edges) { List<Integer> res = new ArrayList<Integer>(); if (n == 1) { res.add(0); return res; } List<List<Integer>> adjList = new ArrayList<List<Integer>>(); for (int i=0; i<n; i++) { adjList.add(new ArrayList<Integer>()); } int[] degree = new int[n]; for (int i=0; i<edges.length; i++) { adjList.get(edges[i][0]).add(edges[i][1]); adjList.get(edges[i][1]).add(edges[i][0]); degree[edges[i][0]]++; degree[edges[i][1]]++; } Queue<Integer> queue = new ArrayDeque<Integer>(); for (int i = 0; i < n; i++) { if (degree[i] == 1) { queue.offer(i); } } while (!queue.isEmpty()) { List leaves = new ArrayList<Integer>(); int size = queue.size(); for (int i = 0; i < size; i++){ int curr = queue.poll(); leaves.add(curr); for(int next : adjList.get(curr)) { degree[next]--; if (degree[next]==1) { queue.offer(next); } } } res = leaves; } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initia...
[ "0.61792654", "0.5693167", "0.56139445", "0.5566748", "0.5557411", "0.54869866", "0.5383214", "0.5382607", "0.5377555", "0.5329172", "0.53259015", "0.52827543", "0.525301", "0.51963204", "0.51745987", "0.51736814", "0.5163255", "0.51544774", "0.51535267", "0.51269126", "0.512...
0.5138559
19
Constructor: searchResults Display Description: Constructor that handles all of the buttons and the action handlers within the Panel
public searchResultsDisplay(User user) throws IOException, ParseException { //actionListener that lets the user returns the user to their list returntoUserPageButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ChangeEvent event = new ChangeEvent(this); for (ChangeListener listener : returntoUser) { listener.stateChanged(event); } } }); //actionListener that adds the selected game to their list m_addGameButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { try { m_fileManager = new FileManager(); } catch (IOException | ParseException e) { e.printStackTrace(); } m_row = m_gameTable.getSelectedRow(); //gets row of the game that the user wants to add String m_title = (String) m_gameTable.getValueAt(m_row, 0); String m_rating = scoreTextField.getText(); // gets the rating from the textbox for(Game g : (Iterable<Game>) m_searchResult){ if(g.getTitle().equals(m_title)){ if(!(m_rating.equals("") || m_rating == null)){ // if the rating is not empty g.setRating(m_rating); } else{ g.setRating("N/A"); } user.getGameLists().get(0).addGame(g); //adds the game to the user's list try { m_fileManager.saveUserData(user); //saves the data from the newly added game into the user's own list JOptionPane.showMessageDialog(null, "Game Added!", "Success!", JOptionPane.INFORMATION_MESSAGE); ChangeEvent event = new ChangeEvent(this); for (ChangeListener listener : m_addGame) { listener.stateChanged(event); } break; } catch (IOException | ParseException e) { e.printStackTrace(); } } } } }); //ActionListener on searchButton that searches the com.cs_group.objects.Game file again to find another game searchButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //gets the title from the textbox m_testGame.setTitle(searchGameText.getText()); try { if(m_fileManager1.isGameInList(m_testGame)){ // if the game is in the file m_NewSearchResult = m_fileManager1.gamesSearchResult(m_testGame); //makes a new com.cs_group.objects.GameList with the search Result ChangeEvent event = new ChangeEvent(this); for (ChangeListener listener : m_addAnotherGame) { listener.stateChanged(event); } }else { JOptionPane.showMessageDialog(null, "GAME NOT FOUND", "ERROR", JOptionPane.ERROR_MESSAGE);} } catch (IOException | ParseException ioException) { ioException.printStackTrace(); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SearchResultPanel()\n\t{\n\t\tcreateComponents();\n\t\tdesignComponents();\n\t\taddComponents();\n\t}", "public DisputeSearchPanel() {\n initComponents();\n }", "public SearchPanel(\r\n\t\t\tSearchHandler handlerRef, \r\n\t\t\tRecordListView li, \r\n\t\t\tCategoryHandler<IncomeRecord> inCatHan...
[ "0.76926076", "0.7257609", "0.7229268", "0.7072222", "0.6942803", "0.6797276", "0.67393017", "0.6695274", "0.6675209", "0.6674875", "0.66567624", "0.663788", "0.66344726", "0.66189945", "0.660935", "0.65930986", "0.65854716", "0.65660006", "0.65537006", "0.6517189", "0.650518...
0.0
-1
gets the title from the textbox
@Override public void actionPerformed(ActionEvent e) { m_testGame.setTitle(searchGameText.getText()); try { if(m_fileManager1.isGameInList(m_testGame)){ // if the game is in the file m_NewSearchResult = m_fileManager1.gamesSearchResult(m_testGame); //makes a new com.cs_group.objects.GameList with the search Result ChangeEvent event = new ChangeEvent(this); for (ChangeListener listener : m_addAnotherGame) { listener.stateChanged(event); } }else { JOptionPane.showMessageDialog(null, "GAME NOT FOUND", "ERROR", JOptionPane.ERROR_MESSAGE);} } catch (IOException | ParseException ioException) { ioException.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TextField<String> getTITLE() {\n\t\treturn title;\n\t}", "public Text getTxtTitle() {\n\treturn txtRecord;\n }", "public String getBookTitle(){\n return bookTitle.getText();\r\n }", "public String getTitleChoice() {\n return io.readString(\"Please enter the Title of the DVD: \");\n...
[ "0.75844556", "0.7095482", "0.70110786", "0.68252015", "0.67589355", "0.6671918", "0.66656256", "0.6628779", "0.6614007", "0.6614007", "0.6614007", "0.6614007", "0.6614007", "0.6573879", "0.65379065", "0.65379065", "0.65379065", "0.65379065", "0.65379065", "0.65379065", "0.65...
0.0
-1
Method: setGameDisplay Description: Sets the searchResultsDisplay with all of the games that match what the user searched.
public void setGameDisplay(GameList gameList){ String[][] m_data = new String[gameList.getLength()][3]; int m_counter = 0; //iterates through the game list and sets the information at each column to the current games information for (Game g : (Iterable<Game>)gameList) { m_data[m_counter][0] = g.getTitle(); m_data[m_counter][1] = g.getGenre(); m_data[m_counter++][2] = g.getPublisher(); Game m_tmpGame = new Game(); m_tmpGame = g; m_searchResult.addGame(g); // adds the game to the searchResults List } //sets the table with basic information m_gameTable.setModel( new DefaultTableModel( m_data, new String[]{"Title", "Genre", "Publisher"} )); TableColumnModel columns = m_gameTable.getColumnModel(); columns.getColumn(0).setMinWidth(0); m_gameTable.setAutoCreateRowSorter(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setMatch(Match game) {\n this.game = game;\n }", "public searchResultsDisplay(User user) throws IOException, ParseException {\n\n //actionListener that lets the user returns the user to their list\n returntoUserPageButton.addActionListener(new ActionListener() {\n @Overri...
[ "0.5736401", "0.5587684", "0.5521514", "0.545509", "0.53969413", "0.524046", "0.51536137", "0.51475006", "0.51288193", "0.5115515", "0.5065768", "0.5032723", "0.5011929", "0.50040877", "0.49993616", "0.498986", "0.4985425", "0.49835563", "0.49805224", "0.4970398", "0.4959975"...
0.66431403
0
Method: getSearchResultPanel Description: Gets the searchResultPanel for com.cs_group.managers.ScreenManager
public JPanel getSearchResultPanel(){return searchResultPanel;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JPanel getSearchJPanel(){\n\t\treturn searchResults;//Return the search results\n\t}", "public SearchResultPanel()\n\t{\n\t\tcreateComponents();\n\t\tdesignComponents();\n\t\taddComponents();\n\t}", "public ResultPanelView getResultPanel() {\n\t\treturn resultview;\n\t}", "public JPanel getScreen();",...
[ "0.7456045", "0.5958196", "0.5871285", "0.5860285", "0.58330595", "0.5774487", "0.5702239", "0.56790704", "0.55922395", "0.55503887", "0.5511867", "0.5498415", "0.543473", "0.5395263", "0.53889745", "0.5388422", "0.53726846", "0.5367936", "0.5367936", "0.5366097", "0.53660136...
0.74086887
1
Method: addReturntoUserPage Description: adds the listener from returntoUserPageButton to return the user back to their page
public void addReturntoUserPage(ChangeListener listener) { returntoUser.add(listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void handleBackButton(ActionEvent event) throws IOException {\n showUserAccountPage(event);\n }", "@Override\n public boolean onKeyUp(int keyCode, KeyEvent event) {\n // Back Button\n //==================\n switch (keyCode){\n case(KeyEvent.KEYCODE_BACK):\n ...
[ "0.6371361", "0.6091974", "0.60499847", "0.5992564", "0.59431684", "0.59306604", "0.58992654", "0.5884861", "0.5858559", "0.5831775", "0.58307314", "0.5797619", "0.57463264", "0.5744429", "0.57226604", "0.5712146", "0.5708639", "0.5701501", "0.5684969", "0.5683428", "0.566937...
0.8267005
0
Method: addAnotherGame Description: adds the listener from the searchButton to search the file again with the new critera
public void addAnotherGame(ChangeListener listener){ m_addAnotherGame.add(listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void actionPerformed(ActionEvent e) {\n m_testGame.setTitle(searchGameText.getText());\n try {\n if(m_fileManager1.isGameInList(m_testGame)){ // if the game is in the file\n m_NewSearchResult = m_fileManager1.games...
[ "0.7626344", "0.66372216", "0.5713525", "0.5672533", "0.55978596", "0.54589736", "0.5453385", "0.54288095", "0.5411461", "0.5369889", "0.5302122", "0.528592", "0.5281298", "0.527595", "0.52664834", "0.52660877", "0.5262702", "0.5251581", "0.52494794", "0.5244307", "0.52313787...
0.59510595
2
Method: setSearchResultLabel Descritpion: sets the Search Result Label with the string from the user
public void setSearchResultLabel(String resultLabel){ searchResultLabel.setText(resultLabel);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setResultLabelText(JLabel resultLabel) {\r\n if (result == Occupant.NONE) { // If the result was a tie\r\n resultLabel.setText(\"Tie! No winners!\");\r\n } else { \r\n resultLabel.setText(result.toString() + \" has won this round!\");\r\n }\r\n }", "void...
[ "0.7226217", "0.69365394", "0.68373215", "0.66971326", "0.6694722", "0.65664583", "0.6561596", "0.6552137", "0.65466166", "0.65466166", "0.6530945", "0.6527134", "0.65251917", "0.6521497", "0.6496614", "0.64921886", "0.64616245", "0.6456923", "0.64302355", "0.64240074", "0.64...
0.9083858
0
Method: getSearchResult Description: returns a list of games that match the user's search
public GameList getSearchResult(){ return m_NewSearchResult;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<GameResult> getAllResults();", "List<GameResult> getAllGameResults();", "public ArrayList<Movie> getSearchResult(String search) {\n\t\tArrayList<Movie> res = new ArrayList<>();\n\t\tfor (int i=0; i<getDataLength(); ++i) {\n\t\t\tboolean check = false;\n\t\t\tcheck = this.dataList.get(i).getTitle().toLower...
[ "0.6877852", "0.67113054", "0.6407654", "0.63854337", "0.6327969", "0.63224494", "0.6191836", "0.617974", "0.60502166", "0.60153455", "0.59058833", "0.58850175", "0.58773136", "0.58454657", "0.58330816", "0.5817653", "0.5812319", "0.577355", "0.5769227", "0.5762553", "0.57545...
0.6944959
0
Method: getTestGame Description: gets the Game object of the title that the user searched so that it can be displayed in searchResultsDisplay.
public Game getTestGame(){ return m_testGame; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Game getGame(String title) {\n\n if(games != null)\n return games.get(title);\n else\n return null;\n }", "@Test\n\tpublic void getGameTestGameFound() {\n\t\tGame expectedGame = new Game();\n\t\tGame game = gameRepository.createGame(expectedGame);\n\n\t\texpectedGame...
[ "0.68779236", "0.62731224", "0.6166691", "0.6027889", "0.60130924", "0.6011256", "0.5998871", "0.59921855", "0.59921855", "0.59921855", "0.59921855", "0.59801996", "0.59081393", "0.58938265", "0.58847", "0.58847", "0.58637196", "0.5845351", "0.5839741", "0.58040965", "0.57996...
0.7032787
0
/ Clase constructora concreta de la clase abstracta PersonajeBuilder. Se encarga de la representacion del Personaje de Agua.
@Override public void reset() { // Crea instancia y define el tipo del personaje. this.personaje = new Personaje(); this.personaje.setTipo("Agua"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Person(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Persona() {\n \t\n }", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Persona() {\n\t}", "public PersonAddressBuilderDFB(PersonDFB person){\n ...
[ "0.67960465", "0.66670185", "0.65906096", "0.65906096", "0.652129", "0.6442835", "0.6384059", "0.635442", "0.63406265", "0.63378376", "0.6284654", "0.6249297", "0.617841", "0.61753434", "0.6147802", "0.6142117", "0.6140686", "0.6084328", "0.60718536", "0.6056986", "0.60504836...
0.0
-1
Modifica el nivel del personaje. Toma valores del 1 al 5.
@Override public void buildNivel(int nivel) { if(nivel < 6) this.personaje.setNivel(nivel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setNivel (int nivel)\r\n\t{\r\n\t\tthis.nivel = nivel;\r\n\t}", "public void setNivel(int nivel) {\n this.nivel = nivel;\n }", "protected void subirDeNivel(int n) //A cada 100 de xp, sobe de nivel\n {\n this.nivel = nivel + n;\n }", "public void setNivel...
[ "0.76251346", "0.740715", "0.7229274", "0.7221064", "0.7213972", "0.7086152", "0.6857928", "0.6857928", "0.6754088", "0.6682793", "0.6670143", "0.6667158", "0.6629516", "0.6366111", "0.6177588", "0.6130093", "0.5934562", "0.58021975", "0.57609046", "0.574772", "0.5735832", ...
0.76944965
0
El personaje obtiene un arma de nombre "Lanza", categoria A y danio 9.
@Override public void buildArma() { this.personaje.setArma(new Arma("Lanza", 'A', 9)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void leituraMapa() throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(caminho+\"/caminho.txt\"));\n String linha = br.readLine();\n String array[] = new String[3];\n while (linha != null){\n array = linha.split(\",\");\n dm.addEleme...
[ "0.6569619", "0.6231772", "0.619461", "0.61436117", "0.61231905", "0.60926867", "0.6091667", "0.6073469", "0.60568297", "0.5996329", "0.59960014", "0.59886044", "0.59388673", "0.59218615", "0.58981264", "0.5876437", "0.5866248", "0.5859935", "0.5838829", "0.58333766", "0.5819...
0.5864523
17
Se le asigna una habilidad secundaria al personaje segun el valor pasado por parametro.
@Override public void buildHabilidadSecundaria(int tipo) { String habilidad; habilidad = switch (tipo) { case 1 -> "Burbuja"; case 2 -> "Corriente marina"; case 3 -> "Compresion"; default -> "Tsunami"; }; this.personaje.setHabilidadSecundaria(habilidad); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setParam(String chave, Object valor) {\n //se contem a chave, entao eh removido e adicionado novamente\n if (paramSis.containsKey(chave)) {\n paramSis.remove(chave);\n paramSis.put(chave, valor);\n } else {\n //senao o valor eh adicionado\n ...
[ "0.53500015", "0.5283026", "0.5236795", "0.5223307", "0.5115458", "0.5102026", "0.5101473", "0.5094774", "0.5087566", "0.5069124", "0.50400794", "0.50261277", "0.50029486", "0.49921477", "0.49847728", "0.49670887", "0.4952303", "0.4937867", "0.4930909", "0.49305868", "0.49145...
0.61840254
0
Modifica la edad del personaje.
@Override public void buildEdad(int edad) { if (edad > 0 && edad <51) this.personaje.setEdad(edad); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cambiarEdad(int edad){\r\n\t\tthis.edad = edad;\r\n\t}", "public void setEdad(int edad) {\n this.edad = edad;\n }", "public void setEdificio (String pEdificio)\r\n {\r\n this.edificio = pEdificio;\r\n }", "public void agregarAlFinal(int edad){\n if(!estaVacia()){\n ...
[ "0.69907945", "0.6718352", "0.663153", "0.65517735", "0.6538721", "0.6373959", "0.6367379", "0.6292057", "0.62906855", "0.62346107", "0.6217627", "0.6216601", "0.62079155", "0.6198586", "0.61702526", "0.6153742", "0.6151605", "0.61513346", "0.61513346", "0.6131727", "0.612340...
0.685697
1
Define la personalidad del personaje.
@Override public void buildPersonalidad() { this.personaje.setPersonalidad("Pacientes y estrategas."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public void damePersonaje(String personaje){\n this.personaje=personaje;\n\n\n\n }", "void crearNuevaPersona(Persona persona);", "public Persona()\...
[ "0.72741914", "0.69547904", "0.6796272", "0.6634444", "0.659874", "0.636874", "0.6320959", "0.6315146", "0.62937087", "0.6285335", "0.62473804", "0.62099093", "0.62073904", "0.6182376", "0.6128318", "0.612793", "0.61014044", "0.6099448", "0.60860705", "0.6072794", "0.60616934...
0.76909125
0
Define el aspecto del personaje.
@Override public void buildAspecto() { this.personaje.setAspecto("Se presenta con rasgos humanos, rodeado de circulos de agua."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IAspect register(IPartType partType, IAspect aspect);", "public interface Aspectalizable {\n\n /**\n * Get the data associated with an aspect\n * @param aspectName The aspect name\n * @return The data or null if the aspect is not associated with this object\n */\n Object getAspectDat...
[ "0.599334", "0.5959024", "0.5929798", "0.5903744", "0.5662848", "0.55552566", "0.5497225", "0.5253528", "0.5233442", "0.51825017", "0.5178119", "0.5169338", "0.5166564", "0.5145851", "0.5116155", "0.50788933", "0.5058058", "0.5047155", "0.5044583", "0.5015424", "0.49892563", ...
0.80492395
0
Intercepts the request and checks is a session attribute with name currentuser is set or not. If not set, sets it to a default value to simulate allowall behavior
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String testUser = request.getParameter("testUser"); if (testUser == null || testUser.isEmpty() || testUser.equalsIgnoreCase("undefined")) { testUser = "default"; } Map<String, String> userAttrs = m_userAttributes.get(testUser); String user = userAttrs.get("username"); String group = userAttrs.get("usergroup"); WebUtils.setSessionAttribute(request, "currentuser", user); WebUtils.setSessionAttribute(request, "currentgroup", group); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setSessionAttribs(HttpServletRequest req, BlogUser user) {\n\t\treq.getSession().setAttribute(\"current.user.id\", user.getId());\n\t\treq.getSession().setAttribute(\"current.user.fn\", user.getFirstName());\n\t\treq.getSession().setAttribute(\"current.user.ln\", user.getLastName());\n\t\treq.getSessi...
[ "0.6072737", "0.6021256", "0.5977512", "0.5919502", "0.58000314", "0.57847774", "0.5780505", "0.5762656", "0.57541513", "0.56843036", "0.5647876", "0.56229645", "0.5620219", "0.55600995", "0.55534726", "0.55250823", "0.5491628", "0.548781", "0.5485887", "0.54425853", "0.54235...
0.6676133
0
Sets the attributes for each user created. The users and their attributes are injected
public void setUserAttributes(Map<String, Map<String, String>> mUserAttributes) { m_userAttributes = mUserAttributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createUsers() {\n\n\t\tList<User> UserList = Arrays.asList(new User(\"Kiran\", \"kumar\", \"kiran@gmail.com\", 20),\n\t\t\t\tnew User(\"Ram\", \"kumar\", \"ram@gmail.com\", 22), new User(\"RamKiran\", \"LaxmiKiran\", \"sita@gmail.com\", 30),\n\t\t\t\tnew User(\"Lakshamn\", \"Seth\", \"seth@gmail.com\"...
[ "0.6691408", "0.6502055", "0.6270155", "0.62232184", "0.6175018", "0.6161079", "0.61422336", "0.612812", "0.6117844", "0.6115549", "0.6109574", "0.60717124", "0.60678756", "0.601498", "0.6007481", "0.6005115", "0.59691447", "0.5950059", "0.59477955", "0.593436", "0.5897033", ...
0.58390695
24