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
standard slf4j methods still work just fine
public static void main(String[] args) throws Exception { log.info("It is now {}", new java.util.Date()); // add a throwable handler that only applies to this log log.addThrowableHandler(t -> System.err.format("Handled a throwable: %s%n", t.getMessage())); // add a throwable handler that applies to ALL logs Log.addGlobalThrowableHandler(t -> System.err.format("GLOBALLY handled a throwable: %s%n", t.getMessage())); // single-level logger log.info.format("This is a simple message going to the %s logger.", "info"); // one of the new log levels log.cwarn.print("This warning goes to the log and to the console with coloring"); // create a stopwatch that logs its duration to info level try (StopwatchLog sw1 = log.info.stopwatch("simpleStopwatch")) { // do something time consuming... for (int i = 0; i < 5; ++i) { sw1.warn("log message {}", i); } } // create a stopwatch that logs its duration to debug level but will auto-warn or auto-error // if operations take too long try (StopwatchLog sw2 = log.debug.stopwatch("stopwatchdemo") .warnOver(Duration.ofMillis(250)) .errorOver(Duration.ofMillis(500))) { sw2.info("Going to sleep"); Thread.sleep(1000); // takes over 500 ms, so results in an error log sw2.info("Woke up!"); } // use jansi coloring to stdout log.cout.format("@|bold,blue This message is bright blue.|@"); // oh yeah, what about those Throwable handlers? log.warn("uh-oh!", new Exception("let's test the throwable handlers")); // ...and prefixes Log lp = log.withPrefix("my prefix: "); lp.info("and don't forget about log prefixes."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static Logger initLogger() {\n \n \n File logFile = new File(\"workshop2_slf4j.log\");\n logFile.delete();\n return LoggerFactory.getLogger(Slf4j.class.getName());\n }", "void initializeLogging();", "@Override\n public void logs() {\n \n }", "public void e...
[ "0.65537465", "0.6402706", "0.62541556", "0.6189627", "0.61478174", "0.6115631", "0.606727", "0.60442567", "0.6005335", "0.595579", "0.59432024", "0.5919291", "0.5912659", "0.58808905", "0.5863483", "0.58534026", "0.58342737", "0.5830451", "0.58016896", "0.5776434", "0.577059...
0.53472036
60
Number of Points in Chart
protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w = getWidth(); int h = getHeight(); // Draw ordinate. g2.draw(new Line2D.Double(Points, Points, Points, h-Points)); // Draw abcissa. g2.draw(new Line2D.Double(Points, h-Points, w-Points, h-Points)); // Draw labels. Font font = g2.getFont(); FontRenderContext frc = g2.getFontRenderContext(); LineMetrics lm = font.getLineMetrics("0", frc); float sh = lm.getAscent() + lm.getDescent(); // Ordinate label. String s = "Strecke"; float sy = Points + ((h - 2*Points) - s.length()*sh)/2 + lm.getAscent(); for(int i = 0; i < s.length(); i++) { String letter = String.valueOf(s.charAt(i)); float sw = (float)font.getStringBounds(letter, frc).getWidth(); float sx = (Points - sw)/2; g2.drawString(letter, sx, sy); sy += sh; } // Abcissa label. s = "Datum"; sy = h - Points + (Points - sh)/2 + lm.getAscent(); float sw = (float)font.getStringBounds(s, frc).getWidth(); float sx = (w - sw)/2; g2.drawString(s, sx, sy); // Draw lines. double xInc = (double)(w - 2*Points)/(data.length-1); double scale = (double)(h - 2*Points)/getMax(); g2.setPaint(Color.green.darker()); for(int i = 0; i < data.length-1; i++) { double x1 = Points + i*xInc; double y1 = h - Points - scale*data[i]; double x2 = Points + (i+1)*xInc; double y2 = h - Points - scale*data[i+1]; g2.draw(new Line2D.Double(x1, y1, x2, y2)); } // Mark data points. g2.setPaint(Color.red); for(int i = 0; i < data.length; i++) { double x = Points + i*xInc; double y = h - Points - scale*data[i]; g2.fill(new Ellipse2D.Double(x-2, y-2, 4, 4)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPointsCount();", "public int getNPoints() {\n\t\treturn points.size();\n\t}", "@Override\n\tpublic int getNumberOfPoints()\n\t{\n\t\treturn afXValues.length;\n\t}", "public int numPoints() {\n\t\treturn divided ? -1 : points.size();\n\t}", "public int getNbPoints() {\n return nbPoints;\n }...
[ "0.8161297", "0.76527435", "0.75153804", "0.74458104", "0.7420048", "0.73795193", "0.7277979", "0.72074175", "0.70343184", "0.7033498", "0.70229584", "0.69483036", "0.6937647", "0.6922192", "0.68873197", "0.6868589", "0.6833623", "0.6830943", "0.68144846", "0.6810809", "0.680...
0.0
-1
TODO: finish implementation add item to the room
public boolean addDecorItem(DecorItem decorItem) { if (!interiorDesign.doesMatchInterior(decorItem)) { return false; } decorItems.add(decorItem); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addItemToRoom(Item item) {\n this.ItemsInRoom.put(item.getName(), item);\n }", "public void addItem(Item toAdd) throws ImpossiblePositionException, NoSuchItemException {\n int itemX = (int) toAdd.getXyLocation().getX();\n int itemY = (int) toAdd.getXyLocation().getY();\n Arra...
[ "0.75788426", "0.7010212", "0.6831022", "0.6769645", "0.676772", "0.6740603", "0.66911536", "0.6657612", "0.6644359", "0.6604638", "0.6574073", "0.64870125", "0.6486658", "0.6402972", "0.6395242", "0.6375506", "0.63748294", "0.63461345", "0.6343482", "0.6343", "0.6333381", ...
0.0
-1
returns number of items in the room (current number of items, not max number)
public int getNumberOfItems() { return decorItems.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getNumItems();", "int getItemsCount();", "int getItemsCount();", "public int getNumOfRooms() {\n return internalList.size();\n }", "public int getItemCount() {\n checkWidget();\n return OS.SendMessage(handle, OS.TCM_GETITEMCOUNT, 0, 0);\n }", "public int howManyAvailable(It...
[ "0.77240956", "0.7654233", "0.7654233", "0.75960785", "0.7332006", "0.72504556", "0.7196553", "0.7188153", "0.71755844", "0.712688", "0.7108917", "0.70575136", "0.70575136", "0.70497584", "0.703601", "0.7034994", "0.7030847", "0.70292264", "0.7010733", "0.6990765", "0.6984187...
0.6805892
45
Creates a new instance.
public PngImageDataReader() { this(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Instance createInstance();", "public void create(){}", "public Instance() {\n }", "private Instantiation(){}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "void create(T instance) throws IOException;", "public v...
[ "0.7834167", "0.72893584", "0.70771503", "0.7048765", "0.70209944", "0.6839274", "0.67782235", "0.6770133", "0.67429745", "0.6701039", "0.6690158", "0.6630354", "0.66046286", "0.6600776", "0.6600776", "0.6597608", "0.6592152", "0.6564594", "0.65268713", "0.652679", "0.6475239...
0.0
-1
Creates a new instance.
public PngImageDataReader(Color transparent) { this.transparent = transparent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Instance createInstance();", "public void create(){}", "public Instance() {\n }", "private Instantiation(){}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "void create(T instance) throws IOException;", "public v...
[ "0.7834167", "0.72893584", "0.70771503", "0.7048765", "0.70209944", "0.6839274", "0.67782235", "0.6770133", "0.67429745", "0.6701039", "0.6690158", "0.6630354", "0.66046286", "0.6600776", "0.6600776", "0.6597608", "0.6592152", "0.6564594", "0.65268713", "0.652679", "0.6475239...
0.0
-1
Inflate the lv_income_item for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_forth, container, false); sp = getActivity().getSharedPreferences("data", Context.MODE_PRIVATE); editor = sp.edit(); bt_logout = view.findViewById(R.id.bt_logout); bt_logout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { editor.clear(); editor.commit(); Intent intent = new Intent(getActivity(),LoginActivity.class); Toast.makeText(getActivity(),"注销用户成功",Toast.LENGTH_SHORT).show(); startActivity(intent); } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_keranjang, container, false);\n\n lv_item_keranjang = view.findViewById(R.id.lv_keranjang);\n\n tv_h...
[ "0.59029627", "0.580203", "0.57800615", "0.5765248", "0.56212497", "0.5595393", "0.5589781", "0.5566951", "0.55347645", "0.5519776", "0.55102545", "0.54835767", "0.5482767", "0.5462346", "0.5404165", "0.5402502", "0.5378214", "0.5374491", "0.53570974", "0.5333443", "0.5328961...
0.0
-1
/////////////////////////////////////////////////////////////// Creates a new empty tree with a specified depth.
private SceneOctTree ( Bounds bounds, int depth ) { this.bounds = bounds; this.depth = depth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VPHashTree(int depth) {\n super(DEFAULT_BIN_SIZE);\n this.depth = depth;\n this.depthReached = false;\n }", "public StaticTree (int depth) {\r\n\t\tinitializeStack(depth);\r\n\t\t//Initialize root for an empty tree\r\n\t\tthis.root=-1;\r\n\t\t//First available position when creatin...
[ "0.7047536", "0.69058", "0.63412917", "0.62288564", "0.6208746", "0.6206141", "0.6158622", "0.6104402", "0.6075646", "0.6035529", "0.6023986", "0.6022904", "0.6022405", "0.60203254", "0.6016322", "0.6003774", "0.60015184", "0.5989531", "0.5984953", "0.5981055", "0.5977443", ...
0.58421415
30
SceneOctTree /////////////////////////////////////////////////////////////// Gets the bounds of this tree.
public Bounds getBounds () { return (bounds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SceneOctTree (\n Bounds bounds\n ) {\n\n this.bounds = bounds;\n\n }", "public Rectangle getBounds() {\n\t\tif (bounds == null) {\n\t\t\tsuper.getBounds();\n\t\t\tfor (int i = 0; i < getChildren().size(); i++) {\n\t\t\t\tIFigure child = (IFigure) getChildren().get(i);\n\t\t\t\tbounds.union(child.g...
[ "0.6939349", "0.6711912", "0.65519285", "0.6518964", "0.64498395", "0.64367914", "0.6435734", "0.64346623", "0.6425548", "0.6381136", "0.63800675", "0.63740695", "0.63621837", "0.6356533", "0.6355358", "0.63457924", "0.6339917", "0.6321523", "0.63106114", "0.63106114", "0.626...
0.65356284
3
/////////////////////////////////////////////////////////////// Creates a new empty tree.
public SceneOctTree ( Bounds bounds ) { this.bounds = bounds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "public Tree(){\n root = null;\n }", "public Tree() // constructor\n\t{ root = null; }", "public TreeNode() {\n // do nothing\n }", "public TreeBuilder() {\n\t\troot = null;\n\t}", "public voi...
[ "0.7544005", "0.7404558", "0.73339033", "0.7295298", "0.7248352", "0.7211289", "0.72098696", "0.71966106", "0.7152254", "0.7145246", "0.7104704", "0.7099712", "0.70504874", "0.70249295", "0.6982268", "0.69783026", "0.697491", "0.6968745", "0.6946301", "0.6945895", "0.6944739"...
0.0
-1
insertSecondClass /////////////////////////////////////////////////////////////// Inserts an object into the tree.
private void insert ( Node object, Bounds objectBounds, double centerX, double centerY, double centerZ ) { if (this.bounds.contains (centerX, centerY, centerZ)) insertFirstClass (object, objectBounds, centerX, centerY, centerZ); else if (this.bounds.intersects (objectBounds)) insertSecondClass (object, objectBounds); else throw new IllegalArgumentException ("Object does not belong in this tree"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Node insert(Order ord2) {\n\t\treturn null;\n\t}", "@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void add(SecondCategory scategory) {\n\t\tscategory.setCreattime(new Date());\r\n\t\tscateg...
[ "0.583219", "0.5815637", "0.5815637", "0.5380975", "0.53244334", "0.525931", "0.52118635", "0.5146317", "0.5088264", "0.50826216", "0.5074017", "0.5070541", "0.5065056", "0.5056118", "0.50310177", "0.5005666", "0.50001425", "0.49912453", "0.49656928", "0.49628845", "0.4951462...
0.5655161
3
insert /////////////////////////////////////////////////////////////// Inserts an object into the tree.
public void insert ( Node object ) { Bounds objectBounds = object.getBoundsInLocal(); if (LOGGER.isLoggable (Level.FINER)) { LOGGER.finer ("Inserting object with center (x,y,z) = " + objectBounds.getCenterX() + "," + objectBounds.getCenterY() + "," + objectBounds.getCenterZ() + " and (w,h,d) = " + objectBounds.getWidth() + "," + objectBounds.getHeight() + "," + objectBounds.getDepth()); } // if insert (object, objectBounds, objectBounds.getCenterX(), objectBounds.getCenterY(), objectBounds.getCenterZ()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String insert(Object obj) ;", "void insert(Object value, int position);", "@Override\n\tpublic void insert(Unidade obj) {\n\n\t}", "public void insert(T o);", "public void insert(Object item);", "public void insert(T data)\r\n {\r\n root = insert(root, data);\r\n }", "@O...
[ "0.74795556", "0.7372986", "0.7326941", "0.7315736", "0.728016", "0.72728276", "0.7257258", "0.71349186", "0.71179277", "0.7115243", "0.70895696", "0.70030206", "0.6972237", "0.6951951", "0.68700945", "0.6857825", "0.68125665", "0.68124425", "0.6794595", "0.6788854", "0.67492...
0.731106
4
insert /////////////////////////////////////////////////////////////// Check if this tree has first class citizens and if the splitting condition is met, split into children and insert all the objects into the children.
private void split () { if (firstClassList != null && firstClassList.size() > MAX_OBJECTS && depth < MAX_DEPTH) { // Set new bounds along each axis double[] xBounds = new double[] {bounds.getMinX(), bounds.getCenterX(), bounds.getMaxX()}; double[] yBounds = new double[] {bounds.getMinY(), bounds.getCenterY(), bounds.getMaxY()}; double[] zBounds = new double[] {bounds.getMinZ(), bounds.getCenterZ(), bounds.getMaxZ()}; // Create each child children = new SceneOctTree[8]; for (int x = 0; x <= 1; x++) { for (int y = 0; y <= 1; y++) { for (int z = 0; z <= 1; z++) { Bounds childBounds = new BoundingBox ( xBounds[x], yBounds[y], zBounds[z], xBounds[x+1] - xBounds[x], yBounds[y+1] - yBounds[y], zBounds[z+1] - zBounds[z] ); int index = x + y*2 + z*4; children[index] = new SceneOctTree (childBounds, this.depth+1); } // for } // for } // for // Insert first class objects into children. Note that we don't know // if the object will be first or second class in the child so we have // to perform a full insert. for (Node object : firstClassList) { Bounds objectBounds = object.getBoundsInLocal(); for (SceneOctTree child : children) { if (objectBounds.intersects (child.bounds)) child.insert (object); } // for } // for firstClassList = null; // Insert second class objects into children (if any exist). We know // that the object will be second class in the child, so we just // perform a second class insert. if (secondClassList != null) { for (Node object : secondClassList) { Bounds objectBounds = object.getBoundsInLocal(); for (SceneOctTree child : children) { if (objectBounds.intersects (child.bounds)) child.insertSecondClass (object, objectBounds); } // for } // for } // if secondClassList = null; // Perform a split on the children, just in case all the first class // objects that we just inserted all went into one child. for (SceneOctTree child : children) child.split(); } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TreeNode insert(Data newData)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//parent is full so we need to split and return the split\r\n\t\t\tif (isFull())\r\n\t\t\t{\r\n\t\t\t\tthis.split();\r\n\t\t\t\treturn this; //if split return myself to my caller to be added\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//hit a leaf that is not full...
[ "0.58836776", "0.5775017", "0.55452776", "0.53987515", "0.53894544", "0.53601635", "0.53305805", "0.52955055", "0.5291526", "0.5256493", "0.52334195", "0.52264094", "0.51226974", "0.51132876", "0.5103325", "0.5096293", "0.50837046", "0.50795084", "0.5068877", "0.5066342", "0....
0.6605334
0
split /////////////////////////////////////////////////////////////// Finds the objects in this tree whose bounds are visible within the view frustum.
public void findVisible ( Frustum frustum, Set<Node> objectsFound ) { // First check if this is a leaf node with no objects in it. In that // case there's nothing to do, and we don't even want to perform the // frustum check. if (children == null && firstClassList == null && secondClassList == null) return; // Now do the frustum intersection check and if so, go deeper and look // for objects if (frustum.intersects (this.bounds)) { // Base case -- check the individual objects here against the frustum. // We try to eliminate multiple frustum intersection queries by checking // if the object has already been found. if (children == null) { if (firstClassList != null) { for (Node object : firstClassList) { if (!objectsFound.contains (object)) { if (frustum.intersects (object.getBoundsInLocal())) objectsFound.add (object); } // if } // for } // if if (secondClassList != null) { for (Node object : secondClassList) { if (!objectsFound.contains (object)) { if (frustum.intersects (object.getBoundsInLocal())) objectsFound.add (object); } // if } // for } // if } // if // Recursive case -- check the children else { for (SceneOctTree child : children) { child.findVisible (frustum, objectsFound); } // for } // else } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void split () {\n\n if (firstClassList != null && firstClassList.size() > MAX_OBJECTS && depth < MAX_DEPTH) {\n\n // Set new bounds along each axis\n double[] xBounds = new double[] {bounds.getMinX(), bounds.getCenterX(), bounds.getMaxX()};\n double[] yBounds = new double[] {bounds.getMin...
[ "0.6222023", "0.5946327", "0.5861919", "0.5790029", "0.56978977", "0.5656139", "0.53300804", "0.5102417", "0.50872207", "0.5076122", "0.50681907", "0.50590384", "0.50487596", "0.5028423", "0.50046545", "0.49994346", "0.49898902", "0.49431524", "0.4929372", "0.49126226", "0.49...
0.591818
2
TreeNodeVisitor /////////////////////////////////////////////////////////////// Performs a traversal of this tree with the visitor.
private void traversal ( TreeNodeVisitor visitor ) { visitor.visit (this); if (children != null) { for (SceneOctTree child : children) child.traversal (visitor); } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override public <T> T apply(TreeVisitor<T> visitor)\n {\n return visitor.visit(this);\n }", "@Override\n public void visit(NodeVisitor v){\n v.visit(this);\n }", "@Override public <T> T apply(TreeVisitor<T> visitor)\n {\n return visitor.visit(this);\n }", "@Override\n publi...
[ "0.6484418", "0.64693147", "0.6441258", "0.6277745", "0.62255824", "0.6191169", "0.61666983", "0.61328626", "0.60893255", "0.5868196", "0.57593536", "0.56936324", "0.5678877", "0.5669824", "0.55816764", "0.55816764", "0.55803615", "0.55535316", "0.55433154", "0.55360943", "0....
0.7330287
0
traversal /////////////////////////////////////////////////////////////// Summarizes the statistics of this tree to the logging system.
public void summarize () { TreeNodeVisitor visitor = new TreeNodeVisitor(); traversal (visitor); visitor.log(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void show() {\n\t\t\n\t\tSystem.out.println(\"time (tree setup) = \" + treeSetup + \" ms\");\n\t\tSystem.out.println(\"time (average search) = \" + (totalSearch/(float)countSearch) + \" ms\");\n\t\tSystem.out.println(\"time (average at) = \" + (totalAt/(float)countAt) + \" ms\");\n \t}", "@Override\n ...
[ "0.593352", "0.5894615", "0.58063525", "0.5643864", "0.5561399", "0.5478858", "0.5465123", "0.54391587", "0.5435297", "0.5398738", "0.53794736", "0.5361151", "0.5349887", "0.53219205", "0.5298725", "0.52927375", "0.52729297", "0.52539164", "0.52518237", "0.5249112", "0.522669...
0.7786801
0
Model trainModel = Trainer.train("i ./data/in n false");
public static void test() throws IOException { Model trainModel = Trainer.train("-i ./data/in -n fales"); trainModel.saveModel("./data/kdTree"); Model model = Model.loadModel("./data/kdTree"); // Corpus corpus = CorpusReader.readCorpus("./data/test"); Corpus corpus = CorpusReader.readCorpus("./data/kd_test"); int all = 0; int right = 0; for (Instance ins : corpus.getInstanceList()) { Predicter.predict(ins, model); System.out.println(String.format("%s %s", ins.getLabel(), ins.getPredictLabel())); System.out.println("instance: "+ins.getFeatures()); System.out.println("neighbour: "+ins.getNeighbour().get(0).getFeatures()); ++all; if (ins.getLabel().equals(ins.getPredictLabel())) { ++right; } } System.out.println(right+"/"+all); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void train ()\t{\t}", "public void train() throws Exception;", "public void train(){\n recoApp.training(idsToTest);\n }", "TrainingTest createTrainingTest();", "public void train(SieveDocuments trainingInfo) {\r\n\t\t// no training\r\n\t}", "public void startTrainingMode() {\n\t\t\r\n\t}...
[ "0.65833086", "0.655702", "0.6539826", "0.64255893", "0.63814884", "0.6367219", "0.6341514", "0.63123393", "0.62547797", "0.6208543", "0.6184557", "0.617805", "0.6088546", "0.60772276", "0.6068652", "0.60617626", "0.59673303", "0.5907132", "0.58930737", "0.58905286", "0.58549...
0.57394546
27
Author: RiversLau Date: 2018/1/4 8:59
public interface PrincipalCollection extends Iterable, Serializable { /** * 返回应用中唯一标识用户的primary principal * @return */ Object getPrimaryPrincipal(); /** * 返回第一个principal为type类型的,如果没有与type对应的principal,则返回null * 注意:如果用户未登录则返回null * @param type * @param <T> * @return */ <T> T oneByType(Class<T> type); /** * 返回类型为type的principal,如果没有,则返回空集合 * 注意:如果用户尚未登录,则返回空集合 * @param type * @param <T> * @return */ <T> Collection<T> byType(Class<T> type); /** * 从所有配置的Realms中获取单个主体所有的principal,并以List返回,如果没有principal,则返回空List * 注意:如果用户未登录,则返回空List * @return */ List asList(); /** * 从所有配置的Realms中获取单个主体所有的principal,并以Set返回,如果没有principal,则返回空Set * @return */ Set asSet(); /** * 获取单个主体在指定Realm中的principal collection,如果没有,则返回空Collection * @param realmName * @return */ Collection fromRealm(String realmName); /** * 返回所有存在principals的Realm名字集合 * @return */ Set<String> getRealmNames(); /** * 如果集合为空,返回true,否则返回false * @return */ boolean isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String indexBlackLabBuildTime();", "long getTimeBoltHBoltE();", "public int getRainTime()\n {\n return rainTime;\n }", "public void mo21877s() {\n }", "@Override\n\tpublic String getDailyWorkout() {\n\t\treturn \"play ROV 2hr.\";\n\t}", "java.lang.String getFoundingDate();", "public int...
[ "0.5621529", "0.5472838", "0.5439108", "0.5417948", "0.5402195", "0.5377042", "0.5374048", "0.53622586", "0.53171813", "0.5305559", "0.52818936", "0.526058", "0.52521765", "0.5250365", "0.5228777", "0.5228698", "0.52220064", "0.52125204", "0.5212518", "0.52123487", "0.5197334...
0.0
-1
Creates a new instance of LibrosFormBean
public LibrosFormBean() { libr = new ConjuntoLibro(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ContactoFormBean() {\r\n setContexto();\r\n }", "public ProductosBean() {\r\n }", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public ProductoListarBean() {\r\n }", "public RegistroBean() {\r\n }", "public TiposDocumentosBean(){\r\n }", "public Cadast...
[ "0.6381921", "0.61987585", "0.61509156", "0.61386454", "0.607832", "0.6072584", "0.60699934", "0.6048737", "0.6012634", "0.6007238", "0.5992152", "0.5967283", "0.59607154", "0.5929781", "0.5923901", "0.58844644", "0.58680296", "0.58585197", "0.5832278", "0.5815485", "0.581500...
0.8200882
0
Returns the position between two positions. If no such position exists, null is returned instead.
private static Position getPositionBetween(Position p1, Position p2) { int rowDiff = p1.getRow() - p2.getRow(); int colDiff = p1.getCell() - p2.getCell(); if(Math.abs(rowDiff) != 1 && Math.abs(colDiff) != 1) { return new Position(p2.getRow() + (rowDiff/2), p2.getCell() + (colDiff/2)); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Pair<Integer, Integer> getPosition();", "Vector2 getPosition();", "public Vector2 getPosition();", "Position getPosition();", "Position getPosition();", "Object getPosition();", "Point getPosition();", "Point getPosition();", "Pair<Integer, Integer> getInitialPosition();", "public Integer getPosi...
[ "0.6726967", "0.6519621", "0.63755494", "0.631946", "0.631946", "0.6196895", "0.6139193", "0.6139193", "0.61306304", "0.60959464", "0.6045967", "0.6045967", "0.6045967", "0.60102874", "0.5994153", "0.59618884", "0.59253854", "0.59161955", "0.5911905", "0.58816904", "0.5880695...
0.80801314
0
Applies a single move to the board.
public static void applySingleMove(Move move, BoardView board) { Space startSpace = board.getTile(move.getStartPosition()); Space finishSpace = board.getTile(move.getEndPosition()); Position between = getPositionBetween(move.getStartPosition(), move.getEndPosition()); if(between != null) //jump move { Space middle = board.getTile(between); middle.setPiece(null); } finishSpace.setPiece(startSpace.getPiece()); startSpace.setPiece(null); // promotes the piece to king if they reach the end of board if (finishSpace.getPiece().getType() == Piece.PieceEnum.SINGLE) { switch (finishSpace.getPiece().getColor()) { case RED: if (move.getEndPosition().getRow() == 0) { finishSpace.getPiece().promote(); } break; case WHITE: if (move.getEndPosition().getRow() == 7) { finishSpace.getPiece().promote(); } break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void applyMove(Move move) {\r\n Piece piece = grid[move.getStart()];\r\n piece.setPosition(move.getEnd());\r\n\r\n grid[move.getStart()] = null;\r\n grid[move.getEnd()] = piece;\r\n if (move.getTakes() != null) {\r\n grid[move.getTakes().getPosition()] = null;\r\n pieces.get(move.ge...
[ "0.7003233", "0.6964719", "0.6948518", "0.6881492", "0.6786046", "0.6725234", "0.6723834", "0.66486186", "0.6595779", "0.6581548", "0.6552375", "0.6546433", "0.6498448", "0.64654", "0.64653563", "0.64418566", "0.63951796", "0.63749266", "0.63749206", "0.6320173", "0.63064164"...
0.7524272
0
Constructs singleton instance of this class.
private InjectorManager() { // no prepared injectors }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Singleton(){}", "private Singleton() { }", "private Singleton()\n\t\t{\n\t\t}", "private Singleton() {\n\t}", "private SingletonObject() {\n\n\t}", "private SingletonSigar(){}", "private Singleton(){\n }", "private SingletonSample() {}", "public static Singleton getInstance( ) {\n r...
[ "0.7884997", "0.7552146", "0.75315523", "0.7428849", "0.7288645", "0.72830915", "0.723968", "0.72051245", "0.71898425", "0.7126398", "0.71127343", "0.69973856", "0.6904934", "0.6841295", "0.6835046", "0.6825325", "0.6805989", "0.67933106", "0.6773222", "0.6771238", "0.6736327...
0.0
-1
Sets (stores) given injector for actual thread.
protected synchronized void set(Injector injector) { injectors.set(injector); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Inject\n private void setLogger(Logger log) {\n logger = log;\n }", "public void bindToThread() {\n\t\tthis.oldTransactionInfo = transactionInfoHolder.get();\n\t\ttransactionInfoHolder.set(this);\n\t}", "protected final Injector getInjector() {\n return injector;\n }", "@Test @Displa...
[ "0.5631815", "0.56039995", "0.554505", "0.5495539", "0.5339755", "0.5266692", "0.52600116", "0.52564406", "0.52340245", "0.51940227", "0.51572967", "0.51180315", "0.5113881", "0.5110443", "0.507446", "0.5068877", "0.5051245", "0.5004467", "0.49899843", "0.49862286", "0.497113...
0.7624113
0
Returns instance of stored injector for actual thread.
public synchronized Injector get() throws InjectorException { Injector injector = injectors.get(); if (injector == null) { throw new InjectorException("No injector was found"); } return injector; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Injector instance() {\n if (instance == null) {\n instance = new Injector();\n }\n \n return instance;\n }", "protected final Injector getInjector() {\n return injector;\n }", "public static ThreadedPmClientInstanceResolver get() {\n\t\t// syn...
[ "0.68256235", "0.6757265", "0.5938378", "0.5900104", "0.58633965", "0.5794197", "0.57454437", "0.5720982", "0.5708657", "0.5700159", "0.5649331", "0.56078106", "0.5592873", "0.55698276", "0.55337894", "0.55250674", "0.55054766", "0.54887605", "0.545828", "0.5453972", "0.54446...
0.64549845
2
Removes stored injector for actual thread.
protected void remove() { injectors.remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeCredentialsFromCurrentThread() {\n\t\tthis.threadBoundCredentials.set(null);\n\t}", "void destroyForCurrentThread() {\n holderInstance.remove();\n parentHolderInstanceStack.remove();\n }", "void removeInjection() throws Exception;", "public void clear()\n {\n ...
[ "0.69121057", "0.6670972", "0.63166404", "0.59139645", "0.5912446", "0.5836717", "0.58122635", "0.5803395", "0.5755975", "0.5746918", "0.5743715", "0.5732646", "0.5728846", "0.5722177", "0.5707437", "0.56666577", "0.55969113", "0.55893606", "0.55869395", "0.5551571", "0.55511...
0.7038292
0
TODO Autogenerated method stub
@Override public void display(String s) { System.out.println(s + "바나나입니다."); }
{ "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
Returns the damage it does expressed in player's hearts.
@Override public int doDamage() { if (difficulty <5) return damage; else return damage*2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getHungerDamage();", "public short getHandThrowDamage();", "public int getDamage () {\n\t\treturn (this.puissance + stuff.getDegat());\n\t}", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "public int getDamage() {\n return dama...
[ "0.7456675", "0.735441", "0.7340008", "0.7209128", "0.7209128", "0.7209128", "0.7209128", "0.7209128", "0.7157959", "0.7157959", "0.7157959", "0.7157959", "0.7157959", "0.71348184", "0.71309644", "0.71286726", "0.712683", "0.712683", "0.712683", "0.712683", "0.712683", "0.7...
0.654873
43
Generates uri for rest command line runner.
@Override public URI createUri(String url) { try { this.uri = new URI(url); } catch (URISyntaxException e) { e.printStackTrace(); } return uri; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getRestUrl(VariableSpace space) {\n StringBuilder url = new StringBuilder();\n\n if (useSSL) {\n url.append(\"https://\");\n } else {\n url.append(\"http://\");\n }\n\n url.append(space.environmentSubstitute(tenant)).append('.');\n url.append(space.environmentSubstitute(na...
[ "0.59247696", "0.58372146", "0.58295906", "0.5718706", "0.5709258", "0.5691003", "0.5648086", "0.5647786", "0.5625192", "0.55232096", "0.549415", "0.5459009", "0.5444592", "0.54429317", "0.54427665", "0.5437228", "0.5437228", "0.5399954", "0.53471214", "0.5326492", "0.5322646...
0.49284285
62
Builds rest template for Bean.
@Override @Bean public RestTemplate restTemplate(RestTemplateBuilder builder) { return builder.build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Bean\n\tpublic RestTemplate restTemplate(RestTemplateBuilder builder) {\n\t\treturn builder.build();\n\t}", "@Bean\n\tpublic RestTemplate restTemplate(RestTemplateBuilder builder) {\n\t\treturn builder.build();\n\t}", "@LoadBalanced\n\t @Bean\n\t public RestTemplate makeTemp(RestTemplateBuilder builder) {\n\t...
[ "0.58841956", "0.58841956", "0.583601", "0.5726634", "0.56621283", "0.56562495", "0.5596562", "0.5577056", "0.5355432", "0.52764153", "0.5265799", "0.5252272", "0.52339315", "0.5142667", "0.5119075", "0.5116243", "0.5108988", "0.5103162", "0.50830394", "0.50298953", "0.501821...
0.58628464
2
Command line runner wired to the spring application and generates rest data upon receipt of all local and global parameters.
@Override @Bean public CommandLineRunner run(RestTemplate restTemplate) throws Exception { HttpHeaders headers = new HttpHeaders(); headers.set("Accept", "application/json"); return args -> { result = restTemplate.exchange(GlobalCovidRestData.URL, HttpMethod.GET, new HttpEntity<String>(headers), String.class); log.info(result.toString()); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args){\n System.setProperty(\"spring.jackson.serialization.INDENT_OUTPUT\", \"true\");\n\n SpringApplication application = new SpringApplication(Application.class);\n application.addListeners(new ApplicationPidFileWriter(\"ms-recommendation.pid\"));\n ap...
[ "0.6711024", "0.64760095", "0.64364207", "0.6294582", "0.62574875", "0.62566847", "0.6215746", "0.6177166", "0.6134692", "0.6122572", "0.6109269", "0.60750365", "0.6074801", "0.60477316", "0.6046956", "0.6030436", "0.60265243", "0.60249317", "0.60173094", "0.60102415", "0.599...
0.0
-1
An abstract method to get a cell of this Grid.
public abstract T getCell(int row, int column);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract AwtCell get(int y, int x);", "protected abstract double getCell(\r\n int row,\r\n int col);", "Cell getCellAt(Coord coord);", "public Cell get(int row, int col) {\n\t\treturn myGrid.get(row, col);\n\t}", "public Cell getCell() {\n\t\treturn cell;\n\t}", "@Override\r\...
[ "0.82448685", "0.808011", "0.80492014", "0.778838", "0.7748459", "0.76105213", "0.75992924", "0.7564153", "0.75555885", "0.75459343", "0.7536789", "0.7507013", "0.7504585", "0.74853814", "0.7436937", "0.7422559", "0.73465395", "0.7341288", "0.7336753", "0.7322882", "0.7249267...
0.8762388
0
An abstract method to set the cell of this Grid to given item at given row and column.
public abstract void setCell(int row, int column, T item);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract double setCell(\r\n int row,\r\n int col,\r\n double valueToSet);", "protected void set(int row, int col, Cell cell) {\n\t\tmyGrid.set(row, col, cell);\n\t}", "public abstract void setCellValue(int cellValue, int row, int col);", "public void setCell(Object...
[ "0.74122286", "0.7374017", "0.7203134", "0.70269495", "0.6984253", "0.68105286", "0.67307884", "0.67174363", "0.67146516", "0.6644826", "0.6527148", "0.6445977", "0.64329416", "0.6391743", "0.6387595", "0.63801783", "0.6350336", "0.63289195", "0.63131416", "0.62952155", "0.62...
0.9013853
0
An abstract method to get the number of rows of this Grid.
public abstract int getNumRows();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getRows() {\n\t\treturn myGrid.getRows();\n\t}", "public abstract int getNumOfRows();", "public int getNumRows() { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getter for the number of rows\n\t\treturn numRows; \n\t}", "public int getNumRows() {\n\t\treturn NUM_ROWS; \n\t}", "public int getNumRows() {\n ...
[ "0.8115076", "0.8075926", "0.7952265", "0.7873575", "0.78571105", "0.78571105", "0.7784332", "0.7773122", "0.7755421", "0.7755421", "0.7730318", "0.7710408", "0.7669391", "0.7651128", "0.7645924", "0.7618709", "0.760912", "0.7573854", "0.75515413", "0.754137", "0.753502", "...
0.8121231
0
An abstract method to get the number of columns of this Grid.
public abstract int getNumColumns();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int numColumns();", "public int getNumberOfColumns(){\n\t\treturn number_columns;\n\t}", "int getColumnsCount();", "int getColumnsCount();", "public int getNumColumns() {\n\t\treturn numColumns; \n\t}", "public int getNumColumns() {\n\t\treturn numColumns;\n\t}", "public int getNumColum...
[ "0.84421164", "0.8190675", "0.8169722", "0.8169722", "0.8120899", "0.80846447", "0.80722845", "0.79524845", "0.7924313", "0.7889999", "0.78547424", "0.7831813", "0.78166544", "0.78166544", "0.780129", "0.7789188", "0.77578026", "0.77397627", "0.77325433", "0.77020705", "0.763...
0.8580537
0
Represents a string representation of this Grid.
@Override public String toString() { String result = ""; // Convert each sprite in each ArrayList to its string representation, then print it out. for (ArrayList<T> list : new ArrayList<ArrayList<T>>()) { for (T sprite : list) { result += sprite.toString(); } result += "\n"; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString ()\n\t{\n\t\tString s = \"Grid:\\n\";\n\t\tfor (int row=0; row<GRID_SIZE; row++)\n\t\t{\n\t\t\tfor (int col=0; col<GRID_SIZE; col++) {\n\t\t\t\ts = s + grid[col][row].value()+ \" \";\n\t\t\t}\n\t\t\ts += \"\\n\";\n\t\t}\n\t\treturn s;\n\t}", "@Override\n\tpublic String toString() {\n\t\tSt...
[ "0.7278433", "0.71801126", "0.6841517", "0.6651632", "0.66497135", "0.66497135", "0.66244453", "0.6574211", "0.6499368", "0.647625", "0.64739484", "0.64588517", "0.64159435", "0.64097327", "0.64086926", "0.63995254", "0.6360587", "0.63204914", "0.62890095", "0.62835413", "0.6...
0.0
-1
The grid is equal to the other one if it's string representation is also equal
public boolean equals(Grid<T> other) { // TODO Auto-generated method stub return this.toString() == other.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean equalTo( PuzzleGrid pg )\n\t{\n\t\tboolean equal = true;\n\t\t\n\t\t// For each element in each grid, test for equality\n\t\t// Loops break if it is found that two elements are not equal\n\t\tfor ( int y = 0; y < height && equal == true; y++ )\n\t\t{\n\t\t\tfor ( int x = 0; x < width && equal == tru...
[ "0.64299244", "0.62772447", "0.6137035", "0.6012138", "0.5988747", "0.59770554", "0.5940892", "0.5889189", "0.58874094", "0.5872815", "0.58472097", "0.58170253", "0.57144225", "0.570469", "0.57034844", "0.5692685", "0.56794", "0.5675745", "0.56473446", "0.56437904", "0.563087...
0.7720164
0
Scales an image to twice its original width minus one and twice its original height minus one using Directional Cubic Convolution Interpolation.
public static BufferedImage scale(BufferedImage original) { return scale(original, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawIma...
[ "0.67502385", "0.6153987", "0.6073896", "0.6058643", "0.6017153", "0.5999427", "0.59839064", "0.594947", "0.58921206", "0.58043355", "0.57577646", "0.57520807", "0.5730105", "0.56758714", "0.5665612", "0.56190246", "0.5610206", "0.55973583", "0.55711377", "0.55098087", "0.547...
0.5271757
35
Returns a BufferedImage backed by integers and big enough to support the scaling algorithm.
private static BufferedImage getDestinationBufferedImage(BufferedImage bufferedImage, boolean keepIntegerRatio) { int width = bufferedImage.getWidth() * 2 - (keepIntegerRatio ? 0 : 1); int height = bufferedImage.getHeight() * 2 - (keepIntegerRatio ? 0 : 1); BufferedImage destination = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = destination.createGraphics(); g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); g2.drawImage(bufferedImage, 0, 0, width, height, null); g2.dispose(); return destination; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract BufferedImage scale(Dimension destinationSize);", "public BufferedImage makeBufferedImage()\r\n {\r\n\treturn makeRGBImage().makeBufferedImage();\r\n }", "public BufferedImage toImage(){\n // turn it into a png\n int scale = 8;\n int w = 16;\n i...
[ "0.662109", "0.6380909", "0.63506395", "0.6309035", "0.62982327", "0.6274172", "0.62117296", "0.6199804", "0.61923146", "0.6188657", "0.60833746", "0.6029817", "0.60166657", "0.59942245", "0.59623027", "0.594814", "0.59370685", "0.5927391", "0.5908689", "0.5902642", "0.588445...
0.6043391
11
Evaluates the sum of the RGB channel differences between two RGB values. This is equal to |a.r b.r| + |a.g b.g| + |a.b b.b|
protected static int getRGBChannelsDifferenceSum(int rgbA, int rgbB) { int differenceSum = 0; for (short offset = 0; offset <= 16; offset += 8) { differenceSum += Math.abs(((rgbA >> offset) & 0xFF) - ((rgbB >> offset) & 0xFF)); } return differenceSum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static double dif(Color one, Color two) {\n\t\treturn Math.abs(one.getRed() - two.getRed()) + Math.abs(one.getGreen() - two.getGreen()) + Math.abs(one.getBlue() - two.getBlue());\n\t}", "public static double getColorDifference(int a, int b) {\r\n if (a == b) {\r\n return 0;\r\n }...
[ "0.7619078", "0.71646976", "0.6687072", "0.6640505", "0.66119766", "0.64163464", "0.64036936", "0.63993055", "0.62360394", "0.62302065", "0.6131161", "0.6043578", "0.58711296", "0.58114123", "0.5803888", "0.57986087", "0.5796429", "0.57927865", "0.5786888", "0.5612463", "0.55...
0.7275589
1
Evaluates the upright diagonal strength. Uses the sum of all RGB channels differences.
private static int evaluateUpRightDiagonalStrength(UnderlyingArray array, final int x, final int y) { int strength = 0; for (int cY = y - 3; cY <= y + 1; cY += 2) { for (int cX = x - 1; cX <= x + 3; cX += 2) { strength += getRGBChannelsDifferenceSum(array.getRGB(cX, cY), array.getRGB(cX - 2, cY + 2)); } } return strength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int evaluateDownRightDiagonalStrength(UnderlyingArray array, final int x, final int y) {\n int strength = 0;\n for (int cY = y - 3; cY <= y + 1; cY += 2) {\n for (int cX = x - 3; cX <= x + 1; cX += 2) {\n strength += getRGBChannelsDifferenceSum(array.getRGB(cX...
[ "0.7193794", "0.58168554", "0.5664011", "0.5580566", "0.5477267", "0.54745066", "0.54163283", "0.53277415", "0.530032", "0.52884066", "0.52874327", "0.5259829", "0.5248798", "0.5207029", "0.5171443", "0.51647735", "0.5086891", "0.50714433", "0.50617737", "0.50172144", "0.5001...
0.7609285
0
Evaluates the downright diagonal strength. Uses the sum of all RGB channels differences.
private static int evaluateDownRightDiagonalStrength(UnderlyingArray array, final int x, final int y) { int strength = 0; for (int cY = y - 3; cY <= y + 1; cY += 2) { for (int cX = x - 3; cX <= x + 1; cX += 2) { strength += getRGBChannelsDifferenceSum(array.getRGB(cX, cY), array.getRGB(cX + 2, cY + 2)); } } return strength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int evaluateUpRightDiagonalStrength(UnderlyingArray array, final int x, final int y) {\n int strength = 0;\n for (int cY = y - 3; cY <= y + 1; cY += 2) {\n for (int cX = x - 1; cX <= x + 3; cX += 2) {\n strength += getRGBChannelsDifferenceSum(array.getRGB(cX, ...
[ "0.76105887", "0.61034715", "0.6073793", "0.59119105", "0.5877195", "0.5774374", "0.5755766", "0.5707376", "0.56287503", "0.5488361", "0.5479875", "0.5414145", "0.53832674", "0.5364233", "0.5353063", "0.52272946", "0.51744777", "0.50967216", "0.50751615", "0.506064", "0.50246...
0.7662151
0
Returns the required bit shift to retrieve a specific channel from an integer RGB.
private static int getShiftForChannel(int channel) { return 24 - 8 * channel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static int getChannel(int rgb, int channel) {\n return (rgb >> getShiftForChannel(channel)) & 0xFF;\n }", "public static int[][] getChannel(BufferedImage img, String channel){\r\n int[][] table = new int[img.getWidth()][img.getHeight()];\r\n int flag, shift;\r\n if(channe...
[ "0.71760577", "0.60987276", "0.6000144", "0.5613548", "0.5591853", "0.55215454", "0.54824924", "0.54455775", "0.54331535", "0.537288", "0.5357478", "0.53082275", "0.53067875", "0.5289186", "0.5278957", "0.5264484", "0.5242171", "0.5241075", "0.5234347", "0.5231549", "0.521557...
0.6398868
1
Returns the eight bits that correspond to a given channel of the provided RGB integer. 0 maps to Alpha 1 maps to Red 2 maps to Green 3 maps to Blue
protected static int getChannel(int rgb, int channel) { return (rgb >> getShiftForChannel(channel)) & 0xFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int[][] getChannel(BufferedImage img, String channel){\r\n int[][] table = new int[img.getWidth()][img.getHeight()];\r\n int flag, shift;\r\n if(channel.toLowerCase().equals(\"red\")){\r\n flag = 16711680;\r\n shift = 16;\r\n } else if (channel.toLowe...
[ "0.6563199", "0.6309417", "0.6114484", "0.60965395", "0.5946682", "0.5922031", "0.58203137", "0.5771123", "0.57693875", "0.57247174", "0.57232434", "0.5714781", "0.56790066", "0.56708723", "0.56306934", "0.5609269", "0.557667", "0.5550351", "0.55409735", "0.55344903", "0.5530...
0.7010648
0
Returns the provided RGB integer with the specified channel set to the provided value.
protected static int withChannel(int rgb, int channel, int value) { final int shift = getShiftForChannel(channel); // Unset the bits that will be modified rgb &= ~(0xFF << shift); // Set them the provided value int shiftedValue = value << shift; return rgb | shiftedValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int get(int colour) {\r\n\t\t// If the color is incorrect (less than 0) the color is set invisible\r\n\t\tif (colour < 0) {\r\n\t\t\treturn 255;\r\n\t\t}\r\n\r\n\t\t// taking each number of the argument\r\n\t\tint r = colour / 100 % 10;\r\n\t\tint g = colour / 10 % 10;\r\n\t\tint b = colour % 10;\r\...
[ "0.67331475", "0.658815", "0.6102642", "0.6044754", "0.6036239", "0.60069966", "0.5993488", "0.5971961", "0.58974034", "0.5888187", "0.58814067", "0.5873038", "0.5872232", "0.5862071", "0.58501047", "0.5813586", "0.5802963", "0.5778058", "0.57714444", "0.5760898", "0.5752558"...
0.70747757
0
"Forces" a value to a valid range, returning minimum if it is equal to or less than the minimum or maximum if it is greater than or equal to maximum. If the original value is in the range (minimum, maximum), this value is returned.
protected static int forceValidRange(int total, int minimum, int maximum) { if (maximum < minimum) { throw new IllegalArgumentException("maximum should not be less than minimum"); } return Math.min(Math.max(total, minimum), maximum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double correctToRange(double value, double min, double max) {\r\n\t\t// If the value is below the range, set it equal to the minimum.\r\n\t\tif (value < min) {\r\n\t\t\treturn min;\r\n\t\t\t// If it is above the range, set it equal to the maximum.\r\n\t\t} else if (value > max) {\r\n\t\t\treturn max;\r\n\t...
[ "0.79329383", "0.72594607", "0.7172563", "0.71205765", "0.6950727", "0.6918167", "0.69014287", "0.68294525", "0.6694637", "0.664795", "0.66329634", "0.65999794", "0.6535401", "0.6490958", "0.64871836", "0.6485012", "0.64828056", "0.6428474", "0.64017195", "0.6372687", "0.6359...
0.6761403
8
Assert each attribute of entity to equal each attribute of DTO
public static void assertDeepEqualFlightMinimal(Flight entity, FlightMinimalDTO dto) { assertEquals(entity.getId(), dto.getId()); assertEquals(entity.getArrival(), dto.getArrival()); assertEquals(entity.getDeparture(), dto.getDeparture()); assertDeepEqualDestination(entity.getDestination(), dto.getDestination()); assertDeepEqualDestination(entity.getOrigin(), dto.getOrigin()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void allPropertiesShouldBeRepresentedInToStringOutput() {\n assertThat(AssignForceBatch.class, hasValid...
[ "0.5733609", "0.5584797", "0.5580837", "0.5570484", "0.5440512", "0.533799", "0.53104436", "0.5296988", "0.52887017", "0.5233531", "0.52244806", "0.52209675", "0.5187941", "0.5178503", "0.5162273", "0.51612604", "0.5145904", "0.5140292", "0.51335734", "0.51242197", "0.5121209...
0.47182417
88
Assert each attribute of entity to equal each attribute of DTO
public static void assertDeepEqualFlight(Flight entity, FlightDetailDTO dto) { assertEquals(entity.getId(), dto.getId()); assertEquals(entity.getArrival(), dto.getArrival()); assertEquals(entity.getDeparture(), dto.getDeparture()); assertDeepEqualDestination(entity.getDestination(), dto.getDestination()); assertDeepEqualDestination(entity.getOrigin(), dto.getOrigin()); assertDeepEqualPlane(entity.getPlane(), dto.getPlane()); // Deeply assert all stewards. Order should not be changed between mappings so we can count on it. assertEquals(entity.getStewards().size(), dto.getStewards().size()); for (int i = 0; i < entity.getStewards().size(); i++) { assertDeepEqualSteward(entity.getStewards().get(i), dto.getStewards().get(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void allPropertiesShouldBeRepresentedInToStringOutput() {\n assertThat(AssignForceBatch.class, hasValid...
[ "0.5733609", "0.5584797", "0.5580837", "0.5570484", "0.533799", "0.53104436", "0.5296988", "0.52887017", "0.5233531", "0.52244806", "0.52209675", "0.5187941", "0.5178503", "0.5162273", "0.51612604", "0.5145904", "0.5140292", "0.51335734", "0.51242197", "0.51212096", "0.512004...
0.5440512
4
Assert each attribute of entity to equal each attribute of DTO
public static void assertDeepEqualDestination(Destination entity, DestinationDTO dto) { assertEquals(entity.getId(), dto.getId()); assertEquals(entity.getCity(), dto.getCity()); assertEquals(entity.getCountry(), dto.getCountry()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void allPropertiesShouldBeRepresentedInToStringOutput() {\n assertThat(AssignForceBatch.class, hasValid...
[ "0.5731666", "0.5585119", "0.55810577", "0.5573219", "0.54373735", "0.5335766", "0.5311639", "0.5296904", "0.52875674", "0.5232523", "0.52248704", "0.52196723", "0.51870763", "0.5177878", "0.51626235", "0.5161991", "0.5145436", "0.5139838", "0.51323575", "0.51238436", "0.5119...
0.49306962
51
Assert each attribute of entity to equal each attribute of DTO
public static void assertDeepEqualPlane(Plane entity, PlaneDTO dto) { assertEquals(entity.getId(), dto.getId()); assertEquals(entity.getName(), dto.getName()); assertEquals(entity.getType(), dto.getType()); assertEquals((int)entity.getCapacity(), dto.getCapacity()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void allPropertiesShouldBeRepresentedInToStringOutput() {\n assertThat(AssignForceBatch.class, hasValid...
[ "0.5732268", "0.5584337", "0.5580627", "0.5571264", "0.5438498", "0.53366923", "0.53105366", "0.5295857", "0.52873105", "0.52332574", "0.522435", "0.5220416", "0.518662", "0.5178505", "0.51626456", "0.51623714", "0.5144561", "0.5139481", "0.5132564", "0.5124487", "0.5119633",...
0.5094915
23
Assert each attribute of entity to equal each attribute of DTO
public static void assertDeepEqualSteward(Steward entity, StewardDTO dto) { assertEquals(entity.getId(), dto.getId()); assertEquals(entity.getFirstName(), dto.getFirstName()); assertEquals(entity.getLastName(), dto.getLastName()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void allPropertiesShouldBeRepresentedInToStringOutput() {\n assertThat(AssignForceBatch.class, hasValid...
[ "0.5733609", "0.5584797", "0.5580837", "0.5570484", "0.5440512", "0.53104436", "0.5296988", "0.52887017", "0.5233531", "0.52244806", "0.52209675", "0.5187941", "0.5178503", "0.5162273", "0.51612604", "0.5145904", "0.5140292", "0.51335734", "0.51242197", "0.51212096", "0.51200...
0.533799
5
Created by Admin on 9/1/2018.
public interface ApiService { @GET("getallproducts.php") Call<ResponseBody> getAllProduct (); Retrofit retrofit = new Retrofit.Builder() .baseUrl(Constant.BASE_URL) .addConverterFactory(GsonConverterFactory.create()) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Date getCreated()\n {\n return null;\n }", "public Date getCreationDate() {\n\n \n return creationDate;\n\n }", "@Override\n public String getCreationDate() {\n return creationDate;\n }", "public DateTime getCreationTime() {\n return create...
[ "0.6214017", "0.5984446", "0.5953289", "0.5899019", "0.58938557", "0.5884498", "0.5872478", "0.58629614", "0.58626384", "0.5845133", "0.58320785", "0.5820392", "0.58173645", "0.5805577", "0.57958496", "0.57725704", "0.57490844", "0.5740352", "0.57402545", "0.5703757", "0.5684...
0.0
-1
Created by santosh on 9/27/2016.
public interface RestaurantView { void onRestaurantListSuccess(List<Restaurant> restaurantList); void onRestaurantListFailed(); void onNetworkError(); void showErrorMessage(String message); void onResponseFailed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r...
[ "0.62314355", "0.595813", "0.5953543", "0.59361595", "0.5847296", "0.5818899", "0.5818899", "0.57939345", "0.5765429", "0.57609105", "0.57517004", "0.574928", "0.57175994", "0.5710919", "0.5693988", "0.5688129", "0.56872547", "0.56682414", "0.56619585", "0.5648481", "0.561016...
0.0
-1
network tables keep the application running, so exit
@Override public void handle(WindowEvent t) { System.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private NetworkTables() {\n inst = NetworkTableInstance.getDefault();\n\n }", "@Override\n public void run() {\n pool = new JDBCConnectionPool(\n \"org.apache.hive.jdbc.HiveDriver\", \"jdbc:hive2://10.2.216.33:10000\",\n \"\", \"\");\n\n // Get a connectio...
[ "0.5855532", "0.5841503", "0.5773873", "0.5747712", "0.5675697", "0.56516796", "0.56290007", "0.5577989", "0.5566468", "0.5547784", "0.55140287", "0.5502603", "0.5481623", "0.54660124", "0.5454497", "0.5429932", "0.5429541", "0.5423299", "0.54176134", "0.5392352", "0.53813994...
0.0
-1
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPA...
[ "0.7884956", "0.7549951", "0.74975353", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", "0.7461668", ...
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table sys_role2subsys
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", roleId=").append(roleId); sb.append(", subSysId=").append(subSysId); sb.append(", subSysInfoId=").append(subSysInfoId); sb.append(", valid=").append(valid); sb.append(", createUser=").append(createUser); sb.append(", createTime=").append(createTime); sb.append(", modifyUser=").append(modifyUser); sb.append(", modifyTime=").append(modifyTime); sb.append(", memo=").append(memo); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getSysRoles(SysRole sysRole);", "List<RoleEntity> getSystemRoles();", "@Component\npublic interface SysUserRoleMapper extends Mapper<SysUserRole> {\n @Select(\"select r.* from sys_role r, sys_user u, sys_user_role u_r where r.id = u_r.ROLE_ID and u_r.USER_ID = u.ID and u_r.IS_DELETE = 0 and u.ID...
[ "0.60237306", "0.5843739", "0.5661103", "0.5330092", "0.52711195", "0.5200385", "0.5112976", "0.5099849", "0.50509894", "0.5036187", "0.50141054", "0.50129765", "0.50072193", "0.50036937", "0.49918407", "0.49769306", "0.4969948", "0.4967427", "0.49308836", "0.49301854", "0.49...
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table sys_role2subsys
@Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } SysRole2subsys other = (SysRole2subsys) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) && (this.getSubSysId() == null ? other.getSubSysId() == null : this.getSubSysId().equals(other.getSubSysId())) && (this.getSubSysInfoId() == null ? other.getSubSysInfoId() == null : this.getSubSysInfoId().equals(other.getSubSysInfoId())) && (this.getValid() == null ? other.getValid() == null : this.getValid().equals(other.getValid())) && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getModifyUser() == null ? other.getModifyUser() == null : this.getModifyUser().equals(other.getModifyUser())) && (this.getModifyTime() == null ? other.getModifyTime() == null : this.getModifyTime().equals(other.getModifyTime())) && (this.getMemo() == null ? other.getMemo() == null : this.getMemo().equals(other.getMemo())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getSysRoles(SysRole sysRole);", "List<RoleEntity> getSystemRoles();", "@Component\npublic interface SysUserRoleMapper extends Mapper<SysUserRole> {\n @Select(\"select r.* from sys_role r, sys_user u, sys_user_role u_r where r.id = u_r.ROLE_ID and u_r.USER_ID = u.ID and u_r.IS_DELETE = 0 and u.ID...
[ "0.6024019", "0.58435243", "0.56645554", "0.53302777", "0.52711135", "0.520055", "0.51129085", "0.5099965", "0.5049706", "0.5036565", "0.5013457", "0.50130844", "0.5007591", "0.5004145", "0.49920094", "0.49769723", "0.49718162", "0.49702278", "0.49309584", "0.4919475", "0.491...
0.49303967
19
This method was generated by MyBatis Generator. This method corresponds to the database table sys_role2subsys
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); result = prime * result + ((getSubSysId() == null) ? 0 : getSubSysId().hashCode()); result = prime * result + ((getSubSysInfoId() == null) ? 0 : getSubSysInfoId().hashCode()); result = prime * result + ((getValid() == null) ? 0 : getValid().hashCode()); result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getModifyUser() == null) ? 0 : getModifyUser().hashCode()); result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode()); result = prime * result + ((getMemo() == null) ? 0 : getMemo().hashCode()); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getSysRoles(SysRole sysRole);", "List<RoleEntity> getSystemRoles();", "@Component\npublic interface SysUserRoleMapper extends Mapper<SysUserRole> {\n @Select(\"select r.* from sys_role r, sys_user u, sys_user_role u_r where r.id = u_r.ROLE_ID and u_r.USER_ID = u.ID and u_r.IS_DELETE = 0 and u.ID...
[ "0.6024238", "0.58440185", "0.5659981", "0.5329305", "0.52714586", "0.5201451", "0.5112367", "0.50994635", "0.50518256", "0.50374824", "0.50141656", "0.5012402", "0.5007239", "0.5003721", "0.49926096", "0.49762425", "0.49684823", "0.49668267", "0.49326658", "0.49315658", "0.4...
0.0
-1
b0 > usb, b1 > wifi, b2 > telep.
private void displayStatus(final byte b) { runOnUiThread(new Runnable() { @Override public void run() { byte[] output = {b}; Log.d(TAG, "status: " + Utils.bytesToHex2(output)); String currentTime = "[" + formater.format(new Date()) + "] : "; if ((byte) (b & 0x01) == 0x01) { synchronized (this) { isUsbDisconnected = false; } ledUsb.setPressed(true); if ((byte) (mPreviousStatus & 0x01) == 0x00) log(currentTime + "usb connected"); } else { ledUsb.setPressed(false); if ((byte) (mPreviousStatus & 0x01) == 0x01) log(currentTime + "usb disconnected"); } if ((byte) (b & 0x02) == 0x02) { ledWifi.setPressed(true); if ((byte) (mPreviousStatus & 0x02) == 0x00) log(currentTime + "wifi connected"); } else { ledWifi.setPressed(false); if ((byte) (mPreviousStatus & 0x02) == 0x02) log(currentTime + "wifi disconnected"); } if ((byte) (b & 0x04) == 0x04) { ledTelep.setPressed(true); if ((byte) (mPreviousStatus & 0x04) == 0x00) log(currentTime + "telep. connected"); } else { ledTelep.setPressed(false); if ((byte) (mPreviousStatus & 0x04) == 0x04) log(currentTime + "telep. disconnected"); } mPreviousStatus = b; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean mConnect2Device1(BluetoothDevice oDevice1){\n mStateSet(kBT_Connecting); //Connecting to a server\n if (mIsAndroidDevice(oDevice1)) {\n if (mConnect2Device_Sub(UUID_ANDROID_INSECURE, oDevice1)) {\n mStateSet(kBT_Connected1);\n m...
[ "0.61139446", "0.5803244", "0.57819766", "0.5744367", "0.56965935", "0.5656107", "0.5643308", "0.5584286", "0.55648494", "0.55591357", "0.55548835", "0.5550525", "0.55366313", "0.5530653", "0.55211353", "0.5492097", "0.54824173", "0.54718953", "0.54542583", "0.5431233", "0.54...
0.5386515
22
return mBtClient.getState() == UART_PROFILE_CONNECTED;
private boolean isBtConnected(){ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkBTState() {\n\n if (btAdapter == null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(Blu...
[ "0.6376676", "0.6370304", "0.6361247", "0.63571644", "0.6342275", "0.62917703", "0.62175256", "0.6202099", "0.6191803", "0.60767746", "0.606315", "0.6048016", "0.60390365", "0.60065407", "0.60065407", "0.60065407", "0.60065407", "0.60065407", "0.60065407", "0.60065407", "0.60...
0.7161451
0
Simple test to see if we can get a list of emails tryMail
private boolean tryMail(ApiClient client) throws ApiException { try { MailApi mailApi = new MailApi(client); String inbox = getClient().getValues().getInboxFolder(); MailsResponse allMails = mailApi.getAllMails(inbox, "600", null, FALSE, FALSE, null, null, I(0), I(5), I(5), null); return allMails.getError() == null; } catch (OXException | IOException | JSONException e) { throw new ApiException(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetByMail() throws Exception {\n System.out.println(\"getByMail\");\n Connection con = ConnexionMySQL.newConnexion();\n Inscription result = Inscription.getByMail(con, \"jpdumas@btslivh.eu\");\n assertEquals(\"jpdumas@btslivh.eu\", result.getMail());\n }", ...
[ "0.6331036", "0.63266635", "0.6216461", "0.60999644", "0.6099709", "0.6099228", "0.6041309", "0.6038244", "0.6038244", "0.6038244", "0.6038244", "0.6038244", "0.5998733", "0.5987943", "0.5947023", "0.5928686", "0.5912605", "0.58274645", "0.58013004", "0.5763395", "0.57254875"...
0.69270444
0
// class instance SSocket client = new SSocket(); // socket tcp connection String ip = "127.0.0.1"; int port = 8000; client.socketConnect(ip, port); // writes and receives the message String message = "Mensaje del cliente"; System.out.println("Sending: " + message); //String returnStr = client.echo(message); //System.out.println("Receiving: " + returnStr); getSocket().close();
public static void main(String[] args) throws UnknownHostException, IOException, ClassNotFoundException, JSONException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void runTcpClient() {\n\t\t\n\t\tint TCP_SERVER_PORT=5050;\n\n\t try {\n\n\t Socket s = new Socket(\"192.168.0.255\", TCP_SERVER_PORT);\n\n\t BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\n\t BufferedWriter out = new BufferedWriter(new OutputSt...
[ "0.7037635", "0.69328076", "0.69324476", "0.69236386", "0.6881756", "0.6841292", "0.67539424", "0.6711302", "0.66294473", "0.6622063", "0.6605299", "0.6600025", "0.65427583", "0.65393853", "0.6538193", "0.65352964", "0.65289783", "0.65273815", "0.6515373", "0.6497484", "0.646...
0.0
-1
make the connection with the socket
public void socketConnect(String ip, int port) throws UnknownHostException, IOException{ System.out.println("[Connecting to socket...]"); SSocket.socket= new Socket(ip, port); System.out.println("CORRIENDO EN EL PUERTO:"+SSocket.socket.getLocalAddress()+":"+SSocket.socket.getPort()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void makeConnection() {\n\t\t// make a socket, output stream, and try connecting to the server\n\t\twhile (!connection) {\n\t\t\ttry {\n\t\t\t\tsocket = new Socket(address, port);\n\t\t\t\toutStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\tconnection = true;\n\t\t\t} catch (IOException e...
[ "0.7706458", "0.74613875", "0.72241426", "0.7072871", "0.70438224", "0.7022743", "0.6977151", "0.69759476", "0.69515616", "0.6945895", "0.69457465", "0.6924463", "0.6916877", "0.687949", "0.6874329", "0.6858425", "0.68389267", "0.6818227", "0.68155015", "0.68042815", "0.67674...
0.67840075
20
ENVIA UN MENSAJE AL SERVIDOR
public String enviarMensaje(Proceso proceso, boolean nuevo, int tiempo) throws JSONException { try { JSONObject obj= new JSONObject(); if(nuevo) { obj.put("pid", proceso.getPid()); obj.put("nombre", proceso.getNombreProceso()); obj.put("usuario",proceso.getUsuarioProceso()); obj.put("descripcion",proceso.getDescripcion()); obj.put("descripcionAux",proceso.getDescripcion()); obj.put("estado",proceso.getEstado()); obj.put("rafaga",proceso.getRafaga()); obj.put("reemplazosRealizados",0); obj.put("quantum",proceso.getQuantum()); obj.put("tiempoLlegada",proceso.getTiempoLLegada()); obj.put("tiempoInicio",-1); obj.put("tiempoFinal",-1); obj.put("prioridad",proceso.getPrioridad()); obj.put("turnaRound",-1); obj.put("tiempoHilo",proceso.getTiempoHilo()); obj.put("tiempo",tiempo); }else { obj.put("pid", proceso.getPid()); obj.put("descripcion",proceso.getDescripcion()); obj.put("estado",proceso.getEstado()); obj.put("reemplazosRealizados",proceso.getReemplazosRealizados()); obj.put("tiempoInicio",proceso.getTiempoInicio()); obj.put("tiempoFinal",proceso.getTiempoFinal()); obj.put("turnaRound",proceso.getTurnaRound()); obj.put("tiempo",tiempo); } // out & in PrintWriter out = new PrintWriter(getSocket().getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(getSocket().getInputStream())); // writes str in the socket and read out.println(obj); String returnStr = in .readLine(); //in.close(); //out.close(); return returnStr; } catch (IOException e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }", "public static void proveraServisa() {\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje racunate vreme sledeceg servisa:\");\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (red...
[ "0.6428525", "0.64203066", "0.63241273", "0.6302993", "0.6218546", "0.61814046", "0.6139013", "0.6127943", "0.60650283", "0.590048", "0.58837235", "0.58749425", "0.58550507", "0.58389235", "0.58384466", "0.5797806", "0.5776842", "0.57699656", "0.5760114", "0.5749498", "0.5748...
0.0
-1
get the socket instance
private static Socket getSocket() { return socket; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Socket getSocket()\n {\n return socket;\n }", "Socket getSocket()\n {\n return socket;\n }", "protected Socket getSocket()\n {\n return m_Socket;\n }", "protected final Socket getSocket() {\n return socket;\n }", "public Socket getSocket() {\n\t\treturn socke...
[ "0.7702683", "0.76841885", "0.7669196", "0.7590212", "0.74686646", "0.742364", "0.7341614", "0.732485", "0.7277836", "0.72244", "0.72019607", "0.7158693", "0.70281315", "0.69298244", "0.6894501", "0.68589276", "0.68408906", "0.6781909", "0.6771409", "0.6747274", "0.6740911", ...
0.7711815
0
Verify that the input is valid.
@Override public String greetServer(String input) throws IllegalArgumentException { if (!FieldVerifier.isValidName(input)) { // If the input is not valid, throw an IllegalArgumentException back // to // the client. throw new IllegalArgumentException( "Name must be at least 4 characters long"); } String serverInfo = httpRequest.getServletContext().getServerInfo(); String userAgent = httpRequest.getHeader("User-Agent"); // Escape data from the client to avoid cross-site script // vulnerabilities. input = escapeHtml(input); userAgent = escapeHtml(userAgent); return "Helloooo, " + input + "!<br><br>I am running " + serverInfo + ".<br><br>It looks like you are using:<br>" + userAgent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isInputValid() {\n return true;\n }", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "protected abstract boolean isInputValid();", "public abstract boolean verifyInput();", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "protected abstract int i...
[ "0.8048522", "0.7973755", "0.7804058", "0.74282455", "0.7197045", "0.71819925", "0.7157434", "0.70779675", "0.70118624", "0.69604033", "0.67827564", "0.67716426", "0.6746775", "0.6734796", "0.6701452", "0.667794", "0.6676106", "0.667332", "0.6669496", "0.66544193", "0.6638050...
0.0
-1
Escape an html string. Escaping data received from the client helps to prevent crosssite script vulnerabilities.
private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;") .replaceAll(">", "&gt;"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String escapeHtml(String html) {\n if (html == null) {\n return null;\n }\n return html.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\n \">\", \"&gt;\");\n }", "private String escapeHtml(String html) {\n if (html == null) {\n return null;\n }\n r...
[ "0.7095776", "0.7095776", "0.70295376", "0.69896024", "0.69763786", "0.69700474", "0.680942", "0.62468296", "0.6182669", "0.6131638", "0.60966563", "0.5913226", "0.58073694", "0.5798545", "0.57632583", "0.5701912", "0.56843287", "0.56325203", "0.56256753", "0.55553526", "0.55...
0.6955891
7
now get some metadata from the database
private void writeMetaData(ResultSet resultSet) throws SQLException { System.out.println("The columns in the table are: "); System.out.println("Table: " + resultSet.getMetaData().getTableName(1)); for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){ System.out.println("Column " +i + " "+ resultSet.getMetaData().getColumnName(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MetaData getMetaData();", "Metadata getMetaData();", "Map<String, Object> getAllMetadata();", "public Iterable<SequenceInformation> extractMetadata(ExtractionContext extractionContext) throws SQLException;", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaI...
[ "0.73416", "0.713504", "0.70758617", "0.6630307", "0.66275644", "0.66275644", "0.66275644", "0.66275644", "0.66275644", "0.66180897", "0.660932", "0.65971506", "0.6565453", "0.65480274", "0.6502742", "0.6491063", "0.6467865", "0.64341855", "0.6405432", "0.6367638", "0.6367638...
0.0
-1
resultSet is initialised before the first data set
private ArrayList<String> writeResultSet(ResultSet resultSet) throws SQLException { ArrayList<String> inter_result = new ArrayList<String>(); while (resultSet.next()) { // it is possible to get the columns via name // also possible to get the columns via the column number // which starts at 1 // e.g., resultSet.getSTring(2); String hotel_name = resultSet.getString("name"); inter_result.add(hotel_name); //String hotel_area = resultSet.getString("area"); System.out.println("Name: " + hotel_name); //System.out.println("Area: " + hotel_area); } return inter_result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void initResultTable() {\n }", "private void setData(ResultSet resultSet)\r\n throws SQLException, IllegalStateException {\r\n if(connectedToDatabase){\r\n int numberOfRows = 0;\r\n // determine number of rows in ResultSet\r\n resultS...
[ "0.69436103", "0.66689885", "0.6465523", "0.63510406", "0.63128644", "0.6295688", "0.6236615", "0.62341064", "0.6218667", "0.61630213", "0.6153718", "0.6119078", "0.61050236", "0.60698074", "0.6063849", "0.5977064", "0.59744394", "0.593951", "0.5931373", "0.5881521", "0.58662...
0.0
-1
Vision processing thread to look for gear placement pegs and high goal targets
public Entropy2017Targeting(UsbCamera gearCam, UsbCamera groundCam) { gearCamera = gearCam; groundCamera = groundCam; if (gearCam != null) { pegSink = CameraServer.getInstance().getVideo(gearCamera); } if (groundCam != null) { groundSink = CameraServer.getInstance().getVideo(groundCamera); } m_lastSnapshotTime = new Date(); m_lastRawSnapshotTime = new Date(); theProperties = new Properties(); theProperties.setProperty("lowHue", "70"); theProperties.setProperty("highHue", "100"); theProperties.setProperty("lowSat", "100"); theProperties.setProperty("highSat", "255"); theProperties.setProperty("lowVal", "50"); theProperties.setProperty("highVal", "255"); theProperties.setProperty("DilateSize", "4.0"); theProperties.setProperty("DilateKernel", "2"); theProperties.setProperty("CROSS_HAIR_X", "200"); theProperties.setProperty("CROSS_HAIR_Y", "100"); theProperties.setProperty("CROSS_HAIR_SIZE", "30"); theProperties.setProperty("MilliSecsBetweenPics", "1000"); theProperties.setProperty("ErodeSize", "4.0"); theProperties.setProperty("AspectMin", "0.5"); theProperties.setProperty("AspectMax", "5.0"); theProperties.setProperty("AreaMin", "1000"); theProperties.setProperty("AreaMax", "5000"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b...
[ "0.6499032", "0.6218612", "0.61212355", "0.60326993", "0.60007674", "0.59968686", "0.5990694", "0.5974144", "0.5915672", "0.5894124", "0.5863369", "0.58598965", "0.58493286", "0.58357716", "0.58139616", "0.5804519", "0.5788603", "0.5779777", "0.57777303", "0.5749007", "0.5718...
0.5237276
91
Process the specified number of frames for a target
public void processFrames(int numFrames, boolean targetingPeg) { Sensors.targetingCameraMode(); Sensors.setCameraLight(true); framesToProcess = numFrames; processingForPeg = targetingPeg; synchronized(this) { this.notify(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void processFrame(float deltaTime);", "public void incrementFrameNumber()\n {\n\tframeNumber++;\n }", "int getNumberFrames();", "int getFramesCount();", "public void nextFrame() {\r\n if (frame < maxFrames - 1) {\r\n frame++;\r\n } else {\r\n frame = 0;\r\n ...
[ "0.616173", "0.59192985", "0.5798091", "0.578394", "0.5770795", "0.56864214", "0.5562436", "0.5521442", "0.5500088", "0.5438665", "0.53951615", "0.53703284", "0.5320289", "0.52955574", "0.5244031", "0.52264786", "0.52124447", "0.51909715", "0.51821953", "0.5169477", "0.516355...
0.6622341
0
Test main function to find targets from root folder
public static void main(String[] args) { String inputFolder = rootFolder + "\\LED Peg"; String outputFolder = rootFolder + "\\LEDPeg_output"; File folder = new File(inputFolder); File[] listOfFiles = folder.listFiles(); Entropy2017Targeting imageProcessor = new Entropy2017Targeting(null, null); imageProcessor.processingForPeg = true; for(File f : listOfFiles) { System.out.println(); System.out.println("---------------------------------------------------------------------------------------------"); System.out.println(); System.out.println("File: " + f.getPath()); Mat ourImage = Imgcodecs.imread(f.getPath()); imageProcessor.processImage(ourImage); Imgcodecs.imwrite(outputFolder + "\\"+ f.getName()+".png", ourImage); System.out.println("Completed file."); } System.out.println("Processed all images."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testResolveTargetLocation() throws Exception {\n System.out.println(\"resolveTargetLocation\");\n \n instance.resolveTargetLocation();\n \n }", "@Test\n public void downloadToplevel_treeArtifacts() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n ret...
[ "0.57665074", "0.5731012", "0.5720355", "0.56316", "0.5602213", "0.5542404", "0.54498845", "0.5404574", "0.54000485", "0.53921086", "0.5387659", "0.5363724", "0.53192", "0.5300201", "0.52937144", "0.5293415", "0.5288699", "0.52867496", "0.5286371", "0.5251489", "0.5251074", ...
0.0
-1
Processes an image for either peg or high goal targets
private void processImage(Mat image) { ///////////////////////////////////////////////////////////////////////////////////////////////////////// //vvvvvvvvvvvvvvvvvvv FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE vvvvvvvvvvvvvvvvvvv// ///////////////////////////////////////////////////////////////////////////////////////////////////////// if (processingForPeg) { TargetInformation targetInfo; Mat cleanedImage = getHSVThreshold(image); targetInfo = findPeg(cleanedImage); infoList.add(targetInfo); } else { framesToProcess = 100; // So that the processing is continuous until found lookingAtGear = lookForGear(image); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// //^^^^^^^^^^^^^^^^^^^ FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE ^^^^^^^^^^^^^^^^^^^// ///////////////////////////////////////////////////////////////////////////////////////////////////////// return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private TargetInformation findHighGoal(Mat image) {\r\n\t\tTargetInformation ret = new TargetInformation();\r\n\t\tret.targetingPeg = false;\r\n\t\t\r\n long[] xsums = sums(image, true);\r\n long[] ysums = sums(image, false);\r\n \r\n\t List<PeakLoc> xpeaks = findPeaks(xsums, 10);\r\n\t ...
[ "0.635356", "0.6080557", "0.5562427", "0.555573", "0.5481008", "0.5439601", "0.53742206", "0.5357649", "0.53544897", "0.5344483", "0.5329124", "0.53136224", "0.52772266", "0.5276426", "0.5237334", "0.5224088", "0.52149814", "0.52094686", "0.52085304", "0.52053046", "0.5179215...
0.62040657
1
Process pixels in the correct color range and cleanup the image
private Mat getHSVThreshold(Mat image) { // convert BGR values to HSV values Mat hsv = new Mat(); Imgproc.cvtColor(image, hsv, Imgproc.COLOR_BGR2HSV); Mat inRange = new Mat(); Core.inRange( hsv, new Scalar(Double.parseDouble(theProperties.getProperty("lowHue")), Double.parseDouble(theProperties.getProperty("lowSat")), Double.parseDouble(theProperties.getProperty("lowVal"))), new Scalar(Double.parseDouble(theProperties.getProperty("highHue")), Double.parseDouble(theProperties.getProperty("highSat")), Double.parseDouble(theProperties.getProperty("highVal"))), inRange); Mat grey = new Mat(); Imgproc.cvtColor(image, grey, Imgproc.COLOR_BGR2GRAY); Core.bitwise_and(grey, inRange, grey); Imgcodecs.imwrite(rootFolder + "/1_Post_inRange" + ".png", grey); return grey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void normalizeColor(BufferedImage image) {\n\t\tHashMap<Integer, Integer> counts = colorHistogram(image);\r\n\t\tInteger[] a=sortmap(counts); // sorting the map\r\n\t\tInteger minFreq = 1000;\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\tif (counts.get(i) < minFreq) {\r\n\t\t\t\tminFreq = count...
[ "0.66823083", "0.6594104", "0.6348605", "0.6262845", "0.6184738", "0.6118512", "0.6100752", "0.6094127", "0.59671336", "0.59201276", "0.590569", "0.5900706", "0.58764553", "0.5852808", "0.58466595", "0.58347493", "0.58263016", "0.5797173", "0.5783489", "0.574204", "0.57206744...
0.0
-1
Locate the peg target in an image, if any
private TargetInformation findPeg(Mat image) { TargetInformation ret = new TargetInformation(); ret.targetingPeg = true; long[] xsums = sums(image, true); long[] ysums = sums(image, false); List<PeakLoc> ypeaks = findPeaks(ysums); List<PeakLoc> xpeaks = findPeaks(xsums); ///////////////////////////////////////////////////////////////////////////////////////////////////////// //vvvvvvvvvvvvvvvvvvv FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE vvvvvvvvvvvvvvvvvvv// ///////////////////////////////////////////////////////////////////////////////////////////////////////// // Target is only found if we have exactly 2 x peaks, representing both of the pieces of tape if ((xpeaks.size() == 2) && (ypeaks.size() > 0)){ ret.targetFound = true; ret.x = (xpeaks.get(1).getStart() + xpeaks.get(0).getStop()) / 2; ret.gap = xpeaks.get(1).getStart() - xpeaks.get(0).getStop(); ret.width = xpeaks.get(1).getStop() - xpeaks.get(0).getStart(); ret.height = ypeaks.get(0).getStop() - ypeaks.get(0).getStart(); ret.y = ypeaks.get(0).getStart() + ret.height/2; ret.rightOfTarget = xpeaks.get(0).maxValue < xpeaks.get(1).maxValue; ret.pixelsPerInch = ret.height / pegHeightInches; ret.aimX = ret.x + cameraOffsetInches * ret.pixelsPerInch; ret.correctionAngle = (double)((ret.aimX - image.cols() / 2)) / pixelsPerXDegree; } else { ret.targetFound = false; } ///////////////////////////////////////////////////////////////////////////////////////////////////////// //^^^^^^^^^^^^^^^^^^^ FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE ^^^^^^^^^^^^^^^^^^^// ///////////////////////////////////////////////////////////////////////////////////////////////////////// return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private TargetInformation findHighGoal(Mat image) {\r\n\t\tTargetInformation ret = new TargetInformation();\r\n\t\tret.targetingPeg = false;\r\n\t\t\r\n long[] xsums = sums(image, true);\r\n long[] ysums = sums(image, false);\r\n \r\n\t List<PeakLoc> xpeaks = findPeaks(xsums, 10);\r\n\t ...
[ "0.6558934", "0.5948143", "0.580463", "0.57220995", "0.5716737", "0.562653", "0.55354166", "0.5467436", "0.54566956", "0.5449061", "0.54419875", "0.5374583", "0.5365687", "0.5342472", "0.5283729", "0.5270827", "0.5248834", "0.52250487", "0.5223019", "0.5214062", "0.517772", ...
0.7422146
0
Locate the high goal in an image, if any
private TargetInformation findHighGoal(Mat image) { TargetInformation ret = new TargetInformation(); ret.targetingPeg = false; long[] xsums = sums(image, true); long[] ysums = sums(image, false); List<PeakLoc> xpeaks = findPeaks(xsums, 10); List<PeakLoc> ypeaks = findPeaks(ysums, 10); if (ypeaks.size() == 2 && xpeaks.size() > 0) { ret.targetFound = true; ret.x = (xpeaks.get(0).getStop() - xpeaks.get(0).getStart()) / 2; ret.gap = ypeaks.get(1).getStart() - ypeaks.get(0).getStop(); ret.width = xpeaks.get(0).getStop() - xpeaks.get(0).getStart(); ret.height = ypeaks.get(1).getStop() - ypeaks.get(0).getStart(); ret.y = (ypeaks.get(0).getStop() + ypeaks.get(1).getStart())/2; double pixelsPerInch = ret.gap / highGoalGapInches; if (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak()) { pixelsPerInch = (pixelsPerInch + ret.width / highGoalWidthInches) / 2; } if (ypeaks.get(0).isTruePeak()) { if (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak()) { pixelsPerInch = (pixelsPerInch * 2 + ret.width / highGoalHeightInches) / 3; } else { pixelsPerInch = (pixelsPerInch + ret.width / highGoalHeightInches) / 2; } } ret.aimX = ret.x + (cameraOffsetInches - shooterOffsetInches) * pixelsPerInch; ret.correctionAngle = (double)((ret.aimX - image.cols() / 2)) / pixelsPerXDegree; } else { ret.targetFound = false; } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BufferedImage getThresh(BufferedImage img, int left, int right, int top, int bottom) { // Method to get thresholded image \n\t\t//Vision.logger.debug(\"Starting thresholding\");\n\n\t\t//stops it fucking up the locations before we've given it the thresholds\n\t\tif (worldState.isClickingDone()){\n\n\t\t\tne...
[ "0.65452373", "0.61549157", "0.610245", "0.6070247", "0.58171636", "0.58058685", "0.5800539", "0.57866865", "0.5733904", "0.56077886", "0.5597595", "0.5573305", "0.5563211", "0.5551754", "0.5550876", "0.5530079", "0.5489503", "0.5469227", "0.5405505", "0.54047316", "0.540214"...
0.7856968
0
Draws a reticle on the image at the specified coordinates
private void drawTarget(Mat image, long x, long y){ int size = 40; Scalar color; color = new Scalar(0,0,255); Imgproc.line(image, new Point(x-size,y), new Point(x+size,y), color,2); Imgproc.line(image, new Point(x,y-size), new Point(x,y+size), color,2); for (int k =0;k<4;k++) { Imgproc.circle(image, new Point(x,y), (k+1)*size/4, color); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void drawImage(float x, float y, float width, float height);", "public void render() { image.drawFromTopLeft(getX(), getY()); }", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images...
[ "0.7045138", "0.6857895", "0.6809778", "0.6721322", "0.6677649", "0.6640504", "0.65446234", "0.6414519", "0.63130754", "0.63127756", "0.6240335", "0.6198172", "0.6198053", "0.61878186", "0.6112701", "0.6106404", "0.60924184", "0.60891724", "0.6078884", "0.6060223", "0.6059844...
0.6244
10
Sum the rows or columns of a matrix
private static long[] sums(Mat m,boolean byRow) { int rows = m.rows(); int cols = m.cols(); byte[] data = new byte[rows*cols]; long[] retSums = null; int status = m.get(0, 0,data); long total = 0; for (int k=0;k<data.length;k++) { total += Byte.toUnsignedInt(data[k]); } if (byRow) { retSums = new long[cols]; for (int col=0;col<cols;col++) { retSums[col] = 0; for (int row=0;row<rows;row++) { int k = row*cols+col; retSums[col] += Byte.toUnsignedInt(data[k]); } } } else { retSums = new long[rows]; for (int row=0;row<rows;row++) { retSums[row] = 0; for (int col=0;col<cols;col++) { int k = row*cols+col; retSums[row] += Byte.toUnsignedInt(data[k]); } } } int total1 = 0; for (int k=0; k < retSums.length; k++) { total1 += retSums[k]; } return retSums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int sumAll() {\n\t\tint total = 0;\n\t\t//iterate all rows\n\t\tfor(int i = 0;i<size();i++){\n\t\t\t//itreate all columns\n\t\t\tfor(int j = 0;j<size();j++){\n\t\t\t\tInteger cell = matrix.get(i).get(j);\n\t\t\t\ttotal+=cell;\n\t\t\t}\n\t\t}\n\t\treturn total;\n\t}", "public static Matrix sum(Matrix m)...
[ "0.78165835", "0.7591893", "0.75341004", "0.73176557", "0.7293805", "0.71512306", "0.69746375", "0.6972446", "0.69355667", "0.6828626", "0.6822023", "0.6741341", "0.67278236", "0.67157936", "0.6677175", "0.6652885", "0.6600624", "0.6359596", "0.63328254", "0.62548304", "0.622...
0.73507524
3
Finds value spikes in an array
private static List<PeakLoc> findPeaks(long[] sums,long minWidth) { long maxVal = Arrays.stream(sums).max().getAsLong(); ArrayList<PeakLoc> ret = new ArrayList<PeakLoc>(); boolean looking = true; long start = 0; long maxPeakValue = 0; for (int k=0; k < sums.length;k++) { if (looking){ if ((sums[k]) > (maxVal/2)){ looking = false; start = k; } } else{ if (maxPeakValue < sums[k]) { maxPeakValue = sums[k]; } if ((sums[k]) < (maxVal/4)){ looking = true; long width = (k-1)-start; if (width >= minWidth) { ret.add(new PeakLoc(start, k-1, start == 0, maxPeakValue / maxVal)); maxPeakValue = 0; } } } } if (looking == false){ ret.add(new PeakLoc(start, sums.length - 1, false, maxPeakValue / maxVal)); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void fixSpikes(int[] array){\r\n\t\t\r\n\t\tfor(int i=1; i<array.length-1; i++){\r\n\t\t\tlong a=Tools.max(1, array[i-1]);\r\n\t\t\tint b=array[i];\r\n\t\t\tlong c=Tools.max(1, array[i+1]);\r\n\t\t\tif(b>1 && b>a && b>c){\r\n\t\t\t\t//peak\r\n\t\t\t\tif((b>=2*a || b>a+2) && (b>=2*c || b>c+2)){\r\n\t...
[ "0.7020734", "0.57772964", "0.5749899", "0.56146437", "0.54431444", "0.54409623", "0.53452927", "0.53284246", "0.53139293", "0.5309394", "0.52820116", "0.5277111", "0.5267698", "0.52529", "0.5250049", "0.5221698", "0.51919323", "0.51908296", "0.5168628", "0.5151191", "0.51439...
0.48435816
50
Finds value spikes in an array, assumes a minimum of 3 pixels wide for a spike to be considered a peak
private static List<PeakLoc> findPeaks(long[] sums) { return findPeaks(sums, 3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void fixSpikes(int[] array){\r\n\t\t\r\n\t\tfor(int i=1; i<array.length-1; i++){\r\n\t\t\tlong a=Tools.max(1, array[i-1]);\r\n\t\t\tint b=array[i];\r\n\t\t\tlong c=Tools.max(1, array[i+1]);\r\n\t\t\tif(b>1 && b>a && b>c){\r\n\t\t\t\t//peak\r\n\t\t\t\tif((b>=2*a || b>a+2) && (b>=2*c || b>c+2)){\r\n\t...
[ "0.7489707", "0.59893644", "0.587343", "0.575295", "0.5556137", "0.5523561", "0.5518525", "0.5504167", "0.5378065", "0.53418124", "0.53048456", "0.5271925", "0.5251621", "0.52264637", "0.52242535", "0.517643", "0.51756227", "0.5174065", "0.51624465", "0.51295024", "0.5072775"...
0.5007044
22
TODO Autogenerated method stub
@Override protected String getParentPropertyName(Class beanClass) { 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.66713095", "0.6567948", "0.652319", "0.648097", "0.64770466", "0.64586824", "0.64132667", "0.6376419", "0.62759", "0.62545097", "0.62371093", "0.62237984", "0.6201738", "0.619477", "0.619477", "0.61924416", "0.61872935", "0.6173417", "0.613289", "0.6127952", "0.6080854", ...
0.0
-1
TODO Autogenerated method stub
@Override public String[] updateJsonProperties() { 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
1. make a main method
public static void main(String[] args) { //2. create an array of 5 robots. Robot[] robs = new Robot[5]; //3. use a for loop to initialize the robots. for (int i = 0; i < robs.length; i++) { robs[i] = new Robot(); robs[i].setX(100 * i + 100); robs[i].setY(500); robs[i].setSpeed(10); } //4. make each robot start at the bottom of the screen, side by side, facing up //5. use another for loop to iterate through the array and make each robot move // a random amount less than 50. for (int i = 0; i < robs.length; i++) { Random rnd = new Random(); robs[i].move(rnd.nextInt(50)+1); } //6. use a while loop to repeat step 5 until a robot has reached the top of the screen. boolean notwon = true; int winner = -250; while(notwon) { for (int i = 0; i < robs.length; i++) { Random rnd = new Random(); robs[i].move(rnd.nextInt(50)+1); } for (int i = 0; i < robs.length; i++) { if (notwon && winner == -250 && robs[i].getY() <= 72) { winner = i; notwon = false; } } } robs[winner].sparkle(); //7. declare that robot the winner and throw it a party! //8. try different races with different amounts of robots. //9. make the robots race around a circular track. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main(){\n\t}", "public static void main()\n\t{\n\t}", "public static void main() {\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public void main(){\n }", "public static void main(String[]a...
[ "0.82446295", "0.80868167", "0.8083961", "0.78212875", "0.7812002", "0.78073484", "0.7728481", "0.77021515", "0.76746714", "0.76711124", "0.7656188", "0.7648128", "0.7644652", "0.7644652", "0.76300967", "0.76284814", "0.7611351", "0.7591327", "0.7591327", "0.7591327", "0.7591...
0.0
-1
Returns the list of file paths in the specified folder (and not in the subfolders).
public static ArrayList<String> listFilesInFolder(String pFolderPath) { return listFilesInFolder(pFolderPath, false, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> listFilesForFolder(File folder) {\n\t\tList<String> fileList= new ArrayList<String>();\n\t for (final File fileEntry : folder.listFiles()) {\n\t if (fileEntry.isDirectory()) {\n\t listFilesForFolder(fileEntry);\n\t } else {\n\t \tfileList.add(fileEntry.getName...
[ "0.78296703", "0.7788791", "0.76780325", "0.76110375", "0.74424666", "0.7357113", "0.6938095", "0.6892323", "0.67488605", "0.6677088", "0.66615826", "0.66525173", "0.6639267", "0.6634201", "0.6582903", "0.6574894", "0.6553445", "0.65007746", "0.64796174", "0.6433988", "0.6413...
0.7096351
6
Returns the list of file paths in the specified folder. If pIncludeSubfolders is set to true, the subfolders are also explored.
public static ArrayList<String> listFilesInFolder(String pFolderPath, boolean pIncludeSubfolders) { return listFilesInFolder(pFolderPath, pIncludeSubfolders, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ArrayList<String> listFilesInFolder(String pFolderPath, boolean pIncludeSubfolders,\n String pExtension) {\n ArrayList<String> list = new ArrayList<String>();\n\n /*\n * depth = 0 -> only the specified file/folder is returned. To get all\n * files inside a fol...
[ "0.77467626", "0.68967175", "0.68928117", "0.68571514", "0.6639469", "0.6551294", "0.65331435", "0.6264781", "0.6096009", "0.60031444", "0.5889862", "0.5874704", "0.5846866", "0.58241874", "0.58151734", "0.57601273", "0.56953573", "0.56493485", "0.56091946", "0.55868554", "0....
0.7655799
1
Returns the list of files in the specified folder that match the specified extension. If pIncludeSubfolders is set to true, the subfolders are also explored.
public static ArrayList<String> listFilesInFolder(String pFolderPath, boolean pIncludeSubfolders, String pExtension) { ArrayList<String> list = new ArrayList<String>(); /* * depth = 0 -> only the specified file/folder is returned. To get all * files inside a folder, depth must be set to 1. */ int depth = 1; if (pIncludeSubfolders) { depth = Integer.MAX_VALUE; } String matcherString = "glob:**"; if (!ObjectUtils.isObjectEmpty(pExtension)) { matcherString += "." + pExtension; } PathMatcher matcher = FileSystems.getDefault().getPathMatcher(matcherString); try (Stream<Path> paths = Files.walk(Paths.get(pFolderPath), depth)) { // paths.filter(Files::isRegularFile).filter(path -> // matcher.matches(path)) // .forEach(path -> // System.out.println(path.normalize().toString())); paths.filter(Files::isRegularFile).filter(path -> matcher.matches(path)) .forEach(path -> list.add(path.normalize().toString())); } catch (IOException e) { LogUtils.logError(DirectoryUtils.class, "IOException while listing files in folder [" + pFolderPath + "]", e); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ArrayList<String> listFilesInFolder(String pFolderPath, boolean pIncludeSubfolders) {\n return listFilesInFolder(pFolderPath, pIncludeSubfolders, null);\n }", "public File[] listFiles(String extension) {\n\t\tfinal String ext = \".\" + FIleUtil.SafeStr(extension);\n\n\t\tFileFilter Ff = f...
[ "0.65455234", "0.6043014", "0.6031276", "0.60057545", "0.5939012", "0.5916566", "0.5858117", "0.58480173", "0.58460057", "0.5657023", "0.5514274", "0.54782003", "0.54300946", "0.5420332", "0.5376781", "0.53606397", "0.53543055", "0.5273777", "0.5244281", "0.52297425", "0.5228...
0.7581916
0
Project down into the moments
@Override public Pair<SimpleMatrix, SimpleMatrix> symmetricFactorize(FullTensor T, int K) { throw new RuntimeException("Not yet implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void resetMomentObservation() {\r\n\t\tif (momentObservation.isEmpty()) {\r\n\t\t\tObservation o;\r\n\t\t\tfor (int i : momentDegrees) {\r\n\t\t\t\to = new Observation(\"moment \"+i, true);\r\n\t\t\t\to.setStandardPrecision(momentPrecision);\r\n\t\t\t\tmomentObservation.put(i, o);\r\n\t\t\t}\r\n\t\t} else ...
[ "0.58811307", "0.56283087", "0.54931587", "0.5222956", "0.5209887", "0.51931506", "0.5179312", "0.5175016", "0.5096612", "0.49970666", "0.49591196", "0.4953301", "0.49508128", "0.49462232", "0.49265215", "0.4883564", "0.48674121", "0.4865159", "0.4855772", "0.47935528", "0.47...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int[][] costs = new int[n][3]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { costs[i][j] = scn.nextInt(); } } System.out.println(minCost(costs)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
This is a functional problem. Only this function has to be written. This function takes as input 2D array It should return the required output
public static int minCost(int[][] costs) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRo...
[ "0.6360731", "0.61680776", "0.6029457", "0.5952012", "0.5943216", "0.5822687", "0.58146137", "0.5814127", "0.57933784", "0.5708338", "0.5626289", "0.5622318", "0.5568229", "0.5562846", "0.5556954", "0.5554136", "0.5539721", "0.552422", "0.5500973", "0.54927015", "0.54877174",...
0.0
-1
packetSequence, String data Constructor.
public PacketAssembler() { this.theTreeMaps = new TreeMap<Integer, TreeMap<Integer,String>>(); this.countPerMessage = new TreeMap<Integer,Integer>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Packet(String data){\n\t\t\tthis(data, CkSum.genCheck(data));\n\t\t}", "public Protocol(String data)\r\n {\r\n char cData[] = data.toCharArray();\r\n msgType = cData[1];\r\n numArgs = cData[2] - '0';\r\n \r\n if (numArgs > 0)\r\n {\r\n args = new Str...
[ "0.6887273", "0.6522194", "0.64254546", "0.63244855", "0.624784", "0.61829317", "0.6075103", "0.60654414", "0.6050127", "0.5824417", "0.57759595", "0.5745201", "0.5694919", "0.5667217", "0.5664768", "0.5658443", "0.5613944", "0.5518633", "0.5498633", "0.5482371", "0.5467619",...
0.0
-1
public PacketAssembler() Accessors and mutators. General methods. Method to assemble packets. Will read a file and verify if the packet is a complete packet. If it is then this method will store the packet in a TreeMap and then check to see if the complete message has been received. If the complete message has been received, then this method will assemble the message. If a packet is not complete then it will discard the packet.
public void assemblePackets(Scanner inFile) { boolean isNotCompletePacket; int messageId = 0, packetSequence = 0, packetCount = 0; String payload = ""; while( inFile.hasNext() ) { isNotCompletePacket = false; try { messageId = inFile.nextInt(); packetSequence = inFile.nextInt(); packetCount = inFile.nextInt(); } // try to get three integers from Scanner file catch(InputMismatchException e) { inFile.nextLine(); isNotCompletePacket = true; } // if three integers are not present then discard packet if( !(isNotCompletePacket) ) { payload = inFile.nextLine(); this.storePacket(messageId, packetSequence, packetCount, payload); if( this.checkForCompleteMessage(messageId, packetCount) ) { FileUtils.logFile.println(this.TAG + this.assembleMessage(messageId)); } // if the entire message has been received then assemble message and print to log } // if the packet is a complete packet then store and check for complete message } // while the input file has a next input }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PacketAssembler()\n {\n \tthis.theTreeMaps = new TreeMap<Integer, TreeMap<Integer,String>>();\n \tthis.countPerMessage = new TreeMap<Integer,Integer>();\n }", "private LinkedList<Packet> buildPackets(String fileName, String dataFromFile, int packetSize) {\r\n //create list to store data and pac...
[ "0.70167464", "0.5463958", "0.5241355", "0.52352494", "0.5122697", "0.50537264", "0.50345284", "0.50297713", "0.5008694", "0.4949327", "0.49384966", "0.48956877", "0.48568386", "0.4842569", "0.48156655", "0.48013863", "0.47532034", "0.4751827", "0.47461316", "0.47131982", "0....
0.6612391
1
public void assemblePackets(Scanner inFile) Method to store a packet. This will see if the TreeMap already contains the messaageId and if it does then it will check to see if the packet is already there and if it is it will be replaced by the new packet. If the packet doesn't exist then this method will add the new packet and increment the packet count of the message. If the message is not in the TreeMap then it will simply create a new TreeMap to store the new messageIs and start the new count at one.
public void storePacket(int messageId, int packetSequence, int packetCount, String payload) { if( this.theTreeMaps.containsKey(messageId) ) { if( !(this.theTreeMaps.get(messageId).containsKey(packetSequence)) ) { this.countPerMessage.put(messageId, this.countPerMessage.get(messageId)+1); } // if the packet does not exist in the message TreeMap then add one to the counter } // if the TreeMap already contains the messageId else { this.theTreeMaps.put(messageId, (this.theMessages = new TreeMap<Integer,String>())); this.countPerMessage.put(messageId, 1); } // if the messageId is new to the TreeMap then make new TreeMap and start message counter at one this.theTreeMaps.get(messageId).put(packetSequence, payload); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void assemblePackets(Scanner inFile)\n {\n \tboolean isNotCompletePacket;\n \tint messageId = 0, packetSequence = 0, packetCount = 0;\n \tString payload = \"\";\n \n while( inFile.hasNext() )\n {\n \tisNotCompletePacket = false;\n \t\n \ttry\n \t{\n \tmessageId = inFile.nextI...
[ "0.7335788", "0.5749034", "0.55594474", "0.5384943", "0.5352325", "0.5261505", "0.52585673", "0.49836248", "0.4963184", "0.48446965", "0.48411202", "0.47745982", "0.47642353", "0.4714826", "0.47105363", "0.47072113", "0.46782807", "0.46769837", "0.46496153", "0.4648363", "0.4...
0.63881904
1
public void storePacket(int messageId, int packetSequence, int packetCount, String payload) Method to assemble a message.
private String assembleMessage(int messageId) { String theString = ""; for( Integer key : this.theTreeMaps.get(messageId).keySet() ) { theString += this.theTreeMaps.get(messageId).get(key); } // if the messageId in the TreeMap is the same as the current messageId this.theTreeMaps.remove(messageId); return theString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void storePacket(int messageId, int packetSequence, int packetCount, String payload)\n\t{\n\t\n if( this.theTreeMaps.containsKey(messageId) )\n {\n \tif( !(this.theTreeMaps.get(messageId).containsKey(packetSequence)) )\n \t{\n \t\tthis.countPerMessage.put(messageId, this.countPerMessage.get(m...
[ "0.77705055", "0.56179214", "0.5578735", "0.5525978", "0.54608196", "0.54601824", "0.5334213", "0.53153694", "0.5304074", "0.5282114", "0.524936", "0.5241606", "0.5233823", "0.5209017", "0.5187394", "0.5175775", "0.5124753", "0.51100993", "0.5106788", "0.5074993", "0.5053962"...
0.0
-1
private String assembleMessage(int messageId) Method to check if a message has been completely received.
private boolean checkForCompleteMessage(int messageId, int packetCount) { boolean isCompleteMessage; isCompleteMessage = false; if( packetCount == this.countPerMessage.get(messageId) ) { isCompleteMessage = true; } // if the packetCount is equal to the number of packets received for a message return isCompleteMessage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasMessageId();", "boolean hasMessageId();", "boolean hasMessageId();", "private final boolean message_ready ()\n {\n \n if (msg_source == null)\n return false;\n \n in_progress = msg_source.pull_msg ();\n if (in_progress == null) {\n return...
[ "0.7012988", "0.7012988", "0.7012988", "0.6827813", "0.6716161", "0.67084086", "0.67084086", "0.67084086", "0.67084086", "0.67084086", "0.67084086", "0.67084086", "0.67084086", "0.6659591", "0.65832585", "0.65216124", "0.6489147", "0.6452331", "0.642953", "0.642953", "0.63373...
0.71826357
0
TODO Autogenerated method stub
public static void main(String[] args) { Collection<String> list = new ArrayList<>(); list.add("a"); list.add("a"); list.add("b"); list.add("b"); list.add("c"); System.out.println("a:"+listTest(list, "a")); System.out.println("b:"+listTest(list, "b")); System.out.println("c:"+listTest(list, "c")); System.out.println("xxx:"+listTest(list, "xxx")); }
{ "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
the req.body is the callback and it is a json object it is changed to an Mpesa object using JSON
private static Object doMpesa(Request req, Response res){ System.out.println("Here is the confirmation: " + req.body()); Mpesa received = new Gson().fromJson(req.body(),Mpesa.class); System.out.println(); System.out.println(); System.out.println(); System.out.println(); System.out.println("Payment Status: "+ received.getStatus()); publisher send_0k = new publisher(); send_0k.setContent(received.getStatus()); send_0k.publish(); return received; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RequestBody set(byte[] body);", "private void setRequestBody(JSONObject requestBody) throws IOException, JSONException {\n requestBody.put(\"application_metadata\", Base64.encodeBase64String(\"Vuforia test metadata\".getBytes())); // Optional\n }", "public interface MpesaApiService {\n\n @POST(\"m...
[ "0.56049556", "0.53625363", "0.52932787", "0.5235915", "0.5109107", "0.50998384", "0.5072607", "0.49923086", "0.49307668", "0.49256432", "0.49222147", "0.4882712", "0.4860963", "0.48257935", "0.4821268", "0.48110723", "0.4802755", "0.4799982", "0.479677", "0.47958344", "0.478...
0.67766476
0
a call to square returns the square of the value passed. accepts and returns integer
public static int square(int number) { int answer=0; answer = number * number; return answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int squareIt(int a);", "public double square ( int number ) throws RemoteException;", "double getSquareNumber();", "public int square( int intvalue){\n System.out.printf(\"\\nCalled square with int arguments: %d\\n\", intvalue);\n return intvalue * intvalue;\n }", "public static int...
[ "0.81393856", "0.80642045", "0.7945055", "0.77795815", "0.76610965", "0.7654522", "0.74392503", "0.73320764", "0.7242565", "0.7090882", "0.7047536", "0.7040124", "0.7038489", "0.7014071", "0.70063925", "0.69532865", "0.6933153", "0.6689566", "0.6663677", "0.6595277", "0.65687...
0.7282173
8
a call to cube returns the cube of the value passed. accepts and returns integer
public static int cube(int number) { return number * number * number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tpublic int cube() {\n\t\t\treturn width*width*width;\r\n\t\t}", "public static int cube(int n){\n return n*n*n;\n }", "public static int cube(int x) {\n return x * x * x; // block of code for function \n }", "public static int cube(int power){\n return (power*...
[ "0.7671036", "0.7558857", "0.74697953", "0.7400376", "0.7148433", "0.6972827", "0.6904336", "0.6871745", "0.6853059", "0.6646182", "0.6414895", "0.64007616", "0.621835", "0.61541677", "0.61536276", "0.60846704", "0.6078689", "0.60107964", "0.5985774", "0.59604824", "0.5868517...
0.77093023
0
a call to average returns the average of values passed. accepts 2 doubles, returns a double
public static double average(double number1, double number2) { return (number1 + number2) / 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double average();", "public static double average (double ... numbers)\r\n\t{", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public static double average(double number1, double number2, double number3) {\n\t\tre...
[ "0.80507267", "0.7746042", "0.725141", "0.7223544", "0.71811163", "0.71210766", "0.70570993", "0.6980674", "0.6960505", "0.69390196", "0.6929666", "0.68471694", "0.671829", "0.67145157", "0.6686531", "0.66778183", "0.6662046", "0.66597617", "0.6638667", "0.6636057", "0.662836...
0.78030455
1
a call to this average returns the average of values passed. accepts 3 doubles, returns a double
public static double average(double number1, double number2, double number3) { return (number1 + number2 + number3) / 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double average (double ... numbers)\r\n\t{", "double average();", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / co...
[ "0.7891592", "0.77388626", "0.7545692", "0.7493844", "0.7340726", "0.7333326", "0.7273852", "0.72259986", "0.71833736", "0.7168728", "0.7165227", "0.71407557", "0.7129894", "0.7030844", "0.7017355", "0.696905", "0.69552594", "0.6953977", "0.6948903", "0.6911462", "0.6902917",...
0.79403186
0
call to toDegrees returns a value of degrees equivalent to the radian value passed. accepts a double and returns a double
public static double toDegrees(double radian1) { return (radian1 * 180) / 3.14159; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static float rad2deg(float rad) {return rad/D2R;}", "private static double radToDeg(float rad)\r\n/* 30: */ {\r\n/* 31:39 */ return rad * 180.0F / 3.141592653589793D;\r\n/* 32: */ }", "public int getDegrees() {\n\t\treturn (int) (value * (180.0d / Math.PI));\n\t}", "public static Expressio...
[ "0.74307877", "0.74297667", "0.73338157", "0.7332392", "0.72689843", "0.72675616", "0.7176444", "0.709469", "0.70853066", "0.7059278", "0.70514333", "0.70368755", "0.7006855", "0.70003194", "0.6993119", "0.696961", "0.6947403", "0.6947403", "0.6941459", "0.69407636", "0.69364...
0.7711344
0