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
Initialize the contents of the frame.
private void initialize() { this.nativeLookAndFeel(); setBounds(100, 100, 300, 270); setTitle("Gestion Usuarios"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); getContentPane().setLayout(null); lblLoading = new JLabel(new ImageIcon(Main.class.getResource("Resources/Icons/loading2.gif"))); lblLoading.setBounds(90, 46, 100, 100); lblLoading.setVisible(false); getContentPane().add(lblLoading); txtUsuario = new JTextField(); txtUsuario.setFont(new Font("Tahoma", Font.PLAIN, 14)); txtUsuario.setBounds(42, 46, 200, 25); getContentPane().add(txtUsuario); txtUsuario.setDocument(new JTextFieldLimit(20)); btnLogIn = new JButton("Log in"); btnLogIn.setFont(new Font("Tahoma", Font.BOLD, 16)); btnLogIn.setBounds(42, 170, 200, 44); getContentPane().add(btnLogIn); txtPassword = new JPasswordField(); txtPassword.setFont(new Font("Tahoma", Font.PLAIN, 14)); txtPassword.setBounds(42, 121, 200, 25); getContentPane().add(txtPassword); lblUsuario = new JLabel("Usuario"); lblUsuario.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblUsuario.setBounds(42, 15, 63, 20); getContentPane().add(lblUsuario); lblPassword = new JLabel("Password"); lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPassword.setBounds(42, 90, 63, 20); getContentPane().add(lblPassword); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r...
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.71079...
0.0
-1
Cambia el LookAndFeel al nativo del systema
private void nativeLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void LookAndFeel() {\n try {\n // Set System L&F\n BasicLookAndFeel darcula = new DarculaLaf();\n UIManager.setLookAndFeel(darcula);\n } catch (UnsupportedLookAndFeelException e) {\n // handle exception\n }\n }", "private LookAndFeelMana...
[ "0.82003844", "0.8013756", "0.75259256", "0.7512265", "0.7306867", "0.72500557", "0.7214766", "0.717893", "0.70934266", "0.7035303", "0.7004367", "0.6905258", "0.6782702", "0.67705065", "0.6712186", "0.6534111", "0.6509128", "0.6382541", "0.6370439", "0.62706536", "0.6241465"...
0.68721634
12
POST /saveEmployee > saveEmployee the Employee.
@RequestMapping(value = "/employee", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> saveEmployee(@Valid @RequestBody EmployeeDTO employeeDTO, HttpServletRequest request) { log.info("Inside the saveEmployee -" + employeeDTO); log.info("Inside Save employee"+employeeDTO.getManagerId()); long userId = SecurityUtils.getCurrentUserId(); log.info("save Employee call - userId "+userId); employeeDTO.setUserId(userId); try { EmployeeDTO employeeDto = employeeService.createEmployeeInformation(employeeDTO); /* if(employeeDto.isCreateUser()) { UserDTO userDto = new UserDTO(); userDto.setLogin(employeeDto.getEmpId()); userDto.setFirstName(employeeDto.getName()); userDto.setLastName(employeeDto.getLastName()); userDto.setEmployeeId(employeeDto.getId()); userDto.setEmployeeName(employeeDto.getName()); userService.createUserInformation(userDto); } */ }catch(Exception e) { throw new TimesheetException(e, employeeDTO); } return new ResponseEntity<>(HttpStatus.CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void post(Employee employee) {\n\t\t empdao.save(employee);\r\n\t}", "@PostMapping(\"/save\")\n\tpublic ResponseEntity<String> createEmployee(@RequestBody Employee employee) {\n\t\tInteger id = service.saveEmployee(employee);\n\t\tString message = \"Employee '\" + id + \"' Created!\";\n\t\t...
[ "0.79641026", "0.7951724", "0.7836914", "0.7825303", "0.7798182", "0.7797847", "0.77581966", "0.7704043", "0.76252", "0.76142955", "0.75735116", "0.75677377", "0.7549596", "0.74815434", "0.7481348", "0.74735445", "0.7448704", "0.74108285", "0.7374687", "0.733961", "0.73273724...
0.71543944
29
log.debug("ExportStatus fileId "+ fileId);
@RequestMapping(value = "/employee/export/{fileId}/status",method = RequestMethod.GET) public ExportResult exportStatus(@PathVariable("fileId") String fileId) { ExportResult result = employeeService.getExportStatus(fileId); if(result!=null && result.getStatus() != null) { //log.info("result.getSTATUS----------"+result.getStatus()); switch(result.getStatus()) { case "PROCESSING" : result.setMsg("Exporting..."); break; case "COMPLETED" : result.setMsg("Download"); //log.info("FILE-ID--------"+fileId); result.setFile("/api/employee/export/"+fileId); //log.info("FILE-ID AFTER RESULT--------"+result); break; case "FAILED" : result.setMsg("Failed to export. Please try again"); break; default : result.setMsg("Failed to export. Please try again"); break; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\tif (StringUtils.isNotEmpty(empId)) {\n\t\t\t\t\tfilePath += \"/\" + empId;\n\t\t\t\t}\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t...
[ "0.60919666", "0.6030195", "0.5948737", "0.59184426", "0.5858877", "0.5825188", "0.5802374", "0.5644611", "0.5598755", "0.5598241", "0.55178463", "0.54798555", "0.5431496", "0.5426273", "0.5395096", "0.5345545", "0.5339434", "0.53225183", "0.5317662", "0.52989125", "0.5285428...
0.65356654
0
Taking input of all data from the database
private Data initialise() { getRoomsData(); getMeetingTimesData(); setLabMeetingTimes(); getInstructorsData(); getCoursesData(); getDepartmentsData(); getInstructorFixData(); for (int i=0;i<departments.size(); i++){ numberOfClasses += departments.get(i).getCourses().size(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getDataFromDatabase(){\r\n\t \tArrayList<Object> row = HomeActivity.dbPrograms.getDetail(SelectedID);\r\n\t \t\r\n\t\t\t// store data to variables\r\n\t \tProgramID = Integer.parseInt(row.get(0).toString());\r\n\t \tWorkoutID = Integer.parseInt(row.get(1).toString());\r\n\t \tName = row....
[ "0.59852", "0.5963411", "0.5951887", "0.5925442", "0.58282083", "0.5749472", "0.5724736", "0.5719958", "0.56824154", "0.5618596", "0.5617615", "0.56081194", "0.55990493", "0.55906326", "0.5578596", "0.55546683", "0.5552713", "0.55150765", "0.5514367", "0.55121315", "0.5502864...
0.0
-1
Method for returning string of the whole order
String getOrderSummary(){ String s = ""; for (Pizza p : pizzas) { s += p.getInfo() + "\n"; } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String traverseForToString() {\n\t\tif (this.root != null)\n\t\t\tpreorderTraverseForToString(this.root);\n\n\t\treturn this.order;\n\t}", "public String toString(){\n //return myString(root);\n printInOrder(root);\n return \"\";\n }", "public String showCurrentOrder(){\n strin...
[ "0.695701", "0.68562645", "0.6832996", "0.659472", "0.65882474", "0.6517432", "0.64854103", "0.6467352", "0.6438099", "0.642376", "0.6413785", "0.6280532", "0.62438524", "0.623602", "0.61784124", "0.61750513", "0.61705923", "0.61610705", "0.61073744", "0.6084163", "0.599383",...
0.63196003
11
Methods for calculating and formatting order total costs
private double getOrderTotal() { double d = 0; for (Pizza p : pizzas) { d += p.calcTotalCost(); } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateOrderCost(){\n int tmpCost=0;\n for (Vehicle v : vehicleList){\n tmpCost+=v.getCost();\n }\n totalCost=tmpCost;\n }", "String getTotalCost() {\n return Double.toString(totalCost);\n }", "double getTotalCost();", "private void calculateCosts()...
[ "0.73448646", "0.73098814", "0.69224954", "0.6914807", "0.69142395", "0.6842425", "0.6819441", "0.67908436", "0.676742", "0.6736335", "0.67017084", "0.6690543", "0.6666131", "0.6656629", "0.6648985", "0.6632459", "0.6631985", "0.6631056", "0.6628238", "0.6625971", "0.6540114"...
0.68071574
7
Method for calcuting the total number of pizzas
int numberOfPizzas() { return pizzas.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumber() {\n return this.numPizzas;\n }", "public static void numberOfPizzasOfSize(DeluxePizza todaysPizza[])\n\t{\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please enter the specific size of pizza to be counted\");\n\t\tString whichSize = keyboard.next();...
[ "0.66596663", "0.6626703", "0.65617204", "0.6558754", "0.6485674", "0.6349346", "0.6346749", "0.6327094", "0.63012034", "0.6278564", "0.6273866", "0.61811537", "0.6138739", "0.61224884", "0.61090344", "0.60930985", "0.6085784", "0.6068583", "0.60625595", "0.6020978", "0.60169...
0.8050885
0
Method for selecting and deleting pizzas
void removePizza(Pizza p) { pizzas.remove(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void delete(Pizza pizza){\n for(Pizza p : pizzas){\n if(pizza.getID() == p.getID()){\n pizzas.remove(p);\n break;\n }\n }\n }", "@Override\n\tpublic void deleteSelected() {\n\n\t}", "public void clickedPresentationDelete() {\n\t\tif(ma...
[ "0.64635384", "0.58640075", "0.58536947", "0.5838332", "0.58119774", "0.5739398", "0.5709192", "0.56969714", "0.5665282", "0.5644845", "0.56372774", "0.56353354", "0.5630396", "0.5606952", "0.5595484", "0.55952495", "0.5587653", "0.55722713", "0.5552921", "0.5550357", "0.5530...
0.5894346
1
This method will be called when a MessageEvent is posted (in the UI thread for Toast)
@Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(MessageEventBus event) { for (int i = 0; i < list.size(); i++) { User userData = list.get(i); Integer id = userData.getId(); String name = userData.getName(); String username = userData.getUsername(); String email = userData.getEmail(); Log.i("@@@@@", "onMessageEvent : userData : " + userData.toString()); textView.append("User Id : " + id + "\n" + "Name : " + name + "\n" + "UserName : " + username + "\n" + "Email : " + email + "\n\n"); } Toast.makeText(this, event.message, Toast.LENGTH_LONG).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onEventMainThread(MessageEvent event){\n Toast.makeText(this, event.message, Toast.LENGTH_SHORT).show();\n }", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onMessageEvent(MessageEvent event) {\n\n // Display message in TextView\n logMessage(event.getMessage());\n...
[ "0.8003369", "0.7657992", "0.73149467", "0.7233759", "0.72178274", "0.71007574", "0.7014906", "0.6926775", "0.6926775", "0.6871278", "0.67404926", "0.67077863", "0.6676467", "0.6676467", "0.6676467", "0.6676467", "0.6676467", "0.6641495", "0.66342485", "0.6632801", "0.6626385...
0.0
-1
An instance method that compares this object to other. Always check that other is not null, i) an error would occur if you tried to access other.first if other was null, ii) null is a valid argument, the method should simply return false.
public boolean equals( Combination other ) { if(this.one== other.one && this.two == other.two && this.three == other.three && other != null){ return true; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean m4280b(Object obj, Object obj2) {\n if (obj != obj2) {\n if (obj == null || obj.equals(obj2) == null) {\n return null;\n }\n }\n return true;\n }", "public static Comparison checkEquality(JexlNode first, JexlNode second) {\n ...
[ "0.60126257", "0.5931552", "0.58006", "0.57998943", "0.57457995", "0.5740481", "0.57393545", "0.5718943", "0.571471", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", "0.5699724", ...
0.0
-1
Returns a String representation of this Combination.
public String toString() { return this.one+":"+this.two+":"+this.three; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString () {\n\t\tString resumen = \"\";\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tresumen = resumen + this.get(i).toString();\n\t\t}\n\t\treturn resumen;\n\t}", "public String toString() {\n\t\treturn toString(this);\n\t}", "public String toString() {\n\t\treturn toString(true);\n\t}"...
[ "0.7563533", "0.7188381", "0.71179676", "0.71085966", "0.7081577", "0.70600784", "0.7055239", "0.7007453", "0.700418", "0.700352", "0.700352", "0.69983697", "0.6977237", "0.694116", "0.6936497", "0.69339764", "0.69303447", "0.6924532", "0.6920155", "0.69125926", "0.6912311", ...
0.0
-1
Main The Interface PathfindController. Defines what a Pathfind Controller does.
public abstract interface PathfindController extends Controller { // Public Abstract Methods /** * Block next coordinate in path. */ public abstract void blockNext(); /** * Calculate pathfinding and the states for visited and blocked of the * back, front, left, right respectively. * * @return the array of states */ public abstract boolean[] calculate(); /** * Go to next coordinate in path. */ public abstract void goNext(); /** * Checks if next coordinate in path is blocked. * * @return true, if next coordinate in path is blocked */ public abstract boolean isNextBlocked(); /** * Checks if next coordinate in path is visited. * * @return true, if next coordinate in path is visited */ public abstract boolean isNextVisited(); /** * String representation of the raw graph. * * @return the string */ public abstract String rawGraphToString(); /** * Reset pathfinding. */ public abstract void reset(); /** * Rotate to the left coordinate in path. */ public abstract void rotateLeft(); /** * Rotate to the right coordinate in path. */ public abstract void rotateRight(); /** * Unblock next coordinate in path. */ public abstract void unblockNext(); /** * Visit current coordinate in path. */ public abstract void visit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}", "public static void main(String[] args) {\n//\n// controller.setSoldierRank(0, \"Turai\");\n// controller.addModel(new Model(2, \"Lera\", \"RavSamal\"));\n// controll...
[ "0.61802554", "0.615767", "0.61248904", "0.5993431", "0.598166", "0.5904899", "0.5884692", "0.58089495", "0.5726931", "0.57211953", "0.5719448", "0.5688481", "0.5586155", "0.55767566", "0.55752444", "0.55660856", "0.5563384", "0.5539439", "0.55336106", "0.55306894", "0.552061...
0.7194681
0
Public Abstract Methods Block next coordinate in path.
public abstract void blockNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic WB_Point nextPoint();", "public abstract Position nextPosition(Position position);", "public abstract void generateNextBlock();", "@Override\n public MFEDirection next()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +...
[ "0.73428774", "0.6548357", "0.61975205", "0.60964876", "0.60467434", "0.60164994", "0.6006241", "0.6003047", "0.5981252", "0.5977175", "0.5945387", "0.59180087", "0.58868366", "0.5857372", "0.58252734", "0.57776654", "0.5757208", "0.5748722", "0.5724937", "0.5714258", "0.5693...
0.5853199
14
Calculate pathfinding and the states for visited and blocked of the back, front, left, right respectively.
public abstract boolean[] calculate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t//loc1 is the start location,loc2 is the destination\n\tpublic ArrayList<MapCoordinate> bfsSearch(MapCoordinate loc1, MapCoordinate loc2, Map m) {\n\t\tSystem.out.println(\"come into bfsSearch\");\n\t\tif(m.isAgentHasAxe() && m.isAgentHasKey()){\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\...
[ "0.6203519", "0.56833506", "0.5655961", "0.5615959", "0.555798", "0.54889995", "0.54880685", "0.5485794", "0.5483931", "0.54804593", "0.5433591", "0.54026353", "0.5385143", "0.53783584", "0.5365151", "0.5362995", "0.53472143", "0.5341669", "0.53340113", "0.5319409", "0.531551...
0.0
-1
Go to next coordinate in path.
public abstract void goNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void next() {\n\t\t// Next node\n\t\tnode = path.remove(0);\n\t\ttransition(NavigatorState.ROTATE_TO);\n\t}", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50)...
[ "0.6664689", "0.6590251", "0.6557098", "0.64133203", "0.6392218", "0.63555557", "0.6275799", "0.6262765", "0.6262157", "0.6183421", "0.61599463", "0.61282355", "0.6119658", "0.6117189", "0.6105142", "0.6099276", "0.60984427", "0.6082127", "0.607735", "0.6072925", "0.6041818",...
0.58863443
22
Checks if next coordinate in path is blocked.
public abstract boolean isNextBlocked();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkIfBlocked(){\n\t\tsetNextXY();\n\t\t/*if(Physics.hitWall(this, game.wi)){\n\t\t\tblocked=true;\n\t\t}\n\t\telse{\n\t\t\tblocked=false;\n\t\t}\n\t\t*/\n\t\t\n\t\ttry{\n\t\t\tif(game.getController().wallArray[lastX][lastY]||game.getController().wallArray[nextX][nextY]){\n\t\t\t\treturn true;\n\t\...
[ "0.69033813", "0.66249", "0.64961123", "0.6278562", "0.62648964", "0.5988071", "0.59687364", "0.59593856", "0.5851925", "0.58217597", "0.5778345", "0.57479066", "0.5718844", "0.571003", "0.56869113", "0.5674364", "0.56648433", "0.5662675", "0.56505704", "0.5623092", "0.560575...
0.6389076
3
Checks if next coordinate in path is visited.
public abstract boolean isNextVisited();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isVisited () {\n if (this.equals(SquareType.VISITED))\n return true;\n else\n return false;\n }", "public boolean hasBeenVisited() {\n\t\treturn visited; // Replace with your code\n\t}", "public boolean isVisited(){\n return visited;\n }", "priv...
[ "0.6888977", "0.6869118", "0.6742793", "0.67343986", "0.6651703", "0.66029805", "0.65818113", "0.65628797", "0.6548747", "0.63869715", "0.63869715", "0.6349254", "0.63422656", "0.6336295", "0.62800354", "0.6255498", "0.62434685", "0.62073314", "0.61757445", "0.61729264", "0.6...
0.66075784
5
String representation of the raw graph.
public abstract String rawGraphToString();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str +...
[ "0.74436057", "0.73367345", "0.73274195", "0.7305982", "0.7291808", "0.72912437", "0.71736556", "0.7165268", "0.71153706", "0.71059513", "0.7100664", "0.709213", "0.70729816", "0.70647806", "0.7030608", "0.70291704", "0.70191497", "0.69783676", "0.69725883", "0.69329613", "0....
0.8715176
0
Rotate to the left coordinate in path.
public abstract void rotateLeft();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rotateLeft() {\n\t\tthis.direction = this.direction.rotateLeft();\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir - THETA);\r\n\t\t\r\n\t}", "private void rotateLeft() {\n robot.leftBack.setPower...
[ "0.8270631", "0.8044815", "0.79010713", "0.77828014", "0.7711977", "0.74015343", "0.7380543", "0.7357978", "0.7311242", "0.7305097", "0.72757506", "0.72505283", "0.7233195", "0.72205144", "0.72164285", "0.7180057", "0.7130579", "0.71121097", "0.71000904", "0.70905715", "0.705...
0.75325763
5
Rotate to the right coordinate in path.
public abstract void rotateRight();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "public void rotateRight() {\n\t\tthis.direction = this.direction.rotateRight();\n\t}", "private void rotateRight() {\r\n\t switch(direction){\r\n...
[ "0.7058934", "0.7029405", "0.69685054", "0.6918276", "0.6880178", "0.66904444", "0.66798425", "0.66564864", "0.66462076", "0.66432273", "0.66164774", "0.66015166", "0.65576994", "0.6548145", "0.65339375", "0.6516413", "0.65077615", "0.647493", "0.64617395", "0.645718", "0.645...
0.71053755
0
Unblock next coordinate in path.
public abstract void unblockNext();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void unlockLastEdge();", "public void unpin();", "public void unpin();", "private void unlockCell(int x, int y) {\n data[x][y] = false;\n\t}", "@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}", "public synchronized void unblock() {\n\t\tsetBlocked(false);\n\t}", "public void unlock() {\n ...
[ "0.63573325", "0.5966508", "0.5966508", "0.5866534", "0.58207303", "0.5819432", "0.5796809", "0.5791927", "0.5735546", "0.5725819", "0.5636787", "0.55642486", "0.5508358", "0.5505973", "0.5504169", "0.5473695", "0.537356", "0.5347686", "0.5332664", "0.5309363", "0.5270257", ...
0.6850675
0
Visit current coordinate in path.
public abstract void visit();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void pathFinderVisited(int x, int y) {\n\t}", "@Override\n public void handle(long now) {\n OneIteration();\n if (current.getRow() == ia && current.getCol() == ja) {\n drawPath();\n this.stop();...
[ "0.7132528", "0.6177438", "0.6176725", "0.59226507", "0.5830692", "0.5783204", "0.5617541", "0.5611527", "0.5534996", "0.54300153", "0.54232126", "0.5404648", "0.53834176", "0.5365828", "0.5349658", "0.5330497", "0.53292054", "0.5286489", "0.52811354", "0.52319634", "0.522812...
0.4810835
78
returns char matches between word1 and word2
private int getNumMatches(String word1, String word2) { int count = 0; for (int i = 0; i < word1.length(); i++) { if (word1.charAt(i) == word2.charAt(i)) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean wordHasAllExceptFirstInCommon(String word1, String word2) {\n int charsInCommon = 0;\n\n char[] w1 = word1.toCharArray();\n char[] w2 = word2.toCharArray();\n\n for (int i = 1; i < w1.length; i++) {\n for (int j = 0; j < w2.length; j++) {\n ...
[ "0.63043916", "0.6295992", "0.6241409", "0.620911", "0.61718917", "0.613919", "0.6131333", "0.61027753", "0.609594", "0.60806817", "0.60584277", "0.5946861", "0.5929324", "0.5905111", "0.5898448", "0.58534324", "0.5852299", "0.5846741", "0.5837431", "0.5831951", "0.5829448", ...
0.7121681
0
registration of the requested service
void start() { m_e.step(); // 1, 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void registerService(String serviceName, Object service);", "public void onServiceRegistered() {\r\n \t// Nothing to do here\r\n }", "public void registerService(Registrant r) {\n namingService.registerService(r);\n }", "private void registerService() {\r\n DFAgentDescription de...
[ "0.7484848", "0.74102646", "0.7392708", "0.7301543", "0.717688", "0.70655483", "0.68799114", "0.6862838", "0.685867", "0.68450266", "0.67973995", "0.67493445", "0.66751087", "0.6638571", "0.6587356", "0.6574753", "0.65714306", "0.65667945", "0.6561715", "0.6555818", "0.650134...
0.0
-1
Test of getUniqueInt method, of class UniqueRandomGenerator.
@Test public void testGetUniqueInt() { UniqueRandomGenerator instance = new UniqueRandomGenerator(); List<Integer> extracted = new ArrayList<>(); for (int i = 0; i < 1000; i++) { int extr = instance.getUniqueInt(0, 1000); if (extracted.contains(extr)) fail(); else extracted.add(extr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "private int getUniqueSecretKey () {\n\n int minIn...
[ "0.6761224", "0.6704006", "0.6590306", "0.6545996", "0.63984656", "0.6353616", "0.6348174", "0.6325074", "0.6298858", "0.62794244", "0.6268022", "0.6226637", "0.6211235", "0.6201041", "0.62", "0.61972696", "0.61835986", "0.61819714", "0.61771786", "0.6171318", "0.61710703", ...
0.8392744
0
Setea la id del usuario
public void setId( Long id );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setIdUsuario(int value) {\n this.idUsuario = value;\n }", "public void setIdUser(int value) {\n this.idUser = value;\n }", "public void setId_usuario(String usuario) {\n this.id_usuario = usuario;\n }", "public void setIdUsuario(Integer idUsuario) {\n this.idU...
[ "0.8157944", "0.8127355", "0.7967824", "0.7914445", "0.7814982", "0.77944434", "0.77603114", "0.7710908", "0.77005726", "0.76461565", "0.7599547", "0.7561055", "0.7372793", "0.7368909", "0.73365974", "0.7314588", "0.72931516", "0.71184653", "0.7090812", "0.7059531", "0.705953...
0.66093016
74
Setea la id del perfil de usuario
public void setPerfilId( Long id );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setIdPerfil(Integer idPerfil) {\n this.idPerfil = idPerfil;\n }", "public void setIdperfil(int pIdperfil){\n this.idperfil = pIdperfil;\n }", "public void setIdUsuario(int value) {\n this.idUsuario = value;\n }", "public void setIdUsuario(Integer idUsuario) {\n ...
[ "0.75922984", "0.73556226", "0.7332325", "0.715578", "0.7144387", "0.70895046", "0.69118243", "0.68894017", "0.68552804", "0.6854307", "0.6794076", "0.6768845", "0.6659275", "0.6590081", "0.65819764", "0.6580273", "0.65754765", "0.6572943", "0.6535588", "0.64734906", "0.64685...
0.76084405
0
Agrega un nuevo acceso permitido al usuario
public void addAccess(String accessId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void AsignarPermiso(Permiso p){\n\t\tPermisoRol pr = new PermisoRol(p,this);\n\t\tpermisos.add(pr);\n\t}", "private void metodoSalvarUsuarioFirebase(final Usuarios variavelClasseUsuarios) {\n\n refAutenticacaofb = ConfiguracaoFirebase.metodoAutenticacaoFirebase();\n refAutenticacaofb.createU...
[ "0.6091176", "0.60559285", "0.6014667", "0.5977959", "0.57502836", "0.57421017", "0.5698767", "0.5648691", "0.5622944", "0.5618639", "0.55864906", "0.5575313", "0.5520407", "0.54944783", "0.54567564", "0.54433227", "0.5429165", "0.5419878", "0.5418877", "0.5412988", "0.540175...
0.0
-1
Informa si el usuario puede utilizar o no un acceso determinado
public boolean hasAccess(String accessId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }", "public boolean hasUser(){\n return numUser < MAX_USER;\n }", "public boolean getUsuarioSuscrito(){\n return !(suscribirClientBean.getUsuarioSuscrito(idOferta).length == 0);\r...
[ "0.6399298", "0.6393366", "0.62713474", "0.62128556", "0.61941963", "0.61764187", "0.6162408", "0.6119337", "0.61132073", "0.6092264", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6059342", "0.6055948", "0.60348576", "0.597772", "0.5952071"...
0.0
-1
Setea el nodo al cual pertenece el usuario
public void setNodo(Long nodo);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setUsuario(Element element) {\r\n\t\tUsuario user = (Usuario)Contexts.getSessionContext().get(\"user\");\r\n\t\t\r\n\t\tElement usuario = new Element(\"N_UsuarioAlta\");\r\n\t\tElement uniqueKey = new Element(\"uniqueKey\");\r\n\t\tuniqueKey.setAttribute(\"login_name\", user.getUsername());\r\n\t\tuni...
[ "0.6474247", "0.63257015", "0.62246156", "0.6202744", "0.6189759", "0.61682147", "0.6156927", "0.61433756", "0.61433756", "0.6086389", "0.60762304", "0.60632485", "0.6049889", "0.6036822", "0.6036822", "0.6031605", "0.60117626", "0.6011194", "0.59940517", "0.59603846", "0.595...
0.6668736
0
metodos usuados para el menu Setea la descripcion de la categoria del usuario
public void setCategoriaDescripcion(String descripcion);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}", "public void showMemberCategoryMenu() {\n Sys...
[ "0.6475232", "0.6471223", "0.6000086", "0.59987086", "0.5960742", "0.5927745", "0.59123915", "0.5886853", "0.58729035", "0.58331966", "0.58253884", "0.5786102", "0.5781283", "0.57561046", "0.5751526", "0.5732985", "0.5728431", "0.57053065", "0.5686255", "0.56724197", "0.56723...
0.6055602
2
Setea la descripcion del perfil del usuario
public void setPerfilDescripcion(String descripcion);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPerfilDescripcion();", "public void setDescripcion(String p) { this.descripcion = p; }", "private void setDescription(String UserDescription){\n Description = UserDescription;\n }", "public void setDescripcion(String descripcion){\r\n this.descripcion = descripcion;\r\n }...
[ "0.74579257", "0.64136195", "0.6327683", "0.6273705", "0.61404926", "0.6120866", "0.6087494", "0.6056833", "0.6056833", "0.6035325", "0.6000681", "0.5991243", "0.598959", "0.59510994", "0.5927752", "0.59241766", "0.58318985", "0.5809983", "0.57895416", "0.5768559", "0.5715844...
0.8415525
0
Obtiene la descripcion de la categoria del usuario
public String getCategoriaDescripcion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCategoriaDescripcion(String descripcion);", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "public String toString(){\n\t\tif(categoria == 1)\n\t\t\treturn \"Profesor Ayudante\\n\" + super.toString() + \"\\n\" + \"Horario = \" +...
[ "0.701649", "0.6797557", "0.6492468", "0.6391811", "0.6258511", "0.62401235", "0.622539", "0.62181765", "0.6111266", "0.60251975", "0.60251975", "0.599058", "0.59308904", "0.5897695", "0.58752143", "0.586871", "0.5868641", "0.5856054", "0.5847764", "0.5763984", "0.5761871", ...
0.74513376
0
Obtiene la descripcion de la categoria del usuario
public String getPerfilDescripcion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getCategoriaDescripcion();", "public void setCategoriaDescripcion(String descripcion);", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "public String toString(){\n\t\tif(categoria == 1)\n\t\t\treturn \"Profesor Ayudante\\n\" +...
[ "0.74513376", "0.701649", "0.6797557", "0.6492468", "0.6391811", "0.6258511", "0.62401235", "0.622539", "0.62181765", "0.6111266", "0.60251975", "0.60251975", "0.599058", "0.59308904", "0.5897695", "0.58752143", "0.586871", "0.5868641", "0.5856054", "0.5847764", "0.5763984", ...
0.573357
24
Setea el nombre completo del usuario
public void setNombreCompleto(String nombreCompleto);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setName(String name){\r\n gotUserName = true;\r\n this.name = name;\r\n }", "@Override\n public void nick_name(String nick){\n ///Pregunta el nombres y el usuario le asigna\n nickName= nick;\n nombre=nickName;\n }", "public void setNombreUsuario(String no...
[ "0.7128196", "0.7070681", "0.7030617", "0.69576365", "0.69329137", "0.6917079", "0.68931985", "0.6892032", "0.6890565", "0.6884185", "0.6882588", "0.67909545", "0.6760172", "0.6740804", "0.67231643", "0.6715506", "0.6715177", "0.6715177", "0.6715177", "0.6675434", "0.6666397"...
0.6291564
83
Obtiene el nombre completo del usuario
public String getNombreCompleto();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getUserName();", "java.lang.String getUserName();", "java.lang.String getUserName();", "String getUserName();", "String getUserName();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "ja...
[ "0.7397393", "0.7397393", "0.7397393", "0.72094345", "0.72094345", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.717563", "0.70519245", "0.70379806", "0.7016989", "0.6984701", "0.69762564", "0.69039255", "0.6901427", "0.6...
0.0
-1
setea el id de la categoria
public void setCategoriaId(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setId(Category category) {\n\t\r\n}", "public void setIdTipoCategoria( Integer idTipoCategoria ) {\n this.idTipoCategoria = idTipoCategoria ;\n }", "public Long getCategoriaId();", "Category selectCategory(long id);", "public void setNomCategoria (String IdCategoria){\n categor...
[ "0.77756697", "0.747872", "0.7222699", "0.70525426", "0.700245", "0.69826794", "0.6937435", "0.6924072", "0.67559713", "0.66469616", "0.6573387", "0.6536244", "0.65125006", "0.6470933", "0.6469063", "0.64431286", "0.64206636", "0.638333", "0.63428223", "0.63416994", "0.632307...
0.77424
1
Obtiene el valor de la categoria
public Long getCategoriaId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getCategoryValue();", "String getCategoria();", "private Object getAnomizedCategory() {\r\n\tString categorie = (String) record.get(\"categorie\");\r\n\tif (categorie != null) {\r\n\t switch (categorie) {\r\n\t case \"AD\":\r\n\t case \"CO\":\r\n\t case \"FI\":\r\n\t case \"IBL\":\r\n\t c...
[ "0.8007472", "0.75626993", "0.75069386", "0.7472721", "0.7364347", "0.7277173", "0.7215342", "0.71509737", "0.70136285", "0.70136285", "0.6978735", "0.6896483", "0.6819106", "0.6700132", "0.6606834", "0.6574013", "0.6535525", "0.6535525", "0.6501587", "0.64792293", "0.6474647...
0.6449761
21
setea el valor del password
public void setPassword(String pass);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "public void setPassword(java.lang.String newPassword);", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPass...
[ "0.8306343", "0.8306343", "0.8306343", "0.8108337", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8092896", "0.8044999", "0.7989989", "0.7989989", "0.796355", "0.79451936", "0.7927119", "0.7892885", "0.78880346", "0.78597766", "0.78444046", ...
0.8318259
0
Obtiene el valor del password
public String getPassword();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public java.lang.String getPassword();", "String getPa...
[ "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.87286025", "0.85307103", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.850902", "0.8243606", "0.8161515", "0.8159791", "0.81556016", "...
0.8309666
18
Borrar los permisos de acceso del usuario
public void clearAccess();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "public void borrarPiezasAmenazadoras(){\n this.piezasAmenazadoras.clear();\n }", "public synchronized static void borrarProduccion(String usuario){\n if(!produccion.isEmpty())\n ...
[ "0.6096517", "0.60937077", "0.59446806", "0.5922157", "0.5902744", "0.5899348", "0.5894497", "0.57709885", "0.57410026", "0.5739242", "0.57272524", "0.56708616", "0.565448", "0.56393176", "0.5632349", "0.5620863", "0.55920124", "0.5584546", "0.55828637", "0.55777454", "0.5568...
0.5235735
78
length of the previous longest prefix suffix
static void computeLPSArray(String pat, int M, int lps[]) { int len = 0; int i = 1; lps[0] = 0; // lps[0] is always 0 // the loop calculates lps[i] for i = 1 to M-1 while (i < M) { if (pat.charAt(i) == pat.charAt(len)) { len++; lps[i] = len; i++; } else // (pat[i] != pat[len]) { // This is tricky. Consider the example. // AAACAAAA and i = 7. The idea is similar // to search step. if (len != 0) { len = lps[len - 1]; // Also, note that we do not increment // i here } else // if (len == 0) { lps[i] = len; i++; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength = currLong.getAffix().length();\n\t\t}\n\n\t\treturn length...
[ "0.7703375", "0.72682285", "0.67134684", "0.6607823", "0.65152556", "0.651105", "0.65066975", "0.6502674", "0.6473382", "0.63949466", "0.6384248", "0.6374964", "0.6371315", "0.6346853", "0.6315991", "0.6304227", "0.62960315", "0.62715805", "0.6255631", "0.6245429", "0.620675"...
0.0
-1
Converts a date into a Java Calendar object using the system time zone. Only used by debug display consider removing after development
public static Calendar dateToCalendar(Date date) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.setTimeInMillis(date.getTime()); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Date getUTCDate(String timeZone, Calendar cal);", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n C...
[ "0.6684127", "0.6420251", "0.6374774", "0.60953987", "0.60452425", "0.5982437", "0.5885074", "0.5813464", "0.57847387", "0.57847387", "0.5739061", "0.5716253", "0.5672282", "0.5666848", "0.56650406", "0.55940735", "0.559121", "0.5567544", "0.5548541", "0.5539272", "0.55381054...
0.5950276
6
Converts a date into a Java Calendar object using the specified time zone.
public static Calendar dateToCalendar(Date dteStart, TimeZone tz) { Calendar cal = Calendar.getInstance(tz); cal.clear(); int year = dteStart.getYear() + 1900; int month = dteStart.getMonth(); DateFormat formatter = new SimpleDateFormat("dd"); String strDay = formatter.format(dteStart); int day = Integer.parseInt(strDay); int hrs = dteStart.getHours(); int min = dteStart.getMinutes(); int secs = dteStart.getSeconds(); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, month); cal.set(Calendar.DAY_OF_MONTH, day); cal.set(Calendar.HOUR_OF_DAY, hrs); cal.set(Calendar.MINUTE, min); cal.set(Calendar.SECOND, secs); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n ...
[ "0.6681059", "0.63693357", "0.62740546", "0.6227283", "0.61687285", "0.5940857", "0.5853451", "0.57477254", "0.5683162", "0.55808973", "0.5513425", "0.5513425", "0.5507418", "0.5491386", "0.54206175", "0.53062457", "0.5289632", "0.5188174", "0.50769156", "0.50287575", "0.5013...
0.6596035
1
Sets the hours, min and seconds of the provided Calendar without changing the day or time zone
public static Calendar setCalendarTime(Calendar cal, int hrs, int min, int sec) { cal.set(Calendar.HOUR_OF_DAY, hrs); cal.set(Calendar.MINUTE, min); cal.set(Calendar.SECOND, sec); cal.set(Calendar.MILLISECOND, 0); return cal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "void setStartTime(java.util.Calendar startTime);", "public void setCal(C...
[ "0.6650087", "0.6530117", "0.6530117", "0.6348958", "0.63063955", "0.6195569", "0.6173385", "0.60649776", "0.5895946", "0.5872052", "0.58673644", "0.57670313", "0.5740679", "0.5728947", "0.5705342", "0.56926495", "0.5690507", "0.5673012", "0.56614685", "0.5644076", "0.5626418...
0.6681006
0
Creates a new Calendar object initialised with the values provided
public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) { Calendar usaCal = Calendar.getInstance(tz); usaCal.clear(); usaCal.set(year, month, day, hrs, min, secs); return usaCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar() {\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR =...
[ "0.7448413", "0.7186852", "0.71412903", "0.687614", "0.6855412", "0.6716634", "0.66925424", "0.6663102", "0.64941", "0.64889073", "0.641011", "0.63245237", "0.62352854", "0.622643", "0.61609566", "0.61609566", "0.6113396", "0.6102826", "0.60478544", "0.60441554", "0.60335", ...
0.6448375
10
The Stockbroker requires dates to be provided in a certain format as a string. This function takes in any calendar and converts its date time to the format used by the stockbroker's API. WARNING the stockbrokers API documentation says that all date+time values should be in GMT (Greenwich Mean Time) but THIS IS NOT TRUE. In fact the time value needs to be expressed as London local time (That is Java's "Europe/London" time zone). Despite having to append GMT to the end of the string the actual time value is given for the "Europe/London" which MAY NOT BE GMT during British Summer Time
public static String convertCalToBrokerTime(Calendar cal) { String result = ""; Calendar gmtCal = DTUtil.convertToLondonCal(cal); SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd HH:mm:ss"); String timeFMString = format1.format(gmtCal.getTime()) + " GMT"; result = timeFMString; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:...
[ "0.6014059", "0.5961387", "0.594265", "0.57533", "0.5687055", "0.5608953", "0.55955523", "0.5554678", "0.552675", "0.5512427", "0.5504538", "0.5501289", "0.5496432", "0.5474487", "0.5472471", "0.54139286", "0.5394716", "0.53922236", "0.53906053", "0.53720754", "0.53592324", ...
0.568204
5
Given a Java Calendar object this function returns a new Calendar initialised to the same date in the New York / NASDAQUE Time Zone and with its time component set to the instant the stock market would open (Nominally this is 09:30:00 in the "America/New_York" Time Zone).
public static Calendar getExchOpeningCalendar(Calendar aDate) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); if (null != aDate) { result.setTimeInMillis(aDate.getTimeInMillis()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); result.set(Calendar.MILLISECOND, 0); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = ca...
[ "0.60738206", "0.59337264", "0.57955754", "0.56341803", "0.56341803", "0.5618543", "0.55970615", "0.55515325", "0.54607946", "0.5441552", "0.53626597", "0.53211135", "0.53177387", "0.5300809", "0.5278537", "0.52379596", "0.5221206", "0.5207286", "0.51975584", "0.5196771", "0....
0.50258124
29
Creates a Calendar object representing the time at which the New York stock market closes today
public static Calendar getExchClosingTime() { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result.set(Calendar.MILLISECOND, 0); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "C...
[ "0.61461186", "0.5857553", "0.57743686", "0.56050456", "0.5572916", "0.55262", "0.54086435", "0.5358434", "0.5358434", "0.5312917", "0.5289059", "0.5246888", "0.5196287", "0.5095238", "0.5045759", "0.50414884", "0.50372714", "0.5036834", "0.50124466", "0.49988955", "0.4998261...
0.5863349
1
Given a Java Calendar object this function returns a new Calendar initialised to the same date in the New York / NASDAQUE Time Zone and with its time component set to the instant the stock market would CLOSE (Nominally this is 16:00:00 in the "America/New_York" Time Zone).
public static Calendar getExchClosingCalendar(Calendar aDate) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); if (null != aDate) { result.setTimeInMillis(aDate.getTimeInMillis()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result.set(Calendar.MILLISECOND, 0); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public static Calendar convertToLondonCal(Calendar cal) {\r\n long timeInMillis = ca...
[ "0.6071808", "0.58254963", "0.5465888", "0.5459765", "0.5459765", "0.5425151", "0.5299633", "0.5268008", "0.5262563", "0.5250451", "0.52094376", "0.5204616", "0.514388", "0.5041821", "0.5023732", "0.50079966", "0.4992088", "0.49701577", "0.4969823", "0.49686977", "0.49629915"...
0.5429744
5
Given a Java Calendar object this function creates a new Calendar object initalised to the same date and time but in the "Europe/London" time zone. NB API Documentation says stockbroker uses GMT but THIS IS WRONG the server uses local London time.
public static Calendar convertToLondonCal(Calendar cal) { long timeInMillis = cal.getTimeInMillis(); Calendar gmtCal = Calendar.getInstance(TimeZone.getTimeZone("Europe/London")); gmtCal.clear(); gmtCal.setTimeInMillis(timeInMillis); return gmtCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private Calendar createCa...
[ "0.5889341", "0.57962066", "0.57884103", "0.5656253", "0.56100106", "0.5586363", "0.55487067", "0.55352426", "0.54143786", "0.53177154", "0.531408", "0.5283836", "0.5279755", "0.52536803", "0.5252478", "0.5252478", "0.52239555", "0.51975405", "0.5185776", "0.5124754", "0.5124...
0.6865368
0
Given a Java Calendar object this function creates a new Calendar object initalised to the same date and time but in the "America/New_York" time zone.
public static Calendar convertToExchCal(Calendar cal) { long timeInMillis = cal.getTimeInMillis(); Calendar exchCal = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); exchCal.clear(); exchCal.setTimeInMillis(timeInMillis); return exchCal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "private static Calendar g...
[ "0.6013959", "0.5923155", "0.5891367", "0.57034373", "0.5649421", "0.560931", "0.55730593", "0.55624306", "0.5541107", "0.53550166", "0.5294129", "0.5278295", "0.52485436", "0.52485436", "0.52453035", "0.52245003", "0.5154237", "0.51053804", "0.5080292", "0.5071582", "0.50532...
0.0
-1
Calculates the number of days between two timestamps Used by DEPRICATED DataGraphLoader class remove when it is deleted
public static long daysBetween(long start, long end) { long result = 1l; if (end > start) { Long diff = end - start; Double days = diff / DTConstants.MILLSECS_PER_DAY; Integer wholeDays = days.intValue(); if (0 == wholeDays) { wholeDays = 1; } else { if (0 != (days - wholeDays)) { wholeDays++; } } result = wholeDays.longValue(); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getDays() {\n\t\tlong arrival = arrivalDate.toEpochDay();\n\t\tlong departure = departureDate.toEpochDay();\n\t\tint days = (int) Math.abs(arrival - departure);\n\n\t\treturn days;\n\t}", "public long dayDiffCalculator(String a, String b){\n\n long dateDiff = 0;\n\n Date d1 = null;\n ...
[ "0.65580827", "0.63052446", "0.6212837", "0.6176545", "0.61577386", "0.613071", "0.6081939", "0.60404813", "0.6033722", "0.6032598", "0.5987855", "0.5935718", "0.59321284", "0.5927781", "0.59094167", "0.589297", "0.58391815", "0.58322424", "0.579318", "0.5786822", "0.5754789"...
0.0
-1
This function makes a DEEP COPY of the provided Java Calendar
public static Calendar deepCopyCalendar(Calendar cal) { Calendar result = null; if (null != cal) { Calendar newCal = Calendar.getInstance(cal.getTimeZone()); newCal.clear(); newCal.set(Calendar.YEAR, cal.get(Calendar.YEAR)); newCal.set(Calendar.MONTH, cal.get(Calendar.MONTH)); newCal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)); newCal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY)); newCal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE)); newCal.set(Calendar.SECOND, cal.get(Calendar.SECOND)); newCal.set(Calendar.MILLISECOND, cal.get(Calendar.MILLISECOND)); result = newCal; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Calendar toCalendar() {\n\t\treturn (Calendar) _cal.clone();\n\t}", "public VCalendar clone() {\n\t\treturn new VCalendar(this.content, this.collectionId, this.resourceId, this.earliestStart, this.latestEnd, null);\n\t}", "public Object clone() {\n return new Value(_calendar);\n }", "Cale...
[ "0.5671384", "0.5646488", "0.55086994", "0.54916954", "0.54916954", "0.5474034", "0.53922176", "0.5384255", "0.53414583", "0.52641594", "0.5101307", "0.50715846", "0.5069169", "0.4987591", "0.49692723", "0.49184543", "0.49179256", "0.4917013", "0.4916165", "0.49106094", "0.48...
0.6715591
0
This method calculates the gradient of a line across multiple days. The time component does not include days when no trading occurred on the market
public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) { double result = 0; if (null != aLine && null != listOfTradingDays) { AbstractGraphPoint myCurrStart = aLine.getCurrentC(); AbstractGraphPoint myCurrEnd = aLine.getCurrentE(); if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) { // TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator); // tDay.addAll(listOfTradingDays); //Calc P1 //Get Market close time on start day Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate()); endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE); endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis(); //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR); //Now calculate P2 //Get Market open time on end day Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate()); startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE); startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis()); //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis(); //Now calc P3 //Get count of trading days from list // int currStartDay = myCurrStart.getDateAsNumber(); // int currEndDay = myCurrEnd.getDateAsNumber(); // NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>(); // for(AbstractGraphPoint currPoint : tDay){ // int currDay = currPoint.getDateAsNumber(); // if(currDay > currStartDay && currDay < currEndDay){ // subSet.add(currPoint); // } // } NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false); ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>(); theSet.addAll(subSet); for (AbstractGraphPoint currPoint : theSet) { if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) { subSet.remove(currPoint); } } double dayCount = subSet.size(); double p3 = dayCount * DTUtil.msPerTradingDay(); //Sum all three parts as deltaX double deltaX = p1 + p2 + p3; double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice(); //Gradient is deltaY / deltaX result = deltaY / deltaX; System.out.println("Delta Y = " + deltaY); System.out.println("Delta X = " + deltaX); System.out.println(aLine.toString()); } else { result = aLine.getGradient(); System.out.println(aLine.toString()); } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateGradient(int startX, int startY, int endX, int endY, int startSat, int endSat, int hueSat, int brightnessSat) {\n colorMode(HSB,360,100,100);\n int dX = Math.abs(endX-startX);\n int dY = Math.abs(endY-startY);\n double changePerPixel = (endSat-startSat)/(double)dY;\n strokeWeight(2);\n in...
[ "0.6270706", "0.5652772", "0.56369054", "0.5496412", "0.54484797", "0.54474527", "0.5397276", "0.5335478", "0.5307909", "0.52711195", "0.5129194", "0.5120325", "0.509528", "0.5092168", "0.5083971", "0.50790226", "0.50535226", "0.5046796", "0.49982423", "0.49170136", "0.491031...
0.6086929
1
Calculates the total number of milliseconds in a trading day based on the Exchange opening and Closing constants in DTConstants
public static long msPerTradingDay() { long result = 0; Calendar dateStart = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Calendar dateEnd = DTUtil.deepCopyCalendar(dateStart); dateStart.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); dateStart.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); dateStart.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); dateEnd.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR); dateEnd.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN); dateEnd.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC); result = dateEnd.getTimeInMillis() - dateStart.getTimeInMillis(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getTimeRemainingInUTCDay(){\n\t\tdouble daysLeftInDay;\n\n\t\tInstant origin = Instant.ofEpochMilli (cur_mainshock.getOriginTime());\n\t\tZonedDateTime zdt = ZonedDateTime.ofInstant (origin, ZoneOffset.UTC);\n\t\tZonedDateTime zdt2 = zdt.toLocalDate().atStartOfDay (ZoneOffset.UTC);\n\t\tInstant dayb...
[ "0.63464344", "0.6157951", "0.61567205", "0.60082847", "0.5915011", "0.5870548", "0.5704308", "0.5387799", "0.5373567", "0.5367631", "0.53604513", "0.5343743", "0.5319286", "0.5290029", "0.5274184", "0.5247247", "0.52401394", "0.5233758", "0.52264714", "0.52064824", "0.520531...
0.79507214
0
Given a data graph this function identifies all 'flats' on the graph. For the definition of a flat see the findAllFlatsOfAtLeastLength(int length, BaseGraph graph) function in this class
public static GraphFlatCollection<IGraphFlat> findAllFlats(BaseGraph<AbstractGraphPoint> graph) { //NB a 'FLAT' must be at least 2 seconds long GraphFlatCollection<IGraphFlat> result = DTUtil.findAllFlatsOfAtLeastLength(2, graph); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static GraphFlatCollection<IGraphFlat> findAllFlatsOfAtLeastLength(int length, BaseGraph<AbstractGraphPoint> graph) {\r\n GraphFlatCollection<IGraphFlat> result = new GraphFlatCollection<IGraphFlat>(graph);\r\n if (0 < length && graph != null) {\r\n if (1 < graph.size()) {\r\n ...
[ "0.67457134", "0.5296903", "0.51615965", "0.5139004", "0.5081935", "0.504917", "0.50103647", "0.49941513", "0.4893", "0.4845202", "0.4840811", "0.4833592", "0.4812638", "0.47767997", "0.4770353", "0.47586596", "0.471229", "0.47013852", "0.46810246", "0.46766576", "0.4651932",...
0.751705
0
Given a data graph and a minimum 'length' this function identifies all 'flats' on the graph. A 'Flat' occurs when stocks price has not changed for a specified period of time (in seconds). By default Bryn uses a two second flat and the findAllFlats(BaseGraph graph) function in this class may be used to automatically apply the default; for other length values use this method
public static GraphFlatCollection<IGraphFlat> findAllFlatsOfAtLeastLength(int length, BaseGraph<AbstractGraphPoint> graph) { GraphFlatCollection<IGraphFlat> result = new GraphFlatCollection<IGraphFlat>(graph); if (0 < length && graph != null) { if (1 < graph.size()) { //Get a descending iterator of graph points Iterator<AbstractGraphPoint> descIter = graph.descendingIterator(); AbstractGraphPoint currPoint = descIter.next(); GraphFlat currFlat = new GraphFlat(currPoint); while (descIter.hasNext()) { currPoint = descIter.next(); if (!currFlat.addPoint(currPoint)) { //Value has changed add currFlat to collection if (currFlat.isAtLeastXLong(length)) { result.add(currFlat); } //This point is the start of a new flat currFlat = new GraphFlat(currPoint); } } //If the last flat is at least the required length add it if (currFlat.isAtLeastXLong(length)) { result.add(currFlat); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static GraphFlatCollection<IGraphFlat> findAllFlats(BaseGraph<AbstractGraphPoint> graph) {\r\n //NB a 'FLAT' must be at least 2 seconds long\r\n GraphFlatCollection<IGraphFlat> result = DTUtil.findAllFlatsOfAtLeastLength(2, graph);\r\n return result;\r\n }", "public static GraphFla...
[ "0.7518537", "0.4714363", "0.44924268", "0.44083273", "0.4316959", "0.42136133", "0.42053753", "0.41913798", "0.41859004", "0.41725248", "0.41563767", "0.41477057", "0.4139792", "0.41348693", "0.41291198", "0.41194096", "0.410909", "0.40663183", "0.40535107", "0.40427047", "0...
0.7582316
0
This function generates a Java Calendar object for today with the time values initialised to the time the stock exchange opens
public static Calendar getExchOpeningTime() { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); result.set(Calendar.MILLISECOND, 0); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "p...
[ "0.65914094", "0.63238055", "0.6222478", "0.6186958", "0.6177609", "0.6113258", "0.6107154", "0.6067813", "0.6041003", "0.58676803", "0.57538074", "0.57274103", "0.5727327", "0.566251", "0.56378657", "0.5614263", "0.55741835", "0.5570057", "0.55655843", "0.55655843", "0.55501...
0.6256393
2
This function will create a Java Calendar object initialised to the date and time of the first point in a data graph or to the stock market opening time if their is no data in the graph. NB: We have observed that data does not always become available for a stock at the expected stock market opening time. This function may be used to retrieve the actual date & time a stock started to trade from its data graph
public static Calendar getExchOpeningTimeFromGraph(BaseGraph<AbstractGraphPoint> graph) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); if (null != graph && 0 < graph.size()) { AbstractGraphPoint first = graph.first(); result.setTimeInMillis(first.getTimestamp()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Date computeFirstFireTime(Calendar calendar);", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.ge...
[ "0.59976166", "0.599486", "0.59168035", "0.58145493", "0.5671935", "0.5646885", "0.56310344", "0.5474914", "0.54403806", "0.5392866", "0.53376377", "0.53219366", "0.5282867", "0.52453756", "0.5243018", "0.52387434", "0.52047884", "0.5202352", "0.5147413", "0.5147098", "0.5089...
0.6135886
0
Given any data point this function will construct a Java Calendar initialised to the data and time the stock market would have opened on the day the data point relates to.
public static Calendar getExchOpeningTimeFromPoint(AbstractGraphPoint aPoint) { Calendar result = Calendar.getInstance(DTConstants.EXCH_TIME_ZONE); result.setTimeInMillis(aPoint.getTimestamp()); result.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR); result.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN); result.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n ...
[ "0.6003875", "0.57305706", "0.54935724", "0.5490956", "0.54809535", "0.54572237", "0.53147846", "0.5298605", "0.52872574", "0.5285195", "0.5279734", "0.52653414", "0.52607113", "0.5256082", "0.5252091", "0.5228708", "0.5189558", "0.5116214", "0.51130706", "0.50959194", "0.507...
0.621077
0
Given a timestamp this function identifies the 'Pair' of flats so that the first flat starts before the timestamp and the second ends after it and their are no flats between the two. Simply given a timestamp it finds the pair of flats that 'straddle' that point.
public static GraphFlatPair getFlatPairAroundTimePoint(long timestamp, BaseGraph<AbstractGraphPoint> graph) { GraphFlatPair result = null; if (null != graph && 0 < graph.size()) { GraphFlatCollection<IGraphFlat> allFlats = DTUtil.findAllFlats(graph); TreeSet<GraphFlatPair> flatPairs = allFlats.getFlatPairs(); for (GraphFlatPair currPair : flatPairs) { long startTime = currPair.getFirstFlat().getEarliestPoint().getTimestamp(); long endTime = currPair.getSecondFlat().getLatestPoint().getTimestamp(); if (startTime <= timestamp && endTime >= timestamp) { result = currPair; break; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Pair<DateTime, DateTime> getSegmentBounds(ReadableInstant instant) {\n LocalDate date = new DateTime(instant).toLocalDate(); // a day in the local time zone\n DateTime[] fenceposts = getSegmentFenceposts(date);\n for (int i = 0; i + 1 < fenceposts.length; i++) {\n i...
[ "0.542941", "0.5212273", "0.5080402", "0.50761473", "0.5000415", "0.4993118", "0.4985136", "0.49335903", "0.4926757", "0.49239957", "0.48507208", "0.48252907", "0.47948033", "0.47107178", "0.46984237", "0.461587", "0.4612746", "0.4593944", "0.45754504", "0.45097214", "0.44685...
0.67727983
0
Bryn has defined a two step rounding process to handle all numbers received from the stock brokers API. Given any numeric value this function applies the first step of the rounding process and returns the result.
public static Number step1Rounding(Number value) { return rounder.performRounding(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double roundToOneDecimal(double num) {\n\t\treturn (int)((10 * num) + 0.5) / 10.0;\n\t}", "private static double rundeBetrag(double betrag){\n \tdouble round = Math.round(betrag*10000); \r\n \t\r\n \tround = round / 10000; \r\n \tround = Math.round(round*1000); \r\n \tround = round / 1000;...
[ "0.61808", "0.6174214", "0.59811825", "0.5973279", "0.5919774", "0.5894772", "0.58272076", "0.58091336", "0.57661796", "0.57309663", "0.5711006", "0.5691332", "0.56904364", "0.5634686", "0.5617675", "0.5615899", "0.55356324", "0.5507985", "0.5489594", "0.547575", "0.5473838",...
0.6711932
0
This utility function converts a Java Calendar object into an integer number expressed in the format YYYYMMDD. This is often useful for sorting operations. Any time element will be ignored.
public static int convertCalendarToIntDate(Calendar calDate) { int result = 0; StringBuilder data = new StringBuilder(""); int year = calDate.get(Calendar.YEAR); int month = calDate.get(Calendar.MONTH); month++; int day = calDate.get(Calendar.DAY_OF_MONTH); data.append(Integer.toString(year)); switch (month) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: String strMonth = "0" + Integer.toString(month); data.append(strMonth); break; default: data.append(Integer.toString(month)); } switch (day) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: String strDay = "0" + Integer.toString(day); data.append(strDay); break; default: data.append(Integer.toString(day)); } result = Integer.parseInt(data.toString()); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getDateAsNumber(){\n\t\tSimpleDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(f.format(date.get()));\n\t}", "public static int parseDateForDB(Calendar c){\n return Integer.parseInt(c.get(Calendar.YEAR) + \"\"\n + (c.get(Calendar.MONTH) < 10 ? 0 + \...
[ "0.6694453", "0.6301289", "0.629377", "0.6078314", "0.6021659", "0.59345156", "0.5737148", "0.5541539", "0.55145496", "0.53903145", "0.5349009", "0.5349009", "0.53206074", "0.52968687", "0.5269729", "0.52523017", "0.5243298", "0.52169585", "0.5170059", "0.5132877", "0.5120414...
0.685801
0
Given a start and end point and a graph to scan this function looks for a point between the start and end that has a PB Value of at least DTConstants.getScaledPBVALUE();
public static boolean hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph<AbstractGraphPoint> graph) { boolean result = false; if (null != startPoint && null != endPoint && null != graph && 0 < graph.size()) { //Ensure endPoint is after startPoint if (startPoint.getTimestamp() < endPoint.getTimestamp()) { //Get target value double pbValue = DTConstants.getScaledPBVALUE(); double dblHighestWAP = endPoint.getWAP(); double currWAP; double dblDiff; AbstractGraphPoint currPoint; //Subset the graph to deal only with points between the start and end NavigableSet<AbstractGraphPoint> subSet = graph.subSet(startPoint, true, endPoint, false); //Iterate through the set in reverse order (backwards in time) looking for a point with a WAP //at least pbValue LESS than the highest WAP so far. Iterator<AbstractGraphPoint> descIter = subSet.descendingIterator(); while(descIter.hasNext()){ //Get data for point currPoint = descIter.next(); currWAP = currPoint.getWAP(); //Update highest WAP so far if needed if(currWAP > dblHighestWAP){ dblHighestWAP = currWAP; } //Calculate diff between highest WAP so far and currWAP dblDiff = dblHighestWAP - currWAP; //Is the difference >= pbValue if so we have validated that there is a PB+ point between the two points if(dblDiff >= pbValue){ result = true; break; } } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean hasPBPointBetween(IGraphLine aLine, BaseGraph<AbstractGraphPoint> graph){\r\n return DTUtil.hasPBPointBetween(aLine.getStartPoint(), aLine.getEndPoint(), graph);\r\n }", "static Boolean pointInPgm(int x, int y) {\n return (x >= 0 ) && (y >= 0) && (x <= pgmInf.width) && (y...
[ "0.5799063", "0.5196416", "0.51921296", "0.5130196", "0.5066578", "0.5035948", "0.5026182", "0.5018982", "0.49713615", "0.49685708", "0.49613807", "0.49462992", "0.4939893", "0.49279246", "0.49220908", "0.49213612", "0.4876054", "0.48667696", "0.48588592", "0.48562858", "0.48...
0.71309763
0
Alias for the hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph graph) that takes its start and end points from the provided IGraphLine object.
public static boolean hasPBPointBetween(IGraphLine aLine, BaseGraph<AbstractGraphPoint> graph){ return DTUtil.hasPBPointBetween(aLine.getStartPoint(), aLine.getEndPoint(), graph); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean hasPBPointBetween(AbstractGraphPoint startPoint, AbstractGraphPoint endPoint, BaseGraph<AbstractGraphPoint> graph) {\r\n boolean result = false;\r\n if (null != startPoint && null != endPoint && null != graph && 0 < graph.size()) {\r\n //Ensure endPoint is after start...
[ "0.7292554", "0.7037531", "0.6432954", "0.623064", "0.6223124", "0.60622257", "0.6035607", "0.58801156", "0.5747179", "0.57364374", "0.56108165", "0.55510074", "0.5474533", "0.54711974", "0.5467761", "0.5408743", "0.5387884", "0.5378327", "0.53321695", "0.5323887", "0.5308845...
0.8375252
0
Given a RealTimeRunManager this function builds a graph object that contains all the loaded historic data points and all the historic points from the preloaded Y line graph (if one exists). The result is a single graph that covers multiple days and can be associated with a YLine.
public static BaseGraph<AbstractGraphPoint> buildYLinePlusHistDataGraph(RealTimeRunManager manager){ BaseGraph<AbstractGraphPoint> result = null; if(null != manager){ //GetPutup Putup myPutup = manager.getMyPutup(); if(null != myPutup){ BaseGraph<AbstractGraphPoint> preLoadedYLineGraph = myPutup.getPreLoadedYLineGraph(); BaseGraph<AbstractGraphPoint> graphHistoricData = manager.getGraphHistoricData(); result = graphHistoricData.replicateGraph(); result.clear(); result.addAll(graphHistoricData); if(null != preLoadedYLineGraph && 0 < preLoadedYLineGraph.size()){ result.addAll(preLoadedYLineGraph); } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createOnce(){\n\n //Entry\n entries = new ArrayList<Entry>();\n\n //ArrayList of LineData\n lineDatas = new ArrayList<LineData>();\n\n //LineDataSet :\n dataSets = new ArrayList<LineDataSet>();\n\n\n for (int x=0; x<graphsData.size(); x++){\n\n ...
[ "0.58723426", "0.5697314", "0.565884", "0.5545756", "0.54903775", "0.5472164", "0.54128504", "0.5364741", "0.53072333", "0.5290794", "0.5243547", "0.5169606", "0.51556474", "0.51285475", "0.5115538", "0.4975648", "0.49714836", "0.4907172", "0.4896475", "0.48888665", "0.488280...
0.7705797
0
Loads and parses the query file with the given name from classpath and stores its content in cache.
@Cacheable(value = "cypherQueriesCache", key = "#name", unless = "#result != null") private String loadCypher(String name) { try { logger.debug("Cypher query with name {} not found in cache, try loading it from file.", name); ResourcePatternResolver resolver = ResourcePatternUtils.getResourcePatternResolver(this.resourceLoader); Resource[] queryFiles = resolver.getResources("classpath*:queries/*.cql"); for (Resource queryFile : queryFiles) { if (queryFile.getFilename().endsWith(name + QUERY_FILE_SUFFIX)) { logger.debug("Found query file with name {} in classpath.", queryFile.getFilename()); InputStream inputStream = queryFile.getInputStream(); String cypher = StreamUtils.copyToString(inputStream, Charset.defaultCharset()); return cypher; } } logger.warn("Query file with name {} not found in classpath.", name + QUERY_FILE_SUFFIX); return null; } catch (IOException e) { throw new IllegalStateException("Invalid query file path.", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadClasspathCypherScriptFile(String cqlFileName) {\n StringBuilder cypher = new StringBuilder();\n try (Scanner scanner = new Scanner(Thread.currentThread().getContextClassLoader().getResourceAsStream(cqlFileName))) {\n scanner.useDelimiter(System.getProperty(\"line.separator\...
[ "0.58792686", "0.58093685", "0.56234306", "0.5521013", "0.54836357", "0.52768105", "0.5236837", "0.5203174", "0.5199262", "0.5188649", "0.5164219", "0.51599264", "0.51567703", "0.513977", "0.51149213", "0.5114064", "0.50984", "0.50785226", "0.5036936", "0.49819395", "0.496931...
0.7307294
0
Initializes the controller class.
@Override public void initialize(URL url, ResourceBundle rb) { MyUtils.populateColumnNames(cmbSc, "task"); txtSi.setText(si); MyUtils.selectComboBoxValue(cmbSc, sc); refreshTbl(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Co...
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.691256...
0.0
-1
do something or nothig ;]
public void sort(List<T> objects, Comparator<T> comparator) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doNothing(){\n\t}", "public static void doNothing(){\n\t}", "public void woke(){\n\n //TODO\n\n }", "public void smell() {\n\t\t\n\t}", "public void furyo ()\t{\n }", "@Override\n\tpublic void some() {\n\t\t\n\t}", "public void logic(){\r\n\r\n\t}", "public void baocun() {\n\t\t...
[ "0.67409694", "0.6466994", "0.64530134", "0.6430639", "0.64125454", "0.63235277", "0.6292125", "0.6269731", "0.62456", "0.6242658", "0.6215193", "0.6214036", "0.62126696", "0.6164746", "0.6160586", "0.6150086", "0.613691", "0.6136875", "0.6126539", "0.6109496", "0.6102251", ...
0.0
-1
sort BundleInfo by version
public EclipseInfo sortByVersion(){ getBundleInfos().sortValues(new BundleInfoVersionComparator(), false); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String getBundleSpecVersion(String headers) {\n Map<String, List<String>> res = new HashMap<String, List<String>>();\n\n String[] headersTokens = headers.split(\";\");\n if (headersTokens.length > 1) {\n ArrayList<String> curHeader = new ArrayList<String>();\n ...
[ "0.58565825", "0.56455624", "0.55063033", "0.5489136", "0.5478079", "0.54010224", "0.5316695", "0.52885365", "0.5280602", "0.5266418", "0.5243919", "0.5241037", "0.52307725", "0.51562554", "0.51547444", "0.5153871", "0.5137595", "0.5130722", "0.51266986", "0.5125426", "0.5099...
0.69537693
0
Added Department section in the json object
private String getListData() { String jsonStr = "{ \"users\" :[" + "{\"name\":\"Ritesh Kumar\",\"designation\":\"Team Leader\",\"department\":\"Main office\",\"location\":\"Brampton\"}" + ",{\"name\":\"Frank Lee\",\"designation\":\"Developer\",\"department\":\"Developer's office\",\"location\":\"Markham\"}" + ",{\"name\":\"Arthur Young\",\"designation\":\"Charted Accountant\",\"department\":\"Account office\",\"location\":\"Toronto\"}] }"; return jsonStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addDepartment(IBaseDTO dto) {\n\t\tSysDepartment sd=new SysDepartment();\n\t\t\n\t\tsd.setName((String)dto.get(\"name\"));\n\t\tsd.setParentId((String)dto.get(\"parentId\"));\n\t\tsd.setRemarks((String)dto.get(\"remark\"));\n\t\tsd.setTagShow((String)dto.get(\"tagShow\"));\n\t\tsd.setId(ks.getNext(\"sy...
[ "0.6727589", "0.6490208", "0.64714926", "0.6459321", "0.645874", "0.6434636", "0.63519245", "0.6228464", "0.6187688", "0.61390185", "0.61316043", "0.6102095", "0.6099086", "0.60701925", "0.606952", "0.60336924", "0.6026632", "0.6010603", "0.59394234", "0.59358037", "0.5932880...
0.0
-1
0 if positive, 1 if negative
public static int sign(int num) { return (num >> 31) & 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean isPositive();", "public boolean isPositive()\n\t{\n\t\treturn _bIsPositive;\n\t}", "private boolean isPositive() {\n return this._isPositive;\n }", "public static void main(String[] args){\n int num= 120;\n boolean positive = num>0;\n boolean negative = num ...
[ "0.7108732", "0.6691979", "0.6646622", "0.65794396", "0.6564112", "0.6458411", "0.6441478", "0.6430603", "0.64095336", "0.638986", "0.63409287", "0.63044924", "0.62545633", "0.62322724", "0.62196434", "0.62151474", "0.6170733", "0.61653185", "0.6156554", "0.60787874", "0.6051...
0.0
-1
add and edge to a node
public void addEdge(Edge e){ adjacentEdges.add(e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEdge(Node from, Node to);", "void addEdge(int x, int y);", "void add(Edge edge);", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "void addEdge(int source, int destination, int weight);", "public void addEdge(int start, int end);", "boolean addEdge(E edge);", "...
[ "0.8026272", "0.77887315", "0.77788883", "0.769147", "0.754985", "0.7339072", "0.73152703", "0.7214416", "0.7201552", "0.71232665", "0.70859736", "0.7084505", "0.7031816", "0.70316666", "0.70315915", "0.7025291", "0.7024754", "0.69921863", "0.69831586", "0.6980278", "0.695905...
0.6962796
20
add a list of nodes as edges to a given node
public void addAllEdges(ArrayList<Node> nList, ArrayList<Obstacle> oList) { for (int i = 0; i < nList.size(); i++) { Node node = nList.get(i); double w = node.vertex.distanceTo(this.vertex); Edge e = new Edge(w, node); if (!e.intersectObstacleHuh(oList, this) && !(w == 0.0)){ //if this edge does not intersect any obstacles in give map, add //as a visible edge to node this.addEdge(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEdge(Node from, Node to);", "public void addEdge(int start, int end);", "public void addEdge(){\n Node[] newAdjacent = new Node[adjacent.length + 1];\n for (int i = 0; i < adjacent.length; i++) {\n newAdjacent[i] = adjacent[i];\n }\n adj...
[ "0.75173587", "0.73267716", "0.71603495", "0.712714", "0.7038755", "0.6941814", "0.6847333", "0.6831036", "0.68188214", "0.6762855", "0.6745265", "0.6714425", "0.6709204", "0.6700326", "0.66924417", "0.6665868", "0.66379094", "0.65967005", "0.6560416", "0.6559565", "0.6558618...
0.594788
74
returns humand readable node object
public String toString(){ return vertex.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Node getNode();", "public String toString(){\n return \"Node: \" + data;\n }", "public String getNodeValue ();", "public String getNode() {\n return node;\n }", "public Node getNode();", "public String getNode()\n {\n return node;\n }", "@AutoEscape\n\tpublic String getNode_1...
[ "0.69781256", "0.6891004", "0.67425346", "0.66328347", "0.66243434", "0.6605511", "0.6558947", "0.65267843", "0.6501711", "0.6448545", "0.6445223", "0.6433623", "0.6432986", "0.6422221", "0.6359603", "0.6274888", "0.6274348", "0.6265717", "0.6265717", "0.62613153", "0.624423"...
0.0
-1
String rootDirectory = request.getSession().getServletContext().getRealPath("/");
@Override public String saveFile(MultipartFile file, String rootDirectory ) { String path = null; try { if (file != null && !file.isEmpty()) { java.util.Date date = new java.util.Date(); int i = (int) (date.getTime() / 1000); String extention = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); String fileName =file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")); path = rootDirectory + fileName + "-" + i + "."+ extention; File finalFilePath = new File(path); //create all path directories if not exist finalFilePath.getParentFile().mkdirs(); file.transferTo(new File(path)); } } catch (IOException e) { e.printStackTrace(); } return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IPath getRuntimeBaseDirectory(TomcatServer server);", "protected String getRootPath() {\n\t\treturn \"/WEB-INF\";\n\t}", "@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}", "Path getRootPath();", "String rootPath();", "private String getPath() {\n\t\treturn ...
[ "0.71699566", "0.7055788", "0.6686687", "0.6612563", "0.65533996", "0.6525139", "0.6525139", "0.6525139", "0.6525139", "0.6479644", "0.63547873", "0.6330258", "0.63001263", "0.62684107", "0.62418336", "0.6191932", "0.6127235", "0.60964036", "0.60934955", "0.6071023", "0.60353...
0.0
-1
broadcasting have message to all it's neighbors
public static void broadcastHaveMessage(String peerID, byte[] pieceIndex){ for (RemotePeerInfo peer : Constants.listOfAllPeers) { if(!peer.peerID.equals(peerID)){ try { Message msg = new Message(1 + pieceIndex.length, 4, pieceIndex); byte[] msgByteArray = msg.createMessage(); utilities.writeToOutputStream(peer.out, msgByteArray); } catch (Exception e) { e.printStackTrace(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void broadcast() {\n for (int i = 1; i <= nbMessagesToBroadcast; i++) {\n Message broadcastMsg = new Message(pid, pid, i,false, null);\n lcb.broadcast(broadcastMsg);\n logs.add(String.format(\"b %d\\n\",i));\n }\n }", "private void broadcast(String message...
[ "0.6745808", "0.6530819", "0.6516562", "0.6272593", "0.6248642", "0.61319697", "0.59604526", "0.59125304", "0.58673126", "0.5857072", "0.5851101", "0.58467746", "0.58408326", "0.5783418", "0.5688467", "0.5684713", "0.56705093", "0.5664514", "0.56423706", "0.5631228", "0.56051...
0.0
-1
Inizializza i componenti necessari a testare i metodi.
@BeforeEach void setUp() throws Exception { price=new Price(990.0, 1760.0); classification= new Classification("Sport", "Tennis"); event= new Event("Abierto", "17AZvbG62X1NsqR", "https://www.ticketmaster.com.mx/abierto-mexicano-de-tenis-miercoles-acapulco-guerrero-03-17-2021/event/140058FF8A8F176F","2021-03-17" , "18:00:00",classification , price); event1= new Event("Abierto", "17AZvbG62X1NsqR", "https://www.ticketmaster.com.mx/abierto-mexicano-de-tenis-miercoles-acapulco-guerrero-03-17-2021/event/140058FF8A8F176F","2021-03-23" , "18:00:00",classification , price); events.set(0, event); events.set(1, event1); Stato = new State("Monterrey", 403, events ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public test_para_lanzar_metodos() {\n initComponents();\n \n \n \n \n \n \n }", "private void initcomponent() {\n\r\n\t}", "public InicioTeste() {\n initComponents();\n }", "private void setup(){\n\n // menginisialisasi variabel component\n ...
[ "0.6797777", "0.6511016", "0.63096", "0.62574774", "0.6222537", "0.62045586", "0.61286616", "0.606183", "0.6008852", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "0.5999314", "...
0.0
-1
Questo testa se il numero totale di eventi di un determinato stato e' corretto;
@Test void testConfrontaData() throws Exception { assertEquals(2,stats.NumeroTotaleEventi(Stato)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void totalHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getTotalHires() == 4);\n\t}", "public int probabilidadesHastaAhora(){\n return contadorEstados + 1;\n }", "private void assertCountEvent(int exepectedCount, String eleementName, String json) {\n\n// System.out.pri...
[ "0.6124261", "0.6106938", "0.60680956", "0.593869", "0.5824756", "0.5802684", "0.57872385", "0.5730139", "0.57301384", "0.56679237", "0.5651565", "0.5650269", "0.5640435", "0.56379247", "0.5633462", "0.56223947", "0.5596154", "0.55922395", "0.5574622", "0.55744135", "0.557241...
0.72556406
0
Chiffrement d'une String en blowfish
private String encrypt(String input){ byte[] crypt = null; try { // Génération d'une spec de clé secrète à partir de la clé "secret" SecretKeySpec KS = new SecretKeySpec(SECRET_KEY.getBytes(), "Blowfish"); // Initialisation d'un code basé sur blowfish Cipher cipher = Cipher.getInstance("Blowfish"); cipher.init(Cipher.ENCRYPT_MODE, KS); // chiffrement du message crypt = cipher.doFinal(input.getBytes()); } catch (NoSuchAlgorithmException e) { System.err.println("Algorithme inconnu " + e.getMessage()); } catch (NoSuchPaddingException e) { System.err.println("Offset inconnu " + e.getMessage()); } catch (InvalidKeyException e) { System.err.println("Clé non valide " + e.getMessage()); } catch (IllegalBlockSizeException e) { System.err.println("Bloc de taille invalide " + e.getMessage()); } catch (BadPaddingException e) { System.err.println("Mauvais Padding : " + e.getMessage()); } // (pour des raisons d'encodage des caractères et de sauvegarde des bytes[] en base, on gardera les HexValues) return byteArrayToHexString(crypt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Crypt(String s);", "private String decodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n String decoding = decodageMot(text);\n SubstCipher decodingText = new SubstCipher(this.s...
[ "0.63219225", "0.6254435", "0.62143415", "0.61981165", "0.617154", "0.61409634", "0.6106541", "0.6092872", "0.6057742", "0.6009548", "0.6008888", "0.5919922", "0.5876385", "0.58694524", "0.5866743", "0.5861068", "0.58311146", "0.58011353", "0.579213", "0.5748684", "0.57391226...
0.59503573
11
Enregistrement d'un nouvel utilisateur
public boolean registerNewUser(String email, String pass, int accountID){ String encPass = encrypt(pass); PreparedStatement pst; try { // Préparation de l'insertion pst = connection.prepareStatement("INSERT INTO user (email, password) VALUES (?,?)"); pst.setString(1, email); pst.setString(2, encPass); pst.executeUpdate(); // Récupération de l'ID de l'utilisateur pst = connection.prepareStatement("SELECT id FROM user WHERE email = ?"); pst.setString(1, email); if(!pst.execute()){ return false; } ResultSet rs = pst.getResultSet(); rs.next(); int id = rs.getInt(1); //TODO récupération du mot de passe en provenance de la banque String accPass = "lalala"; // Enregistrement du nouveau compte en banque pst = connection.prepareStatement("INSERT INTO account_access (id, account_id, password) VALUES (?,?,?)"); pst.setInt(1, id); pst.setInt(2, accountID); pst.setString(3, accPass); if(!(pst.executeUpdate() == 1)){ return false; } return true; } catch (SQLException e) { System.err.println("[ERREUR SQL] Impossible d'insérer le nouvel utilisateur: " + e.getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}", "public void effacerUtilisateur() {\r\n this.modele.effacerUtilisateur(this.modele);\r\n this.modele = new Utilisateurs();\r\n }", "...
[ "0.71558404", "0.7038353", "0.7031756", "0.7015406", "0.6989056", "0.69227326", "0.6888336", "0.68532467", "0.68076444", "0.67817163", "0.6780337", "0.6778839", "0.67663604", "0.673294", "0.6680652", "0.66697115", "0.66655785", "0.6638908", "0.6616492", "0.65943986", "0.65779...
0.0
-1
Get product by provided id.
CafeProduct getProductById(final Integer productId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Product getProductByID(Long id);", "@Override\n\tpublic Product getProduct(int id) {\n\t\treturn productDao.getProduct(id);\n\t}", "public Product getProductWithId(int id) {\n for (Product s : products) {\n if (s.getId() == id) { return s;}\n }\n return null;\n }", "public ...
[ "0.85038114", "0.84221286", "0.8384023", "0.83488333", "0.8346603", "0.8281538", "0.8278932", "0.820037", "0.81812376", "0.8103075", "0.80738086", "0.8053274", "0.805252", "0.805252", "0.80416906", "0.80237216", "0.7998011", "0.79830736", "0.7974379", "0.79454577", "0.7940327...
0.82859117
5
Delete product by id
void deleteProduct(Integer productId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteProduct(Long id);", "void deleteProduct(int productId) throws ProductException;", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Product : {}\", id);\n productRepository.delete(id);\n }", "public void deleteProductById(int id) {\n\t\tproductMapper.de...
[ "0.9171445", "0.84613955", "0.83377355", "0.83112466", "0.8269032", "0.8240872", "0.82112134", "0.8173118", "0.81667584", "0.8104922", "0.80716956", "0.8047363", "0.80000013", "0.7975696", "0.7972366", "0.7947062", "0.7919945", "0.79101306", "0.7895886", "0.7893873", "0.78318...
0.88115484
1
TODO Autogenerated method stub System.out.println("FoodShopServiceimpl addFoodshop");
@Override public int addFoodshop(FoodshopVO vo) { return dao.insertFoodshop(vo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic int addshop(Shop shop) {\n\t\treturn dao.addshop(shop);\r\n\t}", "@Override\r\n\tpublic void AddShop(Shop shop) {\n\t\tSystem.out.println(\"-------ShopDaoImp.AddShop-----------\"\r\n\t\t\t\t+ shop.getName());\r\n\t\tgetSession().save(shop);\r\n\t}", "@Override\n\tpublic String addShop(Foo...
[ "0.70184577", "0.688535", "0.68615097", "0.6786287", "0.6620852", "0.65936905", "0.65631616", "0.6547774", "0.6514246", "0.6503919", "0.6467871", "0.63904923", "0.6174403", "0.61126864", "0.60864884", "0.6080103", "0.6070931", "0.6025893", "0.6007093", "0.6005991", "0.6001075...
0.80972224
0
TODO Autogenerated method stub
@Override public int discountsearch(FoodshopVO vo) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public int locsearch(FoodshopVO vo) { return 0; }
{ "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
Logs a user in with its password
public String logInUser(Long userId) { return TokenAuthService.addBearer(tokenAuthService.createTokenForUser(userId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User logInUser(final String login, final String password);", "void login(String user, String password);", "public void login() {\n\t\tUser user = new User(\"admin\", \"12345678\", Role.ADMIN);\n\t\tuser.setEmail(\"admin@gibmit.ch\");\n\t\t\n\t\tif(user != null) {\n\t\t\tuserBean.setLoggedInUser(user);\n...
[ "0.7958234", "0.79360735", "0.75537384", "0.7391002", "0.7334946", "0.7265172", "0.72136635", "0.71882385", "0.71461266", "0.71458185", "0.71017474", "0.70779115", "0.70389813", "0.7037826", "0.70218885", "0.70142776", "0.70115596", "0.69699883", "0.6949619", "0.69436246", "0...
0.0
-1
Creates a Course without any owners, followers or posts
public Course createTestCourseObject() { Course course = new Course(makeRandomString()); return courseRepository.save(course); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void create() {\n Application.currentUserCan( 1 );\n \n String author = session.get(\"userEmail\");\n String title = params.get( \"course[title]\", String.class );\n String content = params.get( \"course[content]\", String.class );\n \n if( title.lengt...
[ "0.7350077", "0.7243404", "0.6887928", "0.6874972", "0.6804459", "0.6787115", "0.66148806", "0.65737736", "0.65737736", "0.6558112", "0.64991003", "0.64819473", "0.6476087", "0.64719075", "0.646321", "0.64049315", "0.6387338", "0.62681174", "0.61681736", "0.6146063", "0.61040...
0.63698226
17
Creates a Post without anything
public Post createTestPostObject(Course course) { Post post = new Post(makeRandomString(), makeRandomString(), course, new Date(), new Date()); return postRepository.save(post); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping(\"/posts\")\n ResponseEntity<?> createPost(@RequestBody Post post) {\n post.setOwner(SecurityContextHolder.getContext().getAuthentication().getName());\n post.setDateCreated(LocalDateTime.now());\n\n EntityModel<Post> newPost = modelAssembler.toModel(postRepository.save(post));...
[ "0.7440482", "0.74346423", "0.73977154", "0.73348767", "0.7286598", "0.702004", "0.70136404", "0.6950119", "0.6909419", "0.68857515", "0.68435305", "0.6756766", "0.67363", "0.6715142", "0.66520166", "0.6641089", "0.6597919", "0.6564922", "0.6548229", "0.65253603", "0.6519238"...
0.6507745
22
nothing to do yet
@Override public void initialize(Bootstrap<SeqNumConfiguration> bootstrap) { }
{ "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 grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {...
[ "0.6106569", "0.60834163", "0.6064461", "0.6015456", "0.59833896", "0.5946322", "0.59131056", "0.5862406", "0.5862406", "0.5840434", "0.5813796", "0.5810636", "0.5802016", "0.5800202", "0.5793572", "0.5790893", "0.577759", "0.5761792", "0.5761074", "0.5757549", "0.5749601", ...
0.0
-1
Created by mauchilan on 20/3/17.
public interface UsuarioDao extends GenericDao<Usuario, Integer> { List<Usuario> getAllUsuario(); List<Usuario> getUsuarioByEstado(Object[] parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", ...
[ "0.5955577", "0.5804739", "0.58047175", "0.5731462", "0.5688046", "0.5667873", "0.5667873", "0.56401175", "0.56342286", "0.5622523", "0.5597232", "0.55538785", "0.55490303", "0.55433077", "0.5530508", "0.55272937", "0.5527241", "0.5527241", "0.5527241", "0.5527241", "0.552724...
0.0
-1
in every 2 hours period do this check whether there is a must send notification by checking database if so send it.
@Scheduled(fixedRateString = "PT120M") void someJob(){ // String s = "Testing message.\nNow time is : "+new Date(); //// System.out.println(s); // PushNotificationOptions.sendMessageToAllUsers(s); // //get all schedules in current dayOfWeek Collection<Notification> notifications = notificationService.findAllByDayOfWeekAndTime(); for(Notification notification : notifications){ // System.out.println(notification.toString()); // System.out.println(!notification.getStatus()); //// System.out.println(check(notification.getStartTime())); // //check for already not sent notifications , also check for time difference < TIME_CONSTANT // if(!notification.getStatus() && check(notification.getStartTime())){ // //send push notification // PushNotificationOptions.sendMessageToAllUsers(notification.getMessage()); // //mark the notification as sent // notificationService.setStatus(notification.getNotificationId()); // } if(checkForDayTime()){ PushNotificationOptions.sendMessageToAllUsers(notification.getMessage()); notificationService.setStatus(notification.getNotificationId()); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Scheduled(fixedRate = 60_000)\n public void checkEventTime() {\n isTimeService.findAll().forEach(event -> {\n if (event.getSchedulledTime().isBefore(LocalDateTime.now())) {\n this.producer.sendReachTimeMessage(new IsTime(event.getMessageId()));\n this.isTimeServi...
[ "0.6686329", "0.63562876", "0.62219584", "0.61696553", "0.6163989", "0.6116342", "0.6112527", "0.6055009", "0.6002878", "0.59440506", "0.5940745", "0.5930527", "0.5908151", "0.58977896", "0.58941746", "0.5884432", "0.5880623", "0.58761525", "0.5866256", "0.5854404", "0.584876...
0.68188536
0
in every sunday 6.00pm do this clearing notification Collection and re adding them.set status to false
@Scheduled(cron = "0 0 18 * * SUN") void refreshNotifications(){ notificationService.refreshAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void refreshNotification() {\n String str = this.mCurrentAddedNotiSsid;\n if (str != null) {\n showNotification(str, true, true);\n }\n String str2 = this.mCurrentDeletedNotiSsid;\n if (str2 != null) {\n showNotification(str2, false, true);\n ...
[ "0.67248106", "0.64135295", "0.63531595", "0.62517095", "0.62504995", "0.614467", "0.611838", "0.6101447", "0.6005047", "0.59613055", "0.5957891", "0.59199417", "0.59050894", "0.58821887", "0.5877708", "0.58572257", "0.5847977", "0.5842829", "0.58420175", "0.5803596", "0.5795...
0.6493158
1
/ there are a bunch of tabs, and given the chosen tab, we need to set the background of white on it, but also need to remove this attribute on other tabs, if set
protected void activateTab() { GWT.log("activateTab " + getActiveTabId()); List<String> ids = new ArrayList<String>(); ids.add("contestsli"); ids.add("driversli"); ids.add("chatsli"); ids.add("dirli"); ids.add("menuli"); for (String id : ids) { com.google.gwt.dom.client.Element element = DOM.getElementById(id); if (element != null) { element.removeAttribute("style"); } } String tabId = getActiveTabId(); if (tabId != null) { com.google.gwt.dom.client.Element element = DOM.getElementById(tabId); if (element != null) { element.setAttribute("style", "background:white;"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void prepareTabBackground(final Tab tab) {\n if (!CustomTabIntentDataProvider.isTrustedCustomTab(mIntent, mSession)) return;\n\n int backgroundColor = mIntentDataProvider.getColorProvider().getInitialBackgroundColor();\n if (backgroundColor == Color.TRANSPARENT) return;\n\n // S...
[ "0.69295955", "0.68757236", "0.6849606", "0.6843681", "0.6651098", "0.6532578", "0.6434188", "0.61832696", "0.60960525", "0.6031405", "0.60122013", "0.58684903", "0.58558005", "0.5848347", "0.5838734", "0.57914644", "0.57671887", "0.57455665", "0.5743979", "0.57244617", "0.57...
0.64763284
6
mapPanel could be null;
protected void initMap(Location location, SimplePanel mapPanel) { GWT.log("initMap"); if (location == null) { mapWidget = new MapWidget(); } else { LatLng latLng = LatLng.newInstance(location.getLatitude(), location.getLongitude()); mapWidget = new MapWidget(latLng, 15); reverseGeocode(latLng, null); Marker marker = new Marker(latLng); mapWidget.addOverlay(marker); } mapWidget.setSize("840px", "600px"); mapWidget.setUIToDefault(); MapUIOptions opts = mapWidget.getDefaultUI(); opts.setDoubleClick(false); mapWidget.setUI(opts); mapWidget.addMapClickHandler(new MapClickHandler() { public void onClick(MapClickEvent e) { Overlay overlay = e.getOverlay(); LatLng point = e.getLatLng(); if (overlay != null && overlay instanceof Marker) { // no point if we click on marker } else { mywebapp.setAutoGps(false); //this is a callback reverseGeocode(point, afterGeocodeCallback); } } }); //mapWidget.checkResize(); //if (mapPanel != null) { mapPanel.setWidget(mapWidget); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GridMapPanel() {\n super();\n initialize();\n }", "public PanelMapDrug() {\n initComponents();\n }", "@Override\n public MapLocation getMap() {\n return null;\n }", "public MapPanel() {\r\n\t\tthis(EarthFlat.class);\r\n\t}", "public MapPanel(String map, Object...
[ "0.6929367", "0.66124314", "0.65667325", "0.6487772", "0.6476561", "0.64721274", "0.64579135", "0.6452153", "0.6445826", "0.64220285", "0.63964224", "0.6307694", "0.63037837", "0.63011163", "0.629915", "0.62984544", "0.62885505", "0.6288023", "0.62714267", "0.62442416", "0.62...
0.6909925
1
/ the calllback we pass here happens after we do our reverse geocoding
private void reverseGeocode(final LatLng latLng, final AsyncCallback callback) { GWT.log("reverseGeocode"); geocoder.getLocations(latLng, new LocationCallback() { public void onFailure(int statusCode) { getMessagePanel().displayError("Failed to geocode position " + latLng.toString() + ". Status: " + statusCode + " " + StatusCodes.getName(statusCode)); if (callback != null) { callback.onFailure(null); } //but we can still set the location } public void onSuccess(JsArray<Placemark> locations) { GWT.log("reverseGeocode onSuccess " + locations.length()); // for (int i = 0; i < locations.length(); ++i) { //just need to get the very first location! Placemark placemark = locations.get(0); Location location = new Location(); location.setLatitude(placemark.getPoint().getLatitude()); location.setLongitude(placemark.getPoint().getLongitude()); GWT.log("address is " + placemark.getStreet()); location.setAddress1(placemark.getStreet()); location.setCity(placemark.getCity()); location.setState(placemark.getState()); location.setZipcode(placemark.getPostalCode()); location.setCountryCode(placemark.getCountry()); location.setGeocoded(true); //does not fetch data, but will update the top of the app mywebapp.setCurrentLocation(location); if (callback != null) { callback.onSuccess(null); } //we just reverse geocoded, not that we clicked on map // } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void onFinishReverseGeoCoding(String result) {\n }", "private void onFinishReverseGeoCoding(String result) {\n }", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult reverseGeoCodeResult) {\n\t\t\t\tif (reverseGeoCodeResult.error == SearchResult.ERRORNO.NO_ERROR) {\n\t\t...
[ "0.7746191", "0.7746191", "0.70878536", "0.70206577", "0.69852", "0.69613534", "0.69266605", "0.68930775", "0.68605715", "0.68549097", "0.68549097", "0.68244386", "0.68151975", "0.6780102", "0.6759908", "0.67300594", "0.6723069", "0.6704283", "0.6671883", "0.6671883", "0.6671...
0.77631205
0
this is fine for desktop, but now i have mobile.... / Spot Spot Spot Spot Spot Spot Spot Spot Spot
protected void getPickSpotULPanel(final ULPanel ulPanel ) { //final ULPanel ulPanel = new ULPanel(); SearchParameters searchParameters = new SearchParameters(); searchParameters.setLatitude(mywebapp.getCurrentLocation().getLatitude()); searchParameters.setLongitude(mywebapp.getCurrentLocation().getLongitude()); searchParameters.setLicensePlate(false); ApiServiceAsync myService = mywebapp.getApiServiceAsync(); myService.search(searchParameters, new AsyncCallback() { public void onFailure(Throwable caught) { getMessagePanel().displayMessage("Error:" + caught.getMessage()); } public void onSuccess(Object result) { MobileResponse mobileResponse = (MobileResponse) result; ulPanel.add(addSpotNotHere()); for (LocationResult locationResult : mobileResponse.getLocationResults()) { ListItem listItem = new ListItem(); Anchor anchor = new Anchor(locationResult.getLabel()); listItem.add(anchor); ulPanel.add(listItem); if (locationResult.getSolrDocument() == null) { pickLocationMap.put(anchor, locationResult); anchor.addClickHandler(createSpotFromLocationHandler); } else { Long spotId = locationResult.getSolrDocument().getFirstLong("spotid_l"); String targetHistoryToken = "#" + MyWebApp.LEAVE_SPOT_MARK + spotId; anchor.setHref(targetHistoryToken); } } ulPanel.add(addSpotNotHere()); } }); //return ulPanel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testDesktopNonIphone()\n\t{\n\n\t\tfor (final String ua : desktop_ua)\n\t\t{\n\t\t\tLOG.info(\"Testing :\" + ua);\n\t\t\tassertTrue(\"Api fails to identify as a desktop device: (\" + ua + \")\", detectionService.isDesktop(ua));\n\t\t\tassertFalse(\"Api wrongly identify as a iphone: (\" + ua + ...
[ "0.548152", "0.53474706", "0.52412987", "0.5240834", "0.523501", "0.5217405", "0.52165776", "0.5169298", "0.51560205", "0.51550835", "0.5141408", "0.51388675", "0.51288885", "0.51153374", "0.5108865", "0.502962", "0.49752977", "0.49548897", "0.4940251", "0.4896738", "0.487923...
0.0
-1
final FlowPanel flowPanel = new FlowPanel();
protected void getPickSpotMobile(final FlowPanel flowPanel) { SearchParameters searchParameters = new SearchParameters(); searchParameters.setLatitude(mywebapp.getCurrentLocation().getLatitude()); searchParameters.setLongitude(mywebapp.getCurrentLocation().getLongitude()); searchParameters.setLicensePlate(false); ApiServiceAsync myService = mywebapp.getApiServiceAsync(); myService.search(searchParameters, new AsyncCallback() { public void onFailure(Throwable caught) { getMessagePanel().displayMessage("Error:" + caught.getMessage()); } public void onSuccess(Object result) { MobileResponse mobileResponse = (MobileResponse) result; // ulPanel.add(addSpotNotHere()); for (LocationResult locationResult : mobileResponse.getLocationResults()) { ListItem listItem = new ListItem(); Anchor anchor = new Anchor(locationResult.getLabel()); flowPanel.add(anchor); //listItem.add(anchor); //ulPanel.add(listItem); if (locationResult.getSolrDocument() == null) { pickLocationMap.put(anchor, locationResult); anchor.addClickHandler(createSpotFromLocationHandler); } else { Long spotId = locationResult.getSolrDocument().getFirstLong("spotid_l"); String targetHistoryToken = "#" + MyWebApp.LEAVE_SPOT_MARK + spotId; anchor.setHref(targetHistoryToken); } } // ulPanel.add(addSpotNotHere()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void setupPanel()\n {\n\n }", "public Panel()\n/* */ {\n/* 56 */ this(new FlowLayout());\n/* */ }", "public FlowPanel(){\r\n setLayout(new FlowLayout());\r\n setBackground(Color.green);\r\n JButton b1 = new JButton(\"Button 1\");\r\n JButton b2 = new JBu...
[ "0.7153181", "0.71138865", "0.691021", "0.6691845", "0.66799545", "0.66209203", "0.6613823", "0.65909994", "0.65831804", "0.6527277", "0.6499493", "0.63883865", "0.63863415", "0.6362439", "0.6360537", "0.63266253", "0.6287224", "0.62729347", "0.6264354", "0.6209417", "0.61975...
0.0
-1