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
Reads a filename at specific path and return a inputReader object
public static BufferedReader readDataFile(String filename,String pathOfFile) { String pathToSave = pathOfFile; BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(pathToSave+filename)); } catch (FileNotFoundException ex) { System.err.println("File not found: " + filename); } return inputReader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Ini read(Path path) throws IOException {\n try (Reader reader = Files.newBufferedReader(path)) {\n return read(reader);\n }\n }", "public InputStream readFile( String fileName, FileType type );", "@Override\n public InputStream openInputFile(String pathname) t...
[ "0.69449896", "0.6911625", "0.6620245", "0.66083854", "0.6544799", "0.65185416", "0.64939743", "0.6419967", "0.6383979", "0.6383979", "0.63568217", "0.63507485", "0.632583", "0.6300613", "0.6266007", "0.61675566", "0.6065786", "0.6059177", "0.6052589", "0.60443217", "0.600874...
0.581876
28
Reading All data files
public static void Algorunner(String pathOfDataset,String reportPath) throws Exception { String path = pathOfDataset; //Map to pathOfDataset String files; File folder = new File(path); File[] listOfFiles = folder.listFiles(); int fileCounter=0; for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); if (files.endsWith(".arff")) { fileCounter++; } } } File[] arffFiles = new File[fileCounter]; fileCounter=0; for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); if (files.endsWith(".arff")) { arffFiles[fileCounter] = listOfFiles[i]; fileCounter++; } } } //Code For printing all file name System.out.println("Files for Testing :"); for (int i = 0; i < arffFiles.length; i++) { if (arffFiles[i].isFile()) { System.out.println((i+1)+") "+arffFiles[i].getName()); } } Classifier[] models = { new J48(), new PART(), new DecisionTable(), new DecisionStump(), new SimpleCart(), new NaiveBayes(), // Naive Bayes Classifier new Logistic(), new Bagging(), new WLSVM(), // SVM new RandomForest(), // Random Forest new IBk(), // K- nearest neighbour new MultilayerPerceptron(), //Neural Network new AdaBoostM1() //Ada boosting }; // //Start writing about csv StringBuilder csv2 = new StringBuilder(","); StringBuilder csvFile = new StringBuilder(","); for(int k=0;k<models.length;k++) { csv2.append(models[k].getClass().getSimpleName()); if(k!=models.length-1) csv2.append(","); else csv2.append("\n"); } System.out.println(csvFile.toString()); double[][] Comparision = new double[arffFiles.length][models.length]; int[][] weight = new int[arffFiles.length][models.length]; for (int i = 0; i < arffFiles.length; i++) { BufferedReader datafile = readDataFile(arffFiles[i].getName().toString(),pathOfDataset); System.out.println("File Under Testing..... : "+arffFiles[i].getName().toString()); Instances data = new Instances(datafile); data.setClassIndex(data.numAttributes() - 1); // Choose a type of validation split //Instances[][] split = crossValidationSplit(data, 10); // Separate split into training and testing arrays //Instances[] trainingSplits = split[0]; //Instances[] testingSplits = split[1]; // Choose a set of classifiers // Run for each classifier model for(int j = 0; j < models.length; j++) { //Code For error rate Evaluation eval = new Evaluation(data); models[j].buildClassifier(data); //used when training and test set is given //eval.evaluateModel(svm, filedata2); //single data eval.crossValidateModel(models[j], data,5, new Random(1)); double recall = eval.fMeasure(0)+eval.fMeasure(1); //eval.areaUnderROC(arg0) double aoc = eval.areaUnderROC(0); aoc = eval.areaUnderROC(1); double accuracy = 1-eval.errorRate(); // System.out.println("SVM error rate : "+errormid*100); // System.out.println(models[j].getClass().getSimpleName() + ": " + String.format("%.2f%%", (1-errormid)*100) + "\n====================="); //double param2 = eval.fMeasure(1); Comparision[i][j]= 1-eval.errorRate(); } } System.out.println(); System.out.println("Accuray of classifiers : Actual : "); for(int k=0;k<arffFiles.length;k++) { csv2.append(arffFiles[k].getName().toString()); csv2.append(","); for(int l=0;l<models.length;l++) { //System.out.print(" || "+Comparision[k][l]); csv2.append(Comparision[k][l]+","); } csv2.deleteCharAt(csv2.length()-1); csv2.append("\n"); //System.out.println(); //System.out.println("********************"); } csv2.deleteCharAt(csv2.length()-1); for(int k=0;k<arffFiles.length;k++) { double[][] sample = new double[2][models.length]; for(int l=0;l<models.length;l++) { sample[0][l]=Comparision[k][l]; sample[1][l]=(l+1); } //test for work... working :) /* for(int w=0;w<2;w++) { for(int q=0;q<models.length;q++) { System.out.print(" "+sample[w][q]); } System.out.println("*******"); } */ int n = models.length; double swap1,swap2; for (int c = 0; c < ( n - 1 ); c++) { for (int d = 0; d < n - c - 1; d++) { if (sample[0][d] > sample[0][d+1]) /* For descending order use < */ { swap1 = sample[0][d]; sample[0][d] = sample[0][d+1]; sample[0][d+1] = swap1; swap2 = sample[1][d]; sample[1][d] = sample[1][d+1]; sample[1][d+1] = swap2; } } } for(int l=0;l<models.length;l++) { Double d = new Double(sample[1][l]); weight[k][d.intValue()-1] = models.length-l; } } //testing System.out.println("Rank Vector "); for(int k=0;k<arffFiles.length;k++) { csvFile.append(arffFiles[k].getName().toString()); csvFile.append(","); for(int l=0;l<models.length;l++) { System.out.print(" || "+weight[k][l]); csvFile.append(weight[k][l]); if(l!=models.length-1) csvFile.append(","); else { //if(k!=arffFiles.length-1) csvFile.append("\n"); } } System.out.println(); } csvFile.append("\n"); csvFile.append("Sum of Ranks (Lower is Better)"); csvFile.append(","); StringBuilder rank = new StringBuilder(); for(int l=0;l<models.length;l++) { int sum=0; for(int k=0;k<arffFiles.length;k++) { sum+=weight[k][l]; } rank.append((double)sum/(double)arffFiles.length); csvFile.append(sum); if(l!=models.length-1) { csvFile.append(","); rank.append(","); } else { //if(k!=arffFiles.length-1) csvFile.append("\n"); rank.append("\n"); } } csvFile.append("\n"); csvFile.append("Avrage Ranks"); csvFile.append(","); csvFile.append(rank.toString()); //Ranks of algorithms int sum=0; int series = models.length; series = (series*(series+1))/2; series = series*(arffFiles.length); for(int l=0;l<models.length;l++) { for(int k=0;k<arffFiles.length;k++) { sum += weight[k][l]; } System.out.println("Parameter for "+models[l].getClass().getSimpleName()+ " : "+sum+"/"+series ); sum=0; System.out.println(); } /* for(int w=0;w<2;w++) { for(int q=0;q<models.length;q++) { System.out.print(" "+sample[w][q]); } System.out.println(" "); System.out.println(" "); System.out.println(" "); } } */ //arffFiles.length][models.length]; System.out.println("Done"); writeCSVReport(csvFile.toString(),reportPath); writeCSVReport(csv2.toString(), reportPath); System.out.println(csvFile.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readAll() throws FileNotFoundException{ \n b = new BinaryIn(this.filename);\n this.x = b.readShort();\n this.y = b.readShort();\n \n int count = (x * y) / (8 * 8);\n this.blocks = new double[count][8][8][3];\n \n Node juuri = readTree();\n ...
[ "0.68270797", "0.6816887", "0.6760399", "0.6661832", "0.6641864", "0.6426408", "0.6236608", "0.62049264", "0.6172738", "0.614309", "0.6129688", "0.61028636", "0.6045402", "0.6012763", "0.60044974", "0.5964211", "0.5954158", "0.59515643", "0.59190816", "0.5908631", "0.5908142"...
0.0
-1
String reportPath = "d:/work241/reportnew4AOC.csv"; String filePath = "./data/BinaryDatasets/"; Algorunner(filePath, reportPath); String reportPath = "d:/Experiment/reports/AllResultInAccuracyFormat.csv";
public static void main(String[] args) throws Exception { String reportPath = "d:/Experiment/ExperimentFeb/reports/LargeDatasets-Accuracy.csv"; String filePath ="d:/Experiment/ExperimentFeb/temp1/"; Algorunner(filePath, reportPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void Algorunner(String pathOfDataset,String reportPath) throws Exception\n\t{\n\t String path = pathOfDataset; //Map to pathOfDataset \n\t String files;\n\t File folder = new File(path);\n\t File[] listOfFiles = folder.listFiles(); \n\t \n\t int fileCounter=0;\n\t for (in...
[ "0.8153445", "0.64745", "0.62991", "0.62346745", "0.6008048", "0.5967826", "0.5953829", "0.5943551", "0.5921406", "0.5888782", "0.58416873", "0.58371484", "0.5822153", "0.5819506", "0.57948023", "0.5768725", "0.5765001", "0.5751401", "0.575135", "0.5723467", "0.56845355", "...
0.71677953
1
getter for local Handler
public Handler getHandler() { return this.serverHandler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Handler getHandler();", "public Handler getHandler() {\r\n return handler;\r\n }", "public Handler getHandler() {\r\n return handler;\r\n }", "@Override\n\tpublic Handler getHandler() {\n\t\treturn mHandler;\n\t}", "public Handler getHandler() {\n return mHandler;\n }", "public S...
[ "0.8217379", "0.78965396", "0.78965396", "0.77025306", "0.76820433", "0.7624469", "0.761036", "0.75523615", "0.7551513", "0.7469211", "0.7465906", "0.73209625", "0.72563756", "0.71790355", "0.69336843", "0.69073874", "0.6833888", "0.6760494", "0.67246747", "0.66895914", "0.66...
0.7377561
11
Add the known body to the list
public void goBackToPlay(CelestialBody celestialBody) { M_PlayerData.getInstance().addKnownBody(celestialBody); // Set the currently visited planet to this one M_PlayerData.getInstance().setCurrPlanet(celestialBody); SceneManager.setCurrScene(new PlayScene()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void addBodyImpl( Body body );", "public CelestialBody add(CelestialBody body)\n throws UnhandledCelestialBodyException;", "public final void addBody( Body body )\n {\n if ( !this.bodies.contains( body ) )\n {\n this.bodies.add( body );\n add...
[ "0.7514656", "0.6836305", "0.6796697", "0.66743845", "0.63527745", "0.6315481", "0.6314213", "0.6233754", "0.6224379", "0.61850667", "0.6143105", "0.61174756", "0.6107501", "0.60843915", "0.6079971", "0.6079067", "0.60401064", "0.6026037", "0.6004466", "0.59564775", "0.587026...
0.0
-1
Get the scene instance
private void setupPlayerControls() { ExtendableScene currScene = SceneManager.getSceneParent(); // Controls for the player // Delegated to player controller currScene.setOnKeyPressed(PlayerController.get()::onKeyPressed); currScene.setOnKeyReleased(PlayerController.get()::onKeyReleased); // All mouse movement events (for turret rotation) view.getPane().setOnMouseMoved(view::changeMouseEvent); view.getPane().setOnMouseDragged(view::changeMouseEvent); // Setup player shooting view.getPane().setOnMousePressed(view::createBullet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Scene getScene(){\n return scene;\n }", "public static Scene getScene() {\n\t\tif (scene == null) {\n\t\t\tinitScene();\n\t\t}\n\t\treturn scene;\n\n\t}", "public Scene retrieveScene()\n {\n return gameStage.getScene();\n }", "public Scene getScene()\n {\n return scene;\n ...
[ "0.83439034", "0.82874864", "0.81015486", "0.78535235", "0.78521687", "0.779576", "0.77667147", "0.76805", "0.76015115", "0.7502247", "0.7223748", "0.7199764", "0.7175365", "0.714338", "0.69775164", "0.68129915", "0.6755902", "0.6685325", "0.65937597", "0.6589774", "0.6521347...
0.0
-1
Animation timer for player movement
private void setupAnimationTimer() { new AnimationTimer() { @Override public void handle(long l) { view.movePlayer(); view.updateView(); } }.start(); // Timeline for UI stuff uiTimeline = new Timeline(); KeyFrame keyStart = new KeyFrame( Duration.seconds(0), e -> view.updateUI((1160 / distance) * 0.005) ); KeyFrame keyEnd = new KeyFrame(Duration.millis(5)); uiTimeline.getKeyFrames().addAll(keyStart, keyEnd); uiTimeline.setCycleCount(Timeline.INDEFINITE); uiTimeline.setAutoReverse(false); countdownTimer = new Timeline( new KeyFrame( Duration.seconds(distance - (1160 / distance) * 0.005), e -> journeyComplete() ) ); // Timeline for asteroids Timeline asteroidTimer = new Timeline( new KeyFrame(Duration.millis(2000), e -> model.AsteroidPool.spawn()) ); asteroidTimer.setCycleCount(Timeline.INDEFINITE); asteroidTimer.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void walking(final Player p){\n timerListener = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n //test to see if the player is currently jumping\n if(jumpState != 2){\n //if the player is not jum...
[ "0.70769167", "0.69772726", "0.67308336", "0.67155975", "0.670579", "0.655079", "0.6539143", "0.64824015", "0.6470951", "0.6413121", "0.64108616", "0.6370942", "0.63547635", "0.63267577", "0.6306176", "0.6301276", "0.6299094", "0.6297573", "0.62863076", "0.6254648", "0.625427...
0.70199156
1
Sets up a new SesameMGraph.
public SesameMGraph setUp(String testName) throws RepositoryException, IOException { final File dataDir= File.createTempFile("SesameGraph", "Test"); dataDir.delete(); dataDir.mkdirs(); cleanDirectory(dataDir); graph= new SesameMGraph(); graph.initialize(dataDir); //graph.activate(cCtx); return graph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Graph() {\r\n\t\tnodePos = new HashMap<Integer, Vec2D>();\r\n\t\tconnectionLists = new HashMap<Integer, List<Connection>>();\r\n\t\t//screenWidth = Config.SCREEN_WIDTH;\r\n\t}", "public Graph() {\r\n\t\tinit();\r\n\t}", "public Graphs() {\n graph = new HashMap<>();\n }", "public samJGraph()\n ...
[ "0.6336331", "0.6312268", "0.6293049", "0.6212147", "0.6153441", "0.5996722", "0.59593886", "0.5915313", "0.5839407", "0.57786673", "0.576391", "0.5744886", "0.57432395", "0.572677", "0.5714772", "0.5706195", "0.5698144", "0.56787324", "0.56677437", "0.56599534", "0.5626892",...
0.6828744
0
Tears down the SesameMGraph.
public void tearDown() throws RepositoryException { graph.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void shutdownMassiveGraph();", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing sessi...
[ "0.6746431", "0.6457153", "0.641792", "0.64047414", "0.6375863", "0.6343797", "0.6192592", "0.61754775", "0.61228096", "0.6120931", "0.60957736", "0.6021747", "0.6011301", "0.6004563", "0.59984463", "0.5976256", "0.5957791", "0.5950299", "0.59499055", "0.5940274", "0.5914492"...
0.0
-1
Cleans the content of the specified directory recursively.
private void cleanDirectory(File dir) { File[] files= dir.listFiles(); if (files!=null && files.length>0) { for (File file: files) { delete(file); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void cleanDirectory(File dir) {\n if (dir.isDirectory()) {\n for (File f : dir.listFiles()) {\n cleanDirectory( f );\n }\n }\n dir.delete();\n }", "private void emptyDirectory(File dir){\n\n for (File file : Objects.requireNonNull(...
[ "0.69367397", "0.6860781", "0.657672", "0.6529941", "0.65037066", "0.64709204", "0.6460337", "0.64513606", "0.64343315", "0.64187837", "0.63739043", "0.6221994", "0.6147974", "0.6133527", "0.6120153", "0.6111219", "0.61055243", "0.6068884", "0.60301924", "0.59941936", "0.5985...
0.69271535
1
Deletes the specified file or directory.
private void delete(File file) { if (file.isDirectory()) { cleanDirectory(file); } file.delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteFile(FsPath path);", "public void deleteFile(File f);", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "public boolean delete(S...
[ "0.76978916", "0.7491678", "0.73087513", "0.7122125", "0.7119734", "0.71066266", "0.70178485", "0.7011207", "0.6983791", "0.69394517", "0.69109946", "0.6851014", "0.68416226", "0.6775642", "0.6750147", "0.6738102", "0.6706748", "0.66922814", "0.6659294", "0.66490597", "0.6629...
0.64789295
31
Converts the specified triple Iterator into a collection.
public static Collection<Triple> toCollection(Iterator<Triple> i) { LinkedList<Triple> list= new LinkedList<Triple>(); while (i.hasNext()) { list.add(i.next()); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IndexedImmutableGraph(Iterator<Triple> tripleIter) {\n this.tripleCollection = new IndexedGraph(tripleIter);\n }", "public Iterator iterator() {\n maintain();\n return new MyIterator(collection.iterator());\n }", "public static <T> List<T> toList(Iterator<T> iterator)\n {\n Lis...
[ "0.5460443", "0.53297037", "0.5235926", "0.51830864", "0.51015496", "0.5089332", "0.5030728", "0.4937148", "0.4892064", "0.4873604", "0.48731536", "0.48701546", "0.4867987", "0.48514307", "0.47871172", "0.47766992", "0.47408876", "0.4739478", "0.4708794", "0.47011307", "0.468...
0.8032804
0
Content id for which you want the related content.
public Builder forContent(String contentId) { this.contentId = contentId; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getContentId();", "int getContentId();", "public Integer getContentId() {\n return contentId;\n }", "@Override\n\tpublic long getContent_id() {\n\t\treturn _contentupdate.getContent_id();\n\t}", "@java.lang.Override\n public int getContentId() {\n return contentId_;\n ...
[ "0.7866705", "0.7567799", "0.7374597", "0.72496206", "0.7234269", "0.72219104", "0.70387805", "0.66962886", "0.65256697", "0.64901793", "0.6447005", "0.6409668", "0.63900065", "0.6360793", "0.6354046", "0.6330157", "0.6309281", "0.6298827", "0.6271014", "0.61972696", "0.61086...
0.0
-1
User id for whom you want the related content.
public Builder byUser(String uid) { this.uid = uid; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public long getUserId() {\n return _partido.getUserId();\n }", "@Override\n public long getUserId() {\n return _usersCatastropheOrgs.getUserId();\n }", "public int getOwnUserId()\n {\n return this.ownUserId;\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn ...
[ "0.6693674", "0.66255623", "0.66015136", "0.65714854", "0.6499418", "0.6499418", "0.6470841", "0.6470841", "0.6470841", "0.6394552", "0.6394552", "0.6394552", "0.6394552", "0.6393937", "0.6376345", "0.6376345", "0.6376345", "0.63652384", "0.63652384", "0.6363737", "0.63444346...
0.0
-1
Language id of the related content. ex: Hindi hi, Kannada kn & etc
public Builder byLanguage(String language) { this.language = language; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getLangId();", "public Integer getLanguageId() {\r\n return languageId;\r\n }", "public String getLanguageKey();", "public String getLanguageId() {\r\n\t\treturn this.languageId;\r\n\t}", "Language findById(String id);", "io.dstore.values.IntegerValue getValueLanguageId();", "public La...
[ "0.7495984", "0.68665254", "0.6735882", "0.6710458", "0.66472226", "0.64309466", "0.6401251", "0.6395198", "0.63595", "0.6323766", "0.6307115", "0.6307115", "0.6307115", "0.63012505", "0.62844014", "0.6245705", "0.6245705", "0.6205839", "0.61184573", "0.60461766", "0.5992577"...
0.0
-1
Related contents results limit.
public Builder limit(long limit) { this.limit = limit; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setMaxResults(int limit);", "private void limitRows()\n {\n paginate(currentPage, getResultsPerPage());\n }", "public int getLimit() {\n return limit;\n }", "public int getLimit() {\r\n return limit;\r\n }", "public int getLimit() {\n return limit;\n }", "pub...
[ "0.6780722", "0.6707805", "0.6213834", "0.6169908", "0.6165343", "0.6165343", "0.6165343", "0.6124767", "0.6124767", "0.6091629", "0.6074819", "0.60746735", "0.60746735", "0.6063436", "0.605837", "0.6058022", "0.6058022", "0.6055699", "0.60401094", "0.6032258", "0.60275286", ...
0.0
-1
Creating service handler class instance
@Override protected Void doInBackground(Void... arg0) { ServiceHandler sh = new ServiceHandler(); // Making a request to url and getting response String playlist = sh.makeServiceCall(url, ServiceHandler.GET); if(playlist != null){ playlistID = playlist; Log.d("pla", playlistID); SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString("playlist-"+getArguments().getString("username")+"-youtube",playlist); editor.commit(); String posts = sh.makeServiceCall("http://thewotimes.com/Y/current.php?user="+getString(R.string.uniser)+"&type=youtube&get=true", ServiceHandler.GET); res = posts; Log.d("stuff", posts); if (posts != null) { try { String filename = getArguments().getString("username")+"-youtube.txt"; String string = posts; FileOutputStream outputStream; try { outputStream = MainActivity.getAppContext().openFileOutput(filename, Context.MODE_PRIVATE); outputStream.write(string.getBytes()); outputStream.close(); } catch (Exception e) { e.printStackTrace(); } JSONArray t = new JSONArray(posts); // Log.d("length", ""+t.length()); for (int i = 0 ; i < t.length(); i++) { JSONObject playlist_dict = t.getJSONObject(i); // NSString *p =[[[[playlist_dict objectForKey:@"items"] objectAtIndex:0] objectForKey:@"snippet"] valueForKey:@"playlistId"]; String p = playlist_dict.getJSONArray("items").getJSONObject(0).getJSONObject("snippet").getString("playlistId"); // Log.d("p", p); if(p.equals(playlist)){ json_dic = playlist_dict; } // do some work here on intValue } items = json_dic.getJSONArray("items"); String nextToken = json_dic.get("nextPageToken").toString(); nextPageToken = nextToken; } catch (JSONException e) { e.printStackTrace(); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateHandler()\n {\n }", "public InternalNameServiceHandler() {\n }", "public GenericHandler() {\n\n }", "@Override\n public java.lang.AutoCloseable createInstance() {\n logger.info(\"Creating the Registry Handler Implementation Instance...\");\n\n DataBroker dataBrokerService =...
[ "0.75162107", "0.7258091", "0.6739117", "0.66412854", "0.65841633", "0.6574419", "0.6513665", "0.64903134", "0.64754814", "0.63773835", "0.6354596", "0.6351367", "0.63301486", "0.6324524", "0.62904763", "0.6282285", "0.62756526", "0.6274459", "0.625382", "0.6220213", "0.62055...
0.0
-1
When clicked, show a toast with the TextView text or do whatever you need.
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try { JSONObject temp_items = items.getJSONObject(position); String ida = temp_items.getJSONObject("snippet").getJSONObject("resourceId").getString("videoId"); // MainActivity.setYoutubeVideo(ida); // getActivity().getActionBar().hide(); Intent intent = new Intent(MainActivity.getAppContext(), YoutubeActivity.class); Bundle extras = new Bundle(); extras.putString("vidid", ida); Log.d("A", position + ""); intent.putExtras(extras); startActivity(intent); } catch (JSONException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View v) {\n String toastText = \"Hello World\";\n\n // This is how long we want to show the toast\n int duration = Toast.LENGTH_SHORT;\n\n // Get the context\n Context context = getApplicationConte...
[ "0.7825363", "0.77406174", "0.7539003", "0.7409347", "0.7378426", "0.73124695", "0.7293316", "0.7275178", "0.7244123", "0.7208238", "0.71937823", "0.7175023", "0.71101505", "0.7085779", "0.7068756", "0.7068285", "0.7065549", "0.7035961", "0.7033898", "0.7022557", "0.7002013",...
0.0
-1
Get the data item for this position
@Override public View getView(int position, View convertView, ViewGroup parent) { YoutubeCell cell = getItem(position); // Check if an existing view is being reused, otherwise inflate the view if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.youtuber_layout, parent, false); } // Lookup view for data population ImageView yimg = (ImageView)convertView.findViewById(R.id.youtube_image); TextView t = (TextView) convertView.findViewById(R.id.youtube_title); Picasso.with(getContext()).load(cell.theImage).into(yimg); t.setText(cell.theTitle); // Populate the data into the template view using the data object // Return the completed view to render on screen return convertView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Item getData()\r\n\t{\r\n\t\treturn theItem;\r\n\t}", "public E getData(int pos) {\n\t\tif (pos >= 0 && pos < dataSize()) {\n\t\t\treturn data.get(pos);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn mDatas.get(position);\n\t\t}",...
[ "0.7668654", "0.731151", "0.72089416", "0.71677965", "0.7130208", "0.7076344", "0.70645505", "0.70532256", "0.7042189", "0.7042189", "0.7042189", "0.70360523", "0.7032629", "0.6959", "0.6956786", "0.6956786", "0.69467556", "0.69467556", "0.69104123", "0.6871041", "0.6827699",...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { finish(); return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.79039484", "0.78061193", "0.7765948", "0.772676", "0.76312095", "0.76217103", "0.75842994", "0.7530533", "0.748778", "0.7458179", "0.7458179", "0.7438179", "0.74213266", "0.7402824", "0.7391232", "0.73864055", "0.7378979", "0.73700106", "0.7362941", "0.73555434", "0.734530...
0.0
-1
onPostExecute muestra el resultado de AsyncTask.
@Override protected void onPostExecute(String result) { imprime(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t protected void onPostExecute(String result) {\n\t }", "protected void onPostExecute(String result) {\n }", "protected void onPostExecute(String result) {\r\n\r\n\t\t}", "@Override\n protected void onPostExecute(String result) {\n }", "@Override\n protected void onPostExecu...
[ "0.7849769", "0.7842368", "0.78373325", "0.7783752", "0.7778886", "0.7778886", "0.7778886", "0.77631074", "0.77631074", "0.77219886", "0.7664888", "0.76597893", "0.76597893", "0.76597893", "0.7655948", "0.7648587", "0.76460505", "0.76460505", "0.7637873", "0.7612863", "0.7612...
0.6864514
100
wrong url changes to "" removes trailing slash
public Link(String url) { try { uri = new URL(fix(url)).toURI(); } catch (Exception e) { uri = URI.create(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String handleUrl(String s) {\n if (s.endsWith(\"/..\")) {\n int idx = s.lastIndexOf('/');\n s = s.substring(0, idx - 1);\n idx = s.lastIndexOf('/');\n String gs = s.substring(0, idx);\n if (!gs.equals(\"smb:/\")) {\n s = gs...
[ "0.69043016", "0.68320066", "0.6740054", "0.67285275", "0.65973175", "0.65639883", "0.6520049", "0.6419029", "0.6312326", "0.6268828", "0.6242955", "0.6235392", "0.6223131", "0.62149507", "0.6185221", "0.614534", "0.6136263", "0.6122012", "0.61169153", "0.6114378", "0.603307"...
0.0
-1
get the start_c corresponding to the cell
public char getStart(){ return start_c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getStartCell() {\r\n\t\tint extraCells = (getContentHeight() - getViewableHeight()) / CELL_SIZE_Y;\r\n\t\tif (getContentHeight() < getViewableHeight()) {\r\n\t\t\textraCells = 0;\r\n\t\t}\r\n\t\treturn (int) ((float) extraCells * ((float) _curScrollValue / (float) _maxScrollValue));\r\n\t}", "public ...
[ "0.7455353", "0.6726554", "0.6465985", "0.6444423", "0.64309716", "0.6231388", "0.6163395", "0.6144555", "0.6132791", "0.6105799", "0.60697246", "0.6052605", "0.60189545", "0.5985163", "0.59789807", "0.5943605", "0.5925406", "0.5917595", "0.58865786", "0.587913", "0.58719474"...
0.67731464
1
get the current_c corresponding to the cell
public char getCurrent(){ return current_c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int getLastCageCellValue(int row, int col);", "public Object getCurrentCellX() {\n\t\treturn x;\n\t}", "public CCode getC() {\n \t\treturn c;\n \t}", "public int getC() {\n return c_;\n }", "public int getC() {\n return c_;\n }", "public int getPosition(){\n\t\treturn ...
[ "0.6823099", "0.6811165", "0.67757803", "0.6670152", "0.6663266", "0.6574716", "0.6510471", "0.64821076", "0.6417597", "0.6402588", "0.6401834", "0.63891673", "0.63537264", "0.632174", "0.6315225", "0.631277", "0.6298026", "0.6230265", "0.62270314", "0.6220453", "0.6205427", ...
0.7199303
0
add new check calculated for next_c of the string which starts with start_c, and where, character before next_c is current_c nextPos is index of arrayList, since it is easier than using character index
public void addCheck(char next_c, int check){ int nextPos = next_c - 'a'; // check if mentioned check already exists in the check_list(nextPos) ArrayList<Integer> list = check_list.get(nextPos); if(!list.contains(check)){ // if check does not exists, add it in the check_list(nextPos) check_list.get(nextPos).add(check); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Integer> getCheckList(char next_c){\n return check_list.get(next_c-'a');\n }", "public boolean matches(char cNext) {\n int nIndex = 0;\n while (nIndex < m_cBuffer.length - 1)\n m_cBuffer[nIndex] = m_cBuffer[++nIndex];\n // save the new ch...
[ "0.60958594", "0.56518424", "0.5549084", "0.543158", "0.5380416", "0.537464", "0.5368098", "0.53329974", "0.53281224", "0.5302976", "0.52169394", "0.52100813", "0.52046824", "0.5200872", "0.5194225", "0.5174276", "0.51732045", "0.5123761", "0.5111421", "0.5103168", "0.5083421...
0.66237575
0
return the check_list for next_c character next_c
public ArrayList<Integer> getCheckList(char next_c){ return check_list.get(next_c-'a'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCheck(char next_c, int check){\n int nextPos = next_c - 'a'; \n // check if mentioned check already exists in the check_list(nextPos)\n ArrayList<Integer> list = check_list.get(nextPos);\n if(!list.contains(check)){\n // if check does not exists, add i...
[ "0.6884989", "0.6660382", "0.5841286", "0.5743287", "0.5732707", "0.54281265", "0.54108894", "0.52868015", "0.52489114", "0.52391404", "0.5147527", "0.5136137", "0.5095563", "0.50450444", "0.49819818", "0.49331075", "0.49283978", "0.49271682", "0.49256423", "0.491187", "0.490...
0.8456242
0
arrange all the check's in the check_list
public void arrange(Order order){ for(int i=0; i<26; ++i){ // arrange list of list; list by list ArrayList<Integer> list = check_list.get(i); for(int j=0; j<list.size(); ++j ){ if(order == Order.ASCENDING){ // ascending order for(int k=i; k<list.size()-1; ++k){ int num1= list.get(k); int num2= list.get(k+1); // ascending order if(num2<num1){ // swap list.set(k, num2); list.set(k+1, num1); } } }else if(order == Order.DESCENDING){ // descending order for(int k=i; k<list.size()-1; ++k){ int num1= list.get(k); int num2= list.get(k+1); // descending order if(num2>num1){ // swap list.set(j, num2); list.set(k, num1); } } } } // put arranged list, back in its place check_list.set(i, list); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void armarListaCheck() {\n listaCheck = new ArrayList();\n listaCheck.add(chkBici);\n listaCheck.add(chkMoto);\n listaCheck.add(chkAuto);\n }", "private static List<Integer> reorganize(List<Integer> result){\n List<Integer> outcome=new ArrayList<>();\n result....
[ "0.6079934", "0.59181476", "0.5869833", "0.58031297", "0.5749567", "0.5645236", "0.5636886", "0.55898154", "0.55120903", "0.5509426", "0.5480763", "0.5460998", "0.54496884", "0.5447102", "0.54376215", "0.5413555", "0.540752", "0.5392968", "0.5392003", "0.5354744", "0.53420067...
0.6481407
0
/Intent intent = new Intent(getApplicationContext(), NewProductDetailActivity.class); intent.putExtra("position",position); startActivity(intent);
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View v)\n {\n Log.d(TAG, \"onItemClick | position = \" + position);\n Intent intent = new Intent(mContext, OrderDetailActivity.class);\n intent.putExtra(StoreConstant.ORDER_TYPE, StoreConstant.ORDER_SHOW);\n ...
[ "0.7951607", "0.7909762", "0.7636695", "0.7598678", "0.7583452", "0.74835724", "0.7482053", "0.7454036", "0.74418366", "0.74365664", "0.7422227", "0.7407504", "0.7405983", "0.73812336", "0.7360356", "0.73376876", "0.73335636", "0.7295153", "0.72823536", "0.72708476", "0.72636...
0.0
-1
EntityManagerFactory emf = Persistence.createEntityManagerFactory("facturacionPU"); EntityManager em = emf.createEntityManager();
public void guardarProducto(Producto producto, EntityManager em) { EntityTransaction etx = em.getTransaction(); try { etx.begin(); em.persist(producto); etx.commit(); } catch (Exception e) { em.getTransaction().rollback(); LOGGER.error(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "EntityManager createEntityManager();", "EMInitializer() {\r\n try {\r\n emf = Persistence.createEntityManagerFactory(\"pl.polsl_MatchStatist\"\r\n + \"icsWeb_war_4.0-SNAPSHOTPU\");\r\n em = emf.createEntityManager();\r\n } catch (Exception e) {\r\n ...
[ "0.778156", "0.7299347", "0.718167", "0.689175", "0.6785555", "0.67158735", "0.6715575", "0.6668984", "0.6625837", "0.658827", "0.6578557", "0.65609664", "0.6461624", "0.6447879", "0.6391606", "0.6388376", "0.6329028", "0.6308923", "0.6295238", "0.6278684", "0.62422305", "0...
0.56985146
88
creates a new parser object for the given file
public SqlFileParser(File sqlScript) { try { this.reader = new BufferedReader(new FileReader(sqlScript)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("file not found " + sqlScript); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "publ...
[ "0.78862715", "0.73792875", "0.7141527", "0.6868034", "0.6716605", "0.6709968", "0.66685486", "0.66608083", "0.66329825", "0.66045976", "0.6573198", "0.65517956", "0.6533502", "0.6506598", "0.6484793", "0.6457127", "0.6431254", "0.6383456", "0.62541354", "0.6239772", "0.62319...
0.5648518
68
creates a new parser object for the given filename
public SqlFileParser(String filename) { try { this.reader = new BufferedReader(new FileReader(filename)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("file not found " + filename); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "publ...
[ "0.7380303", "0.7276484", "0.70246154", "0.6977238", "0.6818986", "0.674782", "0.67348456", "0.66068304", "0.6565904", "0.6489775", "0.6470226", "0.63538665", "0.63276625", "0.6228586", "0.62029725", "0.61422044", "0.6123134", "0.61224633", "0.61120254", "0.6060136", "0.60488...
0.6593031
8
creates a new parser object for the given input steam
public SqlFileParser(InputStream stream) { this.reader = new BufferedReader(new InputStreamReader(stream)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;...
[ "0.74408096", "0.71443796", "0.69569933", "0.69278055", "0.674166", "0.65531695", "0.6546578", "0.64104706", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.63854283", "0.63594365", "0.63443387", "0.63443387", "0.63443387", ...
0.0
-1
read the file line per line: strip comments split on ';' concatenate multipleline statements
public List<String> parse() { String line = null; int lineCounter = 0; StringBuilder statement = new StringBuilder(); List<String> statements = new LinkedList<String>(); Pattern commentPattern = Pattern.compile("(//|#|--)+.*$"); try { while ((line = reader.readLine()) != null) { lineCounter++; //strip comment up to the first non-comment Matcher m = commentPattern.matcher(line); if (m.find()) { line = line.substring(0, m.start()); } //remove leading and trailing whitespace statement.append(" "); line = statement.append(line).toString(); line = line.replaceAll("\\s+", " "); line = line.trim(); //split by ; //Note: possible problems with ; in '' String[] tokens = line.split(";"); //trim the tokens (no leading or trailing whitespace for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].trim(); } boolean containsSemicolon = line.contains(";"); boolean endsWithSemicolon = line.endsWith(";"); if (!containsSemicolon) { //statement is still open, do nothing continue; } if (tokens.length == 1 && endsWithSemicolon) { //statement is complete, semicolon at the end. statements.add(tokens[0]); statement = new StringBuilder(); continue; } // other cases must have more than 1 token //iterate over tokens (but the last one) for (int i = 0; i < tokens.length - 1; i++) { statements.add(tokens[0]); statement = new StringBuilder(); } //last statement may remain open: if (endsWithSemicolon) { statements.add(tokens[0]); statement = new StringBuilder(); } else { statement = new StringBuilder(); statement.append(tokens[tokens.length - 1]); } } if (statement != null && statement.toString().trim().length() > 0) throw new UnclosedStatementException("Statement is not closed until the end of the file."); } catch (IOException e) { logger.warn("An error occurred!", e); } finally { try { reader.close(); } catch (IOException e) { logger.warn("An error occurred!", e); } } return statements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void cleanComments() throws IOException {\n boolean parsingComment = false;\n PrintWriter writer = new PrintWriter(\"clean.txt\", \"UTF-8\");\n ArrayList<String> symbols = new ArrayList<String>();\n String c = String.valueOf((char) _br.read());\n symbols.add(c);\n ...
[ "0.59679884", "0.5964931", "0.5956872", "0.58128816", "0.58127356", "0.5773285", "0.5708144", "0.5655276", "0.56383777", "0.55492306", "0.5537363", "0.5533021", "0.5520777", "0.54695797", "0.5455733", "0.54406357", "0.5417821", "0.54162425", "0.54084224", "0.5383615", "0.5373...
0.6325452
0
TODO Autogenerated method stub
public static String sendEmail(String fromId,String toId, String subject, String emailBody) { System.out.println("Test"); CloseableHttpClient httpClient=null; Base64.Encoder encoder = Base64.getEncoder(); String attachmentStr = encoder.encodeToString(subject.getBytes()); try{ httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost("https://api.sendgrid.com/v3/mail/send"); httpPost.setHeader("content-type", "application/json"); //httpPost.setHeader("accept", "application/json"); httpPost.setHeader("YOUR_API_KEY", "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"); httpPost.setHeader("Authorization", "Bearer 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"); String jsonStr="{\r\n" + " \"personalizations\": [\r\n" + " {\r\n" + " \"to\": [\r\n" + " {\r\n" + " \"email\": \""+toId+"\"\r\n" + " }\r\n" + " ],\r\n" + " \"subject\": \""+subject+"\"\r\n" + " }\r\n" + " ],\r\n" + " \"from\": {\r\n" + " \"email\": \""+fromId+"\"\r\n" + " },\r\n" + " \"content\": [\r\n" + " {\r\n" + " \"type\": \"text/plain\",\r\n" + " \"value\": \""+emailBody+"\"\r\n" + " }\r\n" + " ],\r\n" + "\"attachments\":[ {\"content\":\""+attachmentStr+"\", \"filename\":\"attachment.txt\", \"disposition\":\"attachment\"} ]"+ "}"; StringEntity jsonString =new StringEntity(jsonStr); httpPost.setEntity(jsonString); StringBuilder sb = new StringBuilder(); HttpResponse response = httpClient.execute(httpPost); BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String inputLine = null; while ((inputLine = br.readLine()) != null) { sb.append(inputLine); } httpClient.close(); System.out.println(sb.toString()); //return sb.toString(); }catch(Exception e){ e.printStackTrace(); } return "1"; }
{ "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 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DumpLog.Init(this); setContentView(R.layout.activity_main); Button btnStartup = (Button)findViewById(R.id.btnStartup); btnStartup.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub DumpLog.LOGD("btnStartup onClick"); PackageManager packageManager = getPackageManager(); Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent = packageManager.getLaunchIntentForPackage("com.tencent.tmgp.hhw"); startActivity(intent); } }); Spinner spinner = (Spinner) findViewById(R.id.spinner); //数据 List<String> data_list = new ArrayList<String>(); data_list.add("com.tencent.tmgp.hhw"); //适配器 ArrayAdapter<String> arr_adapter= new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, data_list); //设置样式 arr_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //加载适配器 spinner.setAdapter(arr_adapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View v) { DumpLog.LOGD("btnStartup onClick"); PackageManager packageManager = getPackageManager(); Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent = packageManager.getLaunchIntentForPackage("com.tencent.tmgp.hhw"); startActivity(intent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.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
Created by qiuyd on 2020/2/16.
public interface IFlyAminal { void fly(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpu...
[ "0.5961039", "0.5897514", "0.5516217", "0.55090535", "0.55090535", "0.54945564", "0.54922366", "0.54875195", "0.54690987", "0.54647654", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54185855", "0.54023945", "0.5394271", "0.53909385", ...
0.0
-1
AudioClip audioClip = new AudioClip(String.valueOf(Main.class.getResource(musicFile))); audioClip.setCycleCount(Integer.MAX_VALUE); audioClip.play();
private static void playAudio(String musicFile) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void music (String fileName)\r\n {\r\n\tAudioPlayer MGP = AudioPlayer.player;\r\n\tAudioStream BGM;\r\n\tAudioData MD;\r\n\r\n\tContinuousAudioDataStream loop = null;\r\n\r\n\ttry\r\n\t{\r\n\t InputStream test = new FileInputStream (\"lamarBackgroundMusic.wav\");\r\n\t BGM = new AudioStream ...
[ "0.7364985", "0.7337618", "0.7271064", "0.7269717", "0.7229772", "0.71050924", "0.71040016", "0.70997304", "0.7016364", "0.69911385", "0.692494", "0.6915035", "0.69061357", "0.6903124", "0.6898342", "0.689202", "0.68827325", "0.68341696", "0.68326294", "0.6805048", "0.6794373...
0.68518144
17
Add the entity to the game universe
public UnmovableEntity(GameData data, Point position, String urlString) { this.data = data; this.canvas = data.getCanvas(); URL url = UnmovableEntity.class.getResource(urlString); this.image = new DrawableImage(url, this.canvas); this.position = position; this.data.getUniverse().addGameEntity(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addEntity(org.bukkit.entity.Entity entity) {\n\t\tEntity nmsentity = CommonNMS.getNative(entity);\n\t\tnmsentity.world.getChunkAt(MathUtil.toChunk(nmsentity.locX), MathUtil.toChunk(nmsentity.locZ));\n\t\tnmsentity.dead = false;\n\t\t// Remove an entity tracker for this entity if it was present\n...
[ "0.73113304", "0.7177397", "0.7111769", "0.69543624", "0.6927326", "0.6863991", "0.684597", "0.6824073", "0.6818374", "0.6757948", "0.6707371", "0.6698065", "0.66913927", "0.6680635", "0.6646311", "0.6641719", "0.659184", "0.65660256", "0.65527666", "0.6514255", "0.6505742", ...
0.0
-1
Draw the entity with the graphics, the image and the coordinates
@Override public void draw(Graphics g) { this.canvas.drawImage(g, this.image.getImage(), this.position.x, this.position.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "public voi...
[ "0.7716353", "0.75920004", "0.7414604", "0.7365129", "0.730389", "0.7148276", "0.69811124", "0.6974471", "0.6962596", "0.6952391", "0.68866897", "0.6871396", "0.6821766", "0.6770788", "0.67681456", "0.67422307", "0.67364633", "0.67088336", "0.67088336", "0.67088336", "0.67088...
0.7117642
6
Give the bounding box of the entity, it's a rectangle
@Override public Rectangle getBoundingBox() { Rectangle rectangle = new Rectangle(this.image.getWidth(), this.image.getWidth()); rectangle.setLocation(this.position); return rectangle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Rectangle getBoundingBox(Rectangle rect);", "public Rectangle getBoundingBox() {\n return new Rectangle(this);\r\n }", "public Rectangle getBoundingBox() {\n\t\treturn getBounds();\n\t}", "@Override\n\tpublic BoundaryRectangle getBoundingBox() {\n\t\treturn new BoundaryRectangle(0, 0, drawView.getW...
[ "0.8261532", "0.7713992", "0.76321113", "0.7533775", "0.7511512", "0.7468098", "0.7446029", "0.73271435", "0.7301499", "0.7296774", "0.72562844", "0.72562844", "0.72287315", "0.71629053", "0.71248955", "0.7120112", "0.7117591", "0.7108482", "0.7108482", "0.7108482", "0.710706...
0.76254934
3
Return false because by definition a UnmovableEntity cannot move
@Override public boolean isMovable() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"il...
[ "0.7459672", "0.72733265", "0.72301686", "0.7154673", "0.70622367", "0.705572", "0.7037916", "0.7000601", "0.6967378", "0.6955855", "0.69485927", "0.69370836", "0.6920007", "0.6911075", "0.6892916", "0.6889149", "0.6850046", "0.6816857", "0.680877", "0.67757154", "0.6775438",...
0.63923776
56
prints the game board; must be static
static void printBoard() { System.out.println("/---|---|---\\"); System.out.println("| " + board[0][0] + " | " + board[0][1] + " | " + board[0][2] + " |"); System.out.println("|-----------|"); System.out.println("| " + board[1][0] + " | " + board[1][1] + " | " + board[1][2] + " |"); System.out.println("|-----------|"); System.out.println("| " + board[2][0] + " | " + board[2][1] + " | " + board[2][2] + " |"); System.out.println("\\---|---|---/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printBoard() {\n\t\tSystem.out.println(\"Board:\");\r\n\t\tfor(int i=0; i<BoardSquare.numberOfSquare; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.print(String.format(\"%4s\", (i+1) + \":\"));\r\n\t\t\tif(BoardGame.board.get(i).isPlayerOne()) System.out.print(\" P1\"); \r\n\t\t\tif(BoardGame.board.get(...
[ "0.85774183", "0.8449436", "0.84132004", "0.834984", "0.8284499", "0.82622564", "0.8244837", "0.8236626", "0.8218346", "0.81959915", "0.81747806", "0.8153473", "0.8151843", "0.81483954", "0.8146779", "0.81166273", "0.81156707", "0.81034935", "0.8101362", "0.81008554", "0.8100...
0.8549281
1
Ex_6_Query_3 Get all suppliers that do not import parts from abroad. Get their id, name and the number of parts they can offer to supply.
@Query(value = "SELECT * " + "FROM suppliers as s\n" + "inner JOIN parts p on s.id = p.supplier_id\n" + "WHERE is_importer = false\n" + "GROUP BY s.id;",nativeQuery = true) List<Supplier> findAllThatDoNotImport();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List zipcodeWithSuppliersList() throws AdException {\r\n\t\t try {\r\n\t\t begin();\r\n\t\t Query q = getSession().createSQLQuery(\"select DISTINCT zipcode from Zipcode\");\r\n\t\t List list = q.list();\r\n\t\t commit();\r\n\t\t return list;\r\n\...
[ "0.6146872", "0.58566767", "0.5829563", "0.5754436", "0.5585512", "0.5554836", "0.55442023", "0.5462037", "0.54516315", "0.5417327", "0.541215", "0.5314491", "0.53071225", "0.5305741", "0.5304819", "0.5267095", "0.5245724", "0.52350897", "0.52206004", "0.52203655", "0.5214898...
0.63159835
0
Applies regex on each input in the file to figure out the valid ones.
public static boolean isValidinput(String query){ Pattern regex = Pattern.compile("[$&+,:;=@#|]"); Matcher matcher = regex.matcher(query); if (matcher.find()){ return false; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tStri...
[ "0.6269113", "0.61125535", "0.56649745", "0.5605596", "0.55189216", "0.5487509", "0.5484236", "0.5466741", "0.54514426", "0.5431776", "0.5424148", "0.5333047", "0.5295188", "0.52807355", "0.52669835", "0.5246023", "0.5237399", "0.51836556", "0.5162575", "0.5153242", "0.515285...
0.0
-1
Splits the query and returns an ArrayList containing only Roman numerals and elements
public static ArrayList<String> splitQuery(String query){ ArrayList<String> queryArray = new ArrayList<String>(Arrays.asList(query.split("((?<=:)|(?=:))|( )"))); int startIndex = 0, endIndex = 0; for (int i = 0; i < queryArray.size(); i++) { if(queryArray.get(i).toLowerCase().equals("is")){ startIndex = i+1; } else if(queryArray.get(i).toLowerCase().equals("?")){ endIndex = i; } } String[] array = queryArray.toArray(new String[queryArray.size()]); return new ArrayList<String>(Arrays.asList(java.util.Arrays.copyOfRange(array, startIndex, endIndex))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getIntergalacticToRomanNotes() {\n\t\tArrayList<String> intergacaticToRomanNotes = new ArrayList<String>();\n\t\t\n\t\t// Assumption: intergalactic numbers are in lower case only, \n\t\t// and roman numerals are in capitals only\n\t\tString validNoteRegex = \"^[a-z]+\\\\s+is\\\\s+[MDCLXVI]...
[ "0.5919523", "0.578325", "0.574752", "0.5706735", "0.5534275", "0.5315872", "0.5273251", "0.51787937", "0.5089135", "0.50606513", "0.5053324", "0.5024917", "0.49831706", "0.48840663", "0.48818558", "0.4863853", "0.4856856", "0.48549438", "0.48392856", "0.48387134", "0.4827585...
0.6009802
0
Formats the response to a query and displays it in readable format
public static String outputFormatter(ArrayList<String> output){ return output.toString().replace(",", "").replace("[", "").replace("]", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String answerQuery(Query query) {\r\n\t\tString reply = null;\r\n\t\tif(query != null){\r\n\t\t\tif(query.elements != null){\r\n\t\t\t\tArrayList<String> queryReply = query.elements;\r\n\t\t\t\tqueryReply.add(is);\r\n\t\t\t\tqueryReply.add(Float.toString(query.price));\r\n\t\t\t\t\r\n\t\t\t\tif(query.isCred...
[ "0.62613827", "0.55853355", "0.54873604", "0.5460785", "0.5460785", "0.54381484", "0.542633", "0.5359296", "0.5332751", "0.5315104", "0.5313741", "0.52890927", "0.52786", "0.5264329", "0.5251827", "0.5250201", "0.524712", "0.5219545", "0.52096725", "0.51691073", "0.5153547", ...
0.0
-1
Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report
@Test(groups = "Transactions Tests", description = "Create new transaction") public void createNewTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("Extra income"); TransactionsScreen.typeTransactionAmount("300"); TransactionsScreen.clickTransactionType(); TransactionsScreen.typeTransactionNote("Extra income from this month"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$300")); test.log(Status.PASS, "Sub-account created successfully and the value is correct"); //Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$300")); test.log(Status.PASS, "'Double Entry' account also have the transaction and the value is correct"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testAddTransaction(){\n setDoubleEntryEnabled(true);\n\t\tsetDefaultTransactionType(TransactionType.DEBIT);\n validateTransactionListDisplayed();\n\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeTe...
[ "0.6536693", "0.62100655", "0.60498476", "0.60071486", "0.5922749", "0.57999444", "0.57973224", "0.5789302", "0.5786915", "0.5722957", "0.5706464", "0.56923556", "0.5666513", "0.56641597", "0.5657025", "0.563548", "0.56064916", "0.5592608", "0.5573065", "0.55642", "0.55638427...
0.7106467
0
Editing an transaction, testing if it's visible with the new value and logging the result to the report
@Test(groups = "Transactions Tests", description = "Edit transaction") public void editTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickEditBtnFromTransactionItem("Extra income"); TransactionsScreen.typeTransactionDescription("Bonus"); TransactionsScreen.typeTransactionAmount("600"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Bonus").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$600")); test.log(Status.PASS, "Sub-account edited successfully and the value is correct"); //Testing if the edited transaction was edited in the 'Double Entry' account, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("Bonus").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$600")); test.log(Status.PASS, "Transaction in the 'Double Entry' account was edited too and the value is correct"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onEditTransaction(Transaction transaction) {\n\t}", "@Override\n\t\tpublic boolean update(AccountTransaction t) {\n\t\t\treturn false;\n\t\t}", "void editTransaction(ITransaction trans, ItemInterface tradeItem, String time, String place\n , String tradeType, IUserAccount user);", "priv...
[ "0.6417807", "0.6114119", "0.61056644", "0.60342664", "0.5980264", "0.58972555", "0.5755415", "0.57468027", "0.5733633", "0.5728225", "0.5623526", "0.55984074", "0.55520594", "0.552433", "0.55224323", "0.5502259", "0.547705", "0.5461646", "0.54261196", "0.5414276", "0.5407738...
0.73645914
0
Duplicating an transaction, testing if there is two identical transactions and logging the result to the report
@Test(groups = "Transactions Tests", description = "Duplicate transaction") public void duplicateTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDuplicateTransactionOption(); TransactionsScreen.transactionItens("Bonus").shouldHave(size(2)); test.log(Status.PASS, "Transaction successfully duplicated"); //Testing if there is two identical transactions in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItens("Bonus").shouldHave(size(2)); test.log(Status.PASS, "Transaction successfully duplicated in the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void testSameObjectEquals() {\n final Transaction copy = testTransaction1;\n assertTrue(testTransaction1.equals(copy)); // pmd doesn't like either\n // way\n\n }", "@Test\n public void processTestA()\n {\n acc_db.addAcco...
[ "0.63687694", "0.6106939", "0.6065073", "0.5903291", "0.575435", "0.5745094", "0.569909", "0.56916356", "0.56742746", "0.5672573", "0.56640047", "0.56400955", "0.56331277", "0.5626508", "0.5623507", "0.5604464", "0.559845", "0.5581869", "0.5569591", "0.5538824", "0.5535129", ...
0.75571835
0
Deleting an transaction, testing if there no transaction and logging the result to the report
@Test(groups = "Transactions Tests", description = "Delete transaction") public void deleteTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.transactionItens("Edited Transaction test").shouldHave(size(0)); test.log(Status.PASS, "Transaction successfully deleted"); //Testing if there no transaction in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItens("Bonus").shouldHave(size(0)); test.log(Status.PASS, "Transaction successfully deleted from the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean delete(Transaction transaction) throws Exception;", "@Override\n\tpublic void deleteTransaction(Transaction transaction) {\n\n\t}", "public void deleteTransactionById(int id);", "public void deleteTransaction() {\n\t\tconn = MySqlConnection.ConnectDb();\n\t\tString sqlDelete = \"delete from Ac...
[ "0.7609447", "0.71998453", "0.70170695", "0.6954799", "0.6895283", "0.6690905", "0.655995", "0.62845415", "0.6278361", "0.62639445", "0.62284076", "0.6181802", "0.6180325", "0.61801773", "0.6143982", "0.6126395", "0.6110589", "0.61062056", "0.6096468", "0.6078374", "0.5996784...
0.7131652
2
Creating a new transaction, testing if its visible, if the value is correct and logging the result to the report
@Test(groups = "Transactions Tests", description = "Transaction Calculation") public void transactionCalculation() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("Extra income"); TransactionsScreen.typeTransactionAmount("100"); TransactionsScreen.clickTransactionType(); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$100")); test.log(Status.PASS, "Transaction created successfully and the value is correct"); //Creating another transaction, testing if its visible, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Expenses"); SubAccountScreen.clickSubAccountItem("Books"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("How to become a good QA Engineer book"); TransactionsScreen.typeTransactionAmount("50"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("How to become a good QA Engineer book").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$50")); test.log(Status.PASS, "Second transaction created successfully and the value is correct"); //Testing if the calculation is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.transactionAmoutFromSubAccountItem("Cash in Wallet").shouldHave(text("$50")); test.log(Status.PASS, "Calculation is correct"); //Deleting both transactions for app cleanup and logging the result to the report SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Extra income"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.clickOptionsBtnFromTransactionItem("How to become a good QA Engineer book"); TransactionsScreen.clickDeleteTransactionOption(); test.log(Status.PASS, "Transactions deleted successfully"); //Testing if both transactions were deleted from the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.transactionAmoutFromSubAccountItem("Cash in Wallet").shouldHave(text("$0")); test.log(Status.PASS, "Transactions from the 'Double Entry' account deleted successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(groups = \"Transactions Tests\", description = \"Create new transaction\")\n\tpublic void createNewTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDesc...
[ "0.70256174", "0.64621663", "0.620057", "0.6059172", "0.6005508", "0.58925414", "0.58261156", "0.580826", "0.5775638", "0.56959265", "0.56824064", "0.5682304", "0.5663322", "0.56488544", "0.56428486", "0.5641981", "0.5624004", "0.55969757", "0.5596861", "0.55713403", "0.55652...
0.5671565
12
Creating a new account, testing if it's visible and logging the result to the report
@Test(groups = "Transactions Tests", description = "Delete account with Transaction") public void deleteAccountWithTransaction() { MainScreen.clickAddAccountBtn(); NewAccountScreen.typeAccountName("Freelance jobs"); NewAccountScreen.clickAccountColor(); NewAccountScreen.clickColorOption(); NewAccountScreen.typeAccountDescription("Account to control my freelance jobs money"); NewAccountScreen.clickPlaceholderAccountOption(); NewAccountScreen.clickSaveBtn(); MainScreen.accountItem("Freelance jobs").shouldBe(visible); test.log(Status.PASS, "Account created successfully"); //Creating a new sub-account, testing if it's visible and logging the result to the report MainScreen.clickAccountItem("Freelance jobs"); SubAccountScreen.clickAddSubAccountBtn(); NewAccountScreen.typeAccountName("Test Automation jobs"); NewAccountScreen.clickAccountColor(); NewAccountScreen.clickColorOption(); NewAccountScreen.typeAccountDescription("Sub-account to control meu Test Automation freelance jobs"); NewAccountScreen.clickSaveBtn(); SubAccountScreen.subAccountItem("Test Automation jobs").shouldBe(visible); test.log(Status.PASS, "Sub-account created successfully"); //Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report SubAccountScreen.clickSubAccountItem("Test Automation jobs"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("N26 Home Task"); TransactionsScreen.typeTransactionAmount("250"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("N26 Home Task").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$250")); test.log(Status.PASS, "Transaction created and the value is correct"); //Testing if the transaction was created in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("N26 Home Task").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$250")); test.log(Status.PASS, "Transaction in the 'Double Entry' account created and the value is correct"); //Deleting the account with the transaction, testing if it's not listed and logging the result to the report returnToHomeScreen(); MainScreen.clickOptionsBtnFromAccountItem("Freelance jobs"); MainScreen.clickDeleteAccountOption(); MainScreen.clickDeleteTransactionRadioOption(); MainScreen.clickDeleteBtn(); MainScreen.accountItem("Freelance jobs").shouldNotBe(visible); test.log(Status.PASS, "Account and Transaction deleted successfully"); //Testing if the transaction were deleted from the 'Double Entry' account and logging the result to the report MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("N26 Home Task").shouldNotBe(visible); test.log(Status.PASS, "Transaction deleted successfully from the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "@Test\n\tpublic void createAccount() {\t\n\t\t\n\t\tRediffOR.setCreateAccoutLinkClick();\n\t\tRediffOR.getFullNameTextField().sendKeys(\"Kim Smith\");\n\t\tRediffOR.getEmailIDTextField().sendKeys(\"Kim Smith\");\n\t\t\t\t\t\...
[ "0.73140806", "0.7223947", "0.71283185", "0.6842713", "0.6816629", "0.68144506", "0.6659177", "0.6649392", "0.659907", "0.65895915", "0.6542764", "0.6526161", "0.6428114", "0.63601124", "0.6347817", "0.6318162", "0.6275739", "0.62695664", "0.6247896", "0.6233415", "0.6220047"...
0.0
-1
Instantiates a new Dictionary pair.
DictionaryPair (K someKey , V someValue) { this.key = someKey; this.value = someValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dictionary createDictionary(){\n Dictionary dict = new Dictionary(9973);\n return dict;\n }", "public static final HashMap dict (Object ... pairs) {\r\n HashMap map = new HashMap();\r\n for (int i=0; i<pairs.length; i=i+2) {\r\n map.put(pairs[i], pairs[i+1]);\r\n ...
[ "0.7101338", "0.68039674", "0.6574625", "0.6433278", "0.6343924", "0.62561226", "0.62349534", "0.6229912", "0.6176179", "0.6165443", "0.6002332", "0.5954013", "0.5917588", "0.58613664", "0.5851697", "0.5770473", "0.5721529", "0.5720304", "0.5714059", "0.5684827", "0.56767493"...
0.71542233
0
Sets key. Actually, we don't use this function.
public void setKey(K newKey) { this.key = newKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setKey(java.lang.String key);", "void setKey(final String key);", "private void setKey(String key) {\n this.key = key;\n }", "void setKey(String key);", "public void setKey(final String key);", "public void setKey(final String key);", "private void setKey(String key){\n\t\tthis.key=key;\...
[ "0.83833957", "0.8341458", "0.83083117", "0.83046573", "0.8302332", "0.8302332", "0.82819116", "0.82662946", "0.8229606", "0.81961906", "0.8171741", "0.8119748", "0.8111704", "0.81113297", "0.8081525", "0.8081525", "0.8068404", "0.8068404", "0.8068404", "0.806707", "0.8066728...
0.7476585
40
Sets new value via key.
public void setValue(V newValue) { this.value = newValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(K key, V value);", "void set(K key, V value);", "void set(String key, Object value);", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "final <T> void se...
[ "0.8000552", "0.7963359", "0.75919294", "0.75058055", "0.7436106", "0.7349112", "0.7337807", "0.72984815", "0.7286553", "0.723537", "0.7155324", "0.71493953", "0.710588", "0.70861655", "0.7070242", "0.70453584", "0.7031449", "0.7031449", "0.7021766", "0.70178306", "0.70132625...
0.0
-1
Compare two keys same or not.
@Override public int compareTo(DictionaryPair o) { return this.key.compareTo(o.key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Acquirente)) {\n return false;\n }\n Acquirente that = (Acquirente) other;\n if (this.getIdacquirente() != that.getIdacquirente()) {\n ...
[ "0.74812675", "0.7382617", "0.72286236", "0.7175957", "0.71175873", "0.69519955", "0.6950424", "0.69211733", "0.6864309", "0.67182225", "0.66599005", "0.66293484", "0.6616995", "0.65696084", "0.64817", "0.6468629", "0.64584273", "0.6455308", "0.644449", "0.63863665", "0.63538...
0.5696551
55
Instantiates a new Dictionary. We use list to store Dictionary pair.
public Dictionary () { list = new DoubleLinkedList<>(); this.count = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dictionary createDictionary(){\n Dictionary dict = new Dictionary(9973);\n return dict;\n }", "public void createHashMap() {\n myList = new HashMap<>();\n scrabbleList = new HashMap<>();\n }", "public Dictionary()\n\t{\n\t\tfor(Character i = 97; i<=122;i++)\n\t\t\tthis....
[ "0.75309145", "0.67487067", "0.6615284", "0.647563", "0.6419831", "0.62873524", "0.623641", "0.6140169", "0.60297287", "0.6003227", "0.59901255", "0.5949612", "0.5921554", "0.5919194", "0.590509", "0.58904195", "0.5862454", "0.58187425", "0.57981676", "0.57840586", "0.5753141...
0.72412765
1
Add key and value to the dictionary pair. It the key exits, update the value.
public void add(K key,V value) { DictionaryPair pair = new DictionaryPair(key,value); int index = findPosition(key); if (index!=DsConst.NOT_FOUND) { list.set(index,pair); } else { list.addLast(pair); this.count++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V add(K key, V value)\n { \n checkInitialization();\n if ((key == null) || (value == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null; \n int keyIndex = locateIndex(key); \n ...
[ "0.72074616", "0.7111181", "0.70679516", "0.692424", "0.6875344", "0.6859261", "0.68395656", "0.6832421", "0.6803037", "0.67540437", "0.6735782", "0.6714019", "0.6675324", "0.6675324", "0.6664614", "0.6660028", "0.6657366", "0.66384697", "0.6629542", "0.66178554", "0.66171545...
0.73446196
0
Sets value. Add key and value to the dictionary pair. It the key exits, update the value.
public void setValue(K key, V value) { this.add(key, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(K key, V value);", "public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}", "public void put(Key key, Value val);", "private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueS...
[ "0.7777818", "0.7341793", "0.7244698", "0.723383", "0.7110498", "0.70105976", "0.6992011", "0.6790107", "0.6764305", "0.675715", "0.67502606", "0.6746778", "0.6740471", "0.67393017", "0.6716575", "0.6670988", "0.66674", "0.66403437", "0.6639613", "0.66325945", "0.66317284", ...
0.7723468
1
Gets value. Input a key, and return the corresponding value. If the key doesn't exist, return null
public V getValue(K key) { int i = findPosition(key); if (i==DsConst.NOT_FOUND) { return null; } DictionaryPair p = list.get(i); return p.getValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V get(K key) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n V result = null;\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n result = node.getD...
[ "0.80932856", "0.79579484", "0.7903351", "0.7874939", "0.7773788", "0.77470875", "0.77176225", "0.7670111", "0.76642424", "0.7634628", "0.7629276", "0.7622377", "0.7603847", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7594988"...
0.72891587
55
Keys vector. Add all key.
public Vector keys() { Vector<K> temp = new Vector<>(3); for (int i=0;i<this.count;i++) { DictionaryPair p = list.get(i);//(DictionaryPair) data.get(i); temp.addLast(p.getKey()); } return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IIterator getKeys()\r\n {\r\n return new VectorIterator(m_keys);\r\n }", "public KeySet getKeys();", "@Override\n public Set<K> keySet() {\n return keys;\n }", "@Override\n\tpublic Set<K> keySet() {\n\t\treturn keys;\n\t}", "public ArrayList getKeys() {\r\n return this.keys;\r\n...
[ "0.6966067", "0.678948", "0.67390376", "0.66332406", "0.6615594", "0.6587651", "0.65866303", "0.65866303", "0.6559737", "0.6542555", "0.65002424", "0.6468771", "0.6440652", "0.6391398", "0.6378318", "0.63683194", "0.6349412", "0.6344787", "0.6302455", "0.62853384", "0.6274292...
0.67913955
1
Sets the item the person gives out.
public void setItem(Collectable c) { this.m_item = c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setItem(Item item) {\n this.item = item;\n }", "public void setItem (Item item)\n\t{\n\t\tthis.item = item;\n\t}", "public void setItem(Item item) {\n\t\tthis.item = item;\n\t}", "public void setItem(Item item) {\n\t\tthis.item = item;\n\t}", "public void setItem(T item) {\n ...
[ "0.73656243", "0.73582095", "0.72114646", "0.72114646", "0.7171984", "0.7142626", "0.7131456", "0.6965983", "0.6965983", "0.6914667", "0.6691745", "0.6569425", "0.651855", "0.64592355", "0.6410806", "0.6398054", "0.63900644", "0.6366861", "0.6216207", "0.62077135", "0.6197614...
0.604178
29
TODO Autogenerated method stub
@Override public void writeAttributes(XMLStreamWriter writer) throws XMLStreamException { }
{ "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 Types getType() { return GameObject.Types.PERSON; }
{ "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
Method to get Legacy Changes
@com.matrixone.apps.framework.ui.ProgramCallable public MapList getLegacyChanges(Context context, String args[]) throws Exception { MapList sTableData = new MapList(); MapList sResultList = new MapList(); StringList s1 = new StringList(); HashMap programMap = (HashMap)JPO.unpackArgs(args); String strObjectId = (String)programMap.get("objectId"); HashMap requestMap = (HashMap)programMap.get("requestMap"); String filterToolbar = (String)programMap.get("toolbar"); Map tmpMap = UICache.getMenu(context, filterToolbar); MapList filterCmdsList = (MapList)tmpMap.get("children"); Map filterOptCmdMap = (Map)filterCmdsList.get(0); String filterOptCmd = (String)filterOptCmdMap.get("name"); Map commandInfoMap = (Map)UICache.getCommand(context, filterOptCmd); Map commandSetting = (Map)commandInfoMap.get("settings"); String sRangeProgram = (String)commandSetting.get("Range Program"); String sRangeFunction = (String)commandSetting.get("Range Function"); HashMap sRangeProgramResultMap = (HashMap)JPO.invoke(context, sRangeProgram, null, sRangeFunction, JPO.packArgs(new HashMap()), HashMap.class); StringList choicesList = null; String singleSearchType =""; String cmdLabel = ""; String commandName = ""; String sDisplayValue = ""; String sActualValue = ""; String sRegisteredSuite = ""; String strStringResourceFile = ""; String sRequiredCommand = ""; String searchType = ""; String sLegacytype = ""; StringList strList = new StringList(); strList.add(SELECT_NAME); strList.add(SELECT_TYPE); strList.add(SELECT_ID); String wherClause = SELECT_CURRENT + "== 'Active' "; StringBuffer sbSearchType = new StringBuffer(); if(sRangeProgramResultMap!=null){ choicesList = (StringList)sRangeProgramResultMap.get("field_display_choices"); if(choicesList!=null) singleSearchType = (String)choicesList.get(0); } //Getting the ECM Menu details and its commands HashMap menuMap = UICache.getMenu(context, "ECMChangeLegacyMenu"); String sECMMenu = (String)menuMap.get("name"); MapList commandMap = (MapList)menuMap.get("children"); if(commandMap!=null){ Iterator cmdItr = commandMap.iterator(); while(cmdItr.hasNext()) { Map tempMap = (Map)cmdItr.next(); commandName = (String)tempMap.get("name"); HashMap cmdMap = UICache.getCommand(context, commandName); HashMap settingMap = (HashMap)cmdMap.get("settings"); cmdLabel = (String)cmdMap.get("label"); sRegisteredSuite = (String)settingMap.get("Registered Suite"); //strStringResourceFile = UINavigatorUtil.getStringResourceFileId(sRegisteredSuite); StringBuffer strBuf = new StringBuffer("emx"); strBuf.append(sRegisteredSuite); strBuf.append("StringResource"); sDisplayValue =EnoviaResourceBundle.getProperty(context, strBuf.toString(), context.getLocale(),cmdLabel); if(sDisplayValue.equals(singleSearchType)){ sRequiredCommand = commandName; break; } } } if(!UIUtil.isNullOrEmpty(sRequiredCommand)){ HashMap cmdMap = UICache.getCommand(context, sRequiredCommand); String cmdHref = (String)cmdMap.get("href"); HashMap settingsMap = (HashMap)cmdMap.get("settings"); searchType = (String)settingsMap.get("searchType"); } //Getting ECM details if(!UIUtil.isNullOrEmpty(searchType)){ StringList sTypeList = FrameworkUtil.split(searchType, ","); for(int i= 0; i<sTypeList.size(); i++){ String single = (String)sTypeList.get(i); sLegacytype = PropertyUtil.getSchemaProperty(context,single); sbSearchType.append(sLegacytype); if(i!=sTypeList.size()-1) sbSearchType.append(","); } } try{ if(!UIUtil.isNullOrEmpty(sbSearchType.toString())) if(UIUtil.isNullOrEmpty(strObjectId)) sTableData = DomainObject.findObjects(context, sbSearchType.toString(), "*", null, strList); else{ DomainObject partObject=new DomainObject(strObjectId); sResultList= partObject.getRelatedObjects(context, QUERY_WILDCARD, sbSearchType.toString(), strList, null, true, false, (short)1, null, null, 0); Iterator itr = sResultList.iterator(); while (itr.hasNext()) { Map sChangeObject = (Map) itr.next(); String sChangeId = (String) sChangeObject.get(SELECT_ID); if(!s1.contains(sChangeId)){ s1.add(sChangeId); sTableData.add(sChangeObject); } } } } catch (Exception ex) { ex.printStackTrace(); throw new FrameworkException(ex.getMessage()); } if(sTableData!=null) return sTableData; else return new MapList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Changelist[] getChanges() {\n String depot = parent.getDepot();\n String counterName = parent.getCounter();\n Client client = Client.getClient();\n\n // Obtain the most recent changelist available on the client\n Changelist toChange = Changelist.getChange(depot, client);\...
[ "0.6657904", "0.61205745", "0.60166293", "0.5869165", "0.5821728", "0.5661865", "0.56570077", "0.56109655", "0.55925554", "0.558749", "0.5554464", "0.55506617", "0.54991454", "0.54793525", "0.5477846", "0.54757935", "0.5466739", "0.5442674", "0.54173315", "0.5414583", "0.5381...
0.6488243
1
Method to customise exception message.
public DukeBadIndexException(int index) { if (index < 0) { super.message = "You can't enter a negative index!!"; } else if (index == 0) { super.message = "There is no index 0 ://"; } else { super.message = "I don't think you have that many tasks my dude."; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WeldExceptionStringMessage(String message) {\n // This will not be further localized\n this.message = message;\n }", "public String getMessage ()\n {\n String message = super.getMessage();\n\n if (message == null && exception != null) {\n return exception.getMessage();\n ...
[ "0.74284023", "0.739416", "0.7298313", "0.7113796", "0.70708567", "0.7062908", "0.689752", "0.68658024", "0.6826625", "0.6794737", "0.67832804", "0.67736125", "0.6768242", "0.67099327", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064",...
0.0
-1
creating BigInteger object with max value of type long
public static void main(String[] args) { BigInteger number = new BigInteger(Long.MAX_VALUE + ""); number = number.add(BigInteger.ONE); int count = 0; while (count < 5){ if (isPrime(number)){ count++; System.out.println(number); } //increment number by 1 number = number.add(BigInteger.ONE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BigInteger valueOf(long val)\n {\n if (val == 0)\n {\n return BigInteger.ZERO;\n }\n\n // store val into a byte array\n byte[] b = new byte[8];\n for (int i = 0; i < 8; i++)\n {\n b[7 - i] = (byte)val;\n val >>= 8;\n...
[ "0.7068334", "0.6906552", "0.68643105", "0.67866343", "0.6732203", "0.6717791", "0.66904527", "0.6646537", "0.63104343", "0.6243461", "0.62152284", "0.6187847", "0.6174511", "0.6150578", "0.61113507", "0.61080897", "0.6070816", "0.60395056", "0.6035864", "0.6027642", "0.59687...
0.0
-1
check is BigInteger object prime number
public static boolean isPrime(BigInteger number){ BigInteger two = new BigInteger("2"); BigInteger border = number.divide(two); BigInteger start; for (start = two; start.compareTo(border) <= 0; start = start.add(BigInteger.ONE)){ if (number.remainder(start).equals(BigInteger.ZERO)){ return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isPrime(BigInteger n) {\n\t\tglobalLog.stepIn(\"isPrime(\" + n.toString() + \")\");\n\t\tprimeLog.stepIn(\"isPrime(\" + n.toString() + \")\");\n\t\t// Use some other function if n is sufficiently small (n<=10^10)\n\t\tif (n.compareTo(BigInteger.valueOf(10000000000l)) <= 0) {\n\t\t\tprimeLog.l...
[ "0.71072865", "0.7019281", "0.69764787", "0.6839801", "0.6732929", "0.6721", "0.6694725", "0.66845846", "0.6618356", "0.6607378", "0.65311813", "0.65040356", "0.6467195", "0.6453646", "0.64520127", "0.64278036", "0.6423645", "0.6420988", "0.6407282", "0.6406775", "0.6405803",...
0.6962843
3
For Method Get All
public List<CategoriaUsuario> findall(){ return categoriaUsuarioRepository.findAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "public abstract List<Object> getAll();", "public List<R> getAll();", "@Override\n\tpublic ResultWrapper<List<Todos>> getAll() {\n\t\tResultWrapper<List<Todos>> rs = new ResultWr...
[ "0.8147736", "0.7703698", "0.7703698", "0.7703698", "0.7703698", "0.7703698", "0.7663137", "0.7331237", "0.7266823", "0.7244633", "0.7224617", "0.7199688", "0.71535325", "0.7105602", "0.70877665", "0.7076607", "0.7067433", "0.705949", "0.70554286", "0.7050709", "0.7047929", ...
0.0
-1
For Method specific find id
public Optional<CategoriaUsuario> findid(Long id){ return categoriaUsuarioRepository.findById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void find(Integer id) {\n\r\n\t}", "public abstract T findByID(ID id) ;", "T findById(ID id) ;", "public void findById() {\n String answer = view.input(message_get_id);\n if (answer != null){\n try{\n long id = Long.parseLong(answer);\n ...
[ "0.7079428", "0.6647047", "0.62179065", "0.60990185", "0.6031263", "0.60219777", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", ...
0.0
-1
For Method Put (update) specific id
public CategoriaUsuario update(CategoriaUsuario categoriaUsuario){ return categoriaUsuarioRepository.save(categoriaUsuario); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"/{id}\", method = RequestMethod.PUT)\n public void put(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", par...
[ "0.7546944", "0.7482072", "0.7080999", "0.7057817", "0.7035054", "0.69465196", "0.69091386", "0.69072455", "0.68781745", "0.68561214", "0.6855867", "0.6848351", "0.68130577", "0.67535496", "0.67323107", "0.6721144", "0.6692389", "0.6683201", "0.6668602", "0.66632", "0.6640430...
0.0
-1
For Delete specific drop reg in DB
public void delete(Long id){ try { categoriaUsuarioRepository.deleteById(id); }catch (Exception e){ System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void drop(String accountNo) {\n\t\t\n\t}", "public void dyrepdelete(int repno) {\n\t\tDBConn dbconn = DBConn.getDB();\n\t\tConnection conn = null;\n\t\t\n\t\ttry {\n\t\t\tconn=dbconn.getConn();\n\t\t\tconn.setAutoCommit(false);\n\t\t\t\n\t\t\tDYBoardDAO dao = DYBoardDAO.getdao();\n\t\t\tdao.d...
[ "0.6399673", "0.6344634", "0.62025625", "0.6200621", "0.6101256", "0.60913205", "0.60404027", "0.6026072", "0.601378", "0.59857225", "0.5975297", "0.59631133", "0.5937346", "0.5907329", "0.588723", "0.58698785", "0.58698785", "0.5863771", "0.58526", "0.5849639", "0.5842922", ...
0.0
-1
Called when there is a new intent or it is the first intent received
private void actUponIntent(Intent intent){ BusinessesFragmentViewModel model = ViewModelProviders.of(this).get(BusinessesFragmentViewModel.class); boolean isAdvancedSearchIntent = false; if(intent != null){ // Trying to see if we came from the advanced search activity and need to perform a search AdvancedSearchInput advancedSearchInput = intent.getParcelableExtra(ADVANCED_SEARCH_INPUT_KEY); if(advancedSearchInput != null){ // Indicating the list of businesses was loaded and there is no need to load all businesses isAdvancedSearchIntent = true; model.getAdvancedSearchBusinesses(advancedSearchInput).observe(this, new Observer<List<Business>>() { @Override public void onChanged(@Nullable List<Business> businesses) { //Toast.makeText(getApplicationContext(),"onChanged from search", Toast.LENGTH_SHORT).show(); } }); } } // The intent is not advanced search intent if(!isAdvancedSearchIntent){ // Loading all businesses model.getAllBusinesses().observe(this, new Observer<List<Business>>() { @Override public void onChanged(@Nullable List<Business> businesses) { //Toast.makeText(getApplicationContext(),"onChanged from all", Toast.LENGTH_SHORT).show(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n handleIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(inten...
[ "0.817108", "0.7988496", "0.78789043", "0.78789043", "0.7861457", "0.785104", "0.7847534", "0.78299195", "0.78288776", "0.7641862", "0.7633209", "0.7624444", "0.7567786", "0.7452437", "0.7366898", "0.7302838", "0.7287378", "0.7256273", "0.7254402", "0.7148836", "0.7115568", ...
0.0
-1
Toast.makeText(getApplicationContext(),"onChanged from search", Toast.LENGTH_SHORT).show();
@Override public void onChanged(@Nullable List<Business> businesses) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onQueryTextChange(String newText) {\n currentSearchData = new ArrayList<String>();\n getCurrentSearchData(newText);\n RelativeLayout searchDataRelativeView = (RelativeLayout) findViewById(R.id.search_relative_view);\n ...
[ "0.7472048", "0.7264972", "0.70373124", "0.68573314", "0.67848414", "0.67528224", "0.67528224", "0.67528224", "0.67137825", "0.6684374", "0.6655278", "0.6630099", "0.66021514", "0.65985984", "0.65685683", "0.6564724", "0.65641344", "0.6520936", "0.6496067", "0.6458754", "0.64...
0.0
-1
Toast.makeText(getApplicationContext(),"onChanged from all", Toast.LENGTH_SHORT).show();
@Override public void onChanged(@Nullable List<Business> businesses) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onChanged() {\n }", "void onDataChanged();", "@Override\n public void onChanged() {\n }", "public void alert(){\n\t\tfor (ChangeListener l : listeners) {\n\t\t\tl.stateChanged(new ChangeEvent(this));\n\t\t}\n\t}", "public void onDataChanged();", "@Override\n public void ev...
[ "0.7169314", "0.669539", "0.6694601", "0.65896595", "0.6527132", "0.65035695", "0.6497463", "0.64525867", "0.64275193", "0.61386454", "0.61153615", "0.610512", "0.610512", "0.6098044", "0.60887426", "0.6081577", "0.60793173", "0.60533583", "0.6044771", "0.60426354", "0.603883...
0.0
-1
TODO Autogenerated method stub
@Override public Tutorial insert(Tutorial t) { return cotizadorRepository.save(t); }
{ "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
return ith item of the IntList: iternation
public int iterativeGet(int i) { int val = 0; val = this.first; IntList p = this.rest; while (i > 0) { val = p.first; p = p.rest; i--; } return val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }", "public Integer get(int index){\n return list.get(index);\n }", "public Item get(int i);", "int getItems(int index);", "public int get(int i) throws ArrayInde...
[ "0.7198615", "0.68228513", "0.6720617", "0.67174274", "0.66636896", "0.662633", "0.66060156", "0.65407264", "0.6521927", "0.6440333", "0.64207244", "0.63867396", "0.6386017", "0.6345841", "0.63456756", "0.6335271", "0.6294827", "0.6293243", "0.62843335", "0.6261813", "0.62606...
0.7037354
1
return ith item of the IntList: recursion
public int get(int i) { if (i==0) { return first; } return rest.get(i - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int iterativeGet(int i) {\n int val = 0;\n val = this.first;\n IntList p = this.rest;\n while (i > 0) {\n val = p.first;\n p = p.rest;\n i--;\n }\n return val;\n }", "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n ...
[ "0.72769254", "0.64461476", "0.61465645", "0.6096954", "0.6032204", "0.5956715", "0.5905903", "0.5897758", "0.5896339", "0.5857332", "0.58521307", "0.58397", "0.58236736", "0.5816525", "0.58015", "0.5794941", "0.5756095", "0.57556015", "0.57220715", "0.5680737", "0.5676425", ...
0.61091083
3
Get a few urls, and then download web page by http request
static Page Download(){ // TODO: reference to fetch to download webpages WebURL url = queue.poll(); // call http request to get the web page return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getLinks() {\n\n var client = HttpClient.newBuilder()\n .followRedirects(HttpClient.Redirect.ALWAYS)\n .build();\n\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(URL_PREFIX))\n .build();\n client.sendAs...
[ "0.6898061", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6782899", "0.6772595", "0.6465282", "0.64292425", "0.63809216", "0.6368789", "0.634128", "0.62920374", "0.6250325", "0.6221149", ...
0.65290976
13
Extract URLs in page content
static List<WebURL> ExtractUrl(Page page){ // TODO: reference to parser to extractor urls from the web content return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<String> extract(Document document) {\n Elements links = document.select(\"a[href]\");\n Elements media = document.select(\"[src]\");\n Elements imports = document.select(\"link[href]\");\n\n List<String> allLinks = new ArrayList<>();\n populateLinks(allLinks, m...
[ "0.67949164", "0.66035825", "0.6561706", "0.65073764", "0.64317197", "0.64194554", "0.6298129", "0.6252565", "0.6242706", "0.61659354", "0.6161054", "0.61458665", "0.6099071", "0.6056902", "0.60331243", "0.600903", "0.5997185", "0.59707373", "0.5940851", "0.5935357", "0.59151...
0.7733296
0
TODO: filter out duplicated urls single machine: HashMap of hashed web content multithread: threadsafe hashmap database + bloomfilter
List<WebURL> Filter(List<WebURL> urls){ return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void invertedIndex(String URL){\n //if the url set already contains this url, it means this url has already been processed, so return\n if(urlSet.contains(URL)){\n return;\n }\n else{\n //first add this unprocessed url to url list\n urlSet....
[ "0.58376163", "0.58290935", "0.57803565", "0.5574668", "0.5554355", "0.55396163", "0.5481212", "0.5473345", "0.5426008", "0.5416189", "0.5410145", "0.53729856", "0.53626084", "0.53122365", "0.52803934", "0.5271617", "0.52569085", "0.5241415", "0.5240086", "0.5230616", "0.5226...
0.0
-1
Este medoto se utiliza para obtener el la ruta del directorio raiz de la aplicion
public ViewHolder(@NonNull View itemView) { super(itemView); txvNombreMascotaDesparasitante = itemView.findViewById(R.id.txvNombreMascotaDesparasitante); txvNombreDesparasitante = itemView.findViewById(R.id.txvNombreDesparasitante); txvPesoDesparasitante = itemView.findViewById(R.id.txvPesoDesparasitante); txvFechaAplicacionDesparasitante = itemView.findViewById(R.id.txvFechaAplicacionDesparasitante); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDir();", "private static String getRioHomeDirectory() {\n String rioHome = RioHome.get();\n if(!rioHome.endsWith(File.separator))\n rioHome = rioHome+File.separator;\n return rioHome;\n }", "public String pathToSave() {\n String path;\n File folder;\n ...
[ "0.6985088", "0.69307196", "0.69191706", "0.6844622", "0.68091875", "0.67827", "0.6762781", "0.6603355", "0.6483714", "0.6479017", "0.64499116", "0.6398175", "0.63597447", "0.6358058", "0.6328888", "0.63283116", "0.63027185", "0.6274354", "0.62406313", "0.6220463", "0.6194581...
0.0
-1
CREAMOS LA VISTA QUE CONTENDRA, EL DISENIO DE CADA ITEM
@NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View vista = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_desparasitante, parent, false); //RETORNAR INSTANCIA DE LA CLASE PERSONALIZADA PASANDO COMO ARGUMENTO LA VISTA CREADA return new ViewHolder(vista); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void CrearVenda (BaseDades bd, int idproducte, int quantitat) {\n Producte prod = bd.consultarUnProducte(idproducte);\n java.sql.Date dataActual = getCurrentDate();//Data SQL\n if (prod != null) {\n if (bd.actualitzarStock(prod, quantitat, dataActual)>0) {//Hi ha esto...
[ "0.619184", "0.614264", "0.6110364", "0.6075752", "0.6072246", "0.60591614", "0.60551685", "0.6041224", "0.60403514", "0.6006461", "0.6005658", "0.5956549", "0.5940723", "0.5933261", "0.59027684", "0.5897068", "0.5893936", "0.5892146", "0.58921087", "0.5883038", "0.5851655", ...
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro...
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234",...
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n ...
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197"...
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short d...
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", ...
0.0
-1
Test based on a 3x3 board. aka classic tictactoe
private static void test3x3() { MutableBoard simpleBoard = new SimpleBoard(3,3); if (!simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // O if (!simpleBoard.toString().equals("---\n-O-\n---\n")) throw new AssertionError(); if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (simpleBoard.gameover()) throw new AssertionError(); // Cannot replace any placed position. if (simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // X if (!simpleBoard.toString().equals("---\n-O-\n---\n")) throw new AssertionError(); if (!simpleBoard.putPiece(new Move(0, 1))) throw new AssertionError(); // X if (!simpleBoard.toString().equals("-X-\n-O-\n---\n")) throw new AssertionError(); if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (simpleBoard.gameover()) throw new AssertionError(); // Create a new light draft board. Board draftBoard = new LightDraftBoard(simpleBoard, new Move(0, 0), Board.PieceType.CIRCLE); if (!draftBoard.toString().equals("OX-\n-O-\n---\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (draftBoard.gameover()) throw new AssertionError(); // DraftBoard is immutable. draftBoard = new LightDraftBoard(draftBoard, new Move(1, 2), Board.PieceType.CROSS); if (!draftBoard.toString().equals("OX-\n-OX\n---\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (draftBoard.gameover()) throw new AssertionError(); draftBoard = new LightDraftBoard(draftBoard, new Move(2, 2), Board.PieceType.CIRCLE); // wins if (!draftBoard.toString().equals("OX-\n-OX\n--O\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.CIRCLE) throw new AssertionError(); if (!draftBoard.gameover()) throw new AssertionError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void test13() { \n Board board13 = new Board();\n board13.put(1,1,1); \n board13.put(1,2,1);\n board13.put(1,3,2);\n board13.put(2,1,2);\n board13.put(2,2,2);\n board13.put(2,3,1);\n board13.put(3,1,1);\n board13.put(3,2,1);\n board13.put(3,3,2);\n assertTrue(board...
[ "0.7135146", "0.7105412", "0.69119847", "0.686839", "0.68643284", "0.6801614", "0.67940176", "0.67537075", "0.67443544", "0.67385703", "0.67315817", "0.6668784", "0.6665237", "0.6653783", "0.66101056", "0.65934753", "0.65897334", "0.6579375", "0.65700096", "0.65657026", "0.65...
0.68317103
5
We want the highest winning % to be first. A "normal" sort places lower values before higher. So this looks "backwards" from a "normal" sort.
@Override public int compareTo(Team arg) { if (this.getPct() < arg.getPct()) return 1; if (this.getPct() > arg.getPct()) return -1; // return 0; // Don't just return 0 if the records are the same. // We need some tie-breaker so that the ordering is // "complete" for all possible Teams. // Use the city name for now, although they might // not be unique across all divisions! return this.city.compareTo(arg.city); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\...
[ "0.65203846", "0.63473254", "0.6268759", "0.61292666", "0.6126006", "0.59853315", "0.59782207", "0.5961426", "0.593894", "0.58888906", "0.58739036", "0.579205", "0.57827", "0.5753479", "0.5753018", "0.5727485", "0.5712451", "0.57047635", "0.5701688", "0.56943107", "0.5654163"...
0.0
-1
called on main thread
@Override public void onTrimMemory(int level) { if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { // Log.d(TAG, "APP in BACKGROUND"); Timber.i("APP in BACKGROUND"); status = ApplicationBackgroundStatus.BACKGROUND; sendNewStatus(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@...
[ "0.73365766", "0.73365766", "0.72773236", "0.7254053", "0.7254053", "0.7124422", "0.7068514", "0.7068514", "0.70667046", "0.70667046", "0.70667046", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7063541", "0.7062392", "0.7062392...
0.0
-1
Performs the alignment. Abstract.
public abstract void doAlignment(String sq1, String sq2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alignLocation();", "public void align( Alignment alignment, Properties param ) {\n\t\t// For the classes : no optmisation cartesian product !\n\t\tfor ( OWLEntity cl1 : ontology1.getClassesInSignature()){\n\t\t\tfor ( OWLEntity cl2: ontology2.getClassesInSignature() ){\n\t\t\t\tdouble confidence = m...
[ "0.70294404", "0.680898", "0.6721915", "0.6647452", "0.6636087", "0.65958613", "0.6529025", "0.65070933", "0.64349604", "0.6428772", "0.63790804", "0.6280131", "0.6269029", "0.6169826", "0.6110803", "0.6110803", "0.6097728", "0.6079906", "0.6008203", "0.59926724", "0.59009147...
0.7558881
0
first time running this alignment. Create all new matrices.
public void prepareAlignment(String sq1, String sq2) { if(F == null) { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); F = new float[3][n+1][m+1]; B = new TracebackAffine[3][n+1][m+1]; for(int k = 0; k < 3; k++) { for(int i = 0; i < n+1; i ++) { for(int j = 0; j < m+1; j++) B[k][i][j] = new TracebackAffine(0,0,0); } } } //alignment already been run and existing matrix is big enough to reuse. else if(seq1.length() <= n && seq2.length() <= m) { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); } //alignment already been run but matrices not big enough for new alignment. //create all new matrices. else { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); F = new float[3][n+1][m+1]; B = new TracebackAffine[3][n+1][m+1]; for(int k = 0; k < 3; k++) { for(int i = 0; i < n+1; i ++) { for(int j = 0; j < m+1; j++) B[k][i][j] = new TracebackAffine(0,0,0); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble...
[ "0.6295873", "0.58681935", "0.5807994", "0.56388676", "0.56196004", "0.5614657", "0.56045747", "0.5595118", "0.55341613", "0.55212826", "0.55157685", "0.54728824", "0.54689604", "0.5427661", "0.5415776", "0.5404574", "0.53870857", "0.5377504", "0.53686315", "0.5357971", "0.52...
0.6805649
0
Get the next state in the traceback
public Traceback next(Traceback tb) { TracebackAffine tb3 = (TracebackAffine)tb; if(tb3.i + tb3.j + B[tb3.k][tb3.i][tb3.j].i + B[tb3.k][tb3.i][tb3.j].j == 0) return null; //traceback has reached origin therefore stop. else return B[tb3.k][tb3.i][tb3.j]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNextState() {\n return nextState;\n }", "public SLR1_automat.State next_state(String symbol) throws Exception;", "public Symbol cur_err_token() {\r\n return this.lookahead[this.lookahead_pos];\r\n }", "public String get_state() throws Exception {\n\t\treturn this.state;\n\t}", ...
[ "0.63150173", "0.6208069", "0.6042502", "0.5941154", "0.5941154", "0.5900475", "0.58397835", "0.5835424", "0.5803836", "0.5761924", "0.57488054", "0.57439744", "0.5743671", "0.56602585", "0.5611719", "0.55565095", "0.5536324", "0.55318624", "0.5513521", "0.551028", "0.5492095...
0.60999733
2
Print matrix used to calculate this alignment.
public void printf(Output out) { for (int k=0; k<3; k++) { out.println("F[" + k + "]:"); for (int j=0; j<=m; j++) { for (int i=0; i<F[k].length; i++) { out.print(padLeft(formatScore(F[k][i][j]), 5)); } out.println(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void PrintMatrix() {\n\t\t\n\t\tfloat[][] C = this.TermContextMatrix_PPMI;\n\t\t\n\t\tSystem.out.println(\"\\nMatrix:\");\n\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\tfor(int j = 0; j < C[i].length; j++) {\n\t\t\t\tif(j >= C[i].length - 1) {\n\t\t\t\t\tSystem.out.printf(\" %.1f%n\", C[i][j]);\n\t\t\t\t} ...
[ "0.75420344", "0.7243872", "0.71485305", "0.7128738", "0.70161843", "0.69661725", "0.6839923", "0.6825355", "0.6779104", "0.6753959", "0.6748858", "0.6708596", "0.66799253", "0.666531", "0.65976983", "0.6582275", "0.6560419", "0.65585774", "0.64962184", "0.64837104", "0.64678...
0.0
-1
Returns the index of the turtle's current image
@Override public void doCommand(TreeNode commandNode) { int currentImage = displayOption.getImageIndex().get(); commandNode.setResult(currentImage + ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int getImageIndex() {\n/* 216 */ return this.mlibImageIndex;\n/* */ }", "public Sprite getCurrentSprite() {\n\t\tif (this.getVx() <= 0) {\n\t\t\treturn getImages()[0];\n\t\t}\n\t\treturn getImages()[1];\n\t}", "public ImageIdentifier getImageIdentifier() {\n synchronized (this.imageL...
[ "0.65179443", "0.6327418", "0.631957", "0.6305557", "0.6224094", "0.62022233", "0.62008494", "0.612662", "0.61049366", "0.6097565", "0.6094083", "0.6078922", "0.6058608", "0.600662", "0.6001852", "0.5960679", "0.5943499", "0.59209615", "0.5914747", "0.591121", "0.58909446", ...
0.0
-1
TODO Autogenerated method stub
@Override public void turnToward(int x, int y) { }
{ "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
printing out the values for each variable
public static void printSolutions(float[][]matrix, int dimension){ for (int i = 0; i< dimension; i++){ System.out.println("x" + (i+1) + " = " + Math.round(matrix[i][dimension]*1000)/1000.0d);} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void displayVariables() {\n Iterator i = dvm.getVariableNames().iterator();\n Object temp;\n while(i.hasNext()){\n temp = i.next();\n System.out.print(temp + \": \" + dvm.getValue(temp.toString()) + \"\\n\");\n }\n }", "public void printVal()\n ...
[ "0.79395455", "0.74134386", "0.7391068", "0.7294995", "0.71870595", "0.7048558", "0.70310754", "0.6999797", "0.69954276", "0.68545157", "0.6829667", "0.6820818", "0.6798436", "0.6786246", "0.675918", "0.6729713", "0.67196584", "0.6715805", "0.6683448", "0.6664581", "0.6655277...
0.0
-1
swapping two rows of the matrix
public static void rowSwap(float[][] matrix, int row1, int row2, int dimension){ float temp; for (int i = 0; i <= dimension; i++){ temp = matrix[row1][i]; matrix[row1][i] = matrix[row2][i]; matrix[row2][i] = temp;} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void swapRows( int r1, int r2 ) {\n\tfor (int c = 0; c < this.size(); c++){\n\t Object r1Val = matrix[r1][c];\n\t matrix[r1][c] = matrix[r2][c];\n\t matrix[r2][c] = r1Val;\n\t}\n }", "void swapRow(Matrix m, int i1, int i2) {\r\n double[] temp = m.M[i1];\r\n m.M[i1] = m.M[i2];\r\...
[ "0.7787569", "0.7650721", "0.76080513", "0.72652656", "0.72522634", "0.6889796", "0.66977346", "0.66241765", "0.6617374", "0.6580273", "0.65708613", "0.6542914", "0.63808215", "0.63724726", "0.6354202", "0.63267666", "0.6324824", "0.6321792", "0.6243342", "0.6204765", "0.6169...
0.71721685
5
checks to make sure pivot is nonzero, if it is zero: find a row to swap with
public static void checkPivot(float[][] matrix, int column, int dimension){ if (matrix[column][column] != 0){ return; } for (int i = column+1; i < dimension; i++){ if (matrix[i][column] != 0){ rowSwap(matrix, column, i, dimension); System.out.print("Swapping rows " + (column+1) + " and " + (i+1) + " will give us:\n\n"); printMatrix(matrix, dimension); return;}} System.out.print("no unique solution"); // if we made it this far, we couldn't find a non-zero row to swap with so there is no solution System.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean rowSwap(int pr, int pc)\n\t{\n\t\tif(A[pr][pc] == 0) //if pivot is 0\n\t\t{\n\t\t\tfor(int i = pr+1; i < rows; i++) //for everything underneath pivot\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(A[i][pc] != 0) //if non-0 underneath pivot\n\t\t\t\t{\n\t\t\t\t\t//find max in row ie half-pivot\n\t\t\t\t\tint maxI =...
[ "0.70458126", "0.5961114", "0.58427685", "0.5643027", "0.5595781", "0.55891144", "0.5579542", "0.5560033", "0.55523896", "0.5516705", "0.5503447", "0.54947245", "0.5485659", "0.54408014", "0.5439524", "0.5438558", "0.5437799", "0.5408532", "0.54014844", "0.5372469", "0.534696...
0.6372662
1
divide every row by the coefficient
public static void divideRow(float[][] matrix, int row, int dimension){ float divideValue = matrix[row][row]; // coefficient to divide by if (divideValue == 1) { // don't need to divide out the row if the pivot is already 1 return; } System.out.print("Dividing row " + (row+1) + " by " + Math.round(divideValue*1000)/1000.0d + " will give us:\n\n"); for (int i = row; i <= dimension; i++){ matrix[row][i] /= divideValue;} printMatrix(matrix, dimension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide(double skalar) {\r\n for (int i = 0; i < matrix.length; i++) {\r\n for (int j = 0; j < matrix[0].length; j++) {\r\n matrix[i][j] /= skalar;\r\n }\r\n }\r\n }", "@Override\n\tpublic void\n\tscalarDiv( double value )\n\t{\n\t\tdata[0] /= valu...
[ "0.620345", "0.5978556", "0.59061533", "0.5901618", "0.5746224", "0.5639999", "0.5579323", "0.555556", "0.55533105", "0.55350864", "0.54497725", "0.54394025", "0.5429771", "0.5374569", "0.5266728", "0.52583206", "0.5227255", "0.5207783", "0.52032644", "0.5193736", "0.51590616...
0.6220958
0